From 4d0f8bf7dca32cd3c63125dca982750b4596504b Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 16 Sep 2026 19:57:03 +0000 Subject: [PATCH 1/3] ## Python SDK Changes: * `open_router.vault.list_intern_vault_secrets()`: **Added** * `open_router.vault.delete_intern_vault_secret()`: **Added** * `open_router.vault.store_intern_vault_secret()`: **Added** * `open_router.vault.copy_vault_secrets_to_intern()`: **Added** * `open_router.vault.list_vault_secrets()`: **Added** * `open_router.vault.delete_vault_secret()`: **Added** * `open_router.vault.store_vault_secret()`: **Added** --- .speakeasy/gen.lock | 1300 ++++++++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 1620 +++++++++++ .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- docs/components/vaultsecret.mdx | 15 + docs/components/vaultsecretcopyrequest.mdx | 12 + docs/components/vaultsecretcopyresponse.mdx | 12 + docs/components/vaultsecretlistresponse.mdx | 13 + docs/components/vaultsecretresponse.mdx | 12 + docs/components/vaultsecretwriterequest.mdx | 13 + .../copyvaultsecretstointernglobals.mdx | 11 + .../copyvaultsecretstointernrequest.mdx | 13 + .../deleteinternvaultsecretglobals.mdx | 11 + .../deleteinternvaultsecretrequest.mdx | 13 + docs/operations/deletevaultsecretglobals.mdx | 11 + docs/operations/deletevaultsecretrequest.mdx | 12 + .../listinternvaultsecretsglobals.mdx | 11 + .../listinternvaultsecretsrequest.mdx | 14 + docs/operations/listvaultsecretsglobals.mdx | 11 + docs/operations/listvaultsecretsrequest.mdx | 13 + .../storeinternvaultsecretglobals.mdx | 11 + .../storeinternvaultsecretrequest.mdx | 14 + docs/operations/storevaultsecretglobals.mdx | 11 + docs/operations/storevaultsecretrequest.mdx | 13 + docs/sdks/vault/README.mdx | 1382 +++++++++ pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 42 + src/openrouter/components/vaultsecret.py | 43 + .../components/vaultsecretcopyrequest.py | 20 + .../components/vaultsecretcopyresponse.py | 19 + .../components/vaultsecretlistresponse.py | 24 + .../components/vaultsecretresponse.py | 20 + .../components/vaultsecretwriterequest.py | 25 + src/openrouter/operations/__init__.py | 98 + .../operations/copyvaultsecretstointern.py | 162 ++ .../operations/deleteinternvaultsecret.py | 153 + .../operations/deletevaultsecret.py | 144 + .../operations/listinternvaultsecrets.py | 173 ++ src/openrouter/operations/listvaultsecrets.py | 159 ++ .../operations/storeinternvaultsecret.py | 169 ++ src/openrouter/operations/storevaultsecret.py | 160 ++ src/openrouter/sdk.py | 4 + src/openrouter/vault.py | 2501 +++++++++++++++++ uv.lock | 2 +- 46 files changed, 8463 insertions(+), 33 deletions(-) create mode 100644 docs/components/vaultsecret.mdx create mode 100644 docs/components/vaultsecretcopyrequest.mdx create mode 100644 docs/components/vaultsecretcopyresponse.mdx create mode 100644 docs/components/vaultsecretlistresponse.mdx create mode 100644 docs/components/vaultsecretresponse.mdx create mode 100644 docs/components/vaultsecretwriterequest.mdx create mode 100644 docs/operations/copyvaultsecretstointernglobals.mdx create mode 100644 docs/operations/copyvaultsecretstointernrequest.mdx create mode 100644 docs/operations/deleteinternvaultsecretglobals.mdx create mode 100644 docs/operations/deleteinternvaultsecretrequest.mdx create mode 100644 docs/operations/deletevaultsecretglobals.mdx create mode 100644 docs/operations/deletevaultsecretrequest.mdx create mode 100644 docs/operations/listinternvaultsecretsglobals.mdx create mode 100644 docs/operations/listinternvaultsecretsrequest.mdx create mode 100644 docs/operations/listvaultsecretsglobals.mdx create mode 100644 docs/operations/listvaultsecretsrequest.mdx create mode 100644 docs/operations/storeinternvaultsecretglobals.mdx create mode 100644 docs/operations/storeinternvaultsecretrequest.mdx create mode 100644 docs/operations/storevaultsecretglobals.mdx create mode 100644 docs/operations/storevaultsecretrequest.mdx create mode 100644 docs/sdks/vault/README.mdx create mode 100644 src/openrouter/components/vaultsecret.py create mode 100644 src/openrouter/components/vaultsecretcopyrequest.py create mode 100644 src/openrouter/components/vaultsecretcopyresponse.py create mode 100644 src/openrouter/components/vaultsecretlistresponse.py create mode 100644 src/openrouter/components/vaultsecretresponse.py create mode 100644 src/openrouter/components/vaultsecretwriterequest.py create mode 100644 src/openrouter/operations/copyvaultsecretstointern.py create mode 100644 src/openrouter/operations/deleteinternvaultsecret.py create mode 100644 src/openrouter/operations/deletevaultsecret.py create mode 100644 src/openrouter/operations/listinternvaultsecrets.py create mode 100644 src/openrouter/operations/listvaultsecrets.py create mode 100644 src/openrouter/operations/storeinternvaultsecret.py create mode 100644 src/openrouter/operations/storevaultsecret.py create mode 100644 src/openrouter/vault.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 6dc2ae80..f7e6866c 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: 3d1935e25da11a8216d602ade85ff0ce + docChecksum: 5fef1881cb8a1de0e83efde8d77faf74 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.151 - configChecksum: 0414f00387db082c697403f60ad7105e + releaseVersion: 1.1.152 + configChecksum: 78ed5c653eaf792d9360e0931c2f766e repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 7ac4ee62-d0bd-4853-859c-935ad447b5e1 - pristine_commit_hash: f71adcb104f9ed9a85f463b20df14ec1f68baed4 - pristine_tree_hash: 2a6e957877d2a1914fc86d7e3641508dc0a4b07b + generation_id: 74c5e9bc-a7d9-42fd-b85c-ac8919abde8f + pristine_commit_hash: e39a1aaa41102958f1940d05c84991d81c2dabfd + pristine_tree_hash: 3a3ad835ef2a647514fc8afbc4a4bf99cb3f0a0c features: python: acceptHeaders: 3.0.0 @@ -5868,6 +5868,30 @@ trackedFiles: id: 3312b9777716 last_write_checksum: sha1:6ba9bb63173376b0dcb7ac22b859bfef3e3820eb pristine_git_object: cd3d46d3af459e7b95090a8e74e22eed448b3fdd + docs/components/vaultsecret.mdx: + id: f83900f9f59b + last_write_checksum: sha1:b1fa371ebf1c4013e68eee3d829c2806fcdf6cd9 + pristine_git_object: f7e952ab909d88c4460040a50f71256ace063efc + docs/components/vaultsecretcopyrequest.mdx: + id: 31f8edda3085 + last_write_checksum: sha1:7986ca6048fab04668b24b844f5756f33948eef6 + pristine_git_object: 78fb275100efebc906217bb139b78e8440d0f59d + docs/components/vaultsecretcopyresponse.mdx: + id: 8b57b0194e66 + last_write_checksum: sha1:ff3af96e0ddfd579aa7c2cf1893ae5dc8c93818e + pristine_git_object: 60ce995cb8aa52bc9966141ae79c7edb0d34ce41 + docs/components/vaultsecretlistresponse.mdx: + id: fed246224551 + last_write_checksum: sha1:575012e2bac50ae2d1b7a0c926cf35f3ff360597 + pristine_git_object: 0b17bf589ee1d32b61748a62deb3e71562497f03 + docs/components/vaultsecretresponse.mdx: + id: 933fa3914687 + last_write_checksum: sha1:43511297d34b0775fd672907f3044d6e02f99afd + pristine_git_object: 9286dbb18a96ef2539d72f107f64ab62c3f98604 + docs/components/vaultsecretwriterequest.mdx: + id: 8d1688364ae0 + last_write_checksum: sha1:dd7b982e9f3f02beb523d311abfe5c1a05ee8b57 + pristine_git_object: 92dcbeaddf3083a29479188fb9b61dc321f0bb64 docs/components/verbosity.mdx: id: 8dacec626dda last_write_checksum: sha1:77a815930df06dc0c0534ad059e49368be46d94d @@ -6240,6 +6264,14 @@ trackedFiles: id: 2ab0b419379e last_write_checksum: sha1:f3bcb4a33fc0d7d868762b459a838d1fdca99d28 pristine_git_object: d24616128ffb2e8a3f1fc639235d8210dbeea107 + docs/operations/copyvaultsecretstointernglobals.mdx: + id: 60b1b9bf2d73 + last_write_checksum: sha1:fe03bb52f3c85be27192a0973105b29d4e59dc5d + pristine_git_object: 56423f3adbe73251c5338705c371465c4330de5e + docs/operations/copyvaultsecretstointernrequest.mdx: + id: 9040b392c33c + last_write_checksum: sha1:d8c41416f0226d69cbd6e7086531a6fbd76d6695 + pristine_git_object: 17c655cf0eb8cb6128904ade075dd447ddc86755 docs/operations/createaudiospeechglobals.mdx: id: 9b19782b0fc7 last_write_checksum: sha1:620e2236612f7cdf7dc23e0f975671e979d7e4f5 @@ -6516,6 +6548,14 @@ trackedFiles: id: a7b7e64c7fb1 last_write_checksum: sha1:e993d4511c68b02e368f21a0b319b2068c6180b4 pristine_git_object: ba80054b8619991e06ee23b1ce40a97692b15c77 + docs/operations/deleteinternvaultsecretglobals.mdx: + id: 6bab12e48fb6 + last_write_checksum: sha1:31611313c0d6ef1067af551a8433b2eee40dcdcd + pristine_git_object: 4a262e0b42df89377cf2bf618a0e5908ec0f9d2a + docs/operations/deleteinternvaultsecretrequest.mdx: + id: 665a068f6d79 + last_write_checksum: sha1:d4e61d2af2c292361e7d454f086ad82b37ce89a5 + pristine_git_object: 2107702f7d52d81228bf3bec35ab1cb87edb6df7 docs/operations/deletekeysglobals.mdx: id: fd6447706ee1 last_write_checksum: sha1:34725257cc7da12269adca861580e36ab2b82d56 @@ -6544,6 +6584,14 @@ trackedFiles: id: 429d1931c37a last_write_checksum: sha1:02a4aebe7722d11c44caaff6e203a03b21518c20 pristine_git_object: 44e2e267a0a99200a02d71e4d87be41bf689224e + docs/operations/deletevaultsecretglobals.mdx: + id: 445d5e528646 + last_write_checksum: sha1:24ed9b756885b058b5bcf963396e63ad663d7219 + pristine_git_object: 1e2f71a1efedc86e28cf730085044387b5a6556e + docs/operations/deletevaultsecretrequest.mdx: + id: 1bc3371915d0 + last_write_checksum: sha1:7bbf1bc75e35378d070713f19334f9d64bab1ed2 + pristine_git_object: ea844c4582b45f614ab0ea50123b174655b3f9bc docs/operations/deleteworkspacebudgetglobals.mdx: id: c1b4f6dabfee last_write_checksum: sha1:f2e30630f5ff69ba236f790def147e41e145ddd7 @@ -7080,6 +7128,14 @@ trackedFiles: id: e829f52a26d3 last_write_checksum: sha1:cb8b441a4e0138861a6cf660367f674093844590 pristine_git_object: 590e46d83ce8a470b44499464e1343584fc66805 + docs/operations/listinternvaultsecretsglobals.mdx: + id: 83e0c9cb95c6 + last_write_checksum: sha1:4def94f91a2e27836d1e4d8d313ad5bc31154d01 + pristine_git_object: 032e98ae1369d52359a0d2b0ade526c51c736918 + docs/operations/listinternvaultsecretsrequest.mdx: + id: c6d2d4eaeb7f + last_write_checksum: sha1:f54384164a4fa4c4fa8ff8dfd5c6b23c5ffdf0b5 + pristine_git_object: feadc74859b77990d2799e91c577082b21cca4f5 docs/operations/listkeyassignmentsglobals.mdx: id: dabab35850ee last_write_checksum: sha1:08629027424ce4f3ce6232c32f9534bedb714162 @@ -7240,6 +7296,14 @@ trackedFiles: id: b763a3eaa70b last_write_checksum: sha1:2421768f7c35319a79083c02017056bd40f21c4e pristine_git_object: 80f9a41f5527839636e8a51814d420a22a28a82f + docs/operations/listvaultsecretsglobals.mdx: + id: 9f2a43038606 + last_write_checksum: sha1:b06f69a57d6f67af8a67f67baa105a16953c1b99 + pristine_git_object: 0d090bdeae2c43daa54403366110d864b98191f0 + docs/operations/listvaultsecretsrequest.mdx: + id: f0936d4ffe64 + last_write_checksum: sha1:76d5d99a0b7fb22da0335ee26c14a60b79a7ffea + pristine_git_object: 962a3e12c9e7ed9b733d006ccac7fc74520f34e0 docs/operations/listvideoscontentglobals.mdx: id: 3332db3cd666 last_write_checksum: sha1:a5c1c54148c4f70454639dc474aad4fe32b82149 @@ -7408,6 +7472,22 @@ trackedFiles: id: 53486739ebf2 last_write_checksum: sha1:ed574764fc3d9c85d55705aee27616e3de0c8fcc pristine_git_object: 85b44c9e7e9fd56b3a5a0bded755877840cc31b2 + docs/operations/storeinternvaultsecretglobals.mdx: + id: cee17ad4252e + last_write_checksum: sha1:dcf11780c44a028cefc5ccc3e96d53536f3af2e7 + pristine_git_object: e7c3b3f7a288e3496e09f836c6cab27bfe3fd9e8 + docs/operations/storeinternvaultsecretrequest.mdx: + id: af7cc438e792 + last_write_checksum: sha1:e48da7551f97fdc3059722f5ff12d869f189f485 + pristine_git_object: fe38c09ab7459d86b261c497d77c5670f18c6680 + docs/operations/storevaultsecretglobals.mdx: + id: b220b557b26d + last_write_checksum: sha1:c399f9b4d7c63f48b74e7ea081bdc8865b7c566d + pristine_git_object: 6cb21606c48bbb4650b61b16cc63f14842d1eaf0 + docs/operations/storevaultsecretrequest.mdx: + id: 0a579302995d + last_write_checksum: sha1:43a3660ef91d77177e6bbb66f840cfeac069dee5 + pristine_git_object: e8571eae339193f1a757f6e67940b416b3c925fe docs/operations/subcategory.mdx: id: b3291e6c44b9 last_write_checksum: sha1:2594ecd2302b9515e5997f4fbaaebba4a9a0615c @@ -7668,6 +7748,10 @@ trackedFiles: id: cd1132543884 last_write_checksum: sha1:37918eb124f9ae0234e8047be7ec07a955458cbc pristine_git_object: bc53071afea2d5c822b7d8bea60e486d72447e1c + docs/sdks/vault/README.mdx: + id: 3738c6722acd + last_write_checksum: sha1:2b26b8c7e7c88dc4aee023f518b7d8e94f1649f9 + pristine_git_object: 224e03abadbea39a7fa64d5d4733b9b5f80fefab docs/sdks/videogeneration/README.mdx: id: 9a8fa04c3872 last_write_checksum: sha1:106d1c9682b11a43f84c619a08037e310f488b73 @@ -7682,8 +7766,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:091c3674c55879895da0e2d1a50bcc439c979aac - pristine_git_object: 1dea32d47ebfd49521a6b91f7b78851645286097 + last_write_checksum: sha1:3cfc9ee899cdda5cca4600e751d5e69f8c39563b + pristine_git_object: 062b23a1d3bf00497f224ab89f718834158da4e8 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7710,8 +7794,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:bd32a80c2f9141ca664f052ad95a09fab9901c2f - pristine_git_object: 03e58b4653e5fe8b4121c8242e305e8e1c6142a8 + last_write_checksum: sha1:25ce11eca3b8530378dc4fef1340532c46a74db9 + pristine_git_object: 02a088a4c37a08ba118bf4b3810e9c27dea7e26c src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -7750,8 +7834,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:d02ded1fc4989a9f71fab0a2364bbc2e349e365c - pristine_git_object: dbc0ef59722d87b3a6e40498dce7424b98404257 + last_write_checksum: sha1:17395d06856ed4c18e60c58dc737dbf31708f73b + pristine_git_object: e1c0f7fe7a911a43a640fe7cd4b61f4ca101b7f4 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -10204,6 +10288,30 @@ trackedFiles: id: fe4578e64ea3 last_write_checksum: sha1:6c7d8e616c55f8239c7bf46ebf237fa536b6c462 pristine_git_object: a0491cc8fd3bd9986146cb1176e27d5b9c9beb60 + src/openrouter/components/vaultsecret.py: + id: 9fcf1780b21c + last_write_checksum: sha1:8f9d67ffe7ccc6e136436956c62cfc474239367b + pristine_git_object: 001689417bffff3be2613e2f9180e325caeeaef9 + src/openrouter/components/vaultsecretcopyrequest.py: + id: d76c25d3f759 + last_write_checksum: sha1:0606f04ef3007d140e4d87e516f65263540ccb1e + pristine_git_object: d81add3e36047ae6c966e4b28ee401d3f6b7a1fa + src/openrouter/components/vaultsecretcopyresponse.py: + id: ff518133aa95 + last_write_checksum: sha1:489a123976951f829322107bb881a269e48b422c + pristine_git_object: cec8895cc3d2b874207bff4d2d8bf1de7149faa3 + src/openrouter/components/vaultsecretlistresponse.py: + id: d056fcfafa7d + last_write_checksum: sha1:d8f71dbe5bea5b2d69949deda141119972603ad8 + pristine_git_object: 5d2afe2de22d48b4553cd60e4a11eea5b7b417ed + src/openrouter/components/vaultsecretresponse.py: + id: 13721b687525 + last_write_checksum: sha1:a8b37f58c39f59a73d7693b105699256320c3c5e + pristine_git_object: a245014a7b07b95ac665357f587e1340cff8dc85 + src/openrouter/components/vaultsecretwriterequest.py: + id: cbb498111508 + last_write_checksum: sha1:72526fd27fea161dd2701080c2674dc96e046462 + pristine_git_object: b4a3db2fc4c7edf92a475be2952f01b5e2070205 src/openrouter/components/videogenerationrequest.py: id: 70e3c9ff288c last_write_checksum: sha1:27d477e569e2f024bfdbf4aa240403dfe7686555 @@ -10478,8 +10586,8 @@ trackedFiles: pristine_git_object: 8680343bbc90107ae6413bd5686012b1fd75d665 src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:4a0f94d3fb52f1d3e7aed3f2e0a54829eb04fd7a - pristine_git_object: 3a3975ce5e74f5e24d16899c3a8beaf44c636d29 + last_write_checksum: sha1:5e76725bba9755997befe0ccfa9dea8d455c58c7 + pristine_git_object: 4c2089b3de647036bdf11ef5786f1162714a4188 src/openrouter/operations/bulkaddworkspacemembers.py: id: e0ed56117619 last_write_checksum: sha1:5c44eb0d40fdece3ac084615f6c6082be4cf1d5a @@ -10504,6 +10612,10 @@ trackedFiles: id: 8127aafae1ef last_write_checksum: sha1:7e1a34d0a1629bd6ed183a85b71a6897202a02bf pristine_git_object: ff2fc0c099bd5ade18b89e6d39698293ae65e87c + src/openrouter/operations/copyvaultsecretstointern.py: + id: 79d33d578ed1 + last_write_checksum: sha1:b72323ae345357ce1f4f21a7db77c7f96c2e9ad3 + pristine_git_object: ea7d9a7e04d2b942a9a4c6ec6d6e8c96f41e6b79 src/openrouter/operations/createaudiospeech.py: id: af9df6195878 last_write_checksum: sha1:5beec05ba93a68805ad27e05603265864a608dc9 @@ -10596,6 +10708,10 @@ trackedFiles: id: 1fbdb98bbb85 last_write_checksum: sha1:9205bdbe64c2902d51ac7c6bddc8677af5b14ed7 pristine_git_object: a8c58e7fa8dd7e781d70c87ecc427f3fdff59ce9 + src/openrouter/operations/deleteinternvaultsecret.py: + id: ffac57160027 + last_write_checksum: sha1:bc0d5957e085421f3a82cddc86d2bb6139a3d0f9 + pristine_git_object: 40dffe39c9ba070ee8897e4361a4478d8fb1cd0f src/openrouter/operations/deletekeys.py: id: 0bd72d53b0a0 last_write_checksum: sha1:afcea9fd7d8e963f8a73c4f025b83bf6455dd45c @@ -10608,6 +10724,10 @@ trackedFiles: id: 5006e36e243e last_write_checksum: sha1:e3842ba18645e0c26de1810acce50da3b90e2cfc pristine_git_object: fec5503fa15f0f9588686f364f2066bf55f3ea80 + src/openrouter/operations/deletevaultsecret.py: + id: 1a7a4e95df3d + last_write_checksum: sha1:7d5caa272c0e080ce2708b82cde04a65e838bc65 + pristine_git_object: 8db5088e3e9c120394e5399bc580e2c09364ba15 src/openrouter/operations/deleteworkspace.py: id: f92017ce65e8 last_write_checksum: sha1:17f00e42bab5a0356a1057f53f6840a3bd3685d2 @@ -10780,6 +10900,10 @@ trackedFiles: id: ad2131e4aa6c last_write_checksum: sha1:b5bbcbd02ce54cdc8bb1a2a3a424ca93c73f90bc pristine_git_object: 01655ae02036acf433ec5f54fd1d9323a55f0684 + src/openrouter/operations/listinternvaultsecrets.py: + id: d9f9db46871d + last_write_checksum: sha1:31bd0f67cb4e7dffe16c4a4af5d27a08920d355c + pristine_git_object: 4c8177f198d86270e1401cb8dcecbe0b0655eecb src/openrouter/operations/listkeyassignments.py: id: e26c11d1bd3c last_write_checksum: sha1:378b13828e43296aa120e24a0b2d7a55bca85212 @@ -10828,6 +10952,10 @@ trackedFiles: id: 9f32309bb157 last_write_checksum: sha1:530b9e465c38b29c313a2c3a4bc596055825fd81 pristine_git_object: 8d3d678ade3ba25aa65c4ff0bc3cb0783d87106a + src/openrouter/operations/listvaultsecrets.py: + id: 460dacce49ab + last_write_checksum: sha1:c6fcb7a5e7f2f587888a3b087142a2c4c1f23cf9 + pristine_git_object: 8e4c37bcd30f553ae914863ddd9a6189d628a937 src/openrouter/operations/listvideoscontent.py: id: c27f9deb98f8 last_write_checksum: sha1:7eadc5d4d5f52469c09740d08f56970fafb407f2 @@ -10860,6 +10988,14 @@ trackedFiles: id: d9fee71bb577 last_write_checksum: sha1:0cba4011b8e305270ac30f88cb7ab59b6aefe619 pristine_git_object: b065e38c8d449348c4d133004653607e4194da6e + src/openrouter/operations/storeinternvaultsecret.py: + id: 59c0352c6d20 + last_write_checksum: sha1:60af864dcc1d9140f04957a1b5308de2bee9833e + pristine_git_object: 369dd47de25a9c105ade6fbca7e0d9344c305dfe + src/openrouter/operations/storevaultsecret.py: + id: bb6cbedc0cb2 + last_write_checksum: sha1:3f57e7a11f5722b4b51e28abe719076411f006a6 + pristine_git_object: 2ff4b299d19733b4ec6b9c33618c794d427952ce src/openrouter/operations/submitgenerationfeedback.py: id: a1f4458f5e75 last_write_checksum: sha1:634750972ca2bf7d76b1530f19f0d5401a44c3d8 @@ -10926,8 +11062,8 @@ trackedFiles: pristine_git_object: 1bea5be2496b283307c037f131a45a25bcca3c6c src/openrouter/sdk.py: id: ee9846c4c9c5 - last_write_checksum: sha1:5558c4303448970c8727f5e91dd5cce3c2066301 - pristine_git_object: b28878b68aa1c9d1c56fb35239d870227b2ccd3c + last_write_checksum: sha1:2f1264417c334224f12a37efb67a49dcf37b6ae4 + pristine_git_object: 488042f09d81179234cf4d43665d47cd5d5c0379 src/openrouter/sdkconfiguration.py: id: 55773bb98d7c last_write_checksum: sha1:c01826125c31a8b8bc99d9d679782c8758fae001 @@ -11028,6 +11164,10 @@ trackedFiles: id: 4ed16ed605f4 last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553 pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 + src/openrouter/vault.py: + id: 0645fe426ac1 + last_write_checksum: sha1:c6cd8d2dab531fc98053bcae2eb1285b0659eb28 + pristine_git_object: d73bcc0f564ebee39fdd727f9d588859abd19167 src/openrouter/video_generation.py: id: d0a90c1b8efe last_write_checksum: sha1:35ba3b4cb6107daa57b247bfab706a77266130ee @@ -12953,12 +13093,1128 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listInternVaultSecrets: + speakeasy-default-list-intern-vault-secrets: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "200": + application/json: {"data": [{"created_at": "2026-09-15T17:44:00.000Z", "fingerprint": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "hosts": ["api.github.com"], "name": "github_token"}, {"created_at": "2026-08-01T09:30:00.000Z", "fingerprint": null, "hosts": null, "name": "legacy_token"}], "has_more": false} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "504": + application/json: {"error": {"code": 504, "message": "The operation was aborted due to timeout"}} + invalid-vault-request: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid vault request"}} + invalid-or-missing-api-key: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "401": + application/json: {"error": {"code": 401, "message": "Invalid or missing API key"}} + regional-hostname: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "403": + application/json: {"error": {"code": 403, "message": "The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai."}} + workspace-scope-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "403": + application/json: {"error": {"code": 403, "message": "Vault scope is unavailable"}} + not-found: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "404": + application/json: {"error": {"code": 404, "message": "Not found"}} + body-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "408": + application/json: {"error": {"code": 408, "message": "Request body timed out"}} + route-deadline: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "408": + application/json: {"error": {"code": 408, "message": "Vault request timed out"}} + rate-limited: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "429": + application/json: {"error": {"code": 429, "message": "Too many vault requests"}} + internal-error: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid-vault-response: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "502": + application/json: {"error": {"code": 502, "message": "Invalid vault response"}} + vault-request-failed: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "502": + application/json: {"error": {"code": 502, "message": "Vault request failed"}} + vault-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault service is unavailable"}} + writes-disabled: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault writes are not enabled"}} + vault-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + query: + limit: 50 + offset: 0 + responses: + "504": + application/json: {"error": {"code": 504, "message": "Vault request timed out"}} + deleteInternVaultSecret: + invalid-vault-request: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid vault request"}} + invalid-or-missing-api-key: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "401": + application/json: {"error": {"code": 401, "message": "Invalid or missing API key"}} + regional-hostname: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "403": + application/json: {"error": {"code": 403, "message": "The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai."}} + workspace-scope-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "403": + application/json: {"error": {"code": 403, "message": "Vault scope is unavailable"}} + not-found: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "404": + application/json: {"error": {"code": 404, "message": "Not found"}} + body-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "408": + application/json: {"error": {"code": 408, "message": "Request body timed out"}} + route-deadline: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "408": + application/json: {"error": {"code": 408, "message": "Vault request timed out"}} + rate-limited: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "429": + application/json: {"error": {"code": 429, "message": "Too many vault requests"}} + internal-error: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid-vault-response: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "502": + application/json: {"error": {"code": 502, "message": "Invalid vault response"}} + vault-request-failed: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "502": + application/json: {"error": {"code": 502, "message": "Vault request failed"}} + vault-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault service is unavailable"}} + writes-disabled: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault writes are not enabled"}} + vault-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "504": + application/json: {"error": {"code": 504, "message": "Vault request timed out"}} + speakeasy-default-delete-intern-vault-secret: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "504": + application/json: {"error": {"code": 504, "message": "The operation was aborted due to timeout"}} + storeInternVaultSecret: + speakeasy-default-store-intern-vault-secret: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "200": + application/json: {"data": {"created_at": "2026-09-15T17:44:00.000Z", "fingerprint": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "hosts": ["api.github.com"], "name": "github_token"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "504": + application/json: {"error": {"code": 504, "message": "The operation was aborted due to timeout"}} + invalid-vault-request: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid vault request"}} + invalid-or-missing-api-key: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "401": + application/json: {"error": {"code": 401, "message": "Invalid or missing API key"}} + regional-hostname: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "403": + application/json: {"error": {"code": 403, "message": "The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai."}} + workspace-scope-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "403": + application/json: {"error": {"code": 403, "message": "Vault scope is unavailable"}} + not-found: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "404": + application/json: {"error": {"code": 404, "message": "Not found"}} + body-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "408": + application/json: {"error": {"code": 408, "message": "Request body timed out"}} + route-deadline: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "408": + application/json: {"error": {"code": 408, "message": "Vault request timed out"}} + transfer-in-progress: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "409": + application/json: {"error": {"code": 409, "message": "Vault request conflicts with existing secrets"}} + body-too-large: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "413": + application/json: {"error": {"code": 413, "message": "Request body too large"}} + rate-limited: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "429": + application/json: {"error": {"code": 429, "message": "Too many vault requests"}} + internal-error: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid-vault-response: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "502": + application/json: {"error": {"code": 502, "message": "Invalid vault response"}} + vault-request-failed: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "502": + application/json: {"error": {"code": 502, "message": "Vault request failed"}} + vault-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault service is unavailable"}} + writes-disabled: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault writes are not enabled"}} + vault-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "504": + application/json: {"error": {"code": 504, "message": "Vault request timed out"}} + copyVaultSecretsToIntern: + speakeasy-default-copy-vault-secrets-to-intern: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "200": + application/json: {"data": [{"created_at": "2026-09-15T17:44:00.000Z", "fingerprint": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "hosts": ["api.github.com"], "name": "github_token"}]} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "504": + application/json: {"error": {"code": 504, "message": "The operation was aborted due to timeout"}} + invalid-vault-request: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid vault request"}} + invalid-or-missing-api-key: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "401": + application/json: {"error": {"code": 401, "message": "Invalid or missing API key"}} + regional-hostname: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "403": + application/json: {"error": {"code": 403, "message": "The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai."}} + workspace-scope-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "403": + application/json: {"error": {"code": 403, "message": "Vault scope is unavailable"}} + not-found: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "404": + application/json: {"error": {"code": 404, "message": "Not found"}} + body-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "408": + application/json: {"error": {"code": 408, "message": "Request body timed out"}} + route-deadline: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "408": + application/json: {"error": {"code": 408, "message": "Vault request timed out"}} + copy-conflict: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "409": + application/json: {"error": {"code": 409, "message": "Vault request conflicts with existing secrets"}} + body-too-large: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "413": + application/json: {"error": {"code": 413, "message": "Request body too large"}} + rate-limited: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "429": + application/json: {"error": {"code": 429, "message": "Too many vault requests"}} + internal-error: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid-vault-response: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "502": + application/json: {"error": {"code": 502, "message": "Invalid vault response"}} + vault-request-failed: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "502": + application/json: {"error": {"code": 502, "message": "Vault request failed"}} + vault-unavailable: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault service is unavailable"}} + writes-disabled: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault writes are not enabled"}} + vault-timed-out: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + requestBody: + application/json: {"names": ["github_token"]} + responses: + "504": + application/json: {"error": {"code": 504, "message": "Vault request timed out"}} + listVaultSecrets: + speakeasy-default-list-vault-secrets: + parameters: + query: + limit: 50 + offset: 0 + responses: + "200": + application/json: {"data": [{"created_at": "2026-09-15T17:44:00.000Z", "fingerprint": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "hosts": ["api.github.com"], "name": "github_token"}, {"created_at": "2026-08-01T09:30:00.000Z", "fingerprint": null, "hosts": null, "name": "legacy_token"}], "has_more": false} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "504": + application/json: {"error": {"code": 504, "message": "The operation was aborted due to timeout"}} + invalid-vault-request: + parameters: + query: + limit: 50 + offset: 0 + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid vault request"}} + invalid-or-missing-api-key: + parameters: + query: + limit: 50 + offset: 0 + responses: + "401": + application/json: {"error": {"code": 401, "message": "Invalid or missing API key"}} + regional-hostname: + parameters: + query: + limit: 50 + offset: 0 + responses: + "403": + application/json: {"error": {"code": 403, "message": "The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai."}} + workspace-scope-unavailable: + parameters: + query: + limit: 50 + offset: 0 + responses: + "403": + application/json: {"error": {"code": 403, "message": "Vault scope is unavailable"}} + not-found: + parameters: + query: + limit: 50 + offset: 0 + responses: + "404": + application/json: {"error": {"code": 404, "message": "Not found"}} + body-timed-out: + parameters: + query: + limit: 50 + offset: 0 + responses: + "408": + application/json: {"error": {"code": 408, "message": "Request body timed out"}} + route-deadline: + parameters: + query: + limit: 50 + offset: 0 + responses: + "408": + application/json: {"error": {"code": 408, "message": "Vault request timed out"}} + rate-limited: + parameters: + query: + limit: 50 + offset: 0 + responses: + "429": + application/json: {"error": {"code": 429, "message": "Too many vault requests"}} + internal-error: + parameters: + query: + limit: 50 + offset: 0 + responses: + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid-vault-response: + parameters: + query: + limit: 50 + offset: 0 + responses: + "502": + application/json: {"error": {"code": 502, "message": "Invalid vault response"}} + vault-request-failed: + parameters: + query: + limit: 50 + offset: 0 + responses: + "502": + application/json: {"error": {"code": 502, "message": "Vault request failed"}} + vault-unavailable: + parameters: + query: + limit: 50 + offset: 0 + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault service is unavailable"}} + writes-disabled: + parameters: + query: + limit: 50 + offset: 0 + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault writes are not enabled"}} + vault-timed-out: + parameters: + query: + limit: 50 + offset: 0 + responses: + "504": + application/json: {"error": {"code": 504, "message": "Vault request timed out"}} + deleteVaultSecret: + invalid-vault-request: + parameters: + path: + name: "github_token" + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid vault request"}} + invalid-or-missing-api-key: + parameters: + path: + name: "github_token" + responses: + "401": + application/json: {"error": {"code": 401, "message": "Invalid or missing API key"}} + regional-hostname: + parameters: + path: + name: "github_token" + responses: + "403": + application/json: {"error": {"code": 403, "message": "The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai."}} + workspace-scope-unavailable: + parameters: + path: + name: "github_token" + responses: + "403": + application/json: {"error": {"code": 403, "message": "Vault scope is unavailable"}} + not-found: + parameters: + path: + name: "github_token" + responses: + "404": + application/json: {"error": {"code": 404, "message": "Not found"}} + body-timed-out: + parameters: + path: + name: "github_token" + responses: + "408": + application/json: {"error": {"code": 408, "message": "Request body timed out"}} + route-deadline: + parameters: + path: + name: "github_token" + responses: + "408": + application/json: {"error": {"code": 408, "message": "Vault request timed out"}} + rate-limited: + parameters: + path: + name: "github_token" + responses: + "429": + application/json: {"error": {"code": 429, "message": "Too many vault requests"}} + internal-error: + parameters: + path: + name: "github_token" + responses: + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid-vault-response: + parameters: + path: + name: "github_token" + responses: + "502": + application/json: {"error": {"code": 502, "message": "Invalid vault response"}} + vault-request-failed: + parameters: + path: + name: "github_token" + responses: + "502": + application/json: {"error": {"code": 502, "message": "Vault request failed"}} + vault-unavailable: + parameters: + path: + name: "github_token" + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault service is unavailable"}} + writes-disabled: + parameters: + path: + name: "github_token" + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault writes are not enabled"}} + vault-timed-out: + parameters: + path: + name: "github_token" + responses: + "504": + application/json: {"error": {"code": 504, "message": "Vault request timed out"}} + speakeasy-default-delete-vault-secret: + parameters: + path: + name: "github_token" + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "504": + application/json: {"error": {"code": 504, "message": "The operation was aborted due to timeout"}} + storeVaultSecret: + speakeasy-default-store-vault-secret: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "200": + application/json: {"data": {"created_at": "2026-09-15T17:44:00.000Z", "fingerprint": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "hosts": ["api.github.com"], "name": "github_token"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "504": + application/json: {"error": {"code": 504, "message": "The operation was aborted due to timeout"}} + invalid-vault-request: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid vault request"}} + invalid-or-missing-api-key: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "401": + application/json: {"error": {"code": 401, "message": "Invalid or missing API key"}} + regional-hostname: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "403": + application/json: {"error": {"code": 403, "message": "The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai."}} + workspace-scope-unavailable: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "403": + application/json: {"error": {"code": 403, "message": "Vault scope is unavailable"}} + not-found: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "404": + application/json: {"error": {"code": 404, "message": "Not found"}} + body-timed-out: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "408": + application/json: {"error": {"code": 408, "message": "Request body timed out"}} + route-deadline: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "408": + application/json: {"error": {"code": 408, "message": "Vault request timed out"}} + body-too-large: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "413": + application/json: {"error": {"code": 413, "message": "Request body too large"}} + rate-limited: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "429": + application/json: {"error": {"code": 429, "message": "Too many vault requests"}} + internal-error: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid-vault-response: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "502": + application/json: {"error": {"code": 502, "message": "Invalid vault response"}} + vault-request-failed: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "502": + application/json: {"error": {"code": 502, "message": "Vault request failed"}} + vault-unavailable: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault service is unavailable"}} + writes-disabled: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "503": + application/json: {"error": {"code": 503, "message": "Vault writes are not enabled"}} + vault-timed-out: + parameters: + path: + name: "github_token" + requestBody: + application/json: {"hosts": ["api.github.com"], "value": "ghp_exampleTokenValue"} + responses: + "504": + application/json: {"error": {"code": 504, "message": "Vault request timed out"}} examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.tts.create_speech()`: `request.session_id` **Added** - * `open_router.stt.create_transcription()`: `request.session_id` **Added** - * `open_router.embeddings.generate()`: `request.session_id` **Added** - * `open_router.images.generate()`: `request.session_id` **Added** - * `open_router.rerank.rerank()`: `request.session_id` **Added** - * `open_router.video_generation.generate()`: `request.session_id` **Added** + * `open_router.vault.list_intern_vault_secrets()`: **Added** + * `open_router.vault.delete_intern_vault_secret()`: **Added** + * `open_router.vault.store_intern_vault_secret()`: **Added** + * `open_router.vault.copy_vault_secrets_to_intern()`: **Added** + * `open_router.vault.list_vault_secrets()`: **Added** + * `open_router.vault.delete_vault_secret()`: **Added** + * `open_router.vault.store_vault_secret()`: **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 19c3ffb3..5be40c24 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.151 + version: 1.1.152 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 3cedf3f8..8dceac98 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -27273,6 +27273,152 @@ components: output_tokens_details: reasoning_tokens: 0 total_tokens: 35 + VaultSecret: + additionalProperties: false + description: 'Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.' + example: + created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + properties: + created_at: + format: 'date-time' + type: 'string' + fingerprint: + pattern: '^sha256:[a-f0-9]{64}$' + type: + - 'string' + - 'null' + hosts: + items: + maxLength: 254 + type: 'string' + maxItems: 100 + minItems: 1 + type: + - 'array' + - 'null' + name: + maxLength: 255 + minLength: 1 + pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' + type: 'string' + required: + - 'name' + - 'hosts' + - 'fingerprint' + - 'created_at' + type: 'object' + VaultSecretCopyRequest: + additionalProperties: false + description: 'Workspace secrets to copy into the intern scope.' + example: + names: + - 'github_token' + properties: + names: + description: 'Names of workspace secrets to copy, 1 to 100 unique entries. Every name must exist in the workspace scope.' + items: + maxLength: 255 + minLength: 1 + pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' + type: 'string' + maxItems: 100 + minItems: 1 + type: 'array' + required: + - 'names' + type: 'object' + VaultSecretCopyResponse: + additionalProperties: false + description: 'Metadata for the copies now stored in the intern scope, one entry per requested name.' + example: + data: + - created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + properties: + data: + items: + $ref: '#/components/schemas/VaultSecret' + maxItems: 100 + type: 'array' + required: + - 'data' + type: 'object' + VaultSecretListResponse: + additionalProperties: false + description: 'One page of secret metadata for the selected scope.' + example: + data: + - created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + - created_at: '2026-08-01T09:30:00.000Z' + fingerprint: null + hosts: null + name: 'legacy_token' + has_more: false + properties: + data: + items: + $ref: '#/components/schemas/VaultSecret' + maxItems: 100 + type: 'array' + has_more: + description: 'True when more secrets exist beyond this page. Request the next page with `offset` increased by the number of returned entries.' + type: 'boolean' + required: + - 'data' + - 'has_more' + type: 'object' + VaultSecretResponse: + additionalProperties: false + description: 'Metadata for the stored secret.' + example: + data: + created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + properties: + data: + $ref: '#/components/schemas/VaultSecret' + required: + - 'data' + type: 'object' + VaultSecretWriteRequest: + additionalProperties: false + description: 'Secret value and the exact hostnames it may be released to.' + example: + hosts: + - 'api.github.com' + value: 'ghp_exampleTokenValue' + properties: + hosts: + description: 'Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname.' + items: + maxLength: 254 + type: 'string' + maxItems: 100 + minItems: 1 + type: 'array' + value: + description: 'Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.' + maxLength: 65536 + minLength: 1 + type: 'string' + required: + - 'value' + - 'hosts' + type: 'object' VideoGenerationRequest: example: aspect_ratio: '16:9' @@ -40769,6 +40915,1478 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /vault/interns/{internId}/secrets: + get: + description: 'Lists secret metadata stored for one intern. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' + operationId: 'listInternVaultSecrets' + parameters: + - description: 'UUID of an intern in the workspace selected by the API key.' + in: 'path' + name: 'internId' + required: true + schema: + description: 'UUID of an intern in the workspace selected by the API key.' + example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' + format: 'uuid' + type: 'string' + - description: 'Page size, 1 to 100. Defaults to 100.' + in: 'query' + name: 'limit' + required: false + schema: + default: 100 + description: 'Page size, 1 to 100. Defaults to 100.' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Number of secrets to skip, 0 to 10000. Defaults to 0.' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of secrets to skip, 0 to 10000. Defaults to 0.' + example: 0 + maximum: 10000 + minimum: 0 + type: 'integer' + nullable: false + responses: + '200': + content: + application/json: + example: + data: + - created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + - created_at: '2026-08-01T09:30:00.000Z' + fingerprint: null + hosts: null + name: 'legacy_token' + has_more: false + schema: + $ref: '#/components/schemas/VaultSecretListResponse' + description: 'One page of secret metadata.' + '400': + content: + application/json: + examples: + invalid-vault-request: + summary: 'Invalid vault request' + value: + error: + code: 400 + message: 'Invalid vault request' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - The secret name, path, query or JSON body failed validation. The vault returns 400 for a malformed request as well.' + '401': + content: + application/json: + examples: + invalid-or-missing-api-key: + summary: 'Invalid or missing API key' + value: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Missing or unknown API key. Provisioning keys cannot call vault routes.' + '403': + content: + application/json: + examples: + regional-hostname: + summary: 'Regional hostname' + value: + error: + code: 403 + message: 'The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai.' + workspace-scope-unavailable: + summary: 'Workspace scope unavailable' + value: + error: + code: 403 + message: 'Vault scope is unavailable' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - The key has no usable workspace scope, or the request arrived on a regional hostname.' + '404': + content: + application/json: + examples: + not-found: + summary: 'Not found' + value: + error: + code: 404 + message: 'Not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - The intern is not in the selected workspace, the secret does not exist in the selected scope, or the caller is outside the intern programme.' + '408': + content: + application/json: + examples: + body-timed-out: + summary: 'Body timed out' + value: + error: + code: 408 + message: 'Request body timed out' + route-deadline: + summary: 'Route deadline' + value: + error: + code: 408 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - The route deadline passed before the request completed, or the request body stopped arriving.' + '429': + content: + application/json: + examples: + rate-limited: + summary: 'Rate limited' + value: + error: + code: 429 + message: 'Too many vault requests' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - The vault rate limit was reached.' + '500': + content: + application/json: + examples: + internal-error: + summary: 'Internal error' + value: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Scope lookup failed.' + '502': + content: + application/json: + examples: + invalid-vault-response: + summary: 'Invalid vault response' + value: + error: + code: 502 + message: 'Invalid vault response' + vault-request-failed: + summary: 'Vault request failed' + value: + error: + code: 502 + message: 'Vault request failed' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - The vault could not be reached or returned an unexpected response.' + '503': + content: + application/json: + examples: + vault-unavailable: + summary: 'Vault unavailable' + value: + error: + code: 503 + message: 'Vault service is unavailable' + writes-disabled: + summary: 'Writes disabled' + value: + error: + code: 503 + message: 'Vault writes are not enabled' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Vault writes are disabled for the caller, or the vault is not configured.' + '504': + content: + application/json: + examples: + vault-timed-out: + summary: 'Vault timed out' + value: + error: + code: 504 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - The vault did not answer in time.' + security: + - apiKey: [] + summary: 'List intern secrets' + tags: + - 'Vault' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /vault/interns/{internId}/secrets/{name}: + delete: + description: 'Deletes a secret stored for one intern. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' + operationId: 'deleteInternVaultSecret' + parameters: + - description: 'UUID of an intern in the workspace selected by the API key.' + in: 'path' + name: 'internId' + required: true + schema: + description: 'UUID of an intern in the workspace selected by the API key.' + example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' + format: 'uuid' + type: 'string' + - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + in: 'path' + name: 'name' + required: true + schema: + description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + example: 'github_token' + maxLength: 255 + minLength: 1 + pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' + type: 'string' + responses: + '204': + description: 'Secret deleted. The response has no body.' + '400': + content: + application/json: + examples: + invalid-vault-request: + summary: 'Invalid vault request' + value: + error: + code: 400 + message: 'Invalid vault request' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - The secret name, path, query or JSON body failed validation. The vault returns 400 for a malformed request as well.' + '401': + content: + application/json: + examples: + invalid-or-missing-api-key: + summary: 'Invalid or missing API key' + value: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Missing or unknown API key. Provisioning keys cannot call vault routes.' + '403': + content: + application/json: + examples: + regional-hostname: + summary: 'Regional hostname' + value: + error: + code: 403 + message: 'The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai.' + workspace-scope-unavailable: + summary: 'Workspace scope unavailable' + value: + error: + code: 403 + message: 'Vault scope is unavailable' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - The key has no usable workspace scope, or the request arrived on a regional hostname.' + '404': + content: + application/json: + examples: + not-found: + summary: 'Not found' + value: + error: + code: 404 + message: 'Not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - The intern is not in the selected workspace, the secret does not exist in the selected scope, or the caller is outside the intern programme.' + '408': + content: + application/json: + examples: + body-timed-out: + summary: 'Body timed out' + value: + error: + code: 408 + message: 'Request body timed out' + route-deadline: + summary: 'Route deadline' + value: + error: + code: 408 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - The route deadline passed before the request completed, or the request body stopped arriving.' + '429': + content: + application/json: + examples: + rate-limited: + summary: 'Rate limited' + value: + error: + code: 429 + message: 'Too many vault requests' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - The vault rate limit was reached.' + '500': + content: + application/json: + examples: + internal-error: + summary: 'Internal error' + value: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Scope lookup failed.' + '502': + content: + application/json: + examples: + invalid-vault-response: + summary: 'Invalid vault response' + value: + error: + code: 502 + message: 'Invalid vault response' + vault-request-failed: + summary: 'Vault request failed' + value: + error: + code: 502 + message: 'Vault request failed' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - The vault could not be reached or returned an unexpected response.' + '503': + content: + application/json: + examples: + vault-unavailable: + summary: 'Vault unavailable' + value: + error: + code: 503 + message: 'Vault service is unavailable' + writes-disabled: + summary: 'Writes disabled' + value: + error: + code: 503 + message: 'Vault writes are not enabled' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Vault writes are disabled for the caller, or the vault is not configured.' + '504': + content: + application/json: + examples: + vault-timed-out: + summary: 'Vault timed out' + value: + error: + code: 504 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - The vault did not answer in time.' + security: + - apiKey: [] + summary: 'Delete an intern secret' + tags: + - 'Vault' + put: + description: 'Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' + operationId: 'storeInternVaultSecret' + parameters: + - description: 'UUID of an intern in the workspace selected by the API key.' + in: 'path' + name: 'internId' + required: true + schema: + description: 'UUID of an intern in the workspace selected by the API key.' + example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' + format: 'uuid' + type: 'string' + - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + in: 'path' + name: 'name' + required: true + schema: + description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + example: 'github_token' + maxLength: 255 + minLength: 1 + pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' + type: 'string' + requestBody: + content: + application/json: + example: + hosts: + - 'api.github.com' + value: 'ghp_exampleTokenValue' + schema: + $ref: '#/components/schemas/VaultSecretWriteRequest' + required: true + responses: + '200': + content: + application/json: + example: + data: + created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + schema: + $ref: '#/components/schemas/VaultSecretResponse' + description: 'Metadata for the stored secret.' + '400': + content: + application/json: + examples: + invalid-vault-request: + summary: 'Invalid vault request' + value: + error: + code: 400 + message: 'Invalid vault request' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - The secret name, path, query or JSON body failed validation. The vault returns 400 for a malformed request as well.' + '401': + content: + application/json: + examples: + invalid-or-missing-api-key: + summary: 'Invalid or missing API key' + value: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Missing or unknown API key. Provisioning keys cannot call vault routes.' + '403': + content: + application/json: + examples: + regional-hostname: + summary: 'Regional hostname' + value: + error: + code: 403 + message: 'The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai.' + workspace-scope-unavailable: + summary: 'Workspace scope unavailable' + value: + error: + code: 403 + message: 'Vault scope is unavailable' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - The key has no usable workspace scope, or the request arrived on a regional hostname.' + '404': + content: + application/json: + examples: + not-found: + summary: 'Not found' + value: + error: + code: 404 + message: 'Not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - The intern is not in the selected workspace, the secret does not exist in the selected scope, or the caller is outside the intern programme.' + '408': + content: + application/json: + examples: + body-timed-out: + summary: 'Body timed out' + value: + error: + code: 408 + message: 'Request body timed out' + route-deadline: + summary: 'Route deadline' + value: + error: + code: 408 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - The route deadline passed before the request completed, or the request body stopped arriving.' + '409': + content: + application/json: + examples: + transfer-in-progress: + summary: 'Transfer in progress' + value: + error: + code: 409 + message: 'Vault request conflicts with existing secrets' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - The intern is being transferred to another workspace and its vault has not moved yet. Retry once the transfer finishes.' + '413': + content: + application/json: + examples: + body-too-large: + summary: 'Body too large' + value: + error: + code: 413 + message: 'Request body too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - The JSON body exceeds 425000 bytes.' + '429': + content: + application/json: + examples: + rate-limited: + summary: 'Rate limited' + value: + error: + code: 429 + message: 'Too many vault requests' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - The vault rate limit was reached.' + '500': + content: + application/json: + examples: + internal-error: + summary: 'Internal error' + value: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Scope lookup failed.' + '502': + content: + application/json: + examples: + invalid-vault-response: + summary: 'Invalid vault response' + value: + error: + code: 502 + message: 'Invalid vault response' + vault-request-failed: + summary: 'Vault request failed' + value: + error: + code: 502 + message: 'Vault request failed' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - The vault could not be reached or returned an unexpected response.' + '503': + content: + application/json: + examples: + vault-unavailable: + summary: 'Vault unavailable' + value: + error: + code: 503 + message: 'Vault service is unavailable' + writes-disabled: + summary: 'Writes disabled' + value: + error: + code: 503 + message: 'Vault writes are not enabled' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Vault writes are disabled for the caller, or the vault is not configured.' + '504': + content: + application/json: + examples: + vault-timed-out: + summary: 'Vault timed out' + value: + error: + code: 504 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - The vault did not answer in time.' + security: + - apiKey: [] + summary: 'Store an intern secret' + tags: + - 'Vault' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /vault/interns/{internId}/secrets/copy: + post: + description: 'Copies the named workspace secrets into one intern''s scope, replacing any intern secret with the same name. Each copy keeps the source value and host bindings. Every name must exist in the workspace scope or the request fails with 404 and nothing is copied. A workspace secret whose `hosts` is `null` cannot be copied: the request fails with 409 and nothing is copied until that secret is stored again with hosts. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' + operationId: 'copyVaultSecretsToIntern' + parameters: + - description: 'UUID of an intern in the workspace selected by the API key.' + in: 'path' + name: 'internId' + required: true + schema: + description: 'UUID of an intern in the workspace selected by the API key.' + example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + example: + names: + - 'github_token' + schema: + $ref: '#/components/schemas/VaultSecretCopyRequest' + required: true + responses: + '200': + content: + application/json: + example: + data: + - created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + schema: + $ref: '#/components/schemas/VaultSecretCopyResponse' + description: 'Metadata for the copied secrets.' + '400': + content: + application/json: + examples: + invalid-vault-request: + summary: 'Invalid vault request' + value: + error: + code: 400 + message: 'Invalid vault request' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - The secret name, path, query or JSON body failed validation. The vault returns 400 for a malformed request as well.' + '401': + content: + application/json: + examples: + invalid-or-missing-api-key: + summary: 'Invalid or missing API key' + value: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Missing or unknown API key. Provisioning keys cannot call vault routes.' + '403': + content: + application/json: + examples: + regional-hostname: + summary: 'Regional hostname' + value: + error: + code: 403 + message: 'The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai.' + workspace-scope-unavailable: + summary: 'Workspace scope unavailable' + value: + error: + code: 403 + message: 'Vault scope is unavailable' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - The key has no usable workspace scope, or the request arrived on a regional hostname.' + '404': + content: + application/json: + examples: + not-found: + summary: 'Not found' + value: + error: + code: 404 + message: 'Not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - The intern is not in the selected workspace, the secret does not exist in the selected scope, or the caller is outside the intern programme.' + '408': + content: + application/json: + examples: + body-timed-out: + summary: 'Body timed out' + value: + error: + code: 408 + message: 'Request body timed out' + route-deadline: + summary: 'Route deadline' + value: + error: + code: 408 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - The route deadline passed before the request completed, or the request body stopped arriving.' + '409': + content: + application/json: + examples: + copy-conflict: + summary: 'Copy conflict' + value: + error: + code: 409 + message: 'Vault request conflicts with existing secrets' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - A named workspace secret has no hosts yet, or the intern is being transferred to another workspace. Nothing is copied.' + '413': + content: + application/json: + examples: + body-too-large: + summary: 'Body too large' + value: + error: + code: 413 + message: 'Request body too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - The JSON body exceeds 425000 bytes.' + '429': + content: + application/json: + examples: + rate-limited: + summary: 'Rate limited' + value: + error: + code: 429 + message: 'Too many vault requests' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - The vault rate limit was reached.' + '500': + content: + application/json: + examples: + internal-error: + summary: 'Internal error' + value: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Scope lookup failed.' + '502': + content: + application/json: + examples: + invalid-vault-response: + summary: 'Invalid vault response' + value: + error: + code: 502 + message: 'Invalid vault response' + vault-request-failed: + summary: 'Vault request failed' + value: + error: + code: 502 + message: 'Vault request failed' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - The vault could not be reached or returned an unexpected response.' + '503': + content: + application/json: + examples: + vault-unavailable: + summary: 'Vault unavailable' + value: + error: + code: 503 + message: 'Vault service is unavailable' + writes-disabled: + summary: 'Writes disabled' + value: + error: + code: 503 + message: 'Vault writes are not enabled' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Vault writes are disabled for the caller, or the vault is not configured.' + '504': + content: + application/json: + examples: + vault-timed-out: + summary: 'Vault timed out' + value: + error: + code: 504 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - The vault did not answer in time.' + security: + - apiKey: [] + summary: 'Copy workspace secrets to an intern' + tags: + - 'Vault' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /vault/secrets: + get: + description: 'Lists secret metadata for the workspace of the authenticated API key. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' + operationId: 'listVaultSecrets' + parameters: + - description: 'Page size, 1 to 100. Defaults to 100.' + in: 'query' + name: 'limit' + required: false + schema: + default: 100 + description: 'Page size, 1 to 100. Defaults to 100.' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Number of secrets to skip, 0 to 10000. Defaults to 0.' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of secrets to skip, 0 to 10000. Defaults to 0.' + example: 0 + maximum: 10000 + minimum: 0 + type: 'integer' + nullable: false + responses: + '200': + content: + application/json: + example: + data: + - created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + - created_at: '2026-08-01T09:30:00.000Z' + fingerprint: null + hosts: null + name: 'legacy_token' + has_more: false + schema: + $ref: '#/components/schemas/VaultSecretListResponse' + description: 'One page of secret metadata.' + '400': + content: + application/json: + examples: + invalid-vault-request: + summary: 'Invalid vault request' + value: + error: + code: 400 + message: 'Invalid vault request' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - The secret name, path, query or JSON body failed validation. The vault returns 400 for a malformed request as well.' + '401': + content: + application/json: + examples: + invalid-or-missing-api-key: + summary: 'Invalid or missing API key' + value: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Missing or unknown API key. Provisioning keys cannot call vault routes.' + '403': + content: + application/json: + examples: + regional-hostname: + summary: 'Regional hostname' + value: + error: + code: 403 + message: 'The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai.' + workspace-scope-unavailable: + summary: 'Workspace scope unavailable' + value: + error: + code: 403 + message: 'Vault scope is unavailable' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - The key has no usable workspace scope, or the request arrived on a regional hostname.' + '404': + content: + application/json: + examples: + not-found: + summary: 'Not found' + value: + error: + code: 404 + message: 'Not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - The intern is not in the selected workspace, the secret does not exist in the selected scope, or the caller is outside the intern programme.' + '408': + content: + application/json: + examples: + body-timed-out: + summary: 'Body timed out' + value: + error: + code: 408 + message: 'Request body timed out' + route-deadline: + summary: 'Route deadline' + value: + error: + code: 408 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - The route deadline passed before the request completed, or the request body stopped arriving.' + '429': + content: + application/json: + examples: + rate-limited: + summary: 'Rate limited' + value: + error: + code: 429 + message: 'Too many vault requests' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - The vault rate limit was reached.' + '500': + content: + application/json: + examples: + internal-error: + summary: 'Internal error' + value: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Scope lookup failed.' + '502': + content: + application/json: + examples: + invalid-vault-response: + summary: 'Invalid vault response' + value: + error: + code: 502 + message: 'Invalid vault response' + vault-request-failed: + summary: 'Vault request failed' + value: + error: + code: 502 + message: 'Vault request failed' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - The vault could not be reached or returned an unexpected response.' + '503': + content: + application/json: + examples: + vault-unavailable: + summary: 'Vault unavailable' + value: + error: + code: 503 + message: 'Vault service is unavailable' + writes-disabled: + summary: 'Writes disabled' + value: + error: + code: 503 + message: 'Vault writes are not enabled' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Vault writes are disabled for the caller, or the vault is not configured.' + '504': + content: + application/json: + examples: + vault-timed-out: + summary: 'Vault timed out' + value: + error: + code: 504 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - The vault did not answer in time.' + security: + - apiKey: [] + summary: 'List workspace secrets' + tags: + - 'Vault' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /vault/secrets/{name}: + delete: + description: 'Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' + operationId: 'deleteVaultSecret' + parameters: + - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + in: 'path' + name: 'name' + required: true + schema: + description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + example: 'github_token' + maxLength: 255 + minLength: 1 + pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' + type: 'string' + responses: + '204': + description: 'Secret deleted. The response has no body.' + '400': + content: + application/json: + examples: + invalid-vault-request: + summary: 'Invalid vault request' + value: + error: + code: 400 + message: 'Invalid vault request' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - The secret name, path, query or JSON body failed validation. The vault returns 400 for a malformed request as well.' + '401': + content: + application/json: + examples: + invalid-or-missing-api-key: + summary: 'Invalid or missing API key' + value: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Missing or unknown API key. Provisioning keys cannot call vault routes.' + '403': + content: + application/json: + examples: + regional-hostname: + summary: 'Regional hostname' + value: + error: + code: 403 + message: 'The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai.' + workspace-scope-unavailable: + summary: 'Workspace scope unavailable' + value: + error: + code: 403 + message: 'Vault scope is unavailable' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - The key has no usable workspace scope, or the request arrived on a regional hostname.' + '404': + content: + application/json: + examples: + not-found: + summary: 'Not found' + value: + error: + code: 404 + message: 'Not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - The intern is not in the selected workspace, the secret does not exist in the selected scope, or the caller is outside the intern programme.' + '408': + content: + application/json: + examples: + body-timed-out: + summary: 'Body timed out' + value: + error: + code: 408 + message: 'Request body timed out' + route-deadline: + summary: 'Route deadline' + value: + error: + code: 408 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - The route deadline passed before the request completed, or the request body stopped arriving.' + '429': + content: + application/json: + examples: + rate-limited: + summary: 'Rate limited' + value: + error: + code: 429 + message: 'Too many vault requests' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - The vault rate limit was reached.' + '500': + content: + application/json: + examples: + internal-error: + summary: 'Internal error' + value: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Scope lookup failed.' + '502': + content: + application/json: + examples: + invalid-vault-response: + summary: 'Invalid vault response' + value: + error: + code: 502 + message: 'Invalid vault response' + vault-request-failed: + summary: 'Vault request failed' + value: + error: + code: 502 + message: 'Vault request failed' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - The vault could not be reached or returned an unexpected response.' + '503': + content: + application/json: + examples: + vault-unavailable: + summary: 'Vault unavailable' + value: + error: + code: 503 + message: 'Vault service is unavailable' + writes-disabled: + summary: 'Writes disabled' + value: + error: + code: 503 + message: 'Vault writes are not enabled' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Vault writes are disabled for the caller, or the vault is not configured.' + '504': + content: + application/json: + examples: + vault-timed-out: + summary: 'Vault timed out' + value: + error: + code: 504 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - The vault did not answer in time.' + security: + - apiKey: [] + summary: 'Delete a workspace secret' + tags: + - 'Vault' + put: + description: 'Creates or replaces a secret in the workspace of the authenticated API key. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key''s active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.' + operationId: 'storeVaultSecret' + parameters: + - description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + in: 'path' + name: 'name' + required: true + schema: + description: 'Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.' + example: 'github_token' + maxLength: 255 + minLength: 1 + pattern: '^(?!.*__)[a-z]([a-z0-9_]*[a-z0-9])?$' + type: 'string' + requestBody: + content: + application/json: + example: + hosts: + - 'api.github.com' + value: 'ghp_exampleTokenValue' + schema: + $ref: '#/components/schemas/VaultSecretWriteRequest' + required: true + responses: + '200': + content: + application/json: + example: + data: + created_at: '2026-09-15T17:44:00.000Z' + fingerprint: 'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' + hosts: + - 'api.github.com' + name: 'github_token' + schema: + $ref: '#/components/schemas/VaultSecretResponse' + description: 'Metadata for the stored secret.' + '400': + content: + application/json: + examples: + invalid-vault-request: + summary: 'Invalid vault request' + value: + error: + code: 400 + message: 'Invalid vault request' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - The secret name, path, query or JSON body failed validation. The vault returns 400 for a malformed request as well.' + '401': + content: + application/json: + examples: + invalid-or-missing-api-key: + summary: 'Invalid or missing API key' + value: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Missing or unknown API key. Provisioning keys cannot call vault routes.' + '403': + content: + application/json: + examples: + regional-hostname: + summary: 'Regional hostname' + value: + error: + code: 403 + message: 'The Intern API does not support regional data residency yet. Please use the global endpoint at openrouter.ai.' + workspace-scope-unavailable: + summary: 'Workspace scope unavailable' + value: + error: + code: 403 + message: 'Vault scope is unavailable' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - The key has no usable workspace scope, or the request arrived on a regional hostname.' + '404': + content: + application/json: + examples: + not-found: + summary: 'Not found' + value: + error: + code: 404 + message: 'Not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - The intern is not in the selected workspace, the secret does not exist in the selected scope, or the caller is outside the intern programme.' + '408': + content: + application/json: + examples: + body-timed-out: + summary: 'Body timed out' + value: + error: + code: 408 + message: 'Request body timed out' + route-deadline: + summary: 'Route deadline' + value: + error: + code: 408 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - The route deadline passed before the request completed, or the request body stopped arriving.' + '413': + content: + application/json: + examples: + body-too-large: + summary: 'Body too large' + value: + error: + code: 413 + message: 'Request body too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - The JSON body exceeds 425000 bytes.' + '429': + content: + application/json: + examples: + rate-limited: + summary: 'Rate limited' + value: + error: + code: 429 + message: 'Too many vault requests' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - The vault rate limit was reached.' + '500': + content: + application/json: + examples: + internal-error: + summary: 'Internal error' + value: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Scope lookup failed.' + '502': + content: + application/json: + examples: + invalid-vault-response: + summary: 'Invalid vault response' + value: + error: + code: 502 + message: 'Invalid vault response' + vault-request-failed: + summary: 'Vault request failed' + value: + error: + code: 502 + message: 'Vault request failed' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - The vault could not be reached or returned an unexpected response.' + '503': + content: + application/json: + examples: + vault-unavailable: + summary: 'Vault unavailable' + value: + error: + code: 503 + message: 'Vault service is unavailable' + writes-disabled: + summary: 'Writes disabled' + value: + error: + code: 503 + message: 'Vault writes are not enabled' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Vault writes are disabled for the caller, or the vault is not configured.' + '504': + content: + application/json: + examples: + vault-timed-out: + summary: 'Vault timed out' + value: + error: + code: 504 + message: 'Vault request timed out' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - The vault did not answer in time.' + security: + - apiKey: [] + summary: 'Store a workspace secret' + tags: + - 'Vault' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /videos: post: description: 'Submits a video generation request and returns a polling URL to check status' @@ -42269,6 +43887,8 @@ tags: - description: 'Text-to-speech endpoints' name: 'TTS' x-displayName: 'Speech' + - description: 'Store host-bound secrets for a workspace or for one intern. Scope is selected by the API key. Responses return metadata only, never secret values. See https://openrouter.ai/docs/guides/ori/vault.' + name: 'Vault' - description: 'Video Generation endpoints' name: 'Video Generation' - description: 'Workspaces endpoints' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 234f7369..dc768787 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:4375b0282081810779ada4291534f7e2f2187decb5310c1e7b66f1a0342f7103 - sourceBlobDigest: sha256:1f82abd5653a7823db8675692794f6b32a0f74447a1aac741d650ea014f983af + sourceRevisionDigest: sha256:f372695c8d95f0486ae2494a35f43d3143679a95c48ec8fac077a3827484ae81 + sourceBlobDigest: sha256:3c5b24e2b7e270598cf25304fb459757f30c7da5b495e1058d65c4c3c19830b2 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:4375b0282081810779ada4291534f7e2f2187decb5310c1e7b66f1a0342f7103 - sourceBlobDigest: sha256:1f82abd5653a7823db8675692794f6b32a0f74447a1aac741d650ea014f983af + sourceRevisionDigest: sha256:f372695c8d95f0486ae2494a35f43d3143679a95c48ec8fac077a3827484ae81 + sourceBlobDigest: sha256:3c5b24e2b7e270598cf25304fb459757f30c7da5b495e1058d65c4c3c19830b2 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:575c2deec53a260cff11a3849a75f4e27fe65c3651311382ca749ce2fe0e7393 + codeSamplesRevisionDigest: sha256:c9a74e74510bfbe06a5613e792d32fdaf7f9409dc8d66e7503a1c498f83d3cfd workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 948485a4..eae17b53 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2299,4 +2299,14 @@ Based on: ### Generated - [python v1.1.151] . ### Releases -- [PyPI v1.1.151] https://pypi.org/project/openrouter/1.1.151 - . \ No newline at end of file +- [PyPI v1.1.151] https://pypi.org/project/openrouter/1.1.151 - . + +## 2026-09-16 19:55:24 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.152] . +### Releases +- [PyPI v1.1.152] https://pypi.org/project/openrouter/1.1.152 - . \ No newline at end of file diff --git a/docs/components/vaultsecret.mdx b/docs/components/vaultsecret.mdx new file mode 100644 index 00000000..f7e952ab --- /dev/null +++ b/docs/components/vaultsecret.mdx @@ -0,0 +1,15 @@ +--- +title: "VaultSecret" +--- + +Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `fingerprint` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `hosts` | List[*str*] | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/vaultsecretcopyrequest.mdx b/docs/components/vaultsecretcopyrequest.mdx new file mode 100644 index 00000000..78fb2751 --- /dev/null +++ b/docs/components/vaultsecretcopyrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "VaultSecretCopyRequest" +--- + +Workspace secrets to copy into the intern scope. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `names` | List[*str*] | :heavy_check_mark: | Names of workspace secrets to copy, 1 to 100 unique entries. Every name must exist in the workspace scope. | \ No newline at end of file diff --git a/docs/components/vaultsecretcopyresponse.mdx b/docs/components/vaultsecretcopyresponse.mdx new file mode 100644 index 00000000..60ce995c --- /dev/null +++ b/docs/components/vaultsecretcopyresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "VaultSecretCopyResponse" +--- + +Metadata for the copies now stored in the intern scope, one entry per requested name. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `data` | List[[components.VaultSecret](../components/vaultsecret.mdx)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/vaultsecretlistresponse.mdx b/docs/components/vaultsecretlistresponse.mdx new file mode 100644 index 00000000..0b17bf58 --- /dev/null +++ b/docs/components/vaultsecretlistresponse.mdx @@ -0,0 +1,13 @@ +--- +title: "VaultSecretListResponse" +--- + +One page of secret metadata for the selected scope. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `data` | List[[components.VaultSecret](../components/vaultsecret.mdx)] | :heavy_check_mark: | N/A | +| `has_more` | *bool* | :heavy_check_mark: | True when more secrets exist beyond this page. Request the next page with `offset` increased by the number of returned entries. | \ No newline at end of file diff --git a/docs/components/vaultsecretresponse.mdx b/docs/components/vaultsecretresponse.mdx new file mode 100644 index 00000000..9286dbb1 --- /dev/null +++ b/docs/components/vaultsecretresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "VaultSecretResponse" +--- + +Metadata for the stored secret. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.VaultSecret](../components/vaultsecret.mdx) | :heavy_check_mark: | Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts. | \{
"created_at": "2026-09-15T17:44:00.000Z",
"fingerprint": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"hosts": [
"api.github.com"
],
"name": "github_token"
} | \ No newline at end of file diff --git a/docs/components/vaultsecretwriterequest.mdx b/docs/components/vaultsecretwriterequest.mdx new file mode 100644 index 00000000..92dcbead --- /dev/null +++ b/docs/components/vaultsecretwriterequest.mdx @@ -0,0 +1,13 @@ +--- +title: "VaultSecretWriteRequest" +--- + +Secret value and the exact hostnames it may be released to. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `hosts` | List[*str*] | :heavy_check_mark: | Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. | +| `value` | *str* | :heavy_check_mark: | Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. | \ No newline at end of file diff --git a/docs/operations/copyvaultsecretstointernglobals.mdx b/docs/operations/copyvaultsecretstointernglobals.mdx new file mode 100644 index 00000000..56423f3a --- /dev/null +++ b/docs/operations/copyvaultsecretstointernglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "CopyVaultSecretsToInternGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/copyvaultsecretstointernrequest.mdx b/docs/operations/copyvaultsecretstointernrequest.mdx new file mode 100644 index 00000000..17c655cf --- /dev/null +++ b/docs/operations/copyvaultsecretstointernrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "CopyVaultSecretsToInternRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `vault_secret_copy_request` | [components.VaultSecretCopyRequest](../components/vaultsecretcopyrequest.mdx) | :heavy_check_mark: | N/A | \{
"names": [
"github_token"
]
} | \ No newline at end of file diff --git a/docs/operations/deleteinternvaultsecretglobals.mdx b/docs/operations/deleteinternvaultsecretglobals.mdx new file mode 100644 index 00000000..4a262e0b --- /dev/null +++ b/docs/operations/deleteinternvaultsecretglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "DeleteInternVaultSecretGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/deleteinternvaultsecretrequest.mdx b/docs/operations/deleteinternvaultsecretrequest.mdx new file mode 100644 index 00000000..2107702f --- /dev/null +++ b/docs/operations/deleteinternvaultsecretrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "DeleteInternVaultSecretRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | \ No newline at end of file diff --git a/docs/operations/deletevaultsecretglobals.mdx b/docs/operations/deletevaultsecretglobals.mdx new file mode 100644 index 00000000..1e2f71a1 --- /dev/null +++ b/docs/operations/deletevaultsecretglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "DeleteVaultSecretGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/deletevaultsecretrequest.mdx b/docs/operations/deletevaultsecretrequest.mdx new file mode 100644 index 00000000..ea844c45 --- /dev/null +++ b/docs/operations/deletevaultsecretrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "DeleteVaultSecretRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | \ No newline at end of file diff --git a/docs/operations/listinternvaultsecretsglobals.mdx b/docs/operations/listinternvaultsecretsglobals.mdx new file mode 100644 index 00000000..032e98ae --- /dev/null +++ b/docs/operations/listinternvaultsecretsglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ListInternVaultSecretsGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listinternvaultsecretsrequest.mdx b/docs/operations/listinternvaultsecretsrequest.mdx new file mode 100644 index 00000000..feadc748 --- /dev/null +++ b/docs/operations/listinternvaultsecretsrequest.mdx @@ -0,0 +1,14 @@ +--- +title: "ListInternVaultSecretsRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Page size, 1 to 100. Defaults to 100. | 50 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of secrets to skip, 0 to 10000. Defaults to 0. | 0 | \ No newline at end of file diff --git a/docs/operations/listvaultsecretsglobals.mdx b/docs/operations/listvaultsecretsglobals.mdx new file mode 100644 index 00000000..0d090bde --- /dev/null +++ b/docs/operations/listvaultsecretsglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ListVaultSecretsGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listvaultsecretsrequest.mdx b/docs/operations/listvaultsecretsrequest.mdx new file mode 100644 index 00000000..962a3e12 --- /dev/null +++ b/docs/operations/listvaultsecretsrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "ListVaultSecretsRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Page size, 1 to 100. Defaults to 100. | 50 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of secrets to skip, 0 to 10000. Defaults to 0. | 0 | \ No newline at end of file diff --git a/docs/operations/storeinternvaultsecretglobals.mdx b/docs/operations/storeinternvaultsecretglobals.mdx new file mode 100644 index 00000000..e7c3b3f7 --- /dev/null +++ b/docs/operations/storeinternvaultsecretglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "StoreInternVaultSecretGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/storeinternvaultsecretrequest.mdx b/docs/operations/storeinternvaultsecretrequest.mdx new file mode 100644 index 00000000..fe38c09a --- /dev/null +++ b/docs/operations/storeinternvaultsecretrequest.mdx @@ -0,0 +1,14 @@ +--- +title: "StoreInternVaultSecretRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `vault_secret_write_request` | [components.VaultSecretWriteRequest](../components/vaultsecretwriterequest.mdx) | :heavy_check_mark: | N/A | \{
"hosts": [
"api.github.com"
],
"value": "ghp_exampleTokenValue"
} | \ No newline at end of file diff --git a/docs/operations/storevaultsecretglobals.mdx b/docs/operations/storevaultsecretglobals.mdx new file mode 100644 index 00000000..6cb21606 --- /dev/null +++ b/docs/operations/storevaultsecretglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "StoreVaultSecretGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/storevaultsecretrequest.mdx b/docs/operations/storevaultsecretrequest.mdx new file mode 100644 index 00000000..e8571eae --- /dev/null +++ b/docs/operations/storevaultsecretrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "StoreVaultSecretRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `vault_secret_write_request` | [components.VaultSecretWriteRequest](../components/vaultsecretwriterequest.mdx) | :heavy_check_mark: | N/A | \{
"hosts": [
"api.github.com"
],
"value": "ghp_exampleTokenValue"
} | \ No newline at end of file diff --git a/docs/sdks/vault/README.mdx b/docs/sdks/vault/README.mdx new file mode 100644 index 00000000..224e03ab --- /dev/null +++ b/docs/sdks/vault/README.mdx @@ -0,0 +1,1382 @@ +--- +title: "Vault" +description: "Store host-bound secrets for a workspace or for one intern. Scope is selected by the API key. Responses return metadata only, never secret values. See https://openrouter.ai/docs/guides/ori/vault." +--- + +## Overview + +Store host-bound secrets for a workspace or for one intern. Scope is selected by the API key. Responses return metadata only, never secret values. See https://openrouter.ai/docs/guides/ori/vault. + +### Available Operations + +* [list_intern_vault_secrets](#list_intern_vault_secrets) - List intern secrets +* [delete_intern_vault_secret](#delete_intern_vault_secret) - Delete an intern secret +* [store_intern_vault_secret](#store_intern_vault_secret) - Store an intern secret +* [copy_vault_secrets_to_intern](#copy_vault_secrets_to_intern) - Copy workspace secrets to an intern +* [list_vault_secrets](#list_vault_secrets) - List workspace secrets +* [delete_vault_secret](#delete_vault_secret) - Delete a workspace secret +* [store_vault_secret](#store_vault_secret) - Store a workspace secret + +## list_intern_vault_secrets + +Lists secret metadata stored for one intern. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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.vault.list_intern_vault_secrets(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", limit=50, offset=0) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Page size, 1 to 100. Defaults to 100. | 50 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of secrets to skip, 0 to 10000. Defaults to 0. | 0 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.VaultSecretListResponse](../../components/vaultsecretlistresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.GatewayTimeoutResponseError | 504 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete_intern_vault_secret + +Deletes a secret stored for one intern. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: + + open_router.vault.delete_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.GatewayTimeoutResponseError | 504 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## store_intern_vault_secret + +Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + +### Example Usage: body-timed-out + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: body-too-large + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: internal-error + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: invalid-or-missing-api-key + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: invalid-vault-request + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: invalid-vault-response + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: not-found + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: rate-limited + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: regional-hostname + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: route-deadline + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: transfer-in-progress + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: vault-request-failed + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: vault-timed-out + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: vault-unavailable + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: workspace-scope-unavailable + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: writes-disabled + +```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.vault.store_intern_vault_secret(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `hosts` | List[*str*] | :heavy_check_mark: | Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. | | +| `value` | *str* | :heavy_check_mark: | Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. | | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.VaultSecretResponse](../../components/vaultsecretresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.ConflictResponseError | 409 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.GatewayTimeoutResponseError | 504 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## copy_vault_secrets_to_intern + +Copies the named workspace secrets into one intern's scope, replacing any intern secret with the same name. Each copy keeps the source value and host bindings. Every name must exist in the workspace scope or the request fails with 404 and nothing is copied. A workspace secret whose `hosts` is `null` cannot be copied: the request fails with 409 and nothing is copied until that secret is stored again with hosts. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + +### Example Usage: body-timed-out + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: body-too-large + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: copy-conflict + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: internal-error + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: invalid-or-missing-api-key + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: invalid-vault-request + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: invalid-vault-response + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: not-found + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: rate-limited + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: regional-hostname + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: route-deadline + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: vault-request-failed + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: vault-timed-out + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: vault-unavailable + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: workspace-scope-unavailable + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` +### Example Usage: writes-disabled + +```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.vault.copy_vault_secrets_to_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", names=[ + "github_token", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `intern_id` | *str* | :heavy_check_mark: | UUID of an intern in the workspace selected by the API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | +| `names` | List[*str*] | :heavy_check_mark: | Names of workspace secrets to copy, 1 to 100 unique entries. Every name must exist in the workspace scope. | | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.VaultSecretCopyResponse](../../components/vaultsecretcopyresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.ConflictResponseError | 409 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.GatewayTimeoutResponseError | 504 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## list_vault_secrets + +Lists secret metadata for the workspace of the authenticated API key. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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.vault.list_vault_secrets(limit=50, offset=0) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Page size, 1 to 100. Defaults to 100. | 50 | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of secrets to skip, 0 to 10000. Defaults to 0. | 0 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.VaultSecretListResponse](../../components/vaultsecretlistresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.GatewayTimeoutResponseError | 504 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete_vault_secret + +Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: + + open_router.vault.delete_vault_secret(name="github_token") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.GatewayTimeoutResponseError | 504 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## store_vault_secret + +Creates or replaces a secret in the workspace of the authenticated API key. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + +### Example Usage: body-timed-out + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: body-too-large + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: internal-error + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: invalid-or-missing-api-key + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: invalid-vault-request + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: invalid-vault-response + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: not-found + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: rate-limited + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: regional-hostname + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: route-deadline + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: vault-request-failed + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: vault-timed-out + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: vault-unavailable + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: workspace-scope-unavailable + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` +### Example Usage: writes-disabled + +```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.vault.store_vault_secret(name="github_token", hosts=[ + "api.github.com", + ], value="ghp_exampleTokenValue") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. | github_token | +| `hosts` | List[*str*] | :heavy_check_mark: | Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. | | +| `value` | *str* | :heavy_check_mark: | Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. | | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.VaultSecretResponse](../../components/vaultsecretresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.GatewayTimeoutResponseError | 504 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1dea32d4..062b23a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.151" +version = "1.1.152" 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 03e58b46..02a088a4 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.151" +__version__: str = "1.1.152" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.151 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.152 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index dbc0ef59..e1c0f7fe 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -3157,6 +3157,24 @@ UpsertWorkspaceBudgetResponseTypedDict, ) from .urlcitation import URLCitation, URLCitationType, URLCitationTypedDict + from .vaultsecret import VaultSecret, VaultSecretTypedDict + from .vaultsecretcopyrequest import ( + VaultSecretCopyRequest, + VaultSecretCopyRequestTypedDict, + ) + from .vaultsecretcopyresponse import ( + VaultSecretCopyResponse, + VaultSecretCopyResponseTypedDict, + ) + from .vaultsecretlistresponse import ( + VaultSecretListResponse, + VaultSecretListResponseTypedDict, + ) + from .vaultsecretresponse import VaultSecretResponse, VaultSecretResponseTypedDict + from .vaultsecretwriterequest import ( + VaultSecretWriteRequest, + VaultSecretWriteRequestTypedDict, + ) from .videogenerationrequest import ( VideoGenerationRequest, VideoGenerationRequestAspectRatio, @@ -5594,6 +5612,18 @@ "UtcDay", "Variables", "VariablesTypedDict", + "VaultSecret", + "VaultSecretCopyRequest", + "VaultSecretCopyRequestTypedDict", + "VaultSecretCopyResponse", + "VaultSecretCopyResponseTypedDict", + "VaultSecretListResponse", + "VaultSecretListResponseTypedDict", + "VaultSecretResponse", + "VaultSecretResponseTypedDict", + "VaultSecretTypedDict", + "VaultSecretWriteRequest", + "VaultSecretWriteRequestTypedDict", "Verbosity", "VideoGeneration", "VideoGenerationRequest", @@ -7984,6 +8014,18 @@ "URLCitation": ".urlcitation", "URLCitationType": ".urlcitation", "URLCitationTypedDict": ".urlcitation", + "VaultSecret": ".vaultsecret", + "VaultSecretTypedDict": ".vaultsecret", + "VaultSecretCopyRequest": ".vaultsecretcopyrequest", + "VaultSecretCopyRequestTypedDict": ".vaultsecretcopyrequest", + "VaultSecretCopyResponse": ".vaultsecretcopyresponse", + "VaultSecretCopyResponseTypedDict": ".vaultsecretcopyresponse", + "VaultSecretListResponse": ".vaultsecretlistresponse", + "VaultSecretListResponseTypedDict": ".vaultsecretlistresponse", + "VaultSecretResponse": ".vaultsecretresponse", + "VaultSecretResponseTypedDict": ".vaultsecretresponse", + "VaultSecretWriteRequest": ".vaultsecretwriterequest", + "VaultSecretWriteRequestTypedDict": ".vaultsecretwriterequest", "VideoGenerationRequest": ".videogenerationrequest", "VideoGenerationRequestAspectRatio": ".videogenerationrequest", "VideoGenerationRequestOptions": ".videogenerationrequest", diff --git a/src/openrouter/components/vaultsecret.py b/src/openrouter/components/vaultsecret.py new file mode 100644 index 00000000..00168941 --- /dev/null +++ b/src/openrouter/components/vaultsecret.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List +from typing_extensions import TypedDict + + +class VaultSecretTypedDict(TypedDict): + r"""Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.""" + + created_at: datetime + fingerprint: Nullable[str] + hosts: Nullable[List[str]] + name: str + + +class VaultSecret(BaseModel): + r"""Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.""" + + created_at: datetime + + fingerprint: Nullable[str] + + hosts: Nullable[List[str]] + + name: str + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/vaultsecretcopyrequest.py b/src/openrouter/components/vaultsecretcopyrequest.py new file mode 100644 index 00000000..d81add3e --- /dev/null +++ b/src/openrouter/components/vaultsecretcopyrequest.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class VaultSecretCopyRequestTypedDict(TypedDict): + r"""Workspace secrets to copy into the intern scope.""" + + names: List[str] + r"""Names of workspace secrets to copy, 1 to 100 unique entries. Every name must exist in the workspace scope.""" + + +class VaultSecretCopyRequest(BaseModel): + r"""Workspace secrets to copy into the intern scope.""" + + names: List[str] + r"""Names of workspace secrets to copy, 1 to 100 unique entries. Every name must exist in the workspace scope.""" diff --git a/src/openrouter/components/vaultsecretcopyresponse.py b/src/openrouter/components/vaultsecretcopyresponse.py new file mode 100644 index 00000000..cec8895c --- /dev/null +++ b/src/openrouter/components/vaultsecretcopyresponse.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .vaultsecret import VaultSecret, VaultSecretTypedDict +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class VaultSecretCopyResponseTypedDict(TypedDict): + r"""Metadata for the copies now stored in the intern scope, one entry per requested name.""" + + data: List[VaultSecretTypedDict] + + +class VaultSecretCopyResponse(BaseModel): + r"""Metadata for the copies now stored in the intern scope, one entry per requested name.""" + + data: List[VaultSecret] diff --git a/src/openrouter/components/vaultsecretlistresponse.py b/src/openrouter/components/vaultsecretlistresponse.py new file mode 100644 index 00000000..5d2afe2d --- /dev/null +++ b/src/openrouter/components/vaultsecretlistresponse.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .vaultsecret import VaultSecret, VaultSecretTypedDict +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class VaultSecretListResponseTypedDict(TypedDict): + r"""One page of secret metadata for the selected scope.""" + + data: List[VaultSecretTypedDict] + has_more: bool + r"""True when more secrets exist beyond this page. Request the next page with `offset` increased by the number of returned entries.""" + + +class VaultSecretListResponse(BaseModel): + r"""One page of secret metadata for the selected scope.""" + + data: List[VaultSecret] + + has_more: bool + r"""True when more secrets exist beyond this page. Request the next page with `offset` increased by the number of returned entries.""" diff --git a/src/openrouter/components/vaultsecretresponse.py b/src/openrouter/components/vaultsecretresponse.py new file mode 100644 index 00000000..a245014a --- /dev/null +++ b/src/openrouter/components/vaultsecretresponse.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .vaultsecret import VaultSecret, VaultSecretTypedDict +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class VaultSecretResponseTypedDict(TypedDict): + r"""Metadata for the stored secret.""" + + data: VaultSecretTypedDict + r"""Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.""" + + +class VaultSecretResponse(BaseModel): + r"""Metadata for the stored secret.""" + + data: VaultSecret + r"""Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.""" diff --git a/src/openrouter/components/vaultsecretwriterequest.py b/src/openrouter/components/vaultsecretwriterequest.py new file mode 100644 index 00000000..b4a3db2f --- /dev/null +++ b/src/openrouter/components/vaultsecretwriterequest.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class VaultSecretWriteRequestTypedDict(TypedDict): + r"""Secret value and the exact hostnames it may be released to.""" + + hosts: List[str] + r"""Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname.""" + value: str + r"""Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.""" + + +class VaultSecretWriteRequest(BaseModel): + r"""Secret value and the exact hostnames it may be released to.""" + + hosts: List[str] + r"""Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname.""" + + value: str + r"""Secret value, 1 to 65536 characters. It is encrypted at rest and never returned.""" diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 3a3975ce..4c2089b3 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -41,6 +41,12 @@ BulkUnassignMembersFromGuardrailRequest, BulkUnassignMembersFromGuardrailRequestTypedDict, ) + from .copyvaultsecretstointern import ( + CopyVaultSecretsToInternGlobals, + CopyVaultSecretsToInternGlobalsTypedDict, + CopyVaultSecretsToInternRequest, + CopyVaultSecretsToInternRequestTypedDict, + ) from .createaudiospeech import ( CreateAudioSpeechGlobals, CreateAudioSpeechGlobalsTypedDict, @@ -255,6 +261,12 @@ DeleteGuardrailRequest, DeleteGuardrailRequestTypedDict, ) + from .deleteinternvaultsecret import ( + DeleteInternVaultSecretGlobals, + DeleteInternVaultSecretGlobalsTypedDict, + DeleteInternVaultSecretRequest, + DeleteInternVaultSecretRequestTypedDict, + ) from .deletekeys import ( DeleteKeysGlobals, DeleteKeysGlobalsTypedDict, @@ -278,6 +290,12 @@ KeepMembersEnum, KeepMembersTypedDict, ) + from .deletevaultsecret import ( + DeleteVaultSecretGlobals, + DeleteVaultSecretGlobalsTypedDict, + DeleteVaultSecretRequest, + DeleteVaultSecretRequestTypedDict, + ) from .deleteworkspace import ( DeleteWorkspaceGlobals, DeleteWorkspaceGlobalsTypedDict, @@ -621,6 +639,12 @@ ListImageModelsRequest, ListImageModelsRequestTypedDict, ) + from .listinternvaultsecrets import ( + ListInternVaultSecretsGlobals, + ListInternVaultSecretsGlobalsTypedDict, + ListInternVaultSecretsRequest, + ListInternVaultSecretsRequestTypedDict, + ) from .listkeyassignments import ( ListKeyAssignmentsGlobals, ListKeyAssignmentsGlobalsTypedDict, @@ -724,6 +748,12 @@ ListScimGroupsResponse, ListScimGroupsResponseTypedDict, ) + from .listvaultsecrets import ( + ListVaultSecretsGlobals, + ListVaultSecretsGlobalsTypedDict, + ListVaultSecretsRequest, + ListVaultSecretsRequestTypedDict, + ) from .listvideoscontent import ( ListVideosContentGlobals, ListVideosContentGlobalsTypedDict, @@ -809,6 +839,18 @@ SendChatCompletionRequestResponse, SendChatCompletionRequestResponseTypedDict, ) + from .storeinternvaultsecret import ( + StoreInternVaultSecretGlobals, + StoreInternVaultSecretGlobalsTypedDict, + StoreInternVaultSecretRequest, + StoreInternVaultSecretRequestTypedDict, + ) + from .storevaultsecret import ( + StoreVaultSecretGlobals, + StoreVaultSecretGlobalsTypedDict, + StoreVaultSecretRequest, + StoreVaultSecretRequestTypedDict, + ) from .submitgenerationfeedback import ( SubmitGenerationFeedbackGlobals, SubmitGenerationFeedbackGlobalsTypedDict, @@ -918,6 +960,10 @@ "ContentTextTypedDict", "ContentTypedDict", "ContextBucket", + "CopyVaultSecretsToInternGlobals", + "CopyVaultSecretsToInternGlobalsTypedDict", + "CopyVaultSecretsToInternRequest", + "CopyVaultSecretsToInternRequestTypedDict", "CreateAudioSpeechGlobals", "CreateAudioSpeechGlobalsTypedDict", "CreateAudioSpeechRequest", @@ -1053,6 +1099,10 @@ "DeleteGuardrailGlobalsTypedDict", "DeleteGuardrailRequest", "DeleteGuardrailRequestTypedDict", + "DeleteInternVaultSecretGlobals", + "DeleteInternVaultSecretGlobalsTypedDict", + "DeleteInternVaultSecretRequest", + "DeleteInternVaultSecretRequestTypedDict", "DeleteKeysGlobals", "DeleteKeysGlobalsTypedDict", "DeleteKeysRequest", @@ -1067,6 +1117,10 @@ "DeleteScimGroupMappingGlobalsTypedDict", "DeleteScimGroupMappingRequest", "DeleteScimGroupMappingRequestTypedDict", + "DeleteVaultSecretGlobals", + "DeleteVaultSecretGlobalsTypedDict", + "DeleteVaultSecretRequest", + "DeleteVaultSecretRequestTypedDict", "DeleteWorkspaceBudgetGlobals", "DeleteWorkspaceBudgetGlobalsTypedDict", "DeleteWorkspaceBudgetRequest", @@ -1320,6 +1374,10 @@ "ListImageModelsGlobalsTypedDict", "ListImageModelsRequest", "ListImageModelsRequestTypedDict", + "ListInternVaultSecretsGlobals", + "ListInternVaultSecretsGlobalsTypedDict", + "ListInternVaultSecretsRequest", + "ListInternVaultSecretsRequestTypedDict", "ListKeyAssignmentsGlobals", "ListKeyAssignmentsGlobalsTypedDict", "ListKeyAssignmentsRequest", @@ -1400,6 +1458,10 @@ "ListScimGroupsRequestTypedDict", "ListScimGroupsResponse", "ListScimGroupsResponseTypedDict", + "ListVaultSecretsGlobals", + "ListVaultSecretsGlobalsTypedDict", + "ListVaultSecretsRequest", + "ListVaultSecretsRequestTypedDict", "ListVideosContentGlobals", "ListVideosContentGlobalsTypedDict", "ListVideosContentRequest", @@ -1472,6 +1534,14 @@ "SendChatCompletionRequestResponse", "SendChatCompletionRequestResponseTypedDict", "Source", + "StoreInternVaultSecretGlobals", + "StoreInternVaultSecretGlobalsTypedDict", + "StoreInternVaultSecretRequest", + "StoreInternVaultSecretRequestTypedDict", + "StoreVaultSecretGlobals", + "StoreVaultSecretGlobalsTypedDict", + "StoreVaultSecretRequest", + "StoreVaultSecretRequestTypedDict", "Subcategory", "SubmitGenerationFeedbackGlobals", "SubmitGenerationFeedbackGlobalsTypedDict", @@ -1564,6 +1634,10 @@ "BulkUnassignMembersFromGuardrailGlobalsTypedDict": ".bulkunassignmembersfromguardrail", "BulkUnassignMembersFromGuardrailRequest": ".bulkunassignmembersfromguardrail", "BulkUnassignMembersFromGuardrailRequestTypedDict": ".bulkunassignmembersfromguardrail", + "CopyVaultSecretsToInternGlobals": ".copyvaultsecretstointern", + "CopyVaultSecretsToInternGlobalsTypedDict": ".copyvaultsecretstointern", + "CopyVaultSecretsToInternRequest": ".copyvaultsecretstointern", + "CopyVaultSecretsToInternRequestTypedDict": ".copyvaultsecretstointern", "CreateAudioSpeechGlobals": ".createaudiospeech", "CreateAudioSpeechGlobalsTypedDict": ".createaudiospeech", "CreateAudioSpeechRequest": ".createaudiospeech", @@ -1732,6 +1806,10 @@ "DeleteGuardrailGlobalsTypedDict": ".deleteguardrail", "DeleteGuardrailRequest": ".deleteguardrail", "DeleteGuardrailRequestTypedDict": ".deleteguardrail", + "DeleteInternVaultSecretGlobals": ".deleteinternvaultsecret", + "DeleteInternVaultSecretGlobalsTypedDict": ".deleteinternvaultsecret", + "DeleteInternVaultSecretRequest": ".deleteinternvaultsecret", + "DeleteInternVaultSecretRequestTypedDict": ".deleteinternvaultsecret", "DeleteKeysGlobals": ".deletekeys", "DeleteKeysGlobalsTypedDict": ".deletekeys", "DeleteKeysRequest": ".deletekeys", @@ -1749,6 +1827,10 @@ "KeepMembers": ".deletescimgroupmapping", "KeepMembersEnum": ".deletescimgroupmapping", "KeepMembersTypedDict": ".deletescimgroupmapping", + "DeleteVaultSecretGlobals": ".deletevaultsecret", + "DeleteVaultSecretGlobalsTypedDict": ".deletevaultsecret", + "DeleteVaultSecretRequest": ".deletevaultsecret", + "DeleteVaultSecretRequestTypedDict": ".deletevaultsecret", "DeleteWorkspaceGlobals": ".deleteworkspace", "DeleteWorkspaceGlobalsTypedDict": ".deleteworkspace", "DeleteWorkspaceRequest": ".deleteworkspace", @@ -2006,6 +2088,10 @@ "ListImageModelsGlobalsTypedDict": ".listimagemodels", "ListImageModelsRequest": ".listimagemodels", "ListImageModelsRequestTypedDict": ".listimagemodels", + "ListInternVaultSecretsGlobals": ".listinternvaultsecrets", + "ListInternVaultSecretsGlobalsTypedDict": ".listinternvaultsecrets", + "ListInternVaultSecretsRequest": ".listinternvaultsecrets", + "ListInternVaultSecretsRequestTypedDict": ".listinternvaultsecrets", "ListKeyAssignmentsGlobals": ".listkeyassignments", "ListKeyAssignmentsGlobalsTypedDict": ".listkeyassignments", "ListKeyAssignmentsRequest": ".listkeyassignments", @@ -2085,6 +2171,10 @@ "ListScimGroupsRequestTypedDict": ".listscimgroups", "ListScimGroupsResponse": ".listscimgroups", "ListScimGroupsResponseTypedDict": ".listscimgroups", + "ListVaultSecretsGlobals": ".listvaultsecrets", + "ListVaultSecretsGlobalsTypedDict": ".listvaultsecrets", + "ListVaultSecretsRequest": ".listvaultsecrets", + "ListVaultSecretsRequestTypedDict": ".listvaultsecrets", "ListVideosContentGlobals": ".listvideoscontent", "ListVideosContentGlobalsTypedDict": ".listvideoscontent", "ListVideosContentRequest": ".listvideoscontent", @@ -2154,6 +2244,14 @@ "SendChatCompletionRequestRequestTypedDict": ".sendchatcompletionrequest", "SendChatCompletionRequestResponse": ".sendchatcompletionrequest", "SendChatCompletionRequestResponseTypedDict": ".sendchatcompletionrequest", + "StoreInternVaultSecretGlobals": ".storeinternvaultsecret", + "StoreInternVaultSecretGlobalsTypedDict": ".storeinternvaultsecret", + "StoreInternVaultSecretRequest": ".storeinternvaultsecret", + "StoreInternVaultSecretRequestTypedDict": ".storeinternvaultsecret", + "StoreVaultSecretGlobals": ".storevaultsecret", + "StoreVaultSecretGlobalsTypedDict": ".storevaultsecret", + "StoreVaultSecretRequest": ".storevaultsecret", + "StoreVaultSecretRequestTypedDict": ".storevaultsecret", "SubmitGenerationFeedbackGlobals": ".submitgenerationfeedback", "SubmitGenerationFeedbackGlobalsTypedDict": ".submitgenerationfeedback", "SubmitGenerationFeedbackRequest": ".submitgenerationfeedback", diff --git a/src/openrouter/operations/copyvaultsecretstointern.py b/src/openrouter/operations/copyvaultsecretstointern.py new file mode 100644 index 00000000..ea7d9a7e --- /dev/null +++ b/src/openrouter/operations/copyvaultsecretstointern.py @@ -0,0 +1,162 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + vaultsecretcopyrequest as components_vaultsecretcopyrequest, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CopyVaultSecretsToInternGlobalsTypedDict(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 CopyVaultSecretsToInternGlobals(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 CopyVaultSecretsToInternRequestTypedDict(TypedDict): + intern_id: str + r"""UUID of an intern in the workspace selected by the API key.""" + vault_secret_copy_request: ( + components_vaultsecretcopyrequest.VaultSecretCopyRequestTypedDict + ) + 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 CopyVaultSecretsToInternRequest(BaseModel): + intern_id: Annotated[ + str, + pydantic.Field(alias="internId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""UUID of an intern in the workspace selected by the API key.""" + + vault_secret_copy_request: Annotated[ + components_vaultsecretcopyrequest.VaultSecretCopyRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/deleteinternvaultsecret.py b/src/openrouter/operations/deleteinternvaultsecret.py new file mode 100644 index 00000000..40dffe39 --- /dev/null +++ b/src/openrouter/operations/deleteinternvaultsecret.py @@ -0,0 +1,153 @@ +"""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 DeleteInternVaultSecretGlobalsTypedDict(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 DeleteInternVaultSecretGlobals(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 DeleteInternVaultSecretRequestTypedDict(TypedDict): + intern_id: str + r"""UUID of an intern in the workspace selected by the API key.""" + name: str + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + 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 DeleteInternVaultSecretRequest(BaseModel): + intern_id: Annotated[ + str, + pydantic.Field(alias="internId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""UUID of an intern in the workspace selected by the API key.""" + + name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/deletevaultsecret.py b/src/openrouter/operations/deletevaultsecret.py new file mode 100644 index 00000000..8db5088e --- /dev/null +++ b/src/openrouter/operations/deletevaultsecret.py @@ -0,0 +1,144 @@ +"""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 DeleteVaultSecretGlobalsTypedDict(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 DeleteVaultSecretGlobals(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 DeleteVaultSecretRequestTypedDict(TypedDict): + name: str + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + 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 DeleteVaultSecretRequest(BaseModel): + name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/listinternvaultsecrets.py b/src/openrouter/operations/listinternvaultsecrets.py new file mode 100644 index 00000000..4c8177f1 --- /dev/null +++ b/src/openrouter/operations/listinternvaultsecrets.py @@ -0,0 +1,173 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListInternVaultSecretsGlobalsTypedDict(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 ListInternVaultSecretsGlobals(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 ListInternVaultSecretsRequestTypedDict(TypedDict): + intern_id: str + r"""UUID of an intern in the workspace selected by the 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. + + """ + limit: NotRequired[int] + r"""Page size, 1 to 100. Defaults to 100.""" + offset: NotRequired[int] + r"""Number of secrets to skip, 0 to 10000. Defaults to 0.""" + + +class ListInternVaultSecretsRequest(BaseModel): + intern_id: Annotated[ + str, + pydantic.Field(alias="internId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""UUID of an intern in the workspace selected by the 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. + + """ + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Page size, 1 to 100. Defaults to 100.""" + + offset: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Number of secrets to skip, 0 to 10000. Defaults to 0.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "limit", + "offset", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/listvaultsecrets.py b/src/openrouter/operations/listvaultsecrets.py new file mode 100644 index 00000000..8e4c37bc --- /dev/null +++ b/src/openrouter/operations/listvaultsecrets.py @@ -0,0 +1,159 @@ +"""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, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListVaultSecretsGlobalsTypedDict(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 ListVaultSecretsGlobals(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 ListVaultSecretsRequestTypedDict(TypedDict): + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + limit: NotRequired[int] + r"""Page size, 1 to 100. Defaults to 100.""" + offset: NotRequired[int] + r"""Number of secrets to skip, 0 to 10000. Defaults to 0.""" + + +class ListVaultSecretsRequest(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Page size, 1 to 100. Defaults to 100.""" + + offset: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Number of secrets to skip, 0 to 10000. Defaults to 0.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "limit", + "offset", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/storeinternvaultsecret.py b/src/openrouter/operations/storeinternvaultsecret.py new file mode 100644 index 00000000..369dd47d --- /dev/null +++ b/src/openrouter/operations/storeinternvaultsecret.py @@ -0,0 +1,169 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + vaultsecretwriterequest as components_vaultsecretwriterequest, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class StoreInternVaultSecretGlobalsTypedDict(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 StoreInternVaultSecretGlobals(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 StoreInternVaultSecretRequestTypedDict(TypedDict): + intern_id: str + r"""UUID of an intern in the workspace selected by the API key.""" + name: str + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + vault_secret_write_request: ( + components_vaultsecretwriterequest.VaultSecretWriteRequestTypedDict + ) + 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 StoreInternVaultSecretRequest(BaseModel): + intern_id: Annotated[ + str, + pydantic.Field(alias="internId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""UUID of an intern in the workspace selected by the API key.""" + + name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + + vault_secret_write_request: Annotated[ + components_vaultsecretwriterequest.VaultSecretWriteRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/storevaultsecret.py b/src/openrouter/operations/storevaultsecret.py new file mode 100644 index 00000000..2ff4b299 --- /dev/null +++ b/src/openrouter/operations/storevaultsecret.py @@ -0,0 +1,160 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + vaultsecretwriterequest as components_vaultsecretwriterequest, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class StoreVaultSecretGlobalsTypedDict(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 StoreVaultSecretGlobals(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 StoreVaultSecretRequestTypedDict(TypedDict): + name: str + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + vault_secret_write_request: ( + components_vaultsecretwriterequest.VaultSecretWriteRequestTypedDict + ) + 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 StoreVaultSecretRequest(BaseModel): + name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.""" + + vault_secret_write_request: Annotated[ + components_vaultsecretwriterequest.VaultSecretWriteRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py index b28878b6..488042f0 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -43,6 +43,7 @@ from openrouter.scim import Scim from openrouter.stt import STT from openrouter.tts import TTS + from openrouter.vault import Vault from openrouter.video_generation import VideoGeneration from openrouter.workspaces import Workspaces @@ -104,6 +105,8 @@ class OpenRouter(BaseSDK): beta: "Beta" scim: "Scim" r"""Management endpoints for SCIM group-to-workspace mappings, authenticated with a management key. These are not the SCIM 2.0 connector endpoints for your identity provider. In your identity provider, enter the SCIM endpoint URL shown when you enable provisioning under Settings > Members > SCIM Mappings. See https://openrouter.ai/docs/guides/features/scim-mappings#set-up-provisioning.""" + vault: "Vault" + r"""Store host-bound secrets for a workspace or for one intern. Scope is selected by the API key. Responses return metadata only, never secret values. See https://openrouter.ai/docs/guides/ori/vault.""" video_generation: "VideoGeneration" r"""Video Generation endpoints""" workspaces: "Workspaces" @@ -136,6 +139,7 @@ class OpenRouter(BaseSDK): "responses": ("openrouter.responses", "Responses"), "beta": ("openrouter.beta", "Beta"), "scim": ("openrouter.scim", "Scim"), + "vault": ("openrouter.vault", "Vault"), "video_generation": ("openrouter.video_generation", "VideoGeneration"), "workspaces": ("openrouter.workspaces", "Workspaces"), } diff --git a/src/openrouter/vault.py b/src/openrouter/vault.py new file mode 100644 index 00000000..d73bcc0f --- /dev/null +++ b/src/openrouter/vault.py @@ -0,0 +1,2501 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from openrouter import components, errors, operations, utils +from openrouter._hooks import HookContext +from openrouter.types import OptionalNullable, UNSET +from openrouter.utils import get_security_from_env +from openrouter.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Iterable, List, Mapping, Optional + + +class Vault(BaseSDK): + r"""Store host-bound secrets for a workspace or for one intern. Scope is selected by the API key. Responses return metadata only, never secret values. See https://openrouter.ai/docs/guides/ori/vault.""" + + def list_intern_vault_secrets( + self, + *, + intern_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + limit: Optional[int] = 100, + offset: Optional[int] = 0, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.VaultSecretListResponse: + r"""List intern secrets + + Lists secret metadata stored for one intern. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the 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 limit: Page size, 1 to 100. Defaults to 100. + :param offset: Number of secrets to skip, 0 to 10000. Defaults to 0. + :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.ListInternVaultSecretsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + limit=limit, + offset=offset, + ) + + req = self._build_request( + method="GET", + path="/vault/interns/{internId}/secrets", + 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.ListInternVaultSecretsGlobals( + 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="listInternVaultSecrets", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretListResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_intern_vault_secrets_async( + self, + *, + intern_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + limit: Optional[int] = 100, + offset: Optional[int] = 0, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.VaultSecretListResponse: + r"""List intern secrets + + Lists secret metadata stored for one intern. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the 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 limit: Page size, 1 to 100. Defaults to 100. + :param offset: Number of secrets to skip, 0 to 10000. Defaults to 0. + :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.ListInternVaultSecretsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + limit=limit, + offset=offset, + ) + + req = self._build_request_async( + method="GET", + path="/vault/interns/{internId}/secrets", + 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.ListInternVaultSecretsGlobals( + 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="listInternVaultSecrets", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretListResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def delete_intern_vault_secret( + self, + *, + intern_id: str, + name: 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, + ): + r"""Delete an intern secret + + Deletes a secret stored for one intern. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the API key. + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param 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.DeleteInternVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + name=name, + ) + + req = self._build_request( + method="DELETE", + path="/vault/interns/{internId}/secrets/{name}", + 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.DeleteInternVaultSecretGlobals( + 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="deleteInternVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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, "204", "*"): + return + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def delete_intern_vault_secret_async( + self, + *, + intern_id: str, + name: 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, + ): + r"""Delete an intern secret + + Deletes a secret stored for one intern. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the API key. + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param 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.DeleteInternVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + name=name, + ) + + req = self._build_request_async( + method="DELETE", + path="/vault/interns/{internId}/secrets/{name}", + 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.DeleteInternVaultSecretGlobals( + 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="deleteInternVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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, "204", "*"): + return + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(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 store_intern_vault_secret( + self, + *, + intern_id: str, + name: str, + hosts: Iterable[str], + value: 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.VaultSecretResponse: + r"""Store an intern secret + + Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the API key. + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. + :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :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.StoreInternVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + name=name, + vault_secret_write_request=components.VaultSecretWriteRequest( + hosts=utils.unmarshal(hosts, List[str]), + value=value, + ), + ) + + req = self._build_request( + method="PUT", + path="/vault/interns/{internId}/secrets/{name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.StoreInternVaultSecretGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.vault_secret_write_request, + False, + False, + "json", + components.VaultSecretWriteRequest, + ), + 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="storeInternVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(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 store_intern_vault_secret_async( + self, + *, + intern_id: str, + name: str, + hosts: Iterable[str], + value: 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.VaultSecretResponse: + r"""Store an intern secret + + Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the API key. + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. + :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :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.StoreInternVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + name=name, + vault_secret_write_request=components.VaultSecretWriteRequest( + hosts=utils.unmarshal(hosts, List[str]), + value=value, + ), + ) + + req = self._build_request_async( + method="PUT", + path="/vault/interns/{internId}/secrets/{name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.StoreInternVaultSecretGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.vault_secret_write_request, + False, + False, + "json", + components.VaultSecretWriteRequest, + ), + 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="storeInternVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(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 copy_vault_secrets_to_intern( + self, + *, + intern_id: str, + names: Iterable[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.VaultSecretCopyResponse: + r"""Copy workspace secrets to an intern + + Copies the named workspace secrets into one intern's scope, replacing any intern secret with the same name. Each copy keeps the source value and host bindings. Every name must exist in the workspace scope or the request fails with 404 and nothing is copied. A workspace secret whose `hosts` is `null` cannot be copied: the request fails with 409 and nothing is copied until that secret is stored again with hosts. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the API key. + :param names: Names of workspace secrets to copy, 1 to 100 unique entries. Every name must exist in the workspace scope. + :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.CopyVaultSecretsToInternRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + vault_secret_copy_request=components.VaultSecretCopyRequest( + names=utils.unmarshal(names, List[str]), + ), + ) + + req = self._build_request( + method="POST", + path="/vault/interns/{internId}/secrets/copy", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CopyVaultSecretsToInternGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.vault_secret_copy_request, + False, + False, + "json", + components.VaultSecretCopyRequest, + ), + 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="copyVaultSecretsToIntern", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretCopyResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(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 copy_vault_secrets_to_intern_async( + self, + *, + intern_id: str, + names: Iterable[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.VaultSecretCopyResponse: + r"""Copy workspace secrets to an intern + + Copies the named workspace secrets into one intern's scope, replacing any intern secret with the same name. Each copy keeps the source value and host bindings. Every name must exist in the workspace scope or the request fails with 404 and nothing is copied. A workspace secret whose `hosts` is `null` cannot be copied: the request fails with 409 and nothing is copied until that secret is stored again with hosts. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. 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: UUID of an intern in the workspace selected by the API key. + :param names: Names of workspace secrets to copy, 1 to 100 unique entries. Every name must exist in the workspace scope. + :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.CopyVaultSecretsToInternRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + intern_id=intern_id, + vault_secret_copy_request=components.VaultSecretCopyRequest( + names=utils.unmarshal(names, List[str]), + ), + ) + + req = self._build_request_async( + method="POST", + path="/vault/interns/{internId}/secrets/copy", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CopyVaultSecretsToInternGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.vault_secret_copy_request, + False, + False, + "json", + components.VaultSecretCopyRequest, + ), + 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="copyVaultSecretsToIntern", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretCopyResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(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 list_vault_secrets( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + limit: Optional[int] = 100, + offset: Optional[int] = 0, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.VaultSecretListResponse: + r"""List workspace secrets + + Lists secret metadata for the workspace of the authenticated API key. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + + If set, this operation will use `api_key` from the global security. + + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param limit: Page size, 1 to 100. Defaults to 100. + :param offset: Number of secrets to skip, 0 to 10000. Defaults to 0. + :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.ListVaultSecretsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + limit=limit, + offset=offset, + ) + + req = self._build_request( + method="GET", + path="/vault/secrets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListVaultSecretsGlobals( + 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="listVaultSecrets", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretListResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_vault_secrets_async( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + limit: Optional[int] = 100, + offset: Optional[int] = 0, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.VaultSecretListResponse: + r"""List workspace secrets + + Lists secret metadata for the workspace of the authenticated API key. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + + If set, this operation will use `api_key` from the global security. + + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param limit: Page size, 1 to 100. Defaults to 100. + :param offset: Number of secrets to skip, 0 to 10000. Defaults to 0. + :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.ListVaultSecretsRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + limit=limit, + offset=offset, + ) + + req = self._build_request_async( + method="GET", + path="/vault/secrets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListVaultSecretsGlobals( + 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="listVaultSecrets", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretListResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def delete_vault_secret( + self, + *, + name: 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, + ): + r"""Delete a workspace secret + + Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + + If set, this operation will use `api_key` from the global security. + + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param 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.DeleteVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + name=name, + ) + + req = self._build_request( + method="DELETE", + path="/vault/secrets/{name}", + 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.DeleteVaultSecretGlobals( + 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="deleteVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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, "204", "*"): + return + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def delete_vault_secret_async( + self, + *, + name: 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, + ): + r"""Delete a workspace secret + + Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + + If set, this operation will use `api_key` from the global security. + + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param 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.DeleteVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + name=name, + ) + + req = self._build_request_async( + method="DELETE", + path="/vault/secrets/{name}", + 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.DeleteVaultSecretGlobals( + 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="deleteVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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, "204", "*"): + return + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(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 store_vault_secret( + self, + *, + name: str, + hosts: Iterable[str], + value: 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.VaultSecretResponse: + r"""Store a workspace secret + + Creates or replaces a secret in the workspace of the authenticated API key. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + + If set, this operation will use `api_key` from the global security. + + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. + :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :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.StoreVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + name=name, + vault_secret_write_request=components.VaultSecretWriteRequest( + hosts=utils.unmarshal(hosts, List[str]), + value=value, + ), + ) + + req = self._build_request( + method="PUT", + path="/vault/secrets/{name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.StoreVaultSecretGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.vault_secret_write_request, + False, + False, + "json", + components.VaultSecretWriteRequest, + ), + 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="storeVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(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 store_vault_secret_async( + self, + *, + name: str, + hosts: Iterable[str], + value: 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.VaultSecretResponse: + r"""Store a workspace secret + + Creates or replaces a secret in the workspace of the authenticated API key. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. + + If set, this operation will use `api_key` from the global security. + + :param name: Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters. + :param hosts: Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so `API.Example.com.` is stored as `api.example.com`. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to `api.example.com` is never released to `example.com` or any other hostname. + :param value: Secret value, 1 to 65536 characters. It is encrypted at rest and never returned. + :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.StoreVaultSecretRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + name=name, + vault_secret_write_request=components.VaultSecretWriteRequest( + hosts=utils.unmarshal(hosts, List[str]), + value=value, + ), + ) + + req = self._build_request_async( + method="PUT", + path="/vault/secrets/{name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.StoreVaultSecretGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.vault_secret_write_request, + False, + False, + "json", + components.VaultSecretWriteRequest, + ), + 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="storeVaultSecret", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Vault"], + 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.VaultSecretResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "408", "application/json"): + response_data = unmarshal_json_response( + errors.RequestTimeoutResponseErrorData, http_res + ) + raise errors.RequestTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response( + errors.TooManyRequestsResponseErrorData, http_res + ) + raise errors.TooManyRequestsResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "504", "application/json"): + response_data = unmarshal_json_response( + errors.GatewayTimeoutResponseErrorData, http_res + ) + raise errors.GatewayTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/uv.lock b/uv.lock index e32b33c1..d091aa10 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.151" +version = "1.1.152" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 1988e10de468c7f7139f4506770e313df755228a Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Wed, 16 Sep 2026 19:57:12 +0000 Subject: [PATCH 2/3] empty commit to trigger [run-tests] workflow From b7ea0f014c0a2aaddcdbeb2a2c8e402f7f165b34 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Sep 2026 19:57:24 +0000 Subject: [PATCH 3/3] Chore: regenerate docs navigation Auto-generated-by: update-generated-files-action; https://github.com/OpenRouterTeam/python-sdk/actions/runs/35143634793 --- docs/docs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs.json b/docs/docs.json index c0ca1903..be1ac969 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -37,6 +37,7 @@ "sdks/scim/README", "sdks/stt/README", "sdks/tts/README", + "sdks/vault/README", "sdks/videogeneration/README", "sdks/workspaces/README" ]