From 1fed071c5df7e079498453ed4e245f20e8c4c71c Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 29 Oct 2026 02:24:07 +0000 Subject: [PATCH 1/3] ## Python SDK Changes: * `open_router.private_providers.list()`: **Added** * `open_router.private_providers.create()`: **Added** * `open_router.private_providers.delete()`: **Added** * `open_router.private_providers.get()`: **Added** * `open_router.private_providers.update()`: **Added** * `open_router.private_endpoints.create()`: `request.settings` **Added** * `open_router.private_endpoints.get()`: `response.data.settings` **Added** * `open_router.private_endpoints.update()`: * `request` **Changed** * `response.data.settings` **Added** * `open_router.private_endpoints.update_parameters()`: **Deprecated** * `open_router.private_endpoints.update_parameters()`: `response.data.settings` **Added** * `open_router.private_endpoints.update_pricing()`: **Deprecated** * `open_router.private_endpoints.update_pricing()`: `response.data.settings` **Added** --- .speakeasy/gen.lock | 399 +++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 1493 ++++++++++++--- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- .../createprivateendpointrequest.mdx | 1 + .../createprivateproviderrequest.mdx | 13 + docs/components/privateendpoint.mdx | 35 +- .../privateendpointquantization.mdx | 32 + ...rivateendpointreasoningreturnmechanism.mdx | 24 + docs/components/privateendpointresponse.mdx | 6 +- docs/components/privateendpointsettings.mdx | 20 + .../privateendpointsettingscompletions.mdx | 10 + ...ivateendpointsettingsexcludedparameter.mdx | 44 + .../privateendpointsettingsinputs.mdx | 13 + .../privateendpointsettingsreasoning.mdx | 10 + .../privateendpointsettingstoolchoice.mdx | 12 + docs/components/privateprovider.mdx | 14 + docs/components/privateproviderdatapolicy.mdx | 14 + .../components/privateproviderdatapolicy1.mdx | 14 + .../updateprivateendpointrequest.mdx | 18 +- .../updateprivateendpointsettingsrequest.mdx | 20 + ...vateendpointsettingsrequestcompletions.mdx | 10 + ...dpointsettingsrequestexcludedparameter.mdx | 44 + ...teprivateendpointsettingsrequestinputs.mdx | 13 + ...rivateendpointsettingsrequestreasoning.mdx | 10 + ...ivateendpointsettingsrequesttoolchoice.mdx | 12 + .../updateprivateproviderrequest.mdx | 11 + ...updateprivateproviderrequestdatapolicy.mdx | 11 + .../createprivateproviderglobals.mdx | 11 + .../createprivateproviderrequest.mdx | 12 + .../createprivateproviderresponse.mdx | 12 + docs/operations/deleteprivateproviderdata.mdx | 9 + .../deleteprivateproviderglobals.mdx | 11 + .../deleteprivateproviderrequest.mdx | 12 + .../deleteprivateproviderresponse.mdx | 12 + docs/operations/getprivateproviderglobals.mdx | 11 + docs/operations/getprivateproviderrequest.mdx | 12 + .../operations/getprivateproviderresponse.mdx | 12 + .../listprivateprovidersglobals.mdx | 11 + .../listprivateprovidersrequest.mdx | 11 + .../listprivateprovidersresponse.mdx | 12 + .../updateprivateendpointrequest.mdx | 2 +- .../updateprivateproviderglobals.mdx | 11 + .../updateprivateproviderrequest.mdx | 13 + .../updateprivateproviderresponse.mdx | 12 + docs/sdks/privateendpoints/README.mdx | 48 +- docs/sdks/privateproviders/README.mdx | 284 +++ pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 122 ++ .../createprivateendpointrequest.py | 10 + .../createprivateproviderrequest.py | 57 + src/openrouter/components/privateendpoint.py | 9 + .../components/privateendpointquantization.py | 25 + ...privateendpointreasoningreturnmechanism.py | 17 + .../components/privateendpointsettings.py | 231 +++ src/openrouter/components/privateprovider.py | 89 + .../components/privateproviderdatapolicy.py | 44 + .../updateprivateendpointrequest.py | 46 +- .../updateprivateendpointsettingsrequest.py | 320 ++++ .../updateprivateproviderrequest.py | 90 + src/openrouter/operations/__init__.py | 106 ++ .../operations/createprivateprovider.py | 161 ++ .../operations/deleteprivateprovider.py | 164 ++ .../operations/getprivateprovider.py | 155 ++ .../operations/listprivateproviders.py | 150 ++ .../operations/updateprivateprovider.py | 171 ++ src/openrouter/private_endpoints.py | 121 +- src/openrouter/private_providers.py | 1635 +++++++++++++++++ src/openrouter/sdk.py | 4 + uv.lock | 2 +- 72 files changed, 6233 insertions(+), 347 deletions(-) create mode 100644 docs/components/createprivateproviderrequest.mdx create mode 100644 docs/components/privateendpointquantization.mdx create mode 100644 docs/components/privateendpointreasoningreturnmechanism.mdx create mode 100644 docs/components/privateendpointsettings.mdx create mode 100644 docs/components/privateendpointsettingscompletions.mdx create mode 100644 docs/components/privateendpointsettingsexcludedparameter.mdx create mode 100644 docs/components/privateendpointsettingsinputs.mdx create mode 100644 docs/components/privateendpointsettingsreasoning.mdx create mode 100644 docs/components/privateendpointsettingstoolchoice.mdx create mode 100644 docs/components/privateprovider.mdx create mode 100644 docs/components/privateproviderdatapolicy.mdx create mode 100644 docs/components/privateproviderdatapolicy1.mdx create mode 100644 docs/components/updateprivateendpointsettingsrequest.mdx create mode 100644 docs/components/updateprivateendpointsettingsrequestcompletions.mdx create mode 100644 docs/components/updateprivateendpointsettingsrequestexcludedparameter.mdx create mode 100644 docs/components/updateprivateendpointsettingsrequestinputs.mdx create mode 100644 docs/components/updateprivateendpointsettingsrequestreasoning.mdx create mode 100644 docs/components/updateprivateendpointsettingsrequesttoolchoice.mdx create mode 100644 docs/components/updateprivateproviderrequest.mdx create mode 100644 docs/components/updateprivateproviderrequestdatapolicy.mdx create mode 100644 docs/operations/createprivateproviderglobals.mdx create mode 100644 docs/operations/createprivateproviderrequest.mdx create mode 100644 docs/operations/createprivateproviderresponse.mdx create mode 100644 docs/operations/deleteprivateproviderdata.mdx create mode 100644 docs/operations/deleteprivateproviderglobals.mdx create mode 100644 docs/operations/deleteprivateproviderrequest.mdx create mode 100644 docs/operations/deleteprivateproviderresponse.mdx create mode 100644 docs/operations/getprivateproviderglobals.mdx create mode 100644 docs/operations/getprivateproviderrequest.mdx create mode 100644 docs/operations/getprivateproviderresponse.mdx create mode 100644 docs/operations/listprivateprovidersglobals.mdx create mode 100644 docs/operations/listprivateprovidersrequest.mdx create mode 100644 docs/operations/listprivateprovidersresponse.mdx create mode 100644 docs/operations/updateprivateproviderglobals.mdx create mode 100644 docs/operations/updateprivateproviderrequest.mdx create mode 100644 docs/operations/updateprivateproviderresponse.mdx create mode 100644 docs/sdks/privateproviders/README.mdx create mode 100644 src/openrouter/components/createprivateproviderrequest.py create mode 100644 src/openrouter/components/privateendpointquantization.py create mode 100644 src/openrouter/components/privateendpointreasoningreturnmechanism.py create mode 100644 src/openrouter/components/privateendpointsettings.py create mode 100644 src/openrouter/components/privateprovider.py create mode 100644 src/openrouter/components/privateproviderdatapolicy.py create mode 100644 src/openrouter/components/updateprivateendpointsettingsrequest.py create mode 100644 src/openrouter/components/updateprivateproviderrequest.py create mode 100644 src/openrouter/operations/createprivateprovider.py create mode 100644 src/openrouter/operations/deleteprivateprovider.py create mode 100644 src/openrouter/operations/getprivateprovider.py create mode 100644 src/openrouter/operations/listprivateproviders.py create mode 100644 src/openrouter/operations/updateprivateprovider.py create mode 100644 src/openrouter/private_providers.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a08ea92ee..59d02b94f 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: 683ee88c6d5be9a3060432f6134bb5c7 + docChecksum: 6ec0cc2d95e3e118cb5a2da74a5fabd9 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.92 - configChecksum: 907e4a0a073cb66638d416bd639715dd + releaseVersion: 1.3.93 + configChecksum: 197c208db2b3f3f1d4ee0bdcc3234b78 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 628f0c60-38eb-4abe-b68c-e2361d822db9 - pristine_commit_hash: ef203a3cc105ac636a8ea9656ba82ff45573da72 - pristine_tree_hash: a7f9384289628ac678e97c0bf2f8c95c89d75f44 + generation_id: 6b3cf2fb-0692-48b7-9fb6-e57ca8969625 + pristine_commit_hash: f4748b72f6dd2dee13598e64a94925507ef4e4c9 + pristine_tree_hash: 69be6ca0ae492018b6e957996852abb8c34e14e3 features: python: acceptHeaders: 3.0.0 @@ -2676,8 +2676,8 @@ trackedFiles: pristine_git_object: 60a8a9993454283b528ba080749a43d9ba32c94f docs/components/createprivateendpointrequest.mdx: id: 14dbb5bba6c1 - last_write_checksum: sha1:4ad4def964004f9759dcd7d4a47942819435c982 - pristine_git_object: f4d87a0c31cee47d487151d89ac41799f1a4f09a + last_write_checksum: sha1:691fd3df0feca19ea6dbaa4fbcd09f652cc64160 + pristine_git_object: 890018a1e978a65d54743bb46d415220601fcd53 docs/components/createprivateendpointrequestdeclaredregion.mdx: id: 58cea9c8b74d last_write_checksum: sha1:7b835ef8af060b80af19bbbb1eae9ec24eabf747 @@ -2690,6 +2690,10 @@ trackedFiles: id: c24012eb9019 last_write_checksum: sha1:1ded0fec9ea96d5609d08942866480a0f0793b10 pristine_git_object: 9029c97640e540a981dd3cf7ab6810045016da3b + docs/components/createprivateproviderrequest.mdx: + id: a3bd4b4c18b8 + last_write_checksum: sha1:2ace8b457c65d4784fb0cb4b51d076bb22cc2e7a + pristine_git_object: 0fba9adc191c92866416ec43f826bede1b3d16f2 docs/components/createscimgroupmappingrequest.mdx: id: 652e24fba424 last_write_checksum: sha1:68885a75c254af579f1503da026266da3b9646c5 @@ -6228,8 +6232,8 @@ trackedFiles: pristine_git_object: 6a99a2737d18a3c227bf7fcabf58b481d3c7d94b docs/components/privateendpoint.mdx: id: 139c5b16dd66 - last_write_checksum: sha1:683fdf3b960aededaa8d5d242f001b8b9672ac95 - pristine_git_object: 042031a5fce160d797d1f027b972236cb7e620e0 + last_write_checksum: sha1:41eb9890a3c84dc83008f321ad6e8d4cb2036179 + pristine_git_object: f668081e031fcb73bf8bd7658c5a2476872a6990 docs/components/privateendpointactivation.mdx: id: c5cea1d4e39d last_write_checksum: sha1:ebb8d73296264d3c10b4cc76ecc94d4b3d0ff8dd @@ -6258,10 +6262,42 @@ trackedFiles: id: 16264ba816a0 last_write_checksum: sha1:7f5757f15d55242f1632af55da00886221fc1fc3 pristine_git_object: 39c75b1536bc48dba971e42dd5a17b1ea67e6040 + docs/components/privateendpointquantization.mdx: + id: 5f4c25ee2e5a + last_write_checksum: sha1:e2a1a4b70c13660740bb22feee4c2008a74cc46a + pristine_git_object: 83924db5456b2e5f3bf3808f50896d9c9fa72d33 + docs/components/privateendpointreasoningreturnmechanism.mdx: + id: 2418c1071253 + last_write_checksum: sha1:ad6abfe9b4e0233931e41a59b5dcab6ecc5a7399 + pristine_git_object: 329af60e08c83461303aec47f441c925f11edfcf docs/components/privateendpointresponse.mdx: id: 5844d85b61d8 - last_write_checksum: sha1:2ab1eeb7a2d0dd866fb5a44298cf623a316f75f2 - pristine_git_object: 516d8a54edf49d18e8dec389ab2298b42589e631 + last_write_checksum: sha1:ec90e4d6c30386ed0aebbfb5a3f702e71e7cc889 + pristine_git_object: 35ec3c4fcfe1c0f832ba6f7c54378bf7b96d0395 + docs/components/privateendpointsettings.mdx: + id: aa8d95ab2a71 + last_write_checksum: sha1:103bee400b2633c0d8117c6e8fd82c3a3e059151 + pristine_git_object: 4f794ebbc6179a98d0c784ad31cb161a20949621 + docs/components/privateendpointsettingscompletions.mdx: + id: 917fd268a507 + last_write_checksum: sha1:4ffef539437210d355e19775abe8b2711259d2d7 + pristine_git_object: df321f0b64b8388e9e5e3e4089dca7a595ae86ac + docs/components/privateendpointsettingsexcludedparameter.mdx: + id: fb4e4a036c42 + last_write_checksum: sha1:9c3de17408b63f8e4a08c9c1db6910123c972bb3 + pristine_git_object: 86fe9ff2d006203b4d3e4ad7af4ff8639ace082c + docs/components/privateendpointsettingsinputs.mdx: + id: e6e603b0bd4a + last_write_checksum: sha1:5cbe7e8604c2106f077f586f4eb3ebeb260efae4 + pristine_git_object: cf56496ca3ce39b7aab114b4b25a2cac3a186dc4 + docs/components/privateendpointsettingsreasoning.mdx: + id: 000f304e1b19 + last_write_checksum: sha1:5ae8ccd9fe4648c39a43dfa3b95f62a4c5235f3c + pristine_git_object: 42e8bb49f5fea28582e239d2b4db46e6b4d31a09 + docs/components/privateendpointsettingstoolchoice.mdx: + id: e6fb69813793 + last_write_checksum: sha1:b2876df683b39a89c569e3c1d3371309a642f37e + pristine_git_object: ffb4229f2e82e28a283e46e15708535bf1528eab docs/components/privateendpointstatus.mdx: id: 170564aaaa0f last_write_checksum: sha1:3cdf3d3142af4ece802933887e1659bca0ea26be @@ -6282,6 +6318,18 @@ trackedFiles: id: 427cb057c9e7 last_write_checksum: sha1:877c11275f493e90b7ec17b0668e0826b956332f pristine_git_object: 26932977bfd817ac0df95b9b647813ab962476d9 + docs/components/privateprovider.mdx: + id: 0671f6003692 + last_write_checksum: sha1:e1073aa8082762c7a1e4e89dbff7f6b4c88d34f0 + pristine_git_object: e516a1c7c51404da8aba0b8170ea9071e120a94b + docs/components/privateproviderdatapolicy.mdx: + id: b35b9214bc7e + last_write_checksum: sha1:d33353a373eae01c88ece5e251b3b49aa4445721 + pristine_git_object: 3e8025b360d27b6bde60757a4d05c9824cf7727e + docs/components/privateproviderdatapolicy1.mdx: + id: f1314f940e4f + last_write_checksum: sha1:80f415a242cf20067f1fac70dc892670fa86242a + pristine_git_object: b0987792c6d5f499284420482c421812a2fd20f0 docs/components/profile.mdx: id: cb682ce5da89 last_write_checksum: sha1:4cf126470a616a8097d53d721fbc5b50ca2a5495 @@ -7844,12 +7892,44 @@ trackedFiles: pristine_git_object: fd379b0a614a61c1db2e3f33c4b1286750e4f99a docs/components/updateprivateendpointrequest.mdx: id: 8a1aa4763af9 - last_write_checksum: sha1:26788621c2c172ecd73aba3d573ff5747996ffc0 - pristine_git_object: a914e90335119370a0059051296bc39df032b454 + last_write_checksum: sha1:594e8a7a7292ab7e7c2e4c4393fc3b5ec7c3e249 + pristine_git_object: 89ac9f1e2345ed051e1c2b9f3db884bda4e205e4 docs/components/updateprivateendpointrequestdeclaredregion.mdx: id: bb4329841f25 last_write_checksum: sha1:b0db12e42df729be3b5ee9557f5426c6a10eebfe pristine_git_object: 6627ee9dbb618278fe272acde18f649c5db57552 + docs/components/updateprivateendpointsettingsrequest.mdx: + id: f9146ce8d00c + last_write_checksum: sha1:8bda7119b1e90c8bd030ba08665e62c206ede3d2 + pristine_git_object: 0f5e5ee1df6109d488a21b107a653c8c5cc162c0 + docs/components/updateprivateendpointsettingsrequestcompletions.mdx: + id: d04ee87c23e5 + last_write_checksum: sha1:962048f34074e161a6b7f4da45efa1724c5fd034 + pristine_git_object: 10877313575502bf54e73f0291f43d0bda64d209 + docs/components/updateprivateendpointsettingsrequestexcludedparameter.mdx: + id: 57d948bba179 + last_write_checksum: sha1:2586edec3913840e7e5449901c41ed7b75859f9b + pristine_git_object: bfc86e03a360e76d11d9413af48261ecfcabda12 + docs/components/updateprivateendpointsettingsrequestinputs.mdx: + id: 419357a3610d + last_write_checksum: sha1:28614d5184f73ff3ab141114c4a231499275ab72 + pristine_git_object: 71444757bf3748da3b037308fc08027a97ce9c29 + docs/components/updateprivateendpointsettingsrequestreasoning.mdx: + id: 64d1fc8f8559 + last_write_checksum: sha1:8941e32b90fb147b79d2028e7cb44dabb0e2fa9e + pristine_git_object: 979cebc36d8ab093358a9b21f000ef2f423eae1e + docs/components/updateprivateendpointsettingsrequesttoolchoice.mdx: + id: 7eab193f8fec + last_write_checksum: sha1:7ce1f75a29d1e479a523520431b612d5879d469b + pristine_git_object: 22b45d12df9995c529f424dae56dd0b754dece10 + docs/components/updateprivateproviderrequest.mdx: + id: c92cb845b7bd + last_write_checksum: sha1:9d2454f828b96cf7fbdc722785ec42a439db146b + pristine_git_object: 27e83938288180adc6fcf53e98f7aaf4c48e1a08 + docs/components/updateprivateproviderrequestdatapolicy.mdx: + id: 97fea554de03 + last_write_checksum: sha1:05c0c9f25f25a7bec44056a6dabc3b3f1c1a7ceb + pristine_git_object: 15a807bfd555edbd55e535bcdbf81f219be5c1b4 docs/components/updatescimgroupmappingrequest.mdx: id: 4318f4ed22f5 last_write_checksum: sha1:61c181d9a5b51e93c5b357176082b2f6a60b1dca @@ -8626,6 +8706,18 @@ trackedFiles: id: 3cb88260cf95 last_write_checksum: sha1:a494187187accf2445380fbcd7b0ff971d447e11 pristine_git_object: bf0ae5803892de36bd914b7c42315d3c1d4eb57d + docs/operations/createprivateproviderglobals.mdx: + id: 9de3624ed338 + last_write_checksum: sha1:07e22fd44ba8692f6b64f3bb4c8014db646246c8 + pristine_git_object: ebb2f4ae7cd1336a682bff81f666b2b6c8d95c6b + docs/operations/createprivateproviderrequest.mdx: + id: f17089be3d7d + last_write_checksum: sha1:0ead770d5c650bb7b562fb301c0d23d2288d89d9 + pristine_git_object: 3d14c6582bf7986c4f43bf7e68e80bbdb5903305 + docs/operations/createprivateproviderresponse.mdx: + id: 3891f6f3111f + last_write_checksum: sha1:c6670127d56dca8751fa2d7017fd3c236367af40 + pristine_git_object: 87fe5420d27a9ca954d3b556012f963efe3e24d0 docs/operations/creatererankglobals.mdx: id: 4cb9d6ca73a4 last_write_checksum: sha1:cb0c479b4721f6710af00515cf1eda5f2d3e8100 @@ -8786,6 +8878,22 @@ trackedFiles: id: 2286e40fc2e2 last_write_checksum: sha1:9c659a6f49dffc014d32c40358ece48e427f4706 pristine_git_object: fa9a5c377ed524fb0766c2fc2d424e77397133c2 + docs/operations/deleteprivateproviderdata.mdx: + id: 913b7c530419 + last_write_checksum: sha1:50cd1fff4eb02a7941ed223de9d096a8429e6694 + pristine_git_object: 0610240f7875bb7d73000604aeafebb1bb3ac69f + docs/operations/deleteprivateproviderglobals.mdx: + id: 81c8d2ae440a + last_write_checksum: sha1:5d626406740f5ca61c430c852d670d318b5072be + pristine_git_object: 09a8fb2b509471973cb15a77c61ae8d1e04fd9b6 + docs/operations/deleteprivateproviderrequest.mdx: + id: 624dfddc717c + last_write_checksum: sha1:4ce5f2e57e6946e743ce7af7ef6692daf815e4e5 + pristine_git_object: 1ce35ebb341999f9d94b5da98b5b8f52e2c9880a + docs/operations/deleteprivateproviderresponse.mdx: + id: a4424e11bfca + last_write_checksum: sha1:838b8ae8b22510966d5fe458a42394dfe2fe55bb + pristine_git_object: 8835d63ee8f8a834919c48c655640e79bfcfb061 docs/operations/deletescimgroupmappingglobals.mdx: id: 97ed538b3737 last_write_checksum: sha1:45bf60339a5eed8b4195c8b488b7521c30c0b5b1 @@ -9138,6 +9246,18 @@ trackedFiles: id: e53713bf6f69 last_write_checksum: sha1:86b91603fb9624836e1121be51f6485687c41399 pristine_git_object: 7953eb10f9c69981c913c92d2ce8635f473c02d0 + docs/operations/getprivateproviderglobals.mdx: + id: 927ed51ca428 + last_write_checksum: sha1:65686012d67f72ce34b2577c94c34761d6607b10 + pristine_git_object: 2d3e57fc473522fe1952fc28e357f421166983d2 + docs/operations/getprivateproviderrequest.mdx: + id: 51b8abb9a762 + last_write_checksum: sha1:378393997bba38fb61033d56f50c24ce849098a8 + pristine_git_object: 47bccd5fef28ab0bfd6c54313e1683fd8ead7eb7 + docs/operations/getprivateproviderresponse.mdx: + id: 098edc2a4604 + last_write_checksum: sha1:6951ac099bda88c82e711332d2172113d0855b88 + pristine_git_object: 3ff04d8ae44395f6c9cc402419be914bda1a7fe8 docs/operations/getrankingsdailycategory.mdx: id: 37dbd531ea7d last_write_checksum: sha1:3c4ffc04da2558c3357a8759ba9984ea15b58db4 @@ -9590,6 +9710,18 @@ trackedFiles: id: 1a64f95a5b61 last_write_checksum: sha1:7c06f72dc5d031b1111532d6802fe5a9e0e8fb56 pristine_git_object: cd5702265d147a74e5ce3afc2d61402f31aa7c5c + docs/operations/listprivateprovidersglobals.mdx: + id: 8be66ed1c90f + last_write_checksum: sha1:c6620b9e2da5aed354f5eebd39c72e0ca53d472b + pristine_git_object: 283c97788bc798c2d7420446b52df601dded277d + docs/operations/listprivateprovidersrequest.mdx: + id: 40aeb4418a39 + last_write_checksum: sha1:6b95960f1377dade9f415d5b55eacbccccf52611 + pristine_git_object: f85e9fce8e1ea415745a5416036ed1bc1386da5a + docs/operations/listprivateprovidersresponse.mdx: + id: b3d116a5ba89 + last_write_checksum: sha1:48cbb6d60736f3be395ff2f9b556c72f496f731c + pristine_git_object: 1e9f3514bd813c91e6466ccbbca087b73b61f43c docs/operations/listprovidersdata.mdx: id: 79d7624ebbdc last_write_checksum: sha1:44933a10cf08c83fd60046b3c8e169f9518dd0e5 @@ -9968,8 +10100,20 @@ trackedFiles: pristine_git_object: 5521c5f6c1bf939076e4569d9968468d0f2fd3f3 docs/operations/updateprivateendpointrequest.mdx: id: ecd591dc8dd4 - last_write_checksum: sha1:f96c84cad74c1de64caae12a50efd935fb254484 - pristine_git_object: cf7c8e3ae007022c5083dd643f70f31190414a2e + last_write_checksum: sha1:314d0307951bbcc6d95432d192a9d71663e55d81 + pristine_git_object: 32a67482aedc37ac087a7a00400b5979a89fa159 + docs/operations/updateprivateproviderglobals.mdx: + id: cb827a8a67b4 + last_write_checksum: sha1:1009c143751f224fe53a43d236161df94056d1b2 + pristine_git_object: c0584b0ba91f2e0de45179827f67f29d704aeef2 + docs/operations/updateprivateproviderrequest.mdx: + id: 0858d0814a63 + last_write_checksum: sha1:49b302cc51606d0ac510e575574f570d2fbdda92 + pristine_git_object: 54fb50257d22757fc9f7eb90192a0308037ef065 + docs/operations/updateprivateproviderresponse.mdx: + id: cf7ad230efb4 + last_write_checksum: sha1:1403a72062231172d28f0a44f662404497fe115d + pristine_git_object: cf3260159a8668a763f2ed4e74d9b8266130acf2 docs/operations/updatescimgroupmappingglobals.mdx: id: 01643bdf3b7d last_write_checksum: sha1:f45629b1448695fcb9d16b74af5a9af30ae5edd7 @@ -10144,8 +10288,12 @@ trackedFiles: pristine_git_object: e442ecccb64f8b759a9d6c610cec84fd12da1e44 docs/sdks/privateendpoints/README.mdx: id: 54dee70b8cc7 - last_write_checksum: sha1:644bedc8463c94d47a37a87484c50ba8580d5e9d - pristine_git_object: 022a093e1ae210172a6b5546cb5868b2e2585d97 + last_write_checksum: sha1:d3959235845b4eb2f3ba2893837a13533f4b4329 + pristine_git_object: 4b496d94c6129d50b35fd1d6787afac16f9e49d4 + docs/sdks/privateproviders/README.mdx: + id: 517c31195442 + last_write_checksum: sha1:74fdf30e8e62cb868baaee363c57d8e93626cc44 + pristine_git_object: 8840f2ed0135779fe19fb9f0c20212f5c3cc2067 docs/sdks/providers/README.mdx: id: 5ea9af111324 last_write_checksum: sha1:782a6fe2f68c7e03c0496ce0e83cdc3f5a1512f0 @@ -10196,8 +10344,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:ae7c1a35526d41795659423dfcda32bdd8a0d8de - pristine_git_object: bf446a40e74b7e9ccd34d4a7843c5c50d5850629 + last_write_checksum: sha1:cfaedd3a2a030e2763df59aa76f1ab46cf0efa2d + pristine_git_object: fa864346c8b8c61c5a4a6af027729818aa6c1314 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10224,8 +10372,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:3ed6335129e20e65f12efa7c682c3eec66e29bc0 - pristine_git_object: 9530904ce320773f53463eeb1b202e3af8236ce1 + last_write_checksum: sha1:d5373e5b8e0868071fe77dde3f59413923de8be4 + pristine_git_object: f0a3b5ff889bdac54d482e0179cfecc941f03aa5 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -10272,8 +10420,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:aa6b71ab1108f435dedcff9c1d60fbe706a4fe30 - pristine_git_object: f52f50ac4b015c108d56567e0931c07090c48067 + last_write_checksum: sha1:55547b25a2b110e7341b0a7526a0a2e5456b70f0 + pristine_git_object: 7ddf8fc900cfc9414fa6b106149ea5c10d7fbd0e src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -11388,12 +11536,16 @@ trackedFiles: pristine_git_object: ffdb3753adda06f3d93b505ab17657337c66067c src/openrouter/components/createprivateendpointrequest.py: id: b97ebc39b8da - last_write_checksum: sha1:6a0723f03ce26c12953aeba515fd3468df94277b - pristine_git_object: 5cbb248c75129bd8e545cce149a4ca123a335f5e + last_write_checksum: sha1:f01cec108a563af2dba128edf89c1fd1b31085f6 + pristine_git_object: f34960b6ef9560cefba8397e43f2c73baaf2e7dd src/openrouter/components/createprivateendpointvalidationfailedresponse_error.py: id: 9960b9ef29f1 last_write_checksum: sha1:337c9b2191e51407481b588d7f47beeba37bc1f1 pristine_git_object: 2648161b1a975eaa62fcaaec7d011dabc15b6b79 + src/openrouter/components/createprivateproviderrequest.py: + id: 3ed3903ac816 + last_write_checksum: sha1:ffc358983f3b1479a537d2c052e55f16cf33bb29 + pristine_git_object: 2feb021cd9158d06e6005c5a0a6f3bd9db0e748b src/openrouter/components/createscimgroupmappingrequest.py: id: 57d83beb2d2d last_write_checksum: sha1:152e425925cc126310cee52fb6a98f6187a09261 @@ -12724,8 +12876,8 @@ trackedFiles: pristine_git_object: e86eb424bc592492f2903c8b3e30ec23de814991 src/openrouter/components/privateendpoint.py: id: 29da7e1d796a - last_write_checksum: sha1:d4c09da6190c340f72a9b8430ab14ac53cab9e5e - pristine_git_object: 6fb58a0fc661cea4fce3ee2ce604a18eebf77e2f + last_write_checksum: sha1:8c28a6ac3161647a8c20552b504a11a8d54c6f09 + pristine_git_object: 191505ccec0f26eff439491e36f6022497f36947 src/openrouter/components/privateendpointactivation.py: id: e0dabb5cbaaf last_write_checksum: sha1:930c5499cc0920bace93a88c89f0671da13535a1 @@ -12754,10 +12906,22 @@ trackedFiles: id: 2d8979e18f5b last_write_checksum: sha1:9573cef75311eee6c467e4a051308dbfd9a22ec4 pristine_git_object: 8ab720b740586c7709f13f4bdba16214327a73b0 + src/openrouter/components/privateendpointquantization.py: + id: 6365eda62b77 + last_write_checksum: sha1:97c7fadefe3d6664f5ecb01d5b65a0a9be0af9ed + pristine_git_object: 7f3f715503c668cd61abcd3b942db0196cc92a0c + src/openrouter/components/privateendpointreasoningreturnmechanism.py: + id: 8abb037a82e2 + last_write_checksum: sha1:df27d0bad1e6e3022d9b1c272692e635825ffe27 + pristine_git_object: 877a34f6dfe554c10be58d4eb2a7b698dffb17e7 src/openrouter/components/privateendpointresponse.py: id: 38a49c864b72 last_write_checksum: sha1:e9cbd209c0e4128c69645f4b4fb59508b40bb6eb pristine_git_object: 75b7eaee3b2aea9aa60a6b3a94e947148e9b15a9 + src/openrouter/components/privateendpointsettings.py: + id: 2d18a4690908 + last_write_checksum: sha1:086b9d8f07f641a1a0d0bf188233e99ff4d503b6 + pristine_git_object: 9557860a58bb84b8b72ec9921a3ad45c0912bfbc src/openrouter/components/privateendpointstatus.py: id: c997d801be04 last_write_checksum: sha1:d31ca8b19b14c86ecb41e2f5825071c109b5881d @@ -12778,6 +12942,14 @@ trackedFiles: id: 371ee92c4493 last_write_checksum: sha1:4bd041ee69f5adf310f1f647ea6d31419b843df8 pristine_git_object: 6e8b78ced26a0853ead11ec27400f8bf98f1fa83 + src/openrouter/components/privateprovider.py: + id: 958158825a77 + last_write_checksum: sha1:067ac1600eb5cf50b62745097bb1b6311f8f10b4 + pristine_git_object: 7d29a298f94019e5308f242522546aa6a4b609a5 + src/openrouter/components/privateproviderdatapolicy.py: + id: a1fb1200b4cf + last_write_checksum: sha1:0ad8732d32ae4b4bbcf002c9ceecfb70e952aeb1 + pristine_git_object: 90e716a2f187ba0b97ae5b998fc48a073b9d0187 src/openrouter/components/promptcachebreakpoint.py: id: f1e589a13300 last_write_checksum: sha1:f39a912f18e3d27aa9488700e981f282f585d58b @@ -13420,8 +13592,16 @@ trackedFiles: pristine_git_object: 3d096268edfbd2126133cf6da1bb66753ab315d6 src/openrouter/components/updateprivateendpointrequest.py: id: 51a950d71ff3 - last_write_checksum: sha1:1c6dd23b8d4ed56a1895bb59831181cbd8163529 - pristine_git_object: 83382c9fe2d9e5ace0dab2aae73d619f6cc1561f + last_write_checksum: sha1:8cce23bc93220d54540778d40d0dcc615f143e8f + pristine_git_object: 8df7de96472560bd34435f2b65e4007b97ba3514 + src/openrouter/components/updateprivateendpointsettingsrequest.py: + id: 5e27265a3151 + last_write_checksum: sha1:66c49c54b08c084b95c2d46db1e373c73a116045 + pristine_git_object: 4a3a6a0f3ce45aaffa2301eec6b10133bb6e948a + src/openrouter/components/updateprivateproviderrequest.py: + id: 62230b3a1857 + last_write_checksum: sha1:809dc5656e3ffb16e865a74868cfcf8a14168435 + pristine_git_object: 5aebd7da5985df962db2ad8909e75dcdd105506a src/openrouter/components/updatescimgroupmappingrequest.py: id: e014a151bfdd last_write_checksum: sha1:cc62d7f12e168cbe7899f9d96144a480c32159e1 @@ -13796,8 +13976,8 @@ trackedFiles: pristine_git_object: 4a35ede011d09dddab042e2c00413ce4f6be655e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:ffec0200ac8c0d182d9d0e3c4637b1ad8794b6f4 - pristine_git_object: 77272197136efc8570ea7084d9cc0460c8ec8d2c + last_write_checksum: sha1:89297246dcf99e732af65e39891f728958c602d3 + pristine_git_object: 35c06702f9988c078731aa444a188aad52c4078b src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -13902,6 +14082,10 @@ trackedFiles: id: 4c2fd54c9685 last_write_checksum: sha1:67f35439996a6db0ac7c40f65d331d9a5573a3f8 pristine_git_object: cd6cc2ee4a12a1419bfd134c7bc8b353e040630f + src/openrouter/operations/createprivateprovider.py: + id: 0ef86e7ce6bd + last_write_checksum: sha1:3fe74d2e24aacf9db45ad38e694a3b1503d7d056 + pristine_git_object: 28087c0c98f3382f0468f0c0a1b99295362807d7 src/openrouter/operations/creatererank.py: id: 99b5d368a168 last_write_checksum: sha1:2a28c11eea1e64fdf5b5795912915d605d8df579 @@ -13966,6 +14150,10 @@ trackedFiles: id: c61fc1252b0e last_write_checksum: sha1:c6142890856e97d65522da974e0454484230ecfa pristine_git_object: d24ba0719ae73603e9c2a05f66d7f69a556dab4e + src/openrouter/operations/deleteprivateprovider.py: + id: c396dd9f6dc2 + last_write_checksum: sha1:8a73aabdd0a06b3aeaa407faf6e7673514d8afe9 + pristine_git_object: 9f8ac142c2b6d3cde88d0bbc420bf5aa65054d79 src/openrouter/operations/deletescimgroupmapping.py: id: 5006e36e243e last_write_checksum: sha1:e3842ba18645e0c26de1810acce50da3b90e2cfc @@ -14082,6 +14270,10 @@ trackedFiles: id: cec9e371c5f6 last_write_checksum: sha1:d07ec56edb56cc14a1ce268c60289c63e0c386fb pristine_git_object: 91f86d25b38c41430f6529105f75b7eb53753fe9 + src/openrouter/operations/getprivateprovider.py: + id: 1cbd1ca456b2 + last_write_checksum: sha1:f3845cbb405f1baae8e3f0ca21f37a8891433112 + pristine_git_object: bd85d8584a9a7243fd7e9ef5375ab39a371ea1b1 src/openrouter/operations/getrankingsdaily.py: id: 61dd0325de08 last_write_checksum: sha1:352d2aeaebf68140c78343f31cc8ba344dc3d9ae @@ -14234,6 +14426,10 @@ trackedFiles: id: e8ea708382f5 last_write_checksum: sha1:a8ad625eef75179574d1389a513995ef0eeeca52 pristine_git_object: 5f70f10c60bb2d8ccc378e2b5ea00cc99f92ec57 + src/openrouter/operations/listprivateproviders.py: + id: d8ad909a544b + last_write_checksum: sha1:ec09211e03d24ca14b54ebeb6af172a2fd73d3a6 + pristine_git_object: 1b76ac2414e607e8e7565745592764cf7322e9a0 src/openrouter/operations/listproviders.py: id: cf6e2db15118 last_write_checksum: sha1:decee82d2b55738162cc47f02f56c592d53f9ee9 @@ -14334,6 +14530,10 @@ trackedFiles: id: 8c04cca6c180 last_write_checksum: sha1:748d5e531ee17d61982327f319a882bb5492ad4b pristine_git_object: 144cf09790cbf4d2cdb13d91171d9e7609d32370 + src/openrouter/operations/updateprivateprovider.py: + id: 50eadba23be0 + last_write_checksum: sha1:b4333aa3b53c9cf55bf310174a2c586aacb43a86 + pristine_git_object: 953e0c4f3f8659f486cc9f651b97f82e5907cb73 src/openrouter/operations/updatescimgroupmapping.py: id: 5887929f6dff last_write_checksum: sha1:c989609f3c53c3e455f0ad77595a1ce07a21b6e9 @@ -14364,8 +14564,12 @@ trackedFiles: pristine_git_object: 26ecf767f8e1f98145acfa7d0fa14ffcf13955d6 src/openrouter/private_endpoints.py: id: fdbce8846ed0 - last_write_checksum: sha1:786f808e29866de19964dbffac1e1dcbd7fd30ee - pristine_git_object: 518fc30683bf21b7a038a19948117b601e10cbb3 + last_write_checksum: sha1:1b13e618b76900d06fafa5660126f0cd46f7121e + pristine_git_object: 4407f1f32fc228b47344082d322d1502fc3fbcf1 + src/openrouter/private_providers.py: + id: d2b888527155 + last_write_checksum: sha1:de9893f9d5810dc90202ea32d1b676b81d97e8ef + pristine_git_object: f65b0d06ec3f02c21ab85ed59d00d1076aa7a10b src/openrouter/providers.py: id: debc4c48f149 last_write_checksum: sha1:11dbc607825edee8dcc84b39ee8171e097c47acf @@ -14388,8 +14592,8 @@ trackedFiles: pristine_git_object: 6bc5fe5e691f5136f59e018dac5998ac36700e10 src/openrouter/sdk.py: id: ee9846c4c9c5 - last_write_checksum: sha1:c814e782f7fc3e756d7c764a6241e2c978ec8e83 - pristine_git_object: 9e37516f4c72a7b5e22317597b75683656926aa3 + last_write_checksum: sha1:26c43da1bad4b17e698e25ac6c1edeb141130ab5 + pristine_git_object: 5be8b45edc146fa397b064b08c7ca26e6774d758 src/openrouter/sdkconfiguration.py: id: 55773bb98d7c last_write_checksum: sha1:c01826125c31a8b8bc99d9d679782c8758fae001 @@ -18115,7 +18319,7 @@ examples: id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" responses: "200": - application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "settings": {"completions": {"chat": true, "text": false}, "context_length": 128000, "excluded_parameters": ["logit_bias"], "inputs": {"audio": false, "base64_files": null, "base64_images": true, "file_urls": null, "image_urls": true}, "max_completion_tokens": 16384, "max_prompt_tokens": null, "quantization": "bf16", "reasoning": {"return_mechanism": "reasoning", "supported": true}, "tool_choice": {"auto": true, "function": false, "none": true, "required": true}}, "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "403": @@ -18132,10 +18336,10 @@ examples: path: id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" requestBody: - application/json: {"upstream_model_id": "gpt-4o-prod"} + application/json: {} responses: "200": - application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "settings": {"completions": {"chat": true, "text": false}, "context_length": 128000, "excluded_parameters": ["logit_bias"], "inputs": {"audio": false, "base64_files": null, "base64_images": true, "file_urls": null, "image_urls": true}, "max_completion_tokens": 16384, "max_prompt_tokens": null, "quantization": "bf16", "reasoning": {"return_mechanism": "reasoning", "supported": true}, "tool_choice": {"auto": true, "function": false, "none": true, "required": true}}, "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -18241,7 +18445,7 @@ examples: application/json: {"pricing": {"completion": "0.00001", "prompt": "0.0000025"}} responses: "200": - application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "settings": {"completions": {"chat": true, "text": false}, "context_length": 128000, "excluded_parameters": ["logit_bias"], "inputs": {"audio": false, "base64_files": null, "base64_images": true, "file_urls": null, "image_urls": true}, "max_completion_tokens": 16384, "max_prompt_tokens": null, "quantization": "bf16", "reasoning": {"return_mechanism": "reasoning", "supported": true}, "tool_choice": {"auto": true, "function": false, "none": true, "required": true}}, "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -18885,7 +19089,71 @@ examples: application/json: {"declared_parameters": ["temperature", "seed"]} responses: "200": - application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "settings": {"completions": {"chat": true, "text": false}, "context_length": 128000, "excluded_parameters": ["logit_bias"], "inputs": {"audio": false, "base64_files": null, "base64_images": true, "file_urls": null, "image_urls": true}, "max_completion_tokens": 16384, "max_prompt_tokens": null, "quantization": "bf16", "reasoning": {"return_mechanism": "reasoning", "supported": true}, "tool_choice": {"auto": true, "function": false, "none": true, "required": true}}, "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} + "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."}} + "422": + application/json: {"error": {"code": 422, "message": "Invalid argument"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + listPrivateProviders: + speakeasy-default-list-private-providers: + responses: + "200": + application/json: {"data": [{"base_url": "https://inference.example.com/v1", "created_at": "2026-10-06T12:00:00.000Z", "data_policy": {"prompt_retention_days": null, "retains_prompts": false, "training": false}, "display_name": "Acme", "name": "Acme", "slug": "acme"}]} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createPrivateProvider: + speakeasy-default-create-private-provider: + requestBody: + application/json: {"name": "Acme"} + responses: + "201": + application/json: {"data": {"base_url": "https://inference.example.com/v1", "created_at": "2026-10-06T12:00:00.000Z", "data_policy": {"prompt_retention_days": null, "retains_prompts": false, "training": false}, "display_name": "Acme", "name": "Acme", "slug": "acme"}} + "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."}} + "422": + application/json: {"error": {"code": 422, "message": "Invalid argument"}} + "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"}} + deletePrivateProvider: + speakeasy-default-delete-private-provider: + parameters: + path: + slug: "acme" + responses: + "200": + application/json: {"data": {"slug": "acme"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -18900,8 +19168,57 @@ examples: application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} "422": application/json: {"error": {"code": 422, "message": "Invalid argument"}} + "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"}} + getPrivateProvider: + speakeasy-default-get-private-provider: + parameters: + path: + slug: "acme" + responses: + "200": + application/json: {"data": {"base_url": "https://inference.example.com/v1", "created_at": "2026-10-06T12:00:00.000Z", "data_policy": {"prompt_retention_days": null, "retains_prompts": false, "training": false}, "display_name": "Acme", "name": "Acme", "slug": "acme"}} + "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"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + updatePrivateProvider: + speakeasy-default-update-private-provider: + parameters: + path: + slug: "acme" + requestBody: + application/json: {} + responses: + "200": + application/json: {"data": {"base_url": "https://inference.example.com/v1", "created_at": "2026-10-06T12:00:00.000Z", "data_policy": {"prompt_retention_days": null, "retains_prompts": false, "training": false}, "display_name": "Acme", "name": "Acme", "slug": "acme"}} + "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."}} + "422": + application/json: {"error": {"code": 422, "message": "Invalid argument"}} + "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"}} examplesVersion: 1.0.2 +releaseNotes: "## Python SDK Changes:\n* `open_router.private_providers.list()`: **Added**\n* `open_router.private_providers.create()`: **Added**\n* `open_router.private_providers.delete()`: **Added**\n* `open_router.private_providers.get()`: **Added**\n* `open_router.private_providers.update()`: **Added**\n* `open_router.private_endpoints.create()`: `request.settings` **Added**\n* `open_router.private_endpoints.get()`: `response.data.settings` **Added**\n* `open_router.private_endpoints.update()`: \n * `request` **Changed**\n * `response.data.settings` **Added**\n* `open_router.private_endpoints.update_parameters()`: **Deprecated**\n* `open_router.private_endpoints.update_parameters()`: `response.data.settings` **Added**\n* `open_router.private_endpoints.update_pricing()`: **Deprecated**\n* `open_router.private_endpoints.update_pricing()`: `response.data.settings` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c18e7db4c..232d04183 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.92 + version: 1.3.93 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index f8a5535a6..77e291e82 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -10444,6 +10444,8 @@ components: example: 'azure' minLength: 1 type: 'string' + settings: + $ref: '#/components/schemas/UpdatePrivateEndpointSettingsRequest' upstream_model_id: description: 'Model or deployment identifier sent to the upstream provider.' example: 'gpt-4o-prod' @@ -10480,6 +10482,29 @@ components: - 'error' - 'data' type: 'object' + CreatePrivateProviderRequest: + properties: + base_url: + description: 'HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.' + example: 'https://inference.example.com/v1' + type: 'string' + data_policy: + $ref: '#/components/schemas/PrivateProviderDataPolicy' + display_name: + description: 'Defaults to `name`.' + example: 'Acme' + type: 'string' + name: + description: 'Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name.' + example: 'Acme' + type: 'string' + slug: + description: '2-64 lowercase letters and numbers, separated by single hyphens. Cannot be changed later. Defaults to the name lowercased, with every run of other characters replaced by a hyphen (`Acme Inference` becomes `acme-inference`).' + example: 'acme' + type: 'string' + required: + - 'name' + type: 'object' CreateScimGroupMappingRequest: properties: role: @@ -25667,6 +25692,30 @@ components: prompt: '0.0000025' provider_name: 'Azure' provider_slug: 'azure' + settings: + completions: + chat: true + text: false + context_length: 128000 + excluded_parameters: + - 'logit_bias' + inputs: + audio: false + base64_files: null + base64_images: true + file_urls: null + image_urls: true + max_completion_tokens: 16384 + max_prompt_tokens: null + quantization: 'bf16' + reasoning: + return_mechanism: 'reasoning' + supported: true + tool_choice: + auto: true + function: false + none: true + required: true status: 'active' tested_parameters: - 'tools' @@ -25735,6 +25784,8 @@ components: type: - 'string' - 'null' + settings: + $ref: '#/components/schemas/PrivateEndpointSettings' status: $ref: '#/components/schemas/PrivateEndpointStatus' tested_parameters: @@ -25765,6 +25816,7 @@ components: - 'pricing' - 'tested_parameters' - 'declared_parameters' + - 'settings' type: 'object' PrivateEndpointActivation: description: 'Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again.' @@ -25922,6 +25974,37 @@ components: - 'prompt' - 'completion' type: 'object' + PrivateEndpointQuantization: + description: 'Weight precision the deployment runs at; `unknown` when not stated.' + enum: + - 'int4' + - 'int8' + - 'fp4' + - 'mxfp4' + - 'nvfp4' + - 'fp6' + - 'fp8' + - 'mxfp8' + - 'fp16' + - 'bf16' + - 'fp32' + - 'unknown' + example: 'bf16' + type: 'string' + x-speakeasy-unknown-values: allow + PrivateEndpointReasoningReturnMechanism: + description: 'Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default.' + enum: + - 'content-string' + - 'reasoning-content' + - 'reasoning' + - 'none' + - null + example: 'reasoning' + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow PrivateEndpointResponse: properties: data: @@ -25929,6 +26012,184 @@ components: required: - 'data' type: 'object' + PrivateEndpointSettings: + description: 'Capabilities and limits routing uses for this endpoint. A new endpoint copies them from the public endpoint for the same model and provider, or from the model, and the owner can change them. Rate limits are not part of this object: a private endpoint is billed to its own upstream key, so request limits stay with the provider.' + example: + completions: + chat: true + text: false + context_length: 128000 + excluded_parameters: + - 'logit_bias' + inputs: + audio: false + base64_files: null + base64_images: true + file_urls: null + image_urls: true + max_completion_tokens: 16384 + max_prompt_tokens: null + quantization: 'bf16' + reasoning: + return_mechanism: 'reasoning' + supported: true + tool_choice: + auto: true + function: false + none: true + required: true + properties: + completions: + properties: + chat: + description: 'Serves `/chat/completions`; `null` uses the provider default.' + type: + - 'boolean' + - 'null' + text: + description: 'Serves `/completions`; `null` uses the provider default.' + type: + - 'boolean' + - 'null' + required: + - 'chat' + - 'text' + type: 'object' + context_length: + description: 'Longest prompt plus completion, in tokens, or `null` to keep the model default.' + example: 128000 + minimum: 1 + type: + - 'integer' + - 'null' + excluded_parameters: + description: 'Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter.' + example: + - 'logit_bias' + items: + enum: + - 'temperature' + - 'top_p' + - 'top_k' + - 'min_p' + - 'top_a' + - 'frequency_penalty' + - 'presence_penalty' + - 'repetition_penalty' + - 'max_tokens' + - 'max_completion_tokens' + - 'logit_bias' + - 'logprobs' + - 'top_logprobs' + - 'prediction' + - 'seed' + - 'response_format' + - 'structured_outputs' + - 'stop' + - 'tools' + - 'tool_choice' + - 'parallel_tool_calls' + - 'include_reasoning' + - 'reasoning' + - 'reasoning_effort' + - 'web_search_options' + - 'verbosity' + type: 'string' + x-speakeasy-unknown-values: allow + type: 'array' + inputs: + properties: + audio: + description: 'Accepts audio input. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + base64_files: + description: 'Accepts base64 file data. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + base64_images: + description: 'Accepts base64 image data. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + file_urls: + description: 'Accepts file URLs. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + image_urls: + description: 'Accepts image URLs. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + required: + - 'image_urls' + - 'base64_images' + - 'file_urls' + - 'base64_files' + - 'audio' + type: 'object' + max_completion_tokens: + description: 'Longest completion the upstream returns, in tokens, or `null` to keep the model default.' + example: 16384 + minimum: 1 + type: + - 'integer' + - 'null' + max_prompt_tokens: + description: 'Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.' + example: null + minimum: 1 + type: + - 'integer' + - 'null' + quantization: + $ref: '#/components/schemas/PrivateEndpointQuantization' + reasoning: + properties: + return_mechanism: + $ref: '#/components/schemas/PrivateEndpointReasoningReturnMechanism' + supported: + description: 'Whether requests with `reasoning` route to this endpoint.' + example: true + type: 'boolean' + required: + - 'supported' + - 'return_mechanism' + type: 'object' + tool_choice: + properties: + auto: + description: 'Accepts `tool_choice: "auto"`.' + type: 'boolean' + function: + description: 'Accepts a named function in `tool_choice`.' + type: 'boolean' + none: + description: 'Accepts `tool_choice: "none"`.' + type: 'boolean' + required: + description: 'Accepts `tool_choice: "required"`.' + type: 'boolean' + required: + - 'none' + - 'auto' + - 'required' + - 'function' + type: 'object' + required: + - 'context_length' + - 'max_prompt_tokens' + - 'max_completion_tokens' + - 'quantization' + - 'reasoning' + - 'inputs' + - 'tool_choice' + - 'excluded_parameters' + - 'completions' + type: 'object' PrivateEndpointStatus: description: 'Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.' enum: @@ -26027,6 +26288,89 @@ components: required: - 'data' type: 'object' + PrivateProvider: + example: + base_url: 'https://inference.example.com/v1' + created_at: '2026-10-06T12:00:00.000Z' + data_policy: + prompt_retention_days: null + retains_prompts: false + training: false + display_name: 'Acme' + name: 'Acme' + slug: 'acme' + properties: + base_url: + description: 'HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.' + example: 'https://inference.example.com/v1' + type: + - 'string' + - 'null' + created_at: + type: 'string' + data_policy: + description: 'Your declared data policy, or `null` when none was declared.' + properties: + prompt_retention_days: + description: 'Days prompts are retained. Must be `null` unless `retains_prompts` is true.' + type: + - 'integer' + - 'null' + retains_prompts: + description: 'Whether the provider retains prompts or completions.' + type: 'boolean' + training: + description: 'Whether the provider trains on prompts.' + type: 'boolean' + required: + - 'training' + - 'retains_prompts' + - 'prompt_retention_days' + type: + - 'object' + - 'null' + display_name: + example: 'Acme' + type: 'string' + name: + description: 'Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name.' + example: 'Acme' + type: 'string' + slug: + description: 'The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`.' + example: 'acme' + type: 'string' + required: + - 'name' + - 'slug' + - 'display_name' + - 'base_url' + - 'data_policy' + - 'created_at' + type: 'object' + PrivateProviderDataPolicy: + description: 'Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it.' + example: + prompt_retention_days: null + retains_prompts: false + training: false + properties: + prompt_retention_days: + description: 'Days prompts are retained. Must be `null` unless `retains_prompts` is true.' + type: + - 'integer' + - 'null' + retains_prompts: + description: 'Whether the provider retains prompts or completions.' + type: 'boolean' + training: + description: 'Whether the provider trains on prompts.' + type: 'boolean' + required: + - 'training' + - 'retains_prompts' + - 'prompt_retention_days' + type: 'object' PromptCacheBreakpoint: description: 'Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` ("30m" or "12h") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.' example: @@ -32395,12 +32739,27 @@ components: - 'pricing' type: 'object' UpdatePrivateEndpointRequest: + description: 'Only the fields present change. `base_url`, `upstream_model_id`, `declared_zdr` and `declared_region` are accepted on a draft only; `pricing` and `declared_parameters` replace their value; `settings` is itself a partial update where `null` clears a limit or restores the provider default.' + example: + declared_parameters: + - 'seed' + settings: + context_length: 128000 properties: base_url: description: 'HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).' example: 'https://contoso.openai.azure.com' minLength: 1 type: 'string' + declared_parameters: + description: 'Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.' + example: + - 'temperature' + - 'seed' + items: + $ref: '#/components/schemas/PrivateEndpointDeclaredParameter' + maxItems: 25 + type: 'array' declared_region: description: 'Attest where this deployment processes data.' enum: @@ -32418,13 +32777,174 @@ components: type: - 'boolean' - 'null' + pricing: + allOf: + - $ref: '#/components/schemas/PrivateEndpointPricing' + - description: 'Replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the pricing strategy default.' + settings: + allOf: + - $ref: '#/components/schemas/UpdatePrivateEndpointSettingsRequest' + - description: 'Only the fields present change; an omitted field keeps its stored value and `null` clears a limit or reverts a flag to the provider default.' upstream_model_id: description: 'Model or deployment identifier sent to the upstream provider.' example: 'gpt-4o-prod' minLength: 1 type: 'string' - required: - - 'upstream_model_id' + type: 'object' + UpdatePrivateEndpointSettingsRequest: + description: 'Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values.' + example: + context_length: 128000 + reasoning: + supported: true + properties: + completions: + properties: + chat: + description: 'Serves `/chat/completions`; `null` uses the provider default.' + type: + - 'boolean' + - 'null' + text: + description: 'Serves `/completions`; `null` uses the provider default.' + type: + - 'boolean' + - 'null' + type: 'object' + context_length: + description: 'Longest prompt plus completion, in tokens, or `null` to keep the model default.' + example: 128000 + minimum: 1 + type: + - 'integer' + - 'null' + excluded_parameters: + description: 'Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter.' + example: + - 'logit_bias' + items: + enum: + - 'temperature' + - 'top_p' + - 'top_k' + - 'min_p' + - 'top_a' + - 'frequency_penalty' + - 'presence_penalty' + - 'repetition_penalty' + - 'max_tokens' + - 'max_completion_tokens' + - 'logit_bias' + - 'logprobs' + - 'top_logprobs' + - 'prediction' + - 'seed' + - 'response_format' + - 'structured_outputs' + - 'stop' + - 'tools' + - 'tool_choice' + - 'parallel_tool_calls' + - 'include_reasoning' + - 'reasoning' + - 'reasoning_effort' + - 'web_search_options' + - 'verbosity' + type: 'string' + x-speakeasy-unknown-values: allow + type: 'array' + inputs: + properties: + audio: + description: 'Accepts audio input. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + base64_files: + description: 'Accepts base64 file data. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + base64_images: + description: 'Accepts base64 image data. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + file_urls: + description: 'Accepts file URLs. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + image_urls: + description: 'Accepts image URLs. `null` keeps the provider default.' + type: + - 'boolean' + - 'null' + type: 'object' + max_completion_tokens: + description: 'Longest completion the upstream returns, in tokens, or `null` to keep the model default.' + example: 16384 + minimum: 1 + type: + - 'integer' + - 'null' + max_prompt_tokens: + description: 'Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.' + example: null + minimum: 1 + type: + - 'integer' + - 'null' + quantization: + $ref: '#/components/schemas/PrivateEndpointQuantization' + reasoning: + properties: + return_mechanism: + $ref: '#/components/schemas/PrivateEndpointReasoningReturnMechanism' + supported: + description: 'Whether requests with `reasoning` route to this endpoint.' + example: true + type: 'boolean' + type: 'object' + tool_choice: + properties: + auto: + description: 'Accepts `tool_choice: "auto"`.' + type: 'boolean' + function: + description: 'Accepts a named function in `tool_choice`.' + type: 'boolean' + none: + description: 'Accepts `tool_choice: "none"`.' + type: 'boolean' + required: + description: 'Accepts `tool_choice: "required"`.' + type: 'boolean' + type: 'object' + type: 'object' + UpdatePrivateProviderRequest: + properties: + base_url: + description: 'HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.' + example: 'https://inference.example.com/v1' + type: 'string' + data_policy: + properties: + prompt_retention_days: + description: 'Days prompts are retained. Must be `null` unless `retains_prompts` is true.' + type: + - 'integer' + - 'null' + retains_prompts: + description: 'Whether the provider retains prompts or completions.' + type: 'boolean' + training: + description: 'Whether the provider trains on prompts.' + type: 'boolean' + type: 'object' + display_name: + example: 'Acme' + type: 'string' type: 'object' UpdateScimGroupMappingRequest: properties: @@ -47201,67 +47721,382 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'Service temporarily unavailable' - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - security: - - apiKey: [] - summary: 'Get a specific version of a preset' - tags: - - 'Presets' - x-speakeasy-name-override: 'getVersion' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /private-endpoints: - get: - description: 'List the organization''s private endpoints, including drafts. Requires the private endpoints entitlement. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listPrivateEndpoints' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListPrivateEndpointsResponse' - description: 'Private endpoints for the organization' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'Service temporarily unavailable' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + security: + - apiKey: [] + summary: 'Get a specific version of a preset' + tags: + - 'Presets' + x-speakeasy-name-override: 'getVersion' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /private-endpoints: + get: + description: 'List the organization''s private endpoints, including drafts. Requires the private endpoints entitlement. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listPrivateEndpoints' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListPrivateEndpointsResponse' + description: 'Private endpoints for the organization' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '408': + content: + application/json: + example: + error: + code: 408 + message: 'Operation timed out. Please try again later.' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - Operation exceeded time limit' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List private endpoints' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'list' + post: + description: 'Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools`. The response does not echo `declared_parameters` or `tested_parameters`; read them with `GET /private-endpoints/{id}`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createPrivateEndpoint' + parameters: + - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' + in: 'header' + name: 'idempotency-key' + required: false + schema: + description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' + example: 'wayfair-gpt-4o-eastus-2026-09' + maxLength: 255 + minLength: 1 + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePrivateEndpointRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ManagedPrivateEndpointResponse' + description: 'The created endpoint: a draft, or active when `activate` was passed' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' + - $ref: '#/components/schemas/NotFoundResponse' + description: 'The model, provider, or validation workspace was not found. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + '408': + content: + application/json: + example: + error: + code: 408 + message: 'Operation timed out. Please try again later.' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - Operation exceeded time limit' + '409': + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' + - $ref: '#/components/schemas/ConflictResponse' + description: 'The request conflicts with the endpoint state, such as a stale validation. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + '422': + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' + - $ref: '#/components/schemas/UnprocessableEntityResponse' + description: 'The request was invalid, or validation failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + '500': + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' + - $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal server error. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + '502': + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' + - $ref: '#/components/schemas/BadGatewayResponse' + description: 'An upstream dependency failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + summary: 'Create a private endpoint' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'create' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /private-endpoints/{id}: + delete: + description: 'Delete a private endpoint and stop routing to it. Pass `draft_only=true` to refuse (409) when the endpoint has been activated. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deletePrivateEndpoint' + parameters: + - description: 'Stable identifier of the private endpoint.' + in: 'path' + name: 'id' + required: true + schema: + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' + type: 'string' + - description: 'When `true`, only delete the endpoint if it is still a draft (409 otherwise).' + in: 'query' + name: 'draft_only' + required: false + schema: + description: 'When `true`, only delete the endpoint if it is still a draft (409 otherwise).' + enum: + - 'true' + - 'false' + type: 'string' + x-speakeasy-unknown-values: allow + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeletePrivateEndpointResponse' + description: 'The endpoint was deleted' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '408': + content: + application/json: + example: + error: + code: 408 + message: 'Operation timed out. Please try again later.' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - Operation exceeded time limit' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '422': + content: + application/json: + example: + error: + code: 422 + message: 'Invalid argument' + schema: + $ref: '#/components/schemas/UnprocessableEntityResponse' + description: 'Unprocessable Entity - Semantic validation failure' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + summary: 'Delete a private endpoint' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'delete' + get: + description: 'Get one private endpoint with its upstream configuration and current pricing. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getPrivateEndpoint' + parameters: + - description: 'Stable identifier of the private endpoint.' + in: 'path' + name: 'id' + required: true + schema: + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PrivateEndpointResponse' + description: 'The private endpoint' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '408': content: application/json: @@ -47282,37 +48117,36 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List private endpoints' + summary: 'Get a private endpoint' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'list' - post: - description: 'Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools`. The response does not echo `declared_parameters` or `tested_parameters`; read them with `GET /private-endpoints/{id}`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'createPrivateEndpoint' + x-speakeasy-name-override: 'get' + patch: + description: 'Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `upstream_model_id`, `base_url`, `declared_zdr` and `declared_region` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any upstream change clears earlier validation. Naming an upstream field on an active endpoint returns 409 `already_active` and writes nothing; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updatePrivateEndpoint' parameters: - - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' - in: 'header' - name: 'idempotency-key' - required: false + - description: 'Stable identifier of the private endpoint.' + in: 'path' + name: 'id' + required: true schema: - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' - example: 'wayfair-gpt-4o-eastus-2026-09' - maxLength: 255 - minLength: 1 + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' type: 'string' requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreatePrivateEndpointRequest' + $ref: '#/components/schemas/UpdatePrivateEndpointRequest' required: true responses: - '201': + '200': content: application/json: schema: - $ref: '#/components/schemas/ManagedPrivateEndpointResponse' - description: 'The created endpoint: a draft, or active when `activate` was passed' + $ref: '#/components/schemas/PrivateEndpointResponse' + description: 'The updated endpoint' '400': content: application/json: @@ -47346,11 +48180,13 @@ paths: '404': content: application/json: + example: + error: + code: 404 + message: 'Resource not found' schema: - anyOf: - - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' - - $ref: '#/components/schemas/NotFoundResponse' - description: 'The model, provider, or validation workspace was not found. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '408': content: application/json: @@ -47364,47 +48200,55 @@ paths: '409': content: application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' schema: - anyOf: - - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' - - $ref: '#/components/schemas/ConflictResponse' - description: 'The request conflicts with the endpoint state, such as a stale validation. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' '422': content: application/json: + example: + error: + code: 422 + message: 'Invalid argument' schema: - anyOf: - - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' - - $ref: '#/components/schemas/UnprocessableEntityResponse' - description: 'The request was invalid, or validation failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + $ref: '#/components/schemas/UnprocessableEntityResponse' + description: 'Unprocessable Entity - Semantic validation failure' '500': content: application/json: + example: + error: + code: 500 + message: 'Internal Server Error' schema: - anyOf: - - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' - - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal server error. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' '502': content: application/json: + example: + error: + code: 502 + message: 'Provider returned error' schema: - anyOf: - - $ref: '#/components/schemas/CreatePrivateEndpointValidationFailedResponse' - - $ref: '#/components/schemas/BadGatewayResponse' - description: 'An upstream dependency failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.' - summary: 'Create a private endpoint' + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + summary: 'Update a private endpoint' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'create' + x-speakeasy-name-override: 'update' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}: - delete: - description: 'Delete a private endpoint and stop routing to it. Pass `draft_only=true` to refuse (409) when the endpoint has been activated. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'deletePrivateEndpoint' + /private-endpoints/{id}/activate: + post: + description: 'Make a validated draft routable. Returns 409 when the endpoint was never validated, the validation is stale, or it is already active. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'activatePrivateEndpoint' parameters: - description: 'Stable identifier of the private endpoint.' in: 'path' @@ -47415,24 +48259,13 @@ paths: example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' format: 'uuid' type: 'string' - - description: 'When `true`, only delete the endpoint if it is still a draft (409 otherwise).' - in: 'query' - name: 'draft_only' - required: false - schema: - description: 'When `true`, only delete the endpoint if it is still a draft (409 otherwise).' - enum: - - 'true' - - 'false' - type: 'string' - x-speakeasy-unknown-values: allow responses: '200': content: application/json: schema: - $ref: '#/components/schemas/DeletePrivateEndpointResponse' - description: 'The endpoint was deleted' + $ref: '#/components/schemas/ManagedPrivateEndpointResponse' + description: 'The endpoint after the change' '400': content: application/json: @@ -47523,13 +48356,18 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Delete a private endpoint' + summary: 'Activate a validated private endpoint' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'delete' - get: - description: 'Get one private endpoint with its upstream configuration and current pricing. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getPrivateEndpoint' + x-speakeasy-name-override: 'activate' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /private-endpoints/{id}/disable: + post: + description: 'Stop routing to an active endpoint without deleting it. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'disablePrivateEndpoint' parameters: - description: 'Stable identifier of the private endpoint.' in: 'path' @@ -47545,8 +48383,18 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PrivateEndpointResponse' - description: 'The private endpoint' + $ref: '#/components/schemas/ManagedPrivateEndpointResponse' + description: 'The endpoint after the change' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: @@ -47587,6 +48435,26 @@ paths: schema: $ref: '#/components/schemas/RequestTimeoutResponse' description: 'Request Timeout - Operation exceeded time limit' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '422': + content: + application/json: + example: + error: + code: 422 + message: 'Invalid argument' + schema: + $ref: '#/components/schemas/UnprocessableEntityResponse' + description: 'Unprocessable Entity - Semantic validation failure' '500': content: application/json: @@ -47597,13 +48465,28 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get a private endpoint' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + summary: 'Disable a private endpoint' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'get' - patch: - description: 'Replace a draft endpoint''s upstream configuration: send `upstream_model_id`, and `base_url` to change it (an omitted `base_url` keeps the stored one). Omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes. Any change clears earlier validation. Active endpoints return 409; delete and re-create them instead. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updatePrivateEndpoint' + x-speakeasy-name-override: 'disable' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /private-endpoints/{id}/enable: + post: + description: 'Resume routing to a disabled endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'enablePrivateEndpoint' parameters: - description: 'Stable identifier of the private endpoint.' in: 'path' @@ -47614,19 +48497,13 @@ paths: example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' format: 'uuid' type: 'string' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePrivateEndpointRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PrivateEndpointResponse' - description: 'The updated endpoint' + $ref: '#/components/schemas/ManagedPrivateEndpointResponse' + description: 'The endpoint after the change' '400': content: application/json: @@ -47717,18 +48594,19 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Update a draft private endpoint' + summary: 'Enable a private endpoint' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'update' + x-speakeasy-name-override: 'enable' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/activate: - post: - description: 'Make a validated draft routable. Returns 409 when the endpoint was never validated, the validation is stale, or it is already active. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'activatePrivateEndpoint' + /private-endpoints/{id}/parameters: + put: + deprecated: true + description: 'Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updatePrivateEndpointParameters' parameters: - description: 'Stable identifier of the private endpoint.' in: 'path' @@ -47739,13 +48617,19 @@ paths: example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' format: 'uuid' type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePrivateEndpointParametersRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ManagedPrivateEndpointResponse' - description: 'The endpoint after the change' + $ref: '#/components/schemas/PrivateEndpointResponse' + description: 'The endpoint with its new declared parameters' '400': content: application/json: @@ -47836,18 +48720,19 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Activate a validated private endpoint' + summary: 'Set private endpoint supported parameters (deprecated)' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'activate' + x-speakeasy-name-override: 'updateParameters' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/disable: - post: - description: 'Stop routing to an active endpoint without deleting it. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'disablePrivateEndpoint' + /private-endpoints/{id}/pricing: + put: + deprecated: true + description: 'Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updatePrivateEndpointPricing' parameters: - description: 'Stable identifier of the private endpoint.' in: 'path' @@ -47858,13 +48743,19 @@ paths: example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' format: 'uuid' type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePrivateEndpointPricingRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ManagedPrivateEndpointResponse' - description: 'The endpoint after the change' + $ref: '#/components/schemas/PrivateEndpointResponse' + description: 'The endpoint with its new pricing' '400': content: application/json: @@ -47955,18 +48846,18 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Disable a private endpoint' + summary: 'Set private endpoint pricing (deprecated)' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'disable' + x-speakeasy-name-override: 'updatePricing' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/enable: + /private-endpoints/{id}/validate: post: - description: 'Resume routing to a disabled endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'enablePrivateEndpoint' + description: 'Send a live test request to the draft endpoint using the given workspace''s BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'validatePrivateEndpoint' parameters: - description: 'Stable identifier of the private endpoint.' in: 'path' @@ -47977,13 +48868,19 @@ paths: example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' format: 'uuid' type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePrivateEndpointRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ManagedPrivateEndpointResponse' - description: 'The endpoint after the change' + $ref: '#/components/schemas/PrivateEndpointValidationResponse' + description: 'Validation checks' '400': content: application/json: @@ -48074,41 +48971,87 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Enable a private endpoint' + summary: 'Validate a draft private endpoint' tags: - 'Private Endpoints' - x-speakeasy-name-override: 'enable' + x-speakeasy-name-override: 'validate' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/parameters: - put: - description: 'Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updatePrivateEndpointParameters' - parameters: - - description: 'Stable identifier of the private endpoint.' - in: 'path' - name: 'id' - required: true - schema: - description: 'Stable identifier of the private endpoint.' - example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' - format: 'uuid' - type: 'string' + /private-providers: + get: + description: 'List the organization''s private providers. Requires the private endpoints entitlement. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listPrivateProviders' + responses: + '200': + content: + application/json: + schema: + properties: + data: + items: + $ref: '#/components/schemas/PrivateProvider' + type: 'array' + required: + - 'data' + type: 'object' + description: 'Private providers for the organization' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List private providers' + tags: + - 'Private Providers' + x-speakeasy-name-override: 'list' + post: + description: 'Create a private, bring-your-own-key provider visible only to your organization. Use its slug as `provider_slug` when creating private endpoints. Requires both the private endpoints and the private providers entitlements. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createPrivateProvider' requestBody: content: application/json: schema: - $ref: '#/components/schemas/UpdatePrivateEndpointParametersRequest' + $ref: '#/components/schemas/CreatePrivateProviderRequest' required: true responses: - '200': + '201': content: application/json: schema: - $ref: '#/components/schemas/PrivateEndpointResponse' - description: 'The endpoint with its new declared parameters' + properties: + data: + $ref: '#/components/schemas/PrivateProvider' + required: + - 'data' + type: 'object' + description: 'The provider was created' '400': content: application/json: @@ -48179,6 +49122,16 @@ paths: schema: $ref: '#/components/schemas/UnprocessableEntityResponse' description: 'Unprocessable Entity - Semantic validation failure' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -48199,41 +49152,44 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Set private endpoint supported parameters' + summary: 'Create a private provider' tags: - - 'Private Endpoints' - x-speakeasy-name-override: 'updateParameters' + - 'Private Providers' + x-speakeasy-name-override: 'create' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/pricing: - put: - description: 'Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy''s default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updatePrivateEndpointPricing' + /private-providers/{slug}: + delete: + description: 'Delete a private provider. Refuses (409) while any private endpoint still runs under it. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deletePrivateProvider' parameters: - - description: 'Stable identifier of the private endpoint.' - in: 'path' - name: 'id' + - in: 'path' + name: 'slug' required: true schema: - description: 'Stable identifier of the private endpoint.' - example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' - format: 'uuid' + example: 'acme' type: 'string' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePrivateEndpointPricingRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PrivateEndpointResponse' - description: 'The endpoint with its new pricing' + properties: + data: + properties: + slug: + description: 'The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`.' + example: 'acme' + type: 'string' + required: + - 'slug' + type: 'object' + required: + - 'data' + type: 'object' + description: 'The provider was deleted' '400': content: application/json: @@ -48304,6 +49260,16 @@ paths: schema: $ref: '#/components/schemas/UnprocessableEntityResponse' description: 'Unprocessable Entity - Semantic validation failure' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -48324,41 +49290,104 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Set private endpoint pricing' + summary: 'Delete a private provider' tags: - - 'Private Endpoints' - x-speakeasy-name-override: 'updatePricing' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/validate: - post: - description: 'Send a live test request to the draft endpoint using the given workspace''s BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'validatePrivateEndpoint' + - 'Private Providers' + x-speakeasy-name-override: 'delete' + get: + description: 'Get one of the organization’s private providers by slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getPrivateProvider' parameters: - - description: 'Stable identifier of the private endpoint.' - in: 'path' - name: 'id' + - in: 'path' + name: 'slug' required: true schema: - description: 'Stable identifier of the private endpoint.' - example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' - format: 'uuid' + example: 'acme' + type: 'string' + responses: + '200': + content: + application/json: + schema: + properties: + data: + $ref: '#/components/schemas/PrivateProvider' + required: + - 'data' + type: 'object' + description: 'The private provider' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a private provider' + tags: + - 'Private Providers' + x-speakeasy-name-override: 'get' + patch: + description: 'Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updatePrivateProvider' + parameters: + - in: 'path' + name: 'slug' + required: true + schema: + example: 'acme' type: 'string' requestBody: content: application/json: schema: - $ref: '#/components/schemas/ValidatePrivateEndpointRequest' + $ref: '#/components/schemas/UpdatePrivateProviderRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PrivateEndpointValidationResponse' - description: 'Validation checks' + properties: + data: + $ref: '#/components/schemas/PrivateProvider' + required: + - 'data' + type: 'object' + description: 'The updated provider' '400': content: application/json: @@ -48429,6 +49458,16 @@ paths: schema: $ref: '#/components/schemas/UnprocessableEntityResponse' description: 'Unprocessable Entity - Semantic validation failure' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -48449,10 +49488,10 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Validate a draft private endpoint' + summary: 'Update a private provider' tags: - - 'Private Endpoints' - x-speakeasy-name-override: 'validate' + - 'Private Providers' + x-speakeasy-name-override: 'update' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" @@ -54240,6 +55279,8 @@ tags: name: 'Presets' - description: 'Private Endpoints endpoints' name: 'Private Endpoints' + - description: 'Private Providers endpoints' + name: 'Private Providers' - description: 'Provider information endpoints' name: 'Providers' - description: 'Rerank endpoints' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 502766317..cbf00ad0d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:961fe90ca2e42e72fb86e11f22da47c0e8e74ec6c7ddf685a736d95a07aa294f - sourceBlobDigest: sha256:d68b5a65adb80192ca07be6d7745a7f1a1f474ef6815a944f65d67cdf4d63683 + sourceRevisionDigest: sha256:861104f222233ca812d803046f52b1cf68eaa984af4f9971987ebdd2b57a40f4 + sourceBlobDigest: sha256:0a780e2128a9aff1aa1ca88b888f57f562ae4f6c5496cf1ba969ab31e8dd1850 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:961fe90ca2e42e72fb86e11f22da47c0e8e74ec6c7ddf685a736d95a07aa294f - sourceBlobDigest: sha256:d68b5a65adb80192ca07be6d7745a7f1a1f474ef6815a944f65d67cdf4d63683 + sourceRevisionDigest: sha256:861104f222233ca812d803046f52b1cf68eaa984af4f9971987ebdd2b57a40f4 + sourceBlobDigest: sha256:0a780e2128a9aff1aa1ca88b888f57f562ae4f6c5496cf1ba969ab31e8dd1850 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:18ea9c9a5ae2c4ffec3b572549123be4453ccd041f6966d489b323498f73d744 + codeSamplesRevisionDigest: sha256:f1e92e462aeac7d4a0bb09b421029ef8551aeab7b67a2b242d612052b34ec7d8 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 0bf7216d3..a5348e867 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3689,4 +3689,14 @@ Based on: ### Generated - [python v1.3.92] . ### Releases -- [PyPI v1.3.92] https://pypi.org/project/openrouter/1.3.92 - . \ No newline at end of file +- [PyPI v1.3.92] https://pypi.org/project/openrouter/1.3.92 - . + +## 2026-10-29 02:21:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.93] . +### Releases +- [PyPI v1.3.93] https://pypi.org/project/openrouter/1.3.93 - . \ No newline at end of file diff --git a/docs/components/createprivateendpointrequest.mdx b/docs/components/createprivateendpointrequest.mdx index f4d87a0c3..890018a1e 100644 --- a/docs/components/createprivateendpointrequest.mdx +++ b/docs/components/createprivateendpointrequest.mdx @@ -15,4 +15,5 @@ title: "CreatePrivateEndpointRequest" | `model_permaslug` | *str* | ✔️ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | | `pricing` | [Optional[components.PrivateEndpointPricing]](../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | | `provider_slug` | *str* | ✔️ | Slug of the upstream provider. | azure | +| `settings` | [Optional[components.UpdatePrivateEndpointSettingsRequest]](../components/updateprivateendpointsettingsrequest.mdx) | ➖ | Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. | \{
"context_length": 128000,
"reasoning": \{
"supported": true
}
} | | `upstream_model_id` | *str* | ✔️ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/createprivateproviderrequest.mdx b/docs/components/createprivateproviderrequest.mdx new file mode 100644 index 000000000..0fba9adc1 --- /dev/null +++ b/docs/components/createprivateproviderrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "CreatePrivateProviderRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. | https://inference.example.com/v1 | +| `data_policy` | [Optional[components.PrivateProviderDataPolicy]](../components/privateproviderdatapolicy.mdx) | ➖ | Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it. | \{
"prompt_retention_days": null,
"retains_prompts": false,
"training": false
} | +| `display_name` | *Optional[str]* | ➖ | Defaults to `name`. | Acme | +| `name` | *str* | ✔️ | Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name. | Acme | +| `slug` | *Optional[str]* | ➖ | 2-64 lowercase letters and numbers, separated by single hyphens. Cannot be changed later. Defaults to the name lowercased, with every run of other characters replaced by a hyphen (`Acme Inference` becomes `acme-inference`). | acme | \ No newline at end of file diff --git a/docs/components/privateendpoint.mdx b/docs/components/privateendpoint.mdx index 042031a5f..f668081e0 100644 --- a/docs/components/privateendpoint.mdx +++ b/docs/components/privateendpoint.mdx @@ -4,20 +4,21 @@ title: "PrivateEndpoint" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `base_url` | *Nullable[str]* | ✔️ | HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | -| `declared_parameters` | List[*str*] | ✔️ | Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared. | [
"temperature",
"seed"
] | -| `declared_region` | [Nullable[components.PrivateEndpointDeclaredRegion]](../components/privateendpointdeclaredregion.mdx) | ✔️ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | -| `declared_zdr` | *Nullable[bool]* | ✔️ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | -| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `max_completion_tokens` | *OptionalNullable[int]* | ➖ | Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. | 131072 | -| `model_name` | *Nullable[str]* | ✔️ | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | -| `model_permaslug` | *str* | ✔️ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | -| `model_slug` | *Nullable[str]* | ✔️ | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | -| `pricing` | [components.PrivateEndpointPricing](../components/privateendpointpricing.mdx) | ✔️ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `provider_name` | *str* | ✔️ | Display name of the upstream provider. | Azure | -| `provider_slug` | *Nullable[str]* | ✔️ | Slug of the upstream provider, or `null` when the provider is no longer listed. | azure | -| `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | ✔️ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | -| `tested_parameters` | List[*str*] | ✔️ | Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes. | [
"tools",
"tool_choice",
"response_format"
] | -| `upstream_model_id` | *str* | ✔️ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `base_url` | *Nullable[str]* | ✔️ | HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `declared_parameters` | List[*str*] | ✔️ | Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared. | [
"temperature",
"seed"
] | +| `declared_region` | [Nullable[components.PrivateEndpointDeclaredRegion]](../components/privateendpointdeclaredregion.mdx) | ✔️ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | +| `declared_zdr` | *Nullable[bool]* | ✔️ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | +| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `max_completion_tokens` | *OptionalNullable[int]* | ➖ | Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. | 131072 | +| `model_name` | *Nullable[str]* | ✔️ | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | +| `model_permaslug` | *str* | ✔️ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `model_slug` | *Nullable[str]* | ✔️ | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | +| `pricing` | [components.PrivateEndpointPricing](../components/privateendpointpricing.mdx) | ✔️ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `provider_name` | *str* | ✔️ | Display name of the upstream provider. | Azure | +| `provider_slug` | *Nullable[str]* | ✔️ | Slug of the upstream provider, or `null` when the provider is no longer listed. | azure | +| `settings` | [components.PrivateEndpointSettings](../components/privateendpointsettings.mdx) | ✔️ | Capabilities and limits routing uses for this endpoint. A new endpoint copies them from the public endpoint for the same model and provider, or from the model, and the owner can change them. Rate limits are not part of this object: a private endpoint is billed to its own upstream key, so request limits stay with the provider. | \{
"completions": \{
"chat": true,
"text": false
},
"context_length": 128000,
"excluded_parameters": [
"logit_bias"
],
"inputs": \{
"audio": false,
"base64_files": null,
"base64_images": true,
"file_urls": null,
"image_urls": true
},
"max_completion_tokens": 16384,
"max_prompt_tokens": null,
"quantization": "bf16",
"reasoning": \{
"return_mechanism": "reasoning",
"supported": true
},
"tool_choice": \{
"auto": true,
"function": false,
"none": true,
"required": true
}
} | +| `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | ✔️ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | +| `tested_parameters` | List[*str*] | ✔️ | Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes. | [
"tools",
"tool_choice",
"response_format"
] | +| `upstream_model_id` | *str* | ✔️ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/privateendpointquantization.mdx b/docs/components/privateendpointquantization.mdx new file mode 100644 index 000000000..83924db54 --- /dev/null +++ b/docs/components/privateendpointquantization.mdx @@ -0,0 +1,32 @@ +--- +title: "PrivateEndpointQuantization" +--- + +Weight precision the deployment runs at; `unknown` when not stated. + +## Example Usage + +```python +from openrouter.components import PrivateEndpointQuantization + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrivateEndpointQuantization = "int4" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"int4"` +- `"int8"` +- `"fp4"` +- `"mxfp4"` +- `"nvfp4"` +- `"fp6"` +- `"fp8"` +- `"mxfp8"` +- `"fp16"` +- `"bf16"` +- `"fp32"` +- `"unknown"` diff --git a/docs/components/privateendpointreasoningreturnmechanism.mdx b/docs/components/privateendpointreasoningreturnmechanism.mdx new file mode 100644 index 000000000..329af60e0 --- /dev/null +++ b/docs/components/privateendpointreasoningreturnmechanism.mdx @@ -0,0 +1,24 @@ +--- +title: "PrivateEndpointReasoningReturnMechanism" +--- + +Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default. + +## Example Usage + +```python +from openrouter.components import PrivateEndpointReasoningReturnMechanism + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrivateEndpointReasoningReturnMechanism = "content-string" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"content-string"` +- `"reasoning-content"` +- `"reasoning"` +- `"none"` diff --git a/docs/components/privateendpointresponse.mdx b/docs/components/privateendpointresponse.mdx index 516d8a54e..35ec3c4fc 100644 --- a/docs/components/privateendpointresponse.mdx +++ b/docs/components/privateendpointresponse.mdx @@ -4,6 +4,6 @@ title: "PrivateEndpointResponse" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [components.PrivateEndpoint](../components/privateendpoint.mdx) | ✔️ | N/A | \{
"base_url": "https://contoso.openai.azure.com",
"declared_parameters": [
"temperature",
"seed"
],
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"max_completion_tokens": 131072,
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"status": "active",
"tested_parameters": [
"tools",
"tool_choice",
"response_format"
],
"upstream_model_id": "gpt-4o-prod"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.PrivateEndpoint](../components/privateendpoint.mdx) | ✔️ | N/A | \{
"base_url": "https://contoso.openai.azure.com",
"declared_parameters": [
"temperature",
"seed"
],
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"max_completion_tokens": 131072,
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"settings": \{
"completions": \{
"chat": true,
"text": false
},
"context_length": 128000,
"excluded_parameters": [
"logit_bias"
],
"inputs": \{
"audio": false,
"base64_files": null,
"base64_images": true,
"file_urls": null,
"image_urls": true
},
"max_completion_tokens": 16384,
"max_prompt_tokens": null,
"quantization": "bf16",
"reasoning": \{
"return_mechanism": "reasoning",
"supported": true
},
"tool_choice": \{
"auto": true,
"function": false,
"none": true,
"required": true
}
},
"status": "active",
"tested_parameters": [
"tools",
"tool_choice",
"response_format"
],
"upstream_model_id": "gpt-4o-prod"
} | \ No newline at end of file diff --git a/docs/components/privateendpointsettings.mdx b/docs/components/privateendpointsettings.mdx new file mode 100644 index 000000000..4f794ebbc --- /dev/null +++ b/docs/components/privateendpointsettings.mdx @@ -0,0 +1,20 @@ +--- +title: "PrivateEndpointSettings" +--- + +Capabilities and limits routing uses for this endpoint. A new endpoint copies them from the public endpoint for the same model and provider, or from the model, and the owner can change them. Rate limits are not part of this object: a private endpoint is billed to its own upstream key, so request limits stay with the provider. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `completions` | [components.PrivateEndpointSettingsCompletions](../components/privateendpointsettingscompletions.mdx) | ✔️ | N/A | | +| `context_length` | *Nullable[int]* | ✔️ | Longest prompt plus completion, in tokens, or `null` to keep the model default. | 128000 | +| `excluded_parameters` | List[[components.PrivateEndpointSettingsExcludedParameter](../components/privateendpointsettingsexcludedparameter.mdx)] | ✔️ | Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter. | [
"logit_bias"
] | +| `inputs` | [components.PrivateEndpointSettingsInputs](../components/privateendpointsettingsinputs.mdx) | ✔️ | N/A | | +| `max_completion_tokens` | *Nullable[int]* | ✔️ | Longest completion the upstream returns, in tokens, or `null` to keep the model default. | 16384 | +| `max_prompt_tokens` | *Nullable[int]* | ✔️ | Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`. | null | +| `quantization` | [components.PrivateEndpointQuantization](../components/privateendpointquantization.mdx) | ✔️ | Weight precision the deployment runs at; `unknown` when not stated. | bf16 | +| `reasoning` | [components.PrivateEndpointSettingsReasoning](../components/privateendpointsettingsreasoning.mdx) | ✔️ | N/A | | +| `tool_choice` | [components.PrivateEndpointSettingsToolChoice](../components/privateendpointsettingstoolchoice.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/components/privateendpointsettingscompletions.mdx b/docs/components/privateendpointsettingscompletions.mdx new file mode 100644 index 000000000..df321f0b6 --- /dev/null +++ b/docs/components/privateendpointsettingscompletions.mdx @@ -0,0 +1,10 @@ +--- +title: "PrivateEndpointSettingsCompletions" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `chat` | *Nullable[bool]* | ✔️ | Serves `/chat/completions`; `null` uses the provider default. | +| `text` | *Nullable[bool]* | ✔️ | Serves `/completions`; `null` uses the provider default. | \ No newline at end of file diff --git a/docs/components/privateendpointsettingsexcludedparameter.mdx b/docs/components/privateendpointsettingsexcludedparameter.mdx new file mode 100644 index 000000000..86fe9ff2d --- /dev/null +++ b/docs/components/privateendpointsettingsexcludedparameter.mdx @@ -0,0 +1,44 @@ +--- +title: "PrivateEndpointSettingsExcludedParameter" +--- + +## Example Usage + +```python +from openrouter.components import PrivateEndpointSettingsExcludedParameter + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrivateEndpointSettingsExcludedParameter = "temperature" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"temperature"` +- `"top_p"` +- `"top_k"` +- `"min_p"` +- `"top_a"` +- `"frequency_penalty"` +- `"presence_penalty"` +- `"repetition_penalty"` +- `"max_tokens"` +- `"max_completion_tokens"` +- `"logit_bias"` +- `"logprobs"` +- `"top_logprobs"` +- `"prediction"` +- `"seed"` +- `"response_format"` +- `"structured_outputs"` +- `"stop"` +- `"tools"` +- `"tool_choice"` +- `"parallel_tool_calls"` +- `"include_reasoning"` +- `"reasoning"` +- `"reasoning_effort"` +- `"web_search_options"` +- `"verbosity"` diff --git a/docs/components/privateendpointsettingsinputs.mdx b/docs/components/privateendpointsettingsinputs.mdx new file mode 100644 index 000000000..cf56496ca --- /dev/null +++ b/docs/components/privateendpointsettingsinputs.mdx @@ -0,0 +1,13 @@ +--- +title: "PrivateEndpointSettingsInputs" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `audio` | *Nullable[bool]* | ✔️ | Accepts audio input. `null` keeps the provider default. | +| `base64_files` | *Nullable[bool]* | ✔️ | Accepts base64 file data. `null` keeps the provider default. | +| `base64_images` | *Nullable[bool]* | ✔️ | Accepts base64 image data. `null` keeps the provider default. | +| `file_urls` | *Nullable[bool]* | ✔️ | Accepts file URLs. `null` keeps the provider default. | +| `image_urls` | *Nullable[bool]* | ✔️ | Accepts image URLs. `null` keeps the provider default. | \ No newline at end of file diff --git a/docs/components/privateendpointsettingsreasoning.mdx b/docs/components/privateendpointsettingsreasoning.mdx new file mode 100644 index 000000000..42e8bb49f --- /dev/null +++ b/docs/components/privateendpointsettingsreasoning.mdx @@ -0,0 +1,10 @@ +--- +title: "PrivateEndpointSettingsReasoning" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `return_mechanism` | [Nullable[components.PrivateEndpointReasoningReturnMechanism]](../components/privateendpointreasoningreturnmechanism.mdx) | ✔️ | Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default. | reasoning | +| `supported` | *bool* | ✔️ | Whether requests with `reasoning` route to this endpoint. | true | \ No newline at end of file diff --git a/docs/components/privateendpointsettingstoolchoice.mdx b/docs/components/privateendpointsettingstoolchoice.mdx new file mode 100644 index 000000000..ffb4229f2 --- /dev/null +++ b/docs/components/privateendpointsettingstoolchoice.mdx @@ -0,0 +1,12 @@ +--- +title: "PrivateEndpointSettingsToolChoice" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `auto` | *bool* | ✔️ | Accepts `tool_choice: "auto"`. | +| `function` | *bool* | ✔️ | Accepts a named function in `tool_choice`. | +| `none` | *bool* | ✔️ | Accepts `tool_choice: "none"`. | +| `required` | *bool* | ✔️ | Accepts `tool_choice: "required"`. | \ No newline at end of file diff --git a/docs/components/privateprovider.mdx b/docs/components/privateprovider.mdx new file mode 100644 index 000000000..e516a1c7c --- /dev/null +++ b/docs/components/privateprovider.mdx @@ -0,0 +1,14 @@ +--- +title: "PrivateProvider" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `base_url` | *Nullable[str]* | ✔️ | HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. | https://inference.example.com/v1 | +| `created_at` | *str* | ✔️ | N/A | | +| `data_policy` | [Nullable[components.PrivateProviderDataPolicy1]](../components/privateproviderdatapolicy1.mdx) | ✔️ | Your declared data policy, or `null` when none was declared. | | +| `display_name` | *str* | ✔️ | N/A | Acme | +| `name` | *str* | ✔️ | Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name. | Acme | +| `slug` | *str* | ✔️ | The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`. | acme | \ No newline at end of file diff --git a/docs/components/privateproviderdatapolicy.mdx b/docs/components/privateproviderdatapolicy.mdx new file mode 100644 index 000000000..3e8025b36 --- /dev/null +++ b/docs/components/privateproviderdatapolicy.mdx @@ -0,0 +1,14 @@ +--- +title: "PrivateProviderDataPolicy" +--- + +Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `prompt_retention_days` | *Nullable[int]* | ✔️ | Days prompts are retained. Must be `null` unless `retains_prompts` is true. | +| `retains_prompts` | *bool* | ✔️ | Whether the provider retains prompts or completions. | +| `training` | *bool* | ✔️ | Whether the provider trains on prompts. | \ No newline at end of file diff --git a/docs/components/privateproviderdatapolicy1.mdx b/docs/components/privateproviderdatapolicy1.mdx new file mode 100644 index 000000000..b0987792c --- /dev/null +++ b/docs/components/privateproviderdatapolicy1.mdx @@ -0,0 +1,14 @@ +--- +title: "PrivateProviderDataPolicy1" +--- + +Your declared data policy, or `null` when none was declared. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `prompt_retention_days` | *Nullable[int]* | ✔️ | Days prompts are retained. Must be `null` unless `retains_prompts` is true. | +| `retains_prompts` | *bool* | ✔️ | Whether the provider retains prompts or completions. | +| `training` | *bool* | ✔️ | Whether the provider trains on prompts. | \ No newline at end of file diff --git a/docs/components/updateprivateendpointrequest.mdx b/docs/components/updateprivateendpointrequest.mdx index a914e9033..89ac9f1e2 100644 --- a/docs/components/updateprivateendpointrequest.mdx +++ b/docs/components/updateprivateendpointrequest.mdx @@ -2,11 +2,17 @@ title: "UpdatePrivateEndpointRequest" --- +Only the fields present change. `base_url`, `upstream_model_id`, `declared_zdr` and `declared_region` are accepted on a draft only; `pricing` and `declared_parameters` replace their value; `settings` is itself a partial update where `null` clears a limit or restores the provider default. + + ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | -| `declared_region` | [OptionalNullable[components.UpdatePrivateEndpointRequestDeclaredRegion]](../components/updateprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | -| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | -| `upstream_model_id` | *str* | ✔️ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../components/privateendpointdeclaredparameter.mdx)] | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | +| `declared_region` | [OptionalNullable[components.UpdatePrivateEndpointRequestDeclaredRegion]](../components/updateprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | +| `pricing` | [Optional[components.PrivateEndpointPricing]](../components/privateendpointpricing.mdx) | ➖ | N/A | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `settings` | [Optional[components.UpdatePrivateEndpointSettingsRequest]](../components/updateprivateendpointsettingsrequest.mdx) | ➖ | N/A | \{
"context_length": 128000,
"reasoning": \{
"supported": true
}
} | +| `upstream_model_id` | *Optional[str]* | ➖ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/updateprivateendpointsettingsrequest.mdx b/docs/components/updateprivateendpointsettingsrequest.mdx new file mode 100644 index 000000000..0f5e5ee1d --- /dev/null +++ b/docs/components/updateprivateendpointsettingsrequest.mdx @@ -0,0 +1,20 @@ +--- +title: "UpdatePrivateEndpointSettingsRequest" +--- + +Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `completions` | [Optional[components.UpdatePrivateEndpointSettingsRequestCompletions]](../components/updateprivateendpointsettingsrequestcompletions.mdx) | ➖ | N/A | | +| `context_length` | *OptionalNullable[int]* | ➖ | Longest prompt plus completion, in tokens, or `null` to keep the model default. | 128000 | +| `excluded_parameters` | List[[components.UpdatePrivateEndpointSettingsRequestExcludedParameter](../components/updateprivateendpointsettingsrequestexcludedparameter.mdx)] | ➖ | Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter. | [
"logit_bias"
] | +| `inputs` | [Optional[components.UpdatePrivateEndpointSettingsRequestInputs]](../components/updateprivateendpointsettingsrequestinputs.mdx) | ➖ | N/A | | +| `max_completion_tokens` | *OptionalNullable[int]* | ➖ | Longest completion the upstream returns, in tokens, or `null` to keep the model default. | 16384 | +| `max_prompt_tokens` | *OptionalNullable[int]* | ➖ | Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`. | null | +| `quantization` | [Optional[components.PrivateEndpointQuantization]](../components/privateendpointquantization.mdx) | ➖ | Weight precision the deployment runs at; `unknown` when not stated. | bf16 | +| `reasoning` | [Optional[components.UpdatePrivateEndpointSettingsRequestReasoning]](../components/updateprivateendpointsettingsrequestreasoning.mdx) | ➖ | N/A | | +| `tool_choice` | [Optional[components.UpdatePrivateEndpointSettingsRequestToolChoice]](../components/updateprivateendpointsettingsrequesttoolchoice.mdx) | ➖ | N/A | | \ No newline at end of file diff --git a/docs/components/updateprivateendpointsettingsrequestcompletions.mdx b/docs/components/updateprivateendpointsettingsrequestcompletions.mdx new file mode 100644 index 000000000..108773135 --- /dev/null +++ b/docs/components/updateprivateendpointsettingsrequestcompletions.mdx @@ -0,0 +1,10 @@ +--- +title: "UpdatePrivateEndpointSettingsRequestCompletions" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `chat` | *OptionalNullable[bool]* | ➖ | Serves `/chat/completions`; `null` uses the provider default. | +| `text` | *OptionalNullable[bool]* | ➖ | Serves `/completions`; `null` uses the provider default. | \ No newline at end of file diff --git a/docs/components/updateprivateendpointsettingsrequestexcludedparameter.mdx b/docs/components/updateprivateendpointsettingsrequestexcludedparameter.mdx new file mode 100644 index 000000000..bfc86e03a --- /dev/null +++ b/docs/components/updateprivateendpointsettingsrequestexcludedparameter.mdx @@ -0,0 +1,44 @@ +--- +title: "UpdatePrivateEndpointSettingsRequestExcludedParameter" +--- + +## Example Usage + +```python +from openrouter.components import UpdatePrivateEndpointSettingsRequestExcludedParameter + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: UpdatePrivateEndpointSettingsRequestExcludedParameter = "temperature" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"temperature"` +- `"top_p"` +- `"top_k"` +- `"min_p"` +- `"top_a"` +- `"frequency_penalty"` +- `"presence_penalty"` +- `"repetition_penalty"` +- `"max_tokens"` +- `"max_completion_tokens"` +- `"logit_bias"` +- `"logprobs"` +- `"top_logprobs"` +- `"prediction"` +- `"seed"` +- `"response_format"` +- `"structured_outputs"` +- `"stop"` +- `"tools"` +- `"tool_choice"` +- `"parallel_tool_calls"` +- `"include_reasoning"` +- `"reasoning"` +- `"reasoning_effort"` +- `"web_search_options"` +- `"verbosity"` diff --git a/docs/components/updateprivateendpointsettingsrequestinputs.mdx b/docs/components/updateprivateendpointsettingsrequestinputs.mdx new file mode 100644 index 000000000..71444757b --- /dev/null +++ b/docs/components/updateprivateendpointsettingsrequestinputs.mdx @@ -0,0 +1,13 @@ +--- +title: "UpdatePrivateEndpointSettingsRequestInputs" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `audio` | *OptionalNullable[bool]* | ➖ | Accepts audio input. `null` keeps the provider default. | +| `base64_files` | *OptionalNullable[bool]* | ➖ | Accepts base64 file data. `null` keeps the provider default. | +| `base64_images` | *OptionalNullable[bool]* | ➖ | Accepts base64 image data. `null` keeps the provider default. | +| `file_urls` | *OptionalNullable[bool]* | ➖ | Accepts file URLs. `null` keeps the provider default. | +| `image_urls` | *OptionalNullable[bool]* | ➖ | Accepts image URLs. `null` keeps the provider default. | \ No newline at end of file diff --git a/docs/components/updateprivateendpointsettingsrequestreasoning.mdx b/docs/components/updateprivateendpointsettingsrequestreasoning.mdx new file mode 100644 index 000000000..979cebc36 --- /dev/null +++ b/docs/components/updateprivateendpointsettingsrequestreasoning.mdx @@ -0,0 +1,10 @@ +--- +title: "UpdatePrivateEndpointSettingsRequestReasoning" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `return_mechanism` | [OptionalNullable[components.PrivateEndpointReasoningReturnMechanism]](../components/privateendpointreasoningreturnmechanism.mdx) | ➖ | Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default. | reasoning | +| `supported` | *Optional[bool]* | ➖ | Whether requests with `reasoning` route to this endpoint. | true | \ No newline at end of file diff --git a/docs/components/updateprivateendpointsettingsrequesttoolchoice.mdx b/docs/components/updateprivateendpointsettingsrequesttoolchoice.mdx new file mode 100644 index 000000000..22b45d12d --- /dev/null +++ b/docs/components/updateprivateendpointsettingsrequesttoolchoice.mdx @@ -0,0 +1,12 @@ +--- +title: "UpdatePrivateEndpointSettingsRequestToolChoice" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `auto` | *Optional[bool]* | ➖ | Accepts `tool_choice: "auto"`. | +| `function` | *Optional[bool]* | ➖ | Accepts a named function in `tool_choice`. | +| `none` | *Optional[bool]* | ➖ | Accepts `tool_choice: "none"`. | +| `required` | *Optional[bool]* | ➖ | Accepts `tool_choice: "required"`. | \ No newline at end of file diff --git a/docs/components/updateprivateproviderrequest.mdx b/docs/components/updateprivateproviderrequest.mdx new file mode 100644 index 000000000..27e839382 --- /dev/null +++ b/docs/components/updateprivateproviderrequest.mdx @@ -0,0 +1,11 @@ +--- +title: "UpdatePrivateProviderRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. | https://inference.example.com/v1 | +| `data_policy` | [Optional[components.UpdatePrivateProviderRequestDataPolicy]](../components/updateprivateproviderrequestdatapolicy.mdx) | ➖ | N/A | | +| `display_name` | *Optional[str]* | ➖ | N/A | Acme | \ No newline at end of file diff --git a/docs/components/updateprivateproviderrequestdatapolicy.mdx b/docs/components/updateprivateproviderrequestdatapolicy.mdx new file mode 100644 index 000000000..15a807bfd --- /dev/null +++ b/docs/components/updateprivateproviderrequestdatapolicy.mdx @@ -0,0 +1,11 @@ +--- +title: "UpdatePrivateProviderRequestDataPolicy" +--- + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `prompt_retention_days` | *OptionalNullable[int]* | ➖ | Days prompts are retained. Must be `null` unless `retains_prompts` is true. | +| `retains_prompts` | *Optional[bool]* | ➖ | Whether the provider retains prompts or completions. | +| `training` | *Optional[bool]* | ➖ | Whether the provider trains on prompts. | \ No newline at end of file diff --git a/docs/operations/createprivateproviderglobals.mdx b/docs/operations/createprivateproviderglobals.mdx new file mode 100644 index 000000000..ebb2f4ae7 --- /dev/null +++ b/docs/operations/createprivateproviderglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "CreatePrivateProviderGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createprivateproviderrequest.mdx b/docs/operations/createprivateproviderrequest.mdx new file mode 100644 index 000000000..3d14c6582 --- /dev/null +++ b/docs/operations/createprivateproviderrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "CreatePrivateProviderRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `create_private_provider_request` | [components.CreatePrivateProviderRequest](../components/createprivateproviderrequest.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/operations/createprivateproviderresponse.mdx b/docs/operations/createprivateproviderresponse.mdx new file mode 100644 index 000000000..87fe5420d --- /dev/null +++ b/docs/operations/createprivateproviderresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "CreatePrivateProviderResponse" +--- + +The provider was created + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.PrivateProvider](../components/privateprovider.mdx) | ✔️ | N/A | \{
"base_url": "https://inference.example.com/v1",
"created_at": "2026-10-06T12:00:00.000Z",
"data_policy": \{
"prompt_retention_days": null,
"retains_prompts": false,
"training": false
},
"display_name": "Acme",
"name": "Acme",
"slug": "acme"
} | \ No newline at end of file diff --git a/docs/operations/deleteprivateproviderdata.mdx b/docs/operations/deleteprivateproviderdata.mdx new file mode 100644 index 000000000..0610240f7 --- /dev/null +++ b/docs/operations/deleteprivateproviderdata.mdx @@ -0,0 +1,9 @@ +--- +title: "DeletePrivateProviderData" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `slug` | *str* | ✔️ | The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`. | acme | \ No newline at end of file diff --git a/docs/operations/deleteprivateproviderglobals.mdx b/docs/operations/deleteprivateproviderglobals.mdx new file mode 100644 index 000000000..09a8fb2b5 --- /dev/null +++ b/docs/operations/deleteprivateproviderglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "DeletePrivateProviderGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/deleteprivateproviderrequest.mdx b/docs/operations/deleteprivateproviderrequest.mdx new file mode 100644 index 000000000..1ce35ebb3 --- /dev/null +++ b/docs/operations/deleteprivateproviderrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "DeletePrivateProviderRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `slug` | *str* | ✔️ | N/A | acme | \ No newline at end of file diff --git a/docs/operations/deleteprivateproviderresponse.mdx b/docs/operations/deleteprivateproviderresponse.mdx new file mode 100644 index 000000000..8835d63ee --- /dev/null +++ b/docs/operations/deleteprivateproviderresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "DeletePrivateProviderResponse" +--- + +The provider was deleted + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `data` | [operations.DeletePrivateProviderData](../operations/deleteprivateproviderdata.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/operations/getprivateproviderglobals.mdx b/docs/operations/getprivateproviderglobals.mdx new file mode 100644 index 000000000..2d3e57fc4 --- /dev/null +++ b/docs/operations/getprivateproviderglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "GetPrivateProviderGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getprivateproviderrequest.mdx b/docs/operations/getprivateproviderrequest.mdx new file mode 100644 index 000000000..47bccd5fe --- /dev/null +++ b/docs/operations/getprivateproviderrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "GetPrivateProviderRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `slug` | *str* | ✔️ | N/A | acme | \ No newline at end of file diff --git a/docs/operations/getprivateproviderresponse.mdx b/docs/operations/getprivateproviderresponse.mdx new file mode 100644 index 000000000..3ff04d8ae --- /dev/null +++ b/docs/operations/getprivateproviderresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "GetPrivateProviderResponse" +--- + +The private provider + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.PrivateProvider](../components/privateprovider.mdx) | ✔️ | N/A | \{
"base_url": "https://inference.example.com/v1",
"created_at": "2026-10-06T12:00:00.000Z",
"data_policy": \{
"prompt_retention_days": null,
"retains_prompts": false,
"training": false
},
"display_name": "Acme",
"name": "Acme",
"slug": "acme"
} | \ No newline at end of file diff --git a/docs/operations/listprivateprovidersglobals.mdx b/docs/operations/listprivateprovidersglobals.mdx new file mode 100644 index 000000000..283c97788 --- /dev/null +++ b/docs/operations/listprivateprovidersglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ListPrivateProvidersGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listprivateprovidersrequest.mdx b/docs/operations/listprivateprovidersrequest.mdx new file mode 100644 index 000000000..f85e9fce8 --- /dev/null +++ b/docs/operations/listprivateprovidersrequest.mdx @@ -0,0 +1,11 @@ +--- +title: "ListPrivateProvidersRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listprivateprovidersresponse.mdx b/docs/operations/listprivateprovidersresponse.mdx new file mode 100644 index 000000000..1e9f3514b --- /dev/null +++ b/docs/operations/listprivateprovidersresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "ListPrivateProvidersResponse" +--- + +Private providers for the organization + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `data` | List[[components.PrivateProvider](../components/privateprovider.mdx)] | ✔️ | N/A | \ No newline at end of file diff --git a/docs/operations/updateprivateendpointrequest.mdx b/docs/operations/updateprivateendpointrequest.mdx index cf7c8e3ae..32a67482a 100644 --- a/docs/operations/updateprivateendpointrequest.mdx +++ b/docs/operations/updateprivateendpointrequest.mdx @@ -10,4 +10,4 @@ title: "UpdatePrivateEndpointRequest" | `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `update_private_endpoint_request` | [components.UpdatePrivateEndpointRequest](../components/updateprivateendpointrequest.mdx) | ✔️ | N/A | | \ No newline at end of file +| `update_private_endpoint_request` | [components.UpdatePrivateEndpointRequest](../components/updateprivateendpointrequest.mdx) | ✔️ | N/A | \{
"declared_parameters": [
"seed"
],
"settings": \{
"context_length": 128000
}
} | \ No newline at end of file diff --git a/docs/operations/updateprivateproviderglobals.mdx b/docs/operations/updateprivateproviderglobals.mdx new file mode 100644 index 000000000..c0584b0ba --- /dev/null +++ b/docs/operations/updateprivateproviderglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "UpdatePrivateProviderGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateprivateproviderrequest.mdx b/docs/operations/updateprivateproviderrequest.mdx new file mode 100644 index 000000000..54fb50257 --- /dev/null +++ b/docs/operations/updateprivateproviderrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "UpdatePrivateProviderRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `slug` | *str* | ✔️ | N/A | acme | +| `update_private_provider_request` | [components.UpdatePrivateProviderRequest](../components/updateprivateproviderrequest.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/operations/updateprivateproviderresponse.mdx b/docs/operations/updateprivateproviderresponse.mdx new file mode 100644 index 000000000..cf3260159 --- /dev/null +++ b/docs/operations/updateprivateproviderresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "UpdatePrivateProviderResponse" +--- + +The updated provider + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.PrivateProvider](../components/privateprovider.mdx) | ✔️ | N/A | \{
"base_url": "https://inference.example.com/v1",
"created_at": "2026-10-06T12:00:00.000Z",
"data_policy": \{
"prompt_retention_days": null,
"retains_prompts": false,
"training": false
},
"display_name": "Acme",
"name": "Acme",
"slug": "acme"
} | \ No newline at end of file diff --git a/docs/sdks/privateendpoints/README.mdx b/docs/sdks/privateendpoints/README.mdx index 022a093e1..4b496d94c 100644 --- a/docs/sdks/privateendpoints/README.mdx +++ b/docs/sdks/privateendpoints/README.mdx @@ -13,12 +13,12 @@ Private Endpoints endpoints * [create](#create) - Create a private endpoint * [delete](#delete) - Delete a private endpoint * [get](#get) - Get a private endpoint -* [update](#update) - Update a draft private endpoint +* [update](#update) - Update a private endpoint * [activate](#activate) - Activate a validated private endpoint * [disable](#disable) - Disable a private endpoint * [enable](#enable) - Enable a private endpoint -* [update_parameters](#update_parameters) - Set private endpoint supported parameters -* [update_pricing](#update_pricing) - Set private endpoint pricing +* [~~update_parameters~~](#update_parameters) - Set private endpoint supported parameters (deprecated) ⚠️ **Deprecated** +* [~~update_pricing~~](#update_pricing) - Set private endpoint pricing (deprecated) ⚠️ **Deprecated** * [validate](#validate) - Validate a draft private endpoint ## list @@ -112,6 +112,7 @@ with OpenRouter( | `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | | `max_completion_tokens` | *Optional[int]* | ➖ | Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. | 131072 | | `pricing` | [Optional[components.PrivateEndpointPricing]](../../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `settings` | [Optional[components.UpdatePrivateEndpointSettingsRequest]](../../components/updateprivateendpointsettingsrequest.mdx) | ➖ | Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. | \{
"context_length": 128000,
"reasoning": \{
"supported": true
}
} | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -245,7 +246,7 @@ with OpenRouter( ## update -Replace a draft endpoint's upstream configuration: send `upstream_model_id`, and `base_url` to change it (an omitted `base_url` keeps the stored one). Omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes. Any change clears earlier validation. Active endpoints return 409; delete and re-create them instead. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `upstream_model_id`, `base_url`, `declared_zdr` and `declared_region` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any upstream change clears earlier validation. Naming an upstream field on an active endpoint returns 409 `already_active` and writes nothing; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage @@ -261,7 +262,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.private_endpoints.update(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", upstream_model_id="gpt-4o-prod") + res = open_router.private_endpoints.update(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11") # Handle response print(res) @@ -270,17 +271,20 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `upstream_model_id` | *str* | ✔️ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | -| `declared_region` | [OptionalNullable[components.UpdatePrivateEndpointRequestDeclaredRegion]](../../components/updateprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | -| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../../components/privateendpointdeclaredparameter.mdx)] | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | +| `declared_region` | [OptionalNullable[components.UpdatePrivateEndpointRequestDeclaredRegion]](../../components/updateprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | +| `pricing` | [Optional[components.PrivateEndpointPricing]](../../components/privateendpointpricing.mdx) | ➖ | N/A | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `settings` | [Optional[components.UpdatePrivateEndpointSettingsRequest]](../../components/updateprivateendpointsettingsrequest.mdx) | ➖ | N/A | \{
"context_length": 128000,
"reasoning": \{
"supported": true
}
} | +| `upstream_model_id` | *Optional[str]* | ➖ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -463,9 +467,11 @@ with OpenRouter( | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | -## update_parameters +## ~~update_parameters~~ -Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage @@ -521,9 +527,11 @@ with OpenRouter( | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | -## update_pricing +## ~~update_pricing~~ + +Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required. -Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy's default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required. +> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage diff --git a/docs/sdks/privateproviders/README.mdx b/docs/sdks/privateproviders/README.mdx new file mode 100644 index 000000000..8840f2ed0 --- /dev/null +++ b/docs/sdks/privateproviders/README.mdx @@ -0,0 +1,284 @@ +--- +title: "Private Providers" +description: "Private Providers endpoints" +--- + +## Overview + +Private Providers endpoints + +### Available Operations + +* [list](#list) - List private providers +* [create](#create) - Create a private provider +* [delete](#delete) - Delete a private provider +* [get](#get) - Get a private provider +* [update](#update) - Update a private provider + +## list + +List the organization's private providers. Requires the private endpoints entitlement. [Management key](/docs/guides/overview/auth/management-api-keys) 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.private_providers.list() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.ListPrivateProvidersResponse](../../operations/listprivateprovidersresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create + +Create a private, bring-your-own-key provider visible only to your organization. Use its slug as `provider_slug` when creating private endpoints. Requires both the private endpoints and the private providers entitlements. [Management key](/docs/guides/overview/auth/management-api-keys) 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.private_providers.create(name="Acme") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | ✔️ | Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name. | Acme | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. | https://inference.example.com/v1 | +| `data_policy` | [Optional[components.PrivateProviderDataPolicy]](../../components/privateproviderdatapolicy.mdx) | ➖ | Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it. | \{
"prompt_retention_days": null,
"retains_prompts": false,
"training": false
} | +| `display_name` | *Optional[str]* | ➖ | Defaults to `name`. | Acme | +| `slug` | *Optional[str]* | ➖ | 2-64 lowercase letters and numbers, separated by single hyphens. Cannot be changed later. Defaults to the name lowercased, with every run of other characters replaced by a hyphen (`Acme Inference` becomes `acme-inference`). | acme | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.CreatePrivateProviderResponse](../../operations/createprivateproviderresponse.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.UnprocessableEntityResponseError | 422 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete + +Delete a private provider. Refuses (409) while any private endpoint still runs under it. [Management key](/docs/guides/overview/auth/management-api-keys) 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.private_providers.delete(slug="acme") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `slug` | *str* | ✔️ | N/A | acme | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.DeletePrivateProviderResponse](../../operations/deleteprivateproviderresponse.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.UnprocessableEntityResponseError | 422 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## get + +Get one of the organization’s private providers by slug. [Management key](/docs/guides/overview/auth/management-api-keys) 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.private_providers.get(slug="acme") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `slug` | *str* | ✔️ | N/A | acme | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.GetPrivateProviderResponse](../../operations/getprivateproviderresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## update + +Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) 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.private_providers.update(slug="acme") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `slug` | *str* | ✔️ | N/A | acme | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. | https://inference.example.com/v1 | +| `data_policy` | [Optional[components.UpdatePrivateProviderRequestDataPolicy]](../../components/updateprivateproviderrequestdatapolicy.mdx) | ➖ | N/A | | +| `display_name` | *Optional[str]* | ➖ | N/A | Acme | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.UpdatePrivateProviderResponse](../../operations/updateprivateproviderresponse.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.UnprocessableEntityResponseError | 422 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index bf446a40e..fa864346c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.92" +version = "1.3.93" 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 9530904ce..f0a3b5ff8 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.92" +__version__: str = "1.3.93" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.92 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.93 2.950.13 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 f52f50ac4..7ddf8fc90 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1518,6 +1518,10 @@ CreatePrivateEndpointValidationFailedResponseError, CreatePrivateEndpointValidationFailedResponseErrorTypedDict, ) + from .createprivateproviderrequest import ( + CreatePrivateProviderRequest, + CreatePrivateProviderRequestTypedDict, + ) from .createscimgroupmappingrequest import ( CreateScimGroupMappingRequest, CreateScimGroupMappingRequestRole, @@ -3498,10 +3502,27 @@ PrivateEndpointPricing, PrivateEndpointPricingTypedDict, ) + from .privateendpointquantization import PrivateEndpointQuantization + from .privateendpointreasoningreturnmechanism import ( + PrivateEndpointReasoningReturnMechanism, + ) from .privateendpointresponse import ( PrivateEndpointResponse, PrivateEndpointResponseTypedDict, ) + from .privateendpointsettings import ( + PrivateEndpointSettings, + PrivateEndpointSettingsCompletions, + PrivateEndpointSettingsCompletionsTypedDict, + PrivateEndpointSettingsExcludedParameter, + PrivateEndpointSettingsInputs, + PrivateEndpointSettingsInputsTypedDict, + PrivateEndpointSettingsReasoning, + PrivateEndpointSettingsReasoningTypedDict, + PrivateEndpointSettingsToolChoice, + PrivateEndpointSettingsToolChoiceTypedDict, + PrivateEndpointSettingsTypedDict, + ) from .privateendpointstatus import PrivateEndpointStatus from .privateendpointsummary import ( PrivateEndpointSummary, @@ -3519,6 +3540,16 @@ PrivateEndpointValidationResponse, PrivateEndpointValidationResponseTypedDict, ) + from .privateprovider import ( + PrivateProvider, + PrivateProviderDataPolicy1, + PrivateProviderDataPolicy1TypedDict, + PrivateProviderTypedDict, + ) + from .privateproviderdatapolicy import ( + PrivateProviderDataPolicy, + PrivateProviderDataPolicyTypedDict, + ) from .promptcachebreakpoint import ( PromptCacheBreakpoint, PromptCacheBreakpointMode, @@ -4210,6 +4241,25 @@ UpdatePrivateEndpointRequestDeclaredRegion, UpdatePrivateEndpointRequestTypedDict, ) + from .updateprivateendpointsettingsrequest import ( + UpdatePrivateEndpointSettingsRequest, + UpdatePrivateEndpointSettingsRequestCompletions, + UpdatePrivateEndpointSettingsRequestCompletionsTypedDict, + UpdatePrivateEndpointSettingsRequestExcludedParameter, + UpdatePrivateEndpointSettingsRequestInputs, + UpdatePrivateEndpointSettingsRequestInputsTypedDict, + UpdatePrivateEndpointSettingsRequestReasoning, + UpdatePrivateEndpointSettingsRequestReasoningTypedDict, + UpdatePrivateEndpointSettingsRequestToolChoice, + UpdatePrivateEndpointSettingsRequestToolChoiceTypedDict, + UpdatePrivateEndpointSettingsRequestTypedDict, + ) + from .updateprivateproviderrequest import ( + UpdatePrivateProviderRequest, + UpdatePrivateProviderRequestDataPolicy, + UpdatePrivateProviderRequestDataPolicyTypedDict, + UpdatePrivateProviderRequestTypedDict, + ) from .updatescimgroupmappingrequest import ( UpdateScimGroupMappingRequest, UpdateScimGroupMappingRequestRole, @@ -5484,6 +5534,8 @@ "CreatePrivateEndpointValidationFailedResponseDataTypedDict", "CreatePrivateEndpointValidationFailedResponseError", "CreatePrivateEndpointValidationFailedResponseErrorTypedDict", + "CreatePrivateProviderRequest", + "CreatePrivateProviderRequestTypedDict", "CreateScimGroupMappingRequest", "CreateScimGroupMappingRequestRole", "CreateScimGroupMappingRequestTypedDict", @@ -6890,8 +6942,21 @@ "PrivateEndpointParameterCheckTypedDict", "PrivateEndpointPricing", "PrivateEndpointPricingTypedDict", + "PrivateEndpointQuantization", + "PrivateEndpointReasoningReturnMechanism", "PrivateEndpointResponse", "PrivateEndpointResponseTypedDict", + "PrivateEndpointSettings", + "PrivateEndpointSettingsCompletions", + "PrivateEndpointSettingsCompletionsTypedDict", + "PrivateEndpointSettingsExcludedParameter", + "PrivateEndpointSettingsInputs", + "PrivateEndpointSettingsInputsTypedDict", + "PrivateEndpointSettingsReasoning", + "PrivateEndpointSettingsReasoningTypedDict", + "PrivateEndpointSettingsToolChoice", + "PrivateEndpointSettingsToolChoiceTypedDict", + "PrivateEndpointSettingsTypedDict", "PrivateEndpointStatus", "PrivateEndpointSummary", "PrivateEndpointSummaryTypedDict", @@ -6902,6 +6967,12 @@ "PrivateEndpointValidationResponse", "PrivateEndpointValidationResponseTypedDict", "PrivateEndpointValidationTypedDict", + "PrivateProvider", + "PrivateProviderDataPolicy", + "PrivateProviderDataPolicy1", + "PrivateProviderDataPolicy1TypedDict", + "PrivateProviderDataPolicyTypedDict", + "PrivateProviderTypedDict", "Profile", "PromptCacheBreakpoint", "PromptCacheBreakpointMode", @@ -7562,6 +7633,21 @@ "UpdatePrivateEndpointRequest", "UpdatePrivateEndpointRequestDeclaredRegion", "UpdatePrivateEndpointRequestTypedDict", + "UpdatePrivateEndpointSettingsRequest", + "UpdatePrivateEndpointSettingsRequestCompletions", + "UpdatePrivateEndpointSettingsRequestCompletionsTypedDict", + "UpdatePrivateEndpointSettingsRequestExcludedParameter", + "UpdatePrivateEndpointSettingsRequestInputs", + "UpdatePrivateEndpointSettingsRequestInputsTypedDict", + "UpdatePrivateEndpointSettingsRequestReasoning", + "UpdatePrivateEndpointSettingsRequestReasoningTypedDict", + "UpdatePrivateEndpointSettingsRequestToolChoice", + "UpdatePrivateEndpointSettingsRequestToolChoiceTypedDict", + "UpdatePrivateEndpointSettingsRequestTypedDict", + "UpdatePrivateProviderRequest", + "UpdatePrivateProviderRequestDataPolicy", + "UpdatePrivateProviderRequestDataPolicyTypedDict", + "UpdatePrivateProviderRequestTypedDict", "UpdateScimGroupMappingRequest", "UpdateScimGroupMappingRequestRole", "UpdateScimGroupMappingRequestTypedDict", @@ -8780,6 +8866,8 @@ "CreatePrivateEndpointValidationFailedResponseDataTypedDict": ".createprivateendpointvalidationfailedresponse_error", "CreatePrivateEndpointValidationFailedResponseError": ".createprivateendpointvalidationfailedresponse_error", "CreatePrivateEndpointValidationFailedResponseErrorTypedDict": ".createprivateendpointvalidationfailedresponse_error", + "CreatePrivateProviderRequest": ".createprivateproviderrequest", + "CreatePrivateProviderRequestTypedDict": ".createprivateproviderrequest", "CreateScimGroupMappingRequest": ".createscimgroupmappingrequest", "CreateScimGroupMappingRequestRole": ".createscimgroupmappingrequest", "CreateScimGroupMappingRequestTypedDict": ".createscimgroupmappingrequest", @@ -10281,8 +10369,21 @@ "PrivateEndpointParameterCheckTypedDict": ".privateendpointparametercheck", "PrivateEndpointPricing": ".privateendpointpricing", "PrivateEndpointPricingTypedDict": ".privateendpointpricing", + "PrivateEndpointQuantization": ".privateendpointquantization", + "PrivateEndpointReasoningReturnMechanism": ".privateendpointreasoningreturnmechanism", "PrivateEndpointResponse": ".privateendpointresponse", "PrivateEndpointResponseTypedDict": ".privateendpointresponse", + "PrivateEndpointSettings": ".privateendpointsettings", + "PrivateEndpointSettingsCompletions": ".privateendpointsettings", + "PrivateEndpointSettingsCompletionsTypedDict": ".privateendpointsettings", + "PrivateEndpointSettingsExcludedParameter": ".privateendpointsettings", + "PrivateEndpointSettingsInputs": ".privateendpointsettings", + "PrivateEndpointSettingsInputsTypedDict": ".privateendpointsettings", + "PrivateEndpointSettingsReasoning": ".privateendpointsettings", + "PrivateEndpointSettingsReasoningTypedDict": ".privateendpointsettings", + "PrivateEndpointSettingsToolChoice": ".privateendpointsettings", + "PrivateEndpointSettingsToolChoiceTypedDict": ".privateendpointsettings", + "PrivateEndpointSettingsTypedDict": ".privateendpointsettings", "PrivateEndpointStatus": ".privateendpointstatus", "PrivateEndpointSummary": ".privateendpointsummary", "PrivateEndpointSummaryTypedDict": ".privateendpointsummary", @@ -10292,6 +10393,12 @@ "PrivateEndpointValidationNullableTypedDict": ".privateendpointvalidationnullable", "PrivateEndpointValidationResponse": ".privateendpointvalidationresponse", "PrivateEndpointValidationResponseTypedDict": ".privateendpointvalidationresponse", + "PrivateProvider": ".privateprovider", + "PrivateProviderDataPolicy1": ".privateprovider", + "PrivateProviderDataPolicy1TypedDict": ".privateprovider", + "PrivateProviderTypedDict": ".privateprovider", + "PrivateProviderDataPolicy": ".privateproviderdatapolicy", + "PrivateProviderDataPolicyTypedDict": ".privateproviderdatapolicy", "PromptCacheBreakpoint": ".promptcachebreakpoint", "PromptCacheBreakpointMode": ".promptcachebreakpoint", "PromptCacheBreakpointTypedDict": ".promptcachebreakpoint", @@ -10790,6 +10897,21 @@ "UpdatePrivateEndpointRequest": ".updateprivateendpointrequest", "UpdatePrivateEndpointRequestDeclaredRegion": ".updateprivateendpointrequest", "UpdatePrivateEndpointRequestTypedDict": ".updateprivateendpointrequest", + "UpdatePrivateEndpointSettingsRequest": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestCompletions": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestCompletionsTypedDict": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestExcludedParameter": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestInputs": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestInputsTypedDict": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestReasoning": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestReasoningTypedDict": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestToolChoice": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestToolChoiceTypedDict": ".updateprivateendpointsettingsrequest", + "UpdatePrivateEndpointSettingsRequestTypedDict": ".updateprivateendpointsettingsrequest", + "UpdatePrivateProviderRequest": ".updateprivateproviderrequest", + "UpdatePrivateProviderRequestDataPolicy": ".updateprivateproviderrequest", + "UpdatePrivateProviderRequestDataPolicyTypedDict": ".updateprivateproviderrequest", + "UpdatePrivateProviderRequestTypedDict": ".updateprivateproviderrequest", "UpdateScimGroupMappingRequest": ".updatescimgroupmappingrequest", "UpdateScimGroupMappingRequestRole": ".updatescimgroupmappingrequest", "UpdateScimGroupMappingRequestTypedDict": ".updatescimgroupmappingrequest", diff --git a/src/openrouter/components/createprivateendpointrequest.py b/src/openrouter/components/createprivateendpointrequest.py index 5cbb248c7..f34960b6e 100644 --- a/src/openrouter/components/createprivateendpointrequest.py +++ b/src/openrouter/components/createprivateendpointrequest.py @@ -10,6 +10,10 @@ PrivateEndpointPricing, PrivateEndpointPricingTypedDict, ) +from .updateprivateendpointsettingsrequest import ( + UpdatePrivateEndpointSettingsRequest, + UpdatePrivateEndpointSettingsRequestTypedDict, +) from openrouter.types import ( BaseModel, Nullable, @@ -55,6 +59,8 @@ class CreatePrivateEndpointRequestTypedDict(TypedDict): r"""Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.""" pricing: NotRequired[PrivateEndpointPricingTypedDict] r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + settings: NotRequired[UpdatePrivateEndpointSettingsRequestTypedDict] + r"""Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values.""" class CreatePrivateEndpointRequest(BaseModel): @@ -90,6 +96,9 @@ class CreatePrivateEndpointRequest(BaseModel): pricing: Optional[PrivateEndpointPricing] = None r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + settings: Optional[UpdatePrivateEndpointSettingsRequest] = None + r"""Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -101,6 +110,7 @@ def serialize_model(self, handler): "declared_zdr", "max_completion_tokens", "pricing", + "settings", ] ) nullable_fields = set(["declared_region", "declared_zdr"]) diff --git a/src/openrouter/components/createprivateproviderrequest.py b/src/openrouter/components/createprivateproviderrequest.py new file mode 100644 index 000000000..2feb021cd --- /dev/null +++ b/src/openrouter/components/createprivateproviderrequest.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateproviderdatapolicy import ( + PrivateProviderDataPolicy, + PrivateProviderDataPolicyTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CreatePrivateProviderRequestTypedDict(TypedDict): + name: str + r"""Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name.""" + base_url: NotRequired[str] + r"""HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.""" + data_policy: NotRequired[PrivateProviderDataPolicyTypedDict] + r"""Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it.""" + display_name: NotRequired[str] + r"""Defaults to `name`.""" + slug: NotRequired[str] + r"""2-64 lowercase letters and numbers, separated by single hyphens. Cannot be changed later. Defaults to the name lowercased, with every run of other characters replaced by a hyphen (`Acme Inference` becomes `acme-inference`).""" + + +class CreatePrivateProviderRequest(BaseModel): + name: str + r"""Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name.""" + + base_url: Optional[str] = None + r"""HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.""" + + data_policy: Optional[PrivateProviderDataPolicy] = None + r"""Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it.""" + + display_name: Optional[str] = None + r"""Defaults to `name`.""" + + slug: Optional[str] = None + r"""2-64 lowercase letters and numbers, separated by single hyphens. Cannot be changed later. Defaults to the name lowercased, with every run of other characters replaced by a hyphen (`Acme Inference` becomes `acme-inference`).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["base_url", "data_policy", "display_name", "slug"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/privateendpoint.py b/src/openrouter/components/privateendpoint.py index 6fb58a0fc..191505cce 100644 --- a/src/openrouter/components/privateendpoint.py +++ b/src/openrouter/components/privateendpoint.py @@ -6,6 +6,10 @@ PrivateEndpointPricing, PrivateEndpointPricingTypedDict, ) +from .privateendpointsettings import ( + PrivateEndpointSettings, + PrivateEndpointSettingsTypedDict, +) from .privateendpointstatus import PrivateEndpointStatus from openrouter.types import ( BaseModel, @@ -42,6 +46,8 @@ class PrivateEndpointTypedDict(TypedDict): r"""Display name of the upstream provider.""" provider_slug: Nullable[str] r"""Slug of the upstream provider, or `null` when the provider is no longer listed.""" + settings: PrivateEndpointSettingsTypedDict + r"""Capabilities and limits routing uses for this endpoint. A new endpoint copies them from the public endpoint for the same model and provider, or from the model, and the owner can change them. Rate limits are not part of this object: a private endpoint is billed to its own upstream key, so request limits stay with the provider.""" status: PrivateEndpointStatus r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" tested_parameters: List[str] @@ -86,6 +92,9 @@ class PrivateEndpoint(BaseModel): provider_slug: Nullable[str] r"""Slug of the upstream provider, or `null` when the provider is no longer listed.""" + settings: PrivateEndpointSettings + r"""Capabilities and limits routing uses for this endpoint. A new endpoint copies them from the public endpoint for the same model and provider, or from the model, and the owner can change them. Rate limits are not part of this object: a private endpoint is billed to its own upstream key, so request limits stay with the provider.""" + status: PrivateEndpointStatus r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" diff --git a/src/openrouter/components/privateendpointquantization.py b/src/openrouter/components/privateendpointquantization.py new file mode 100644 index 000000000..7f3f71550 --- /dev/null +++ b/src/openrouter/components/privateendpointquantization.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +PrivateEndpointQuantization = Union[ + Literal[ + "int4", + "int8", + "fp4", + "mxfp4", + "nvfp4", + "fp6", + "fp8", + "mxfp8", + "fp16", + "bf16", + "fp32", + "unknown", + ], + UnrecognizedStr, +] +r"""Weight precision the deployment runs at; `unknown` when not stated.""" diff --git a/src/openrouter/components/privateendpointreasoningreturnmechanism.py b/src/openrouter/components/privateendpointreasoningreturnmechanism.py new file mode 100644 index 000000000..877a34f6d --- /dev/null +++ b/src/openrouter/components/privateendpointreasoningreturnmechanism.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +PrivateEndpointReasoningReturnMechanism = Union[ + Literal[ + "content-string", + "reasoning-content", + "reasoning", + "none", + ], + UnrecognizedStr, +] +r"""Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default.""" diff --git a/src/openrouter/components/privateendpointsettings.py b/src/openrouter/components/privateendpointsettings.py new file mode 100644 index 000000000..9557860a5 --- /dev/null +++ b/src/openrouter/components/privateendpointsettings.py @@ -0,0 +1,231 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointquantization import PrivateEndpointQuantization +from .privateendpointreasoningreturnmechanism import ( + PrivateEndpointReasoningReturnMechanism, +) +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import List, Literal, Union +from typing_extensions import TypedDict + + +class PrivateEndpointSettingsCompletionsTypedDict(TypedDict): + chat: Nullable[bool] + r"""Serves `/chat/completions`; `null` uses the provider default.""" + text: Nullable[bool] + r"""Serves `/completions`; `null` uses the provider default.""" + + +class PrivateEndpointSettingsCompletions(BaseModel): + chat: Nullable[bool] + r"""Serves `/chat/completions`; `null` uses the provider default.""" + + text: Nullable[bool] + r"""Serves `/completions`; `null` uses the provider default.""" + + @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 + + +PrivateEndpointSettingsExcludedParameter = Union[ + Literal[ + "temperature", + "top_p", + "top_k", + "min_p", + "top_a", + "frequency_penalty", + "presence_penalty", + "repetition_penalty", + "max_tokens", + "max_completion_tokens", + "logit_bias", + "logprobs", + "top_logprobs", + "prediction", + "seed", + "response_format", + "structured_outputs", + "stop", + "tools", + "tool_choice", + "parallel_tool_calls", + "include_reasoning", + "reasoning", + "reasoning_effort", + "web_search_options", + "verbosity", + ], + UnrecognizedStr, +] + + +class PrivateEndpointSettingsInputsTypedDict(TypedDict): + audio: Nullable[bool] + r"""Accepts audio input. `null` keeps the provider default.""" + base64_files: Nullable[bool] + r"""Accepts base64 file data. `null` keeps the provider default.""" + base64_images: Nullable[bool] + r"""Accepts base64 image data. `null` keeps the provider default.""" + file_urls: Nullable[bool] + r"""Accepts file URLs. `null` keeps the provider default.""" + image_urls: Nullable[bool] + r"""Accepts image URLs. `null` keeps the provider default.""" + + +class PrivateEndpointSettingsInputs(BaseModel): + audio: Nullable[bool] + r"""Accepts audio input. `null` keeps the provider default.""" + + base64_files: Nullable[bool] + r"""Accepts base64 file data. `null` keeps the provider default.""" + + base64_images: Nullable[bool] + r"""Accepts base64 image data. `null` keeps the provider default.""" + + file_urls: Nullable[bool] + r"""Accepts file URLs. `null` keeps the provider default.""" + + image_urls: Nullable[bool] + r"""Accepts image URLs. `null` keeps the provider default.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m + + +class PrivateEndpointSettingsReasoningTypedDict(TypedDict): + return_mechanism: Nullable[PrivateEndpointReasoningReturnMechanism] + r"""Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default.""" + supported: bool + r"""Whether requests with `reasoning` route to this endpoint.""" + + +class PrivateEndpointSettingsReasoning(BaseModel): + return_mechanism: Nullable[PrivateEndpointReasoningReturnMechanism] + r"""Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default.""" + + supported: bool + r"""Whether requests with `reasoning` route to this endpoint.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m + + +class PrivateEndpointSettingsToolChoiceTypedDict(TypedDict): + auto: bool + r"""Accepts `tool_choice: \"auto\"`.""" + function: bool + r"""Accepts a named function in `tool_choice`.""" + none: bool + r"""Accepts `tool_choice: \"none\"`.""" + required: bool + r"""Accepts `tool_choice: \"required\"`.""" + + +class PrivateEndpointSettingsToolChoice(BaseModel): + auto: bool + r"""Accepts `tool_choice: \"auto\"`.""" + + function: bool + r"""Accepts a named function in `tool_choice`.""" + + none: bool + r"""Accepts `tool_choice: \"none\"`.""" + + required: bool + r"""Accepts `tool_choice: \"required\"`.""" + + +class PrivateEndpointSettingsTypedDict(TypedDict): + r"""Capabilities and limits routing uses for this endpoint. A new endpoint copies them from the public endpoint for the same model and provider, or from the model, and the owner can change them. Rate limits are not part of this object: a private endpoint is billed to its own upstream key, so request limits stay with the provider.""" + + completions: PrivateEndpointSettingsCompletionsTypedDict + context_length: Nullable[int] + r"""Longest prompt plus completion, in tokens, or `null` to keep the model default.""" + excluded_parameters: List[PrivateEndpointSettingsExcludedParameter] + r"""Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter.""" + inputs: PrivateEndpointSettingsInputsTypedDict + max_completion_tokens: Nullable[int] + r"""Longest completion the upstream returns, in tokens, or `null` to keep the model default.""" + max_prompt_tokens: Nullable[int] + r"""Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.""" + quantization: PrivateEndpointQuantization + r"""Weight precision the deployment runs at; `unknown` when not stated.""" + reasoning: PrivateEndpointSettingsReasoningTypedDict + tool_choice: PrivateEndpointSettingsToolChoiceTypedDict + + +class PrivateEndpointSettings(BaseModel): + r"""Capabilities and limits routing uses for this endpoint. A new endpoint copies them from the public endpoint for the same model and provider, or from the model, and the owner can change them. Rate limits are not part of this object: a private endpoint is billed to its own upstream key, so request limits stay with the provider.""" + + completions: PrivateEndpointSettingsCompletions + + context_length: Nullable[int] + r"""Longest prompt plus completion, in tokens, or `null` to keep the model default.""" + + excluded_parameters: List[PrivateEndpointSettingsExcludedParameter] + r"""Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter.""" + + inputs: PrivateEndpointSettingsInputs + + max_completion_tokens: Nullable[int] + r"""Longest completion the upstream returns, in tokens, or `null` to keep the model default.""" + + max_prompt_tokens: Nullable[int] + r"""Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.""" + + quantization: PrivateEndpointQuantization + r"""Weight precision the deployment runs at; `unknown` when not stated.""" + + reasoning: PrivateEndpointSettingsReasoning + + tool_choice: PrivateEndpointSettingsToolChoice + + @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/privateprovider.py b/src/openrouter/components/privateprovider.py new file mode 100644 index 000000000..7d29a298f --- /dev/null +++ b/src/openrouter/components/privateprovider.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class PrivateProviderDataPolicy1TypedDict(TypedDict): + r"""Your declared data policy, or `null` when none was declared.""" + + prompt_retention_days: Nullable[int] + r"""Days prompts are retained. Must be `null` unless `retains_prompts` is true.""" + retains_prompts: bool + r"""Whether the provider retains prompts or completions.""" + training: bool + r"""Whether the provider trains on prompts.""" + + +class PrivateProviderDataPolicy1(BaseModel): + r"""Your declared data policy, or `null` when none was declared.""" + + prompt_retention_days: Nullable[int] + r"""Days prompts are retained. Must be `null` unless `retains_prompts` is true.""" + + retains_prompts: bool + r"""Whether the provider retains prompts or completions.""" + + training: bool + r"""Whether the provider trains on prompts.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m + + +class PrivateProviderTypedDict(TypedDict): + base_url: Nullable[str] + r"""HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.""" + created_at: str + data_policy: Nullable[PrivateProviderDataPolicy1TypedDict] + r"""Your declared data policy, or `null` when none was declared.""" + display_name: str + name: str + r"""Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name.""" + slug: str + r"""The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`.""" + + +class PrivateProvider(BaseModel): + base_url: Nullable[str] + r"""HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.""" + + created_at: str + + data_policy: Nullable[PrivateProviderDataPolicy1] + r"""Your declared data policy, or `null` when none was declared.""" + + display_name: str + + name: str + r"""Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name.""" + + slug: str + r"""The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`.""" + + @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/privateproviderdatapolicy.py b/src/openrouter/components/privateproviderdatapolicy.py new file mode 100644 index 000000000..90e716a2f --- /dev/null +++ b/src/openrouter/components/privateproviderdatapolicy.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class PrivateProviderDataPolicyTypedDict(TypedDict): + r"""Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it.""" + + prompt_retention_days: Nullable[int] + r"""Days prompts are retained. Must be `null` unless `retains_prompts` is true.""" + retains_prompts: bool + r"""Whether the provider retains prompts or completions.""" + training: bool + r"""Whether the provider trains on prompts.""" + + +class PrivateProviderDataPolicy(BaseModel): + r"""Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it.""" + + prompt_retention_days: Nullable[int] + r"""Days prompts are retained. Must be `null` unless `retains_prompts` is true.""" + + retains_prompts: bool + r"""Whether the provider retains prompts or completions.""" + + training: bool + r"""Whether the provider trains on prompts.""" + + @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/updateprivateendpointrequest.py b/src/openrouter/components/updateprivateendpointrequest.py index 83382c9fe..8df7de964 100644 --- a/src/openrouter/components/updateprivateendpointrequest.py +++ b/src/openrouter/components/updateprivateendpointrequest.py @@ -1,6 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .privateendpointdeclaredparameter import PrivateEndpointDeclaredParameter +from .privateendpointpricing import ( + PrivateEndpointPricing, + PrivateEndpointPricingTypedDict, +) +from .updateprivateendpointsettingsrequest import ( + UpdatePrivateEndpointSettingsRequest, + UpdatePrivateEndpointSettingsRequestTypedDict, +) from openrouter.types import ( BaseModel, Nullable, @@ -10,7 +19,7 @@ UnrecognizedStr, ) from pydantic import model_serializer -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from typing_extensions import NotRequired, TypedDict @@ -26,23 +35,31 @@ class UpdatePrivateEndpointRequestTypedDict(TypedDict): - upstream_model_id: str - r"""Model or deployment identifier sent to the upstream provider.""" + r"""Only the fields present change. `base_url`, `upstream_model_id`, `declared_zdr` and `declared_region` are accepted on a draft only; `pricing` and `declared_parameters` replace their value; `settings` is itself a partial update where `null` clears a limit or restores the provider default.""" + base_url: NotRequired[str] r"""HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).""" + declared_parameters: NotRequired[List[PrivateEndpointDeclaredParameter]] + r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" declared_region: NotRequired[Nullable[UpdatePrivateEndpointRequestDeclaredRegion]] r"""Attest where this deployment processes data.""" declared_zdr: NotRequired[Nullable[bool]] r"""Attest that this deployment retains no prompt or completion data.""" + pricing: NotRequired[PrivateEndpointPricingTypedDict] + settings: NotRequired[UpdatePrivateEndpointSettingsRequestTypedDict] + upstream_model_id: NotRequired[str] + r"""Model or deployment identifier sent to the upstream provider.""" class UpdatePrivateEndpointRequest(BaseModel): - upstream_model_id: str - r"""Model or deployment identifier sent to the upstream provider.""" + r"""Only the fields present change. `base_url`, `upstream_model_id`, `declared_zdr` and `declared_region` are accepted on a draft only; `pricing` and `declared_parameters` replace their value; `settings` is itself a partial update where `null` clears a limit or restores the provider default.""" base_url: Optional[str] = None r"""HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).""" + declared_parameters: Optional[List[PrivateEndpointDeclaredParameter]] = None + r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" + declared_region: OptionalNullable[UpdatePrivateEndpointRequestDeclaredRegion] = ( UNSET ) @@ -51,9 +68,26 @@ class UpdatePrivateEndpointRequest(BaseModel): declared_zdr: OptionalNullable[bool] = UNSET r"""Attest that this deployment retains no prompt or completion data.""" + pricing: Optional[PrivateEndpointPricing] = None + + settings: Optional[UpdatePrivateEndpointSettingsRequest] = None + + upstream_model_id: Optional[str] = None + r"""Model or deployment identifier sent to the upstream provider.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["base_url", "declared_region", "declared_zdr"]) + optional_fields = set( + [ + "base_url", + "declared_parameters", + "declared_region", + "declared_zdr", + "pricing", + "settings", + "upstream_model_id", + ] + ) nullable_fields = set(["declared_region", "declared_zdr"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/updateprivateendpointsettingsrequest.py b/src/openrouter/components/updateprivateendpointsettingsrequest.py new file mode 100644 index 000000000..4a3a6a0f3 --- /dev/null +++ b/src/openrouter/components/updateprivateendpointsettingsrequest.py @@ -0,0 +1,320 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointquantization import PrivateEndpointQuantization +from .privateendpointreasoningreturnmechanism import ( + PrivateEndpointReasoningReturnMechanism, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +class UpdatePrivateEndpointSettingsRequestCompletionsTypedDict(TypedDict): + chat: NotRequired[Nullable[bool]] + r"""Serves `/chat/completions`; `null` uses the provider default.""" + text: NotRequired[Nullable[bool]] + r"""Serves `/completions`; `null` uses the provider default.""" + + +class UpdatePrivateEndpointSettingsRequestCompletions(BaseModel): + chat: OptionalNullable[bool] = UNSET + r"""Serves `/chat/completions`; `null` uses the provider default.""" + + text: OptionalNullable[bool] = UNSET + r"""Serves `/completions`; `null` uses the provider default.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["chat", "text"]) + nullable_fields = set(["chat", "text"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +UpdatePrivateEndpointSettingsRequestExcludedParameter = Union[ + Literal[ + "temperature", + "top_p", + "top_k", + "min_p", + "top_a", + "frequency_penalty", + "presence_penalty", + "repetition_penalty", + "max_tokens", + "max_completion_tokens", + "logit_bias", + "logprobs", + "top_logprobs", + "prediction", + "seed", + "response_format", + "structured_outputs", + "stop", + "tools", + "tool_choice", + "parallel_tool_calls", + "include_reasoning", + "reasoning", + "reasoning_effort", + "web_search_options", + "verbosity", + ], + UnrecognizedStr, +] + + +class UpdatePrivateEndpointSettingsRequestInputsTypedDict(TypedDict): + audio: NotRequired[Nullable[bool]] + r"""Accepts audio input. `null` keeps the provider default.""" + base64_files: NotRequired[Nullable[bool]] + r"""Accepts base64 file data. `null` keeps the provider default.""" + base64_images: NotRequired[Nullable[bool]] + r"""Accepts base64 image data. `null` keeps the provider default.""" + file_urls: NotRequired[Nullable[bool]] + r"""Accepts file URLs. `null` keeps the provider default.""" + image_urls: NotRequired[Nullable[bool]] + r"""Accepts image URLs. `null` keeps the provider default.""" + + +class UpdatePrivateEndpointSettingsRequestInputs(BaseModel): + audio: OptionalNullable[bool] = UNSET + r"""Accepts audio input. `null` keeps the provider default.""" + + base64_files: OptionalNullable[bool] = UNSET + r"""Accepts base64 file data. `null` keeps the provider default.""" + + base64_images: OptionalNullable[bool] = UNSET + r"""Accepts base64 image data. `null` keeps the provider default.""" + + file_urls: OptionalNullable[bool] = UNSET + r"""Accepts file URLs. `null` keeps the provider default.""" + + image_urls: OptionalNullable[bool] = UNSET + r"""Accepts image URLs. `null` keeps the provider default.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["audio", "base64_files", "base64_images", "file_urls", "image_urls"] + ) + nullable_fields = set( + ["audio", "base64_files", "base64_images", "file_urls", "image_urls"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class UpdatePrivateEndpointSettingsRequestReasoningTypedDict(TypedDict): + return_mechanism: NotRequired[Nullable[PrivateEndpointReasoningReturnMechanism]] + r"""Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default.""" + supported: NotRequired[bool] + r"""Whether requests with `reasoning` route to this endpoint.""" + + +class UpdatePrivateEndpointSettingsRequestReasoning(BaseModel): + return_mechanism: OptionalNullable[PrivateEndpointReasoningReturnMechanism] = UNSET + r"""Where the upstream puts reasoning tokens in its response: `reasoning` and `reasoning-content` are response fields, `content-string` is inline in the message, `none` returns no reasoning. `null` uses the provider default.""" + + supported: Optional[bool] = None + r"""Whether requests with `reasoning` route to this endpoint.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["return_mechanism", "supported"]) + nullable_fields = set(["return_mechanism"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class UpdatePrivateEndpointSettingsRequestToolChoiceTypedDict(TypedDict): + auto: NotRequired[bool] + r"""Accepts `tool_choice: \"auto\"`.""" + function: NotRequired[bool] + r"""Accepts a named function in `tool_choice`.""" + none: NotRequired[bool] + r"""Accepts `tool_choice: \"none\"`.""" + required: NotRequired[bool] + r"""Accepts `tool_choice: \"required\"`.""" + + +class UpdatePrivateEndpointSettingsRequestToolChoice(BaseModel): + auto: Optional[bool] = None + r"""Accepts `tool_choice: \"auto\"`.""" + + function: Optional[bool] = None + r"""Accepts a named function in `tool_choice`.""" + + none: Optional[bool] = None + r"""Accepts `tool_choice: \"none\"`.""" + + required: Optional[bool] = None + r"""Accepts `tool_choice: \"required\"`.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["auto", "function", "none", "required"]) + 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 UpdatePrivateEndpointSettingsRequestTypedDict(TypedDict): + r"""Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values.""" + + completions: NotRequired[UpdatePrivateEndpointSettingsRequestCompletionsTypedDict] + context_length: NotRequired[Nullable[int]] + r"""Longest prompt plus completion, in tokens, or `null` to keep the model default.""" + excluded_parameters: NotRequired[ + List[UpdatePrivateEndpointSettingsRequestExcludedParameter] + ] + r"""Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter.""" + inputs: NotRequired[UpdatePrivateEndpointSettingsRequestInputsTypedDict] + max_completion_tokens: NotRequired[Nullable[int]] + r"""Longest completion the upstream returns, in tokens, or `null` to keep the model default.""" + max_prompt_tokens: NotRequired[Nullable[int]] + r"""Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.""" + quantization: NotRequired[PrivateEndpointQuantization] + r"""Weight precision the deployment runs at; `unknown` when not stated.""" + reasoning: NotRequired[UpdatePrivateEndpointSettingsRequestReasoningTypedDict] + tool_choice: NotRequired[UpdatePrivateEndpointSettingsRequestToolChoiceTypedDict] + + +class UpdatePrivateEndpointSettingsRequest(BaseModel): + r"""Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values.""" + + completions: Optional[UpdatePrivateEndpointSettingsRequestCompletions] = None + + context_length: OptionalNullable[int] = UNSET + r"""Longest prompt plus completion, in tokens, or `null` to keep the model default.""" + + excluded_parameters: Optional[ + List[UpdatePrivateEndpointSettingsRequestExcludedParameter] + ] = None + r"""Request parameters the upstream rejects even though the model supports them; requests using one do not route here. Cannot name a tested parameter.""" + + inputs: Optional[UpdatePrivateEndpointSettingsRequestInputs] = None + + max_completion_tokens: OptionalNullable[int] = UNSET + r"""Longest completion the upstream returns, in tokens, or `null` to keep the model default.""" + + max_prompt_tokens: OptionalNullable[int] = UNSET + r"""Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.""" + + quantization: Optional[PrivateEndpointQuantization] = None + r"""Weight precision the deployment runs at; `unknown` when not stated.""" + + reasoning: Optional[UpdatePrivateEndpointSettingsRequestReasoning] = None + + tool_choice: Optional[UpdatePrivateEndpointSettingsRequestToolChoice] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "completions", + "context_length", + "excluded_parameters", + "inputs", + "max_completion_tokens", + "max_prompt_tokens", + "quantization", + "reasoning", + "tool_choice", + ] + ) + nullable_fields = set( + ["context_length", "max_completion_tokens", "max_prompt_tokens"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/updateprivateproviderrequest.py b/src/openrouter/components/updateprivateproviderrequest.py new file mode 100644 index 000000000..5aebd7da5 --- /dev/null +++ b/src/openrouter/components/updateprivateproviderrequest.py @@ -0,0 +1,90 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class UpdatePrivateProviderRequestDataPolicyTypedDict(TypedDict): + prompt_retention_days: NotRequired[Nullable[int]] + r"""Days prompts are retained. Must be `null` unless `retains_prompts` is true.""" + retains_prompts: NotRequired[bool] + r"""Whether the provider retains prompts or completions.""" + training: NotRequired[bool] + r"""Whether the provider trains on prompts.""" + + +class UpdatePrivateProviderRequestDataPolicy(BaseModel): + prompt_retention_days: OptionalNullable[int] = UNSET + r"""Days prompts are retained. Must be `null` unless `retains_prompts` is true.""" + + retains_prompts: Optional[bool] = None + r"""Whether the provider retains prompts or completions.""" + + training: Optional[bool] = None + r"""Whether the provider trains on prompts.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["prompt_retention_days", "retains_prompts", "training"]) + nullable_fields = set(["prompt_retention_days"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class UpdatePrivateProviderRequestTypedDict(TypedDict): + base_url: NotRequired[str] + r"""HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.""" + data_policy: NotRequired[UpdatePrivateProviderRequestDataPolicyTypedDict] + display_name: NotRequired[str] + + +class UpdatePrivateProviderRequest(BaseModel): + base_url: Optional[str] = None + r"""HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected.""" + + data_policy: Optional[UpdatePrivateProviderRequestDataPolicy] = None + + display_name: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["base_url", "data_policy", "display_name"]) + 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/__init__.py b/src/openrouter/operations/__init__.py index 772721971..35c06702f 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -218,6 +218,14 @@ CreatePrivateEndpointRequest, CreatePrivateEndpointRequestTypedDict, ) + from .createprivateprovider import ( + CreatePrivateProviderGlobals, + CreatePrivateProviderGlobalsTypedDict, + CreatePrivateProviderRequest, + CreatePrivateProviderRequestTypedDict, + CreatePrivateProviderResponse, + CreatePrivateProviderResponseTypedDict, + ) from .creatererank import ( CreateRerankGlobals, CreateRerankGlobalsTypedDict, @@ -337,6 +345,16 @@ DeletePrivateEndpointRequestTypedDict, DraftOnly, ) + from .deleteprivateprovider import ( + DeletePrivateProviderData, + DeletePrivateProviderDataTypedDict, + DeletePrivateProviderGlobals, + DeletePrivateProviderGlobalsTypedDict, + DeletePrivateProviderRequest, + DeletePrivateProviderRequestTypedDict, + DeletePrivateProviderResponse, + DeletePrivateProviderResponseTypedDict, + ) from .deletescimgroupmapping import ( DeleteScimGroupMappingGlobals, DeleteScimGroupMappingGlobalsTypedDict, @@ -569,6 +587,14 @@ GetPrivateEndpointRequest, GetPrivateEndpointRequestTypedDict, ) + from .getprivateprovider import ( + GetPrivateProviderGlobals, + GetPrivateProviderGlobalsTypedDict, + GetPrivateProviderRequest, + GetPrivateProviderRequestTypedDict, + GetPrivateProviderResponse, + GetPrivateProviderResponseTypedDict, + ) from .getrankingsdaily import ( ContextBucket, GetRankingsDailyCategory, @@ -863,6 +889,14 @@ ListPrivateEndpointsRequest, ListPrivateEndpointsRequestTypedDict, ) + from .listprivateproviders import ( + ListPrivateProvidersGlobals, + ListPrivateProvidersGlobalsTypedDict, + ListPrivateProvidersRequest, + ListPrivateProvidersRequestTypedDict, + ListPrivateProvidersResponse, + ListPrivateProvidersResponseTypedDict, + ) from .listproviders import ( Datacenter, Headquarters, @@ -1072,6 +1106,14 @@ UpdatePrivateEndpointPricingRequest, UpdatePrivateEndpointPricingRequestTypedDict, ) + from .updateprivateprovider import ( + UpdatePrivateProviderGlobals, + UpdatePrivateProviderGlobalsTypedDict, + UpdatePrivateProviderRequest, + UpdatePrivateProviderRequestTypedDict, + UpdatePrivateProviderResponse, + UpdatePrivateProviderResponseTypedDict, + ) from .updatescimgroupmapping import ( UpdateScimGroupMappingGlobals, UpdateScimGroupMappingGlobalsTypedDict, @@ -1262,6 +1304,12 @@ "CreatePrivateEndpointGlobalsTypedDict", "CreatePrivateEndpointRequest", "CreatePrivateEndpointRequestTypedDict", + "CreatePrivateProviderGlobals", + "CreatePrivateProviderGlobalsTypedDict", + "CreatePrivateProviderRequest", + "CreatePrivateProviderRequestTypedDict", + "CreatePrivateProviderResponse", + "CreatePrivateProviderResponseTypedDict", "CreateRerankGlobals", "CreateRerankGlobalsTypedDict", "CreateRerankRequest", @@ -1341,6 +1389,14 @@ "DeletePrivateEndpointGlobalsTypedDict", "DeletePrivateEndpointRequest", "DeletePrivateEndpointRequestTypedDict", + "DeletePrivateProviderData", + "DeletePrivateProviderDataTypedDict", + "DeletePrivateProviderGlobals", + "DeletePrivateProviderGlobalsTypedDict", + "DeletePrivateProviderRequest", + "DeletePrivateProviderRequestTypedDict", + "DeletePrivateProviderResponse", + "DeletePrivateProviderResponseTypedDict", "DeleteScimGroupMappingGlobals", "DeleteScimGroupMappingGlobalsTypedDict", "DeleteScimGroupMappingRequest", @@ -1507,6 +1563,12 @@ "GetPrivateEndpointGlobalsTypedDict", "GetPrivateEndpointRequest", "GetPrivateEndpointRequestTypedDict", + "GetPrivateProviderGlobals", + "GetPrivateProviderGlobalsTypedDict", + "GetPrivateProviderRequest", + "GetPrivateProviderRequestTypedDict", + "GetPrivateProviderResponse", + "GetPrivateProviderResponseTypedDict", "GetRankingsDailyCategory", "GetRankingsDailyGlobals", "GetRankingsDailyGlobalsTypedDict", @@ -1726,6 +1788,12 @@ "ListPrivateEndpointsGlobalsTypedDict", "ListPrivateEndpointsRequest", "ListPrivateEndpointsRequestTypedDict", + "ListPrivateProvidersGlobals", + "ListPrivateProvidersGlobalsTypedDict", + "ListPrivateProvidersRequest", + "ListPrivateProvidersRequestTypedDict", + "ListPrivateProvidersResponse", + "ListPrivateProvidersResponseTypedDict", "ListProvidersData", "ListProvidersDataTypedDict", "ListProvidersGlobals", @@ -1897,6 +1965,12 @@ "UpdatePrivateEndpointPricingRequestTypedDict", "UpdatePrivateEndpointRequest", "UpdatePrivateEndpointRequestTypedDict", + "UpdatePrivateProviderGlobals", + "UpdatePrivateProviderGlobalsTypedDict", + "UpdatePrivateProviderRequest", + "UpdatePrivateProviderRequestTypedDict", + "UpdatePrivateProviderResponse", + "UpdatePrivateProviderResponseTypedDict", "UpdateScimGroupMappingGlobals", "UpdateScimGroupMappingGlobalsTypedDict", "UpdateScimGroupMappingRequest", @@ -2095,6 +2169,12 @@ "CreatePrivateEndpointGlobalsTypedDict": ".createprivateendpoint", "CreatePrivateEndpointRequest": ".createprivateendpoint", "CreatePrivateEndpointRequestTypedDict": ".createprivateendpoint", + "CreatePrivateProviderGlobals": ".createprivateprovider", + "CreatePrivateProviderGlobalsTypedDict": ".createprivateprovider", + "CreatePrivateProviderRequest": ".createprivateprovider", + "CreatePrivateProviderRequestTypedDict": ".createprivateprovider", + "CreatePrivateProviderResponse": ".createprivateprovider", + "CreatePrivateProviderResponseTypedDict": ".createprivateprovider", "CreateRerankGlobals": ".creatererank", "CreateRerankGlobalsTypedDict": ".creatererank", "CreateRerankRequest": ".creatererank", @@ -2182,6 +2262,14 @@ "DeletePrivateEndpointRequest": ".deleteprivateendpoint", "DeletePrivateEndpointRequestTypedDict": ".deleteprivateendpoint", "DraftOnly": ".deleteprivateendpoint", + "DeletePrivateProviderData": ".deleteprivateprovider", + "DeletePrivateProviderDataTypedDict": ".deleteprivateprovider", + "DeletePrivateProviderGlobals": ".deleteprivateprovider", + "DeletePrivateProviderGlobalsTypedDict": ".deleteprivateprovider", + "DeletePrivateProviderRequest": ".deleteprivateprovider", + "DeletePrivateProviderRequestTypedDict": ".deleteprivateprovider", + "DeletePrivateProviderResponse": ".deleteprivateprovider", + "DeletePrivateProviderResponseTypedDict": ".deleteprivateprovider", "DeleteScimGroupMappingGlobals": ".deletescimgroupmapping", "DeleteScimGroupMappingGlobalsTypedDict": ".deletescimgroupmapping", "DeleteScimGroupMappingRequest": ".deletescimgroupmapping", @@ -2356,6 +2444,12 @@ "GetPrivateEndpointGlobalsTypedDict": ".getprivateendpoint", "GetPrivateEndpointRequest": ".getprivateendpoint", "GetPrivateEndpointRequestTypedDict": ".getprivateendpoint", + "GetPrivateProviderGlobals": ".getprivateprovider", + "GetPrivateProviderGlobalsTypedDict": ".getprivateprovider", + "GetPrivateProviderRequest": ".getprivateprovider", + "GetPrivateProviderRequestTypedDict": ".getprivateprovider", + "GetPrivateProviderResponse": ".getprivateprovider", + "GetPrivateProviderResponseTypedDict": ".getprivateprovider", "ContextBucket": ".getrankingsdaily", "GetRankingsDailyCategory": ".getrankingsdaily", "GetRankingsDailyGlobals": ".getrankingsdaily", @@ -2574,6 +2668,12 @@ "ListPrivateEndpointsGlobalsTypedDict": ".listprivateendpoints", "ListPrivateEndpointsRequest": ".listprivateendpoints", "ListPrivateEndpointsRequestTypedDict": ".listprivateendpoints", + "ListPrivateProvidersGlobals": ".listprivateproviders", + "ListPrivateProvidersGlobalsTypedDict": ".listprivateproviders", + "ListPrivateProvidersRequest": ".listprivateproviders", + "ListPrivateProvidersRequestTypedDict": ".listprivateproviders", + "ListPrivateProvidersResponse": ".listprivateproviders", + "ListPrivateProvidersResponseTypedDict": ".listprivateproviders", "Datacenter": ".listproviders", "Headquarters": ".listproviders", "ListProvidersData": ".listproviders", @@ -2733,6 +2833,12 @@ "UpdatePrivateEndpointPricingGlobalsTypedDict": ".updateprivateendpointpricing", "UpdatePrivateEndpointPricingRequest": ".updateprivateendpointpricing", "UpdatePrivateEndpointPricingRequestTypedDict": ".updateprivateendpointpricing", + "UpdatePrivateProviderGlobals": ".updateprivateprovider", + "UpdatePrivateProviderGlobalsTypedDict": ".updateprivateprovider", + "UpdatePrivateProviderRequest": ".updateprivateprovider", + "UpdatePrivateProviderRequestTypedDict": ".updateprivateprovider", + "UpdatePrivateProviderResponse": ".updateprivateprovider", + "UpdatePrivateProviderResponseTypedDict": ".updateprivateprovider", "UpdateScimGroupMappingGlobals": ".updatescimgroupmapping", "UpdateScimGroupMappingGlobalsTypedDict": ".updatescimgroupmapping", "UpdateScimGroupMappingRequest": ".updatescimgroupmapping", diff --git a/src/openrouter/operations/createprivateprovider.py b/src/openrouter/operations/createprivateprovider.py new file mode 100644 index 000000000..28087c0c9 --- /dev/null +++ b/src/openrouter/operations/createprivateprovider.py @@ -0,0 +1,161 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + createprivateproviderrequest as components_createprivateproviderrequest, + privateprovider as components_privateprovider, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, RequestMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreatePrivateProviderGlobalsTypedDict(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 CreatePrivateProviderGlobals(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 CreatePrivateProviderRequestTypedDict(TypedDict): + create_private_provider_request: ( + components_createprivateproviderrequest.CreatePrivateProviderRequestTypedDict + ) + 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 CreatePrivateProviderRequest(BaseModel): + create_private_provider_request: Annotated[ + components_createprivateproviderrequest.CreatePrivateProviderRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class CreatePrivateProviderResponseTypedDict(TypedDict): + r"""The provider was created""" + + data: components_privateprovider.PrivateProviderTypedDict + + +class CreatePrivateProviderResponse(BaseModel): + r"""The provider was created""" + + data: components_privateprovider.PrivateProvider diff --git a/src/openrouter/operations/deleteprivateprovider.py b/src/openrouter/operations/deleteprivateprovider.py new file mode 100644 index 000000000..9f8ac142c --- /dev/null +++ b/src/openrouter/operations/deleteprivateprovider.py @@ -0,0 +1,164 @@ +"""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 DeletePrivateProviderGlobalsTypedDict(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 DeletePrivateProviderGlobals(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 DeletePrivateProviderRequestTypedDict(TypedDict): + slug: str + 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 DeletePrivateProviderRequest(BaseModel): + slug: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + 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 DeletePrivateProviderDataTypedDict(TypedDict): + slug: str + r"""The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`.""" + + +class DeletePrivateProviderData(BaseModel): + slug: str + r"""The slug you chose, unique within your account. Use it as `provider_slug` when creating private endpoints and BYOK keys, and in `provider.order`, `only` and `ignore`.""" + + +class DeletePrivateProviderResponseTypedDict(TypedDict): + r"""The provider was deleted""" + + data: DeletePrivateProviderDataTypedDict + + +class DeletePrivateProviderResponse(BaseModel): + r"""The provider was deleted""" + + data: DeletePrivateProviderData diff --git a/src/openrouter/operations/getprivateprovider.py b/src/openrouter/operations/getprivateprovider.py new file mode 100644 index 000000000..bd85d8584 --- /dev/null +++ b/src/openrouter/operations/getprivateprovider.py @@ -0,0 +1,155 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import privateprovider as components_privateprovider +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 GetPrivateProviderGlobalsTypedDict(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 GetPrivateProviderGlobals(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 GetPrivateProviderRequestTypedDict(TypedDict): + slug: str + 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 GetPrivateProviderRequest(BaseModel): + slug: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + 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 GetPrivateProviderResponseTypedDict(TypedDict): + r"""The private provider""" + + data: components_privateprovider.PrivateProviderTypedDict + + +class GetPrivateProviderResponse(BaseModel): + r"""The private provider""" + + data: components_privateprovider.PrivateProvider diff --git a/src/openrouter/operations/listprivateproviders.py b/src/openrouter/operations/listprivateproviders.py new file mode 100644 index 000000000..1b76ac241 --- /dev/null +++ b/src/openrouter/operations/listprivateproviders.py @@ -0,0 +1,150 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import privateprovider as components_privateprovider +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPrivateProvidersGlobalsTypedDict(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 ListPrivateProvidersGlobals(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 ListPrivateProvidersRequestTypedDict(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 ListPrivateProvidersRequest(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 ListPrivateProvidersResponseTypedDict(TypedDict): + r"""Private providers for the organization""" + + data: List[components_privateprovider.PrivateProviderTypedDict] + + +class ListPrivateProvidersResponse(BaseModel): + r"""Private providers for the organization""" + + data: List[components_privateprovider.PrivateProvider] diff --git a/src/openrouter/operations/updateprivateprovider.py b/src/openrouter/operations/updateprivateprovider.py new file mode 100644 index 000000000..953e0c4f3 --- /dev/null +++ b/src/openrouter/operations/updateprivateprovider.py @@ -0,0 +1,171 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + privateprovider as components_privateprovider, + updateprivateproviderrequest as components_updateprivateproviderrequest, +) +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 UpdatePrivateProviderGlobalsTypedDict(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 UpdatePrivateProviderGlobals(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 UpdatePrivateProviderRequestTypedDict(TypedDict): + slug: str + update_private_provider_request: ( + components_updateprivateproviderrequest.UpdatePrivateProviderRequestTypedDict + ) + 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 UpdatePrivateProviderRequest(BaseModel): + slug: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_private_provider_request: Annotated[ + components_updateprivateproviderrequest.UpdatePrivateProviderRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class UpdatePrivateProviderResponseTypedDict(TypedDict): + r"""The updated provider""" + + data: components_privateprovider.PrivateProviderTypedDict + + +class UpdatePrivateProviderResponse(BaseModel): + r"""The updated provider""" + + data: components_privateprovider.PrivateProvider diff --git a/src/openrouter/private_endpoints.py b/src/openrouter/private_endpoints.py index 518fc3068..4407f1f32 100644 --- a/src/openrouter/private_endpoints.py +++ b/src/openrouter/private_endpoints.py @@ -7,6 +7,7 @@ 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, Union +from typing_extensions import deprecated class PrivateEndpoints(BaseSDK): @@ -307,6 +308,12 @@ def create( components.PrivateEndpointPricingTypedDict, ] ] = None, + settings: Optional[ + Union[ + components.UpdatePrivateEndpointSettingsRequest, + components.UpdatePrivateEndpointSettingsRequestTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -334,6 +341,7 @@ def create( :param declared_zdr: Attest that this deployment retains no prompt or completion data. :param max_completion_tokens: Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. + :param settings: Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. :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 @@ -371,6 +379,9 @@ def create( pricing, Optional[components.PrivateEndpointPricing] ), provider_slug=provider_slug, + settings=utils.get_pydantic_model( + settings, Optional[components.UpdatePrivateEndpointSettingsRequest] + ), upstream_model_id=upstream_model_id, ), ) @@ -521,6 +532,12 @@ async def create_async( components.PrivateEndpointPricingTypedDict, ] ] = None, + settings: Optional[ + Union[ + components.UpdatePrivateEndpointSettingsRequest, + components.UpdatePrivateEndpointSettingsRequestTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -548,6 +565,7 @@ async def create_async( :param declared_zdr: Attest that this deployment retains no prompt or completion data. :param max_completion_tokens: Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. + :param settings: Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. :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 @@ -585,6 +603,9 @@ async def create_async( pricing, Optional[components.PrivateEndpointPricing] ), provider_slug=provider_slug, + settings=utils.get_pydantic_model( + settings, Optional[components.UpdatePrivateEndpointSettingsRequest] + ), upstream_model_id=upstream_model_id, ), ) @@ -1310,26 +1331,40 @@ def update( self, *, id: str, - upstream_model_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, base_url: Optional[str] = None, + declared_parameters: Optional[ + Iterable[components.PrivateEndpointDeclaredParameter] + ] = None, declared_region: OptionalNullable[ components.UpdatePrivateEndpointRequestDeclaredRegion ] = UNSET, declared_zdr: OptionalNullable[bool] = UNSET, + pricing: Optional[ + Union[ + components.PrivateEndpointPricing, + components.PrivateEndpointPricingTypedDict, + ] + ] = None, + settings: Optional[ + Union[ + components.UpdatePrivateEndpointSettingsRequest, + components.UpdatePrivateEndpointSettingsRequestTypedDict, + ] + ] = None, + upstream_model_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> components.PrivateEndpointResponse: - r"""Update a draft private endpoint + r"""Update a private endpoint - Replace a draft endpoint's upstream configuration: send `upstream_model_id`, and `base_url` to change it (an omitted `base_url` keeps the stored one). Omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes. Any change clears earlier validation. Active endpoints return 409; delete and re-create them instead. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `upstream_model_id`, `base_url`, `declared_zdr` and `declared_region` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any upstream change clears earlier validation. Naming an upstream field on an active endpoint returns 409 `already_active` and writes nothing; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Stable identifier of the private endpoint. - :param upstream_model_id: Model or deployment identifier sent to the upstream provider. :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. @@ -1338,8 +1373,12 @@ def update( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param base_url: HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). + :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. :param declared_region: Attest where this deployment processes data. :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :param pricing: + :param settings: + :param upstream_model_id: Model or deployment identifier sent to the upstream provider. :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 @@ -1362,8 +1401,18 @@ def update( id=id, update_private_endpoint_request=components.UpdatePrivateEndpointRequest( base_url=base_url, + declared_parameters=utils.unmarshal( + declared_parameters, + Optional[List[components.PrivateEndpointDeclaredParameter]], + ), declared_region=declared_region, declared_zdr=declared_zdr, + pricing=utils.get_pydantic_model( + pricing, Optional[components.PrivateEndpointPricing] + ), + settings=utils.get_pydantic_model( + settings, Optional[components.UpdatePrivateEndpointSettingsRequest] + ), upstream_model_id=upstream_model_id, ), ) @@ -1491,26 +1540,40 @@ async def update_async( self, *, id: str, - upstream_model_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, base_url: Optional[str] = None, + declared_parameters: Optional[ + Iterable[components.PrivateEndpointDeclaredParameter] + ] = None, declared_region: OptionalNullable[ components.UpdatePrivateEndpointRequestDeclaredRegion ] = UNSET, declared_zdr: OptionalNullable[bool] = UNSET, + pricing: Optional[ + Union[ + components.PrivateEndpointPricing, + components.PrivateEndpointPricingTypedDict, + ] + ] = None, + settings: Optional[ + Union[ + components.UpdatePrivateEndpointSettingsRequest, + components.UpdatePrivateEndpointSettingsRequestTypedDict, + ] + ] = None, + upstream_model_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> components.PrivateEndpointResponse: - r"""Update a draft private endpoint + r"""Update a private endpoint - Replace a draft endpoint's upstream configuration: send `upstream_model_id`, and `base_url` to change it (an omitted `base_url` keeps the stored one). Omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes. Any change clears earlier validation. Active endpoints return 409; delete and re-create them instead. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `upstream_model_id`, `base_url`, `declared_zdr` and `declared_region` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any upstream change clears earlier validation. Naming an upstream field on an active endpoint returns 409 `already_active` and writes nothing; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Stable identifier of the private endpoint. - :param upstream_model_id: Model or deployment identifier sent to the upstream provider. :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. @@ -1519,8 +1582,12 @@ async def update_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param base_url: HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). + :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. :param declared_region: Attest where this deployment processes data. :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :param pricing: + :param settings: + :param upstream_model_id: Model or deployment identifier sent to the upstream provider. :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 @@ -1543,8 +1610,18 @@ async def update_async( id=id, update_private_endpoint_request=components.UpdatePrivateEndpointRequest( base_url=base_url, + declared_parameters=utils.unmarshal( + declared_parameters, + Optional[List[components.PrivateEndpointDeclaredParameter]], + ), declared_region=declared_region, declared_zdr=declared_zdr, + pricing=utils.get_pydantic_model( + pricing, Optional[components.PrivateEndpointPricing] + ), + settings=utils.get_pydantic_model( + settings, Optional[components.UpdatePrivateEndpointSettingsRequest] + ), upstream_model_id=upstream_model_id, ), ) @@ -2628,6 +2705,9 @@ async def enable_async( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) def update_parameters( self, *, @@ -2641,9 +2721,9 @@ def update_parameters( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> components.PrivateEndpointResponse: - r"""Set private endpoint supported parameters + r"""Set private endpoint supported parameters (deprecated) - Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Stable identifier of the private endpoint. :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. @@ -2801,6 +2881,9 @@ def update_parameters( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) async def update_parameters_async( self, *, @@ -2814,9 +2897,9 @@ async def update_parameters_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> components.PrivateEndpointResponse: - r"""Set private endpoint supported parameters + r"""Set private endpoint supported parameters (deprecated) - Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Stable identifier of the private endpoint. :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. @@ -2974,6 +3057,9 @@ async def update_parameters_async( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) def update_pricing( self, *, @@ -2990,9 +3076,9 @@ def update_pricing( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> components.PrivateEndpointResponse: - r"""Set private endpoint pricing + r"""Set private endpoint pricing (deprecated) - Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy's default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Stable identifier of the private endpoint. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. @@ -3149,6 +3235,9 @@ def update_pricing( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) async def update_pricing_async( self, *, @@ -3165,9 +3254,9 @@ async def update_pricing_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> components.PrivateEndpointResponse: - r"""Set private endpoint pricing + r"""Set private endpoint pricing (deprecated) - Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy's default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Stable identifier of the private endpoint. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. diff --git a/src/openrouter/private_providers.py b/src/openrouter/private_providers.py new file mode 100644 index 000000000..f65b0d06e --- /dev/null +++ b/src/openrouter/private_providers.py @@ -0,0 +1,1635 @@ +"""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, Mapping, Optional, Union + + +class PrivateProviders(BaseSDK): + r"""Private Providers endpoints""" + + def list( + self, + *, + 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, + ) -> operations.ListPrivateProvidersResponse: + r"""List private providers + + List the organization's private providers. Requires the private endpoints entitlement. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :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.ListPrivateProvidersRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + ) + + req = self._build_request( + method="GET", + path="/private-providers", + 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.ListPrivateProvidersGlobals( + 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, + 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="listPrivateProviders", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.ListPrivateProvidersResponse, 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, "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, "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_async( + self, + *, + 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, + ) -> operations.ListPrivateProvidersResponse: + r"""List private providers + + List the organization's private providers. Requires the private endpoints entitlement. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :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.ListPrivateProvidersRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + ) + + req = self._build_request_async( + method="GET", + path="/private-providers", + 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.ListPrivateProvidersGlobals( + 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, + 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="listPrivateProviders", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.ListPrivateProvidersResponse, 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, "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, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def create( + self, + *, + name: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + base_url: Optional[str] = None, + data_policy: Optional[ + Union[ + components.PrivateProviderDataPolicy, + components.PrivateProviderDataPolicyTypedDict, + ] + ] = None, + display_name: Optional[str] = None, + slug: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreatePrivateProviderResponse: + r"""Create a private provider + + Create a private, bring-your-own-key provider visible only to your organization. Use its slug as `provider_slug` when creating private endpoints. Requires both the private endpoints and the private providers entitlements. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param name: Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name. + :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 base_url: HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. + :param data_policy: Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it. + :param display_name: Defaults to `name`. + :param slug: 2-64 lowercase letters and numbers, separated by single hyphens. Cannot be changed later. Defaults to the name lowercased, with every run of other characters replaced by a hyphen (`Acme Inference` becomes `acme-inference`). + :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.CreatePrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + create_private_provider_request=components.CreatePrivateProviderRequest( + base_url=base_url, + data_policy=utils.get_pydantic_model( + data_policy, Optional[components.PrivateProviderDataPolicy] + ), + display_name=display_name, + name=name, + slug=slug, + ), + ) + + req = self._build_request( + method="POST", + path="/private-providers", + base_url=base_url_, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CreatePrivateProviderGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_private_provider_request, + False, + False, + "json", + components.CreatePrivateProviderRequest, + ), + allow_empty_value=None, + 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="createPrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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, "201", "application/json"): + return unmarshal_json_response( + operations.CreatePrivateProviderResponse, 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, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityResponseErrorData, http_res + ) + raise errors.UnprocessableEntityResponseError(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, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def create_async( + self, + *, + name: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + base_url: Optional[str] = None, + data_policy: Optional[ + Union[ + components.PrivateProviderDataPolicy, + components.PrivateProviderDataPolicyTypedDict, + ] + ] = None, + display_name: Optional[str] = None, + slug: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreatePrivateProviderResponse: + r"""Create a private provider + + Create a private, bring-your-own-key provider visible only to your organization. Use its slug as `provider_slug` when creating private endpoints. Requires both the private endpoints and the private providers entitlements. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param name: Provider name, shown in your activity, logs and Broadcast output. 2-64 letters, numbers, spaces, dots, underscores or hyphens. Cannot be changed later. Neither the name nor its slug may match a public provider name or slug (case-insensitive); other customers may use the same name. + :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 base_url: HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. + :param data_policy: Defaults to training on and retaining prompts, the most conservative declaration. Your own declaration; it applies to your own traffic and OpenRouter does not verify it. + :param display_name: Defaults to `name`. + :param slug: 2-64 lowercase letters and numbers, separated by single hyphens. Cannot be changed later. Defaults to the name lowercased, with every run of other characters replaced by a hyphen (`Acme Inference` becomes `acme-inference`). + :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.CreatePrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + create_private_provider_request=components.CreatePrivateProviderRequest( + base_url=base_url, + data_policy=utils.get_pydantic_model( + data_policy, Optional[components.PrivateProviderDataPolicy] + ), + display_name=display_name, + name=name, + slug=slug, + ), + ) + + req = self._build_request_async( + method="POST", + path="/private-providers", + base_url=base_url_, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CreatePrivateProviderGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_private_provider_request, + False, + False, + "json", + components.CreatePrivateProviderRequest, + ), + allow_empty_value=None, + 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="createPrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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, "201", "application/json"): + return unmarshal_json_response( + operations.CreatePrivateProviderResponse, 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, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityResponseErrorData, http_res + ) + raise errors.UnprocessableEntityResponseError(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, "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( + self, + *, + slug: 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, + ) -> operations.DeletePrivateProviderResponse: + r"""Delete a private provider + + Delete a private provider. Refuses (409) while any private endpoint still runs under it. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param slug: + :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.DeletePrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + slug=slug, + ) + + req = self._build_request( + method="DELETE", + path="/private-providers/{slug}", + 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.DeletePrivateProviderGlobals( + 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, + 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="deletePrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.DeletePrivateProviderResponse, 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, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityResponseErrorData, http_res + ) + raise errors.UnprocessableEntityResponseError(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, "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_async( + self, + *, + slug: 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, + ) -> operations.DeletePrivateProviderResponse: + r"""Delete a private provider + + Delete a private provider. Refuses (409) while any private endpoint still runs under it. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param slug: + :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.DeletePrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + slug=slug, + ) + + req = self._build_request_async( + method="DELETE", + path="/private-providers/{slug}", + 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.DeletePrivateProviderGlobals( + 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, + 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="deletePrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.DeletePrivateProviderResponse, 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, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityResponseErrorData, http_res + ) + raise errors.UnprocessableEntityResponseError(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, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def get( + self, + *, + slug: 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, + ) -> operations.GetPrivateProviderResponse: + r"""Get a private provider + + Get one of the organization’s private providers by slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param slug: + :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.GetPrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + slug=slug, + ) + + req = self._build_request( + method="GET", + path="/private-providers/{slug}", + 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.GetPrivateProviderGlobals( + 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, + 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="getPrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.GetPrivateProviderResponse, 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, "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, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def get_async( + self, + *, + slug: 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, + ) -> operations.GetPrivateProviderResponse: + r"""Get a private provider + + Get one of the organization’s private providers by slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param slug: + :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.GetPrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + slug=slug, + ) + + req = self._build_request_async( + method="GET", + path="/private-providers/{slug}", + 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.GetPrivateProviderGlobals( + 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, + 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="getPrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.GetPrivateProviderResponse, 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, "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, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def update( + self, + *, + slug: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + base_url: Optional[str] = None, + data_policy: Optional[ + Union[ + components.UpdatePrivateProviderRequestDataPolicy, + components.UpdatePrivateProviderRequestDataPolicyTypedDict, + ] + ] = None, + display_name: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.UpdatePrivateProviderResponse: + r"""Update a private provider + + Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param slug: + :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 base_url: HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. + :param data_policy: + :param display_name: + :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.UpdatePrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + slug=slug, + update_private_provider_request=components.UpdatePrivateProviderRequest( + base_url=base_url, + data_policy=utils.get_pydantic_model( + data_policy, + Optional[components.UpdatePrivateProviderRequestDataPolicy], + ), + display_name=display_name, + ), + ) + + req = self._build_request( + method="PATCH", + path="/private-providers/{slug}", + 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.UpdatePrivateProviderGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_private_provider_request, + False, + False, + "json", + components.UpdatePrivateProviderRequest, + ), + allow_empty_value=None, + 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="updatePrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.UpdatePrivateProviderResponse, 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, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityResponseErrorData, http_res + ) + raise errors.UnprocessableEntityResponseError(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, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def update_async( + self, + *, + slug: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + base_url: Optional[str] = None, + data_policy: Optional[ + Union[ + components.UpdatePrivateProviderRequestDataPolicy, + components.UpdatePrivateProviderRequestDataPolicyTypedDict, + ] + ] = None, + display_name: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.UpdatePrivateProviderResponse: + r"""Update a private provider + + Update a private provider’s details or declared data policy. The name and slug cannot change. Refuses (409) a data-policy change while OpenRouter pins the declared policy on one of its endpoints. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param slug: + :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 base_url: HTTPS base URL of an OpenAI-compatible API, used by private endpoints under this provider that set no URL of their own. Without it, each endpoint must set its own. Private, internal, metadata and OpenRouter hosts are rejected. + :param data_policy: + :param display_name: + :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.UpdatePrivateProviderRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + slug=slug, + update_private_provider_request=components.UpdatePrivateProviderRequest( + base_url=base_url, + data_policy=utils.get_pydantic_model( + data_policy, + Optional[components.UpdatePrivateProviderRequestDataPolicy], + ), + display_name=display_name, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/private-providers/{slug}", + 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.UpdatePrivateProviderGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_private_provider_request, + False, + False, + "json", + components.UpdatePrivateProviderRequest, + ), + allow_empty_value=None, + 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="updatePrivateProvider", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Providers"], + 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( + operations.UpdatePrivateProviderResponse, 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, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityResponseErrorData, http_res + ) + raise errors.UnprocessableEntityResponseError(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, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py index 9e37516f4..5be8b45ed 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -41,6 +41,7 @@ from openrouter.organization import Organization from openrouter.presets import Presets from openrouter.private_endpoints import PrivateEndpoints + from openrouter.private_providers import PrivateProviders from openrouter.providers import Providers from openrouter.rerank import Rerank from openrouter.responses import Responses @@ -108,6 +109,8 @@ class OpenRouter(BaseSDK): r"""Presets endpoints""" private_endpoints: "PrivateEndpoints" r"""Private Endpoints endpoints""" + private_providers: "PrivateProviders" + r"""Private Providers endpoints""" providers: "Providers" r"""Provider information endpoints""" rerank: "Rerank" @@ -154,6 +157,7 @@ class OpenRouter(BaseSDK): "organization": ("openrouter.organization", "Organization"), "presets": ("openrouter.presets", "Presets"), "private_endpoints": ("openrouter.private_endpoints", "PrivateEndpoints"), + "private_providers": ("openrouter.private_providers", "PrivateProviders"), "providers": ("openrouter.providers", "Providers"), "rerank": ("openrouter.rerank", "Rerank"), "responses": ("openrouter.responses", "Responses"), diff --git a/uv.lock b/uv.lock index 8f4d921b1..6208d04db 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.92" +version = "1.3.93" source = { editable = "." } dependencies = [ { name = "httpcore" }, From f6f7abae7282dab7d45b0412eac38059a63d9226 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 02:24:15 +0000 Subject: [PATCH 2/3] empty commit to trigger [run-tests] workflow From 4672ddde293fade7bb4afc6e26da7bd94ef5dd18 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 02:24:30 +0000 Subject: [PATCH 3/3] Chore: regenerate docs navigation Auto-generated-by: update-generated-files-action; https://github.com/OpenRouterTeam/python-sdk/actions/runs/40806145298 --- docs/docs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs.json b/docs/docs.json index 99d58bf4b..e4149f6e0 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -35,6 +35,7 @@ "sdks/organization/README", "sdks/presets/README", "sdks/privateendpoints/README", + "sdks/privateproviders/README", "sdks/providers/README", "sdks/rerank/README", "sdks/responses/README",