From 03a7a438cddcb4b1e59ec570f6e736391f303e4f Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 28 Sep 2026 22:14:27 +0000 Subject: [PATCH 1/3] ## Python SDK Changes: * `open_router.private_endpoints.list()`: **Added** * `open_router.private_endpoints.create()`: **Added** * `open_router.private_endpoints.delete()`: **Added** * `open_router.private_endpoints.get()`: **Added** * `open_router.private_endpoints.update()`: **Added** * `open_router.private_endpoints.activate()`: **Added** * `open_router.private_endpoints.disable()`: **Added** * `open_router.private_endpoints.enable()`: **Added** * `open_router.private_endpoints.update_pricing()`: **Added** * `open_router.private_endpoints.validate()`: **Added** --- .speakeasy/gen.lock | 641 +++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 1551 ++++++++ .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- .../createprivateendpointrequest.mdx | 16 + ...teprivateendpointrequestdeclaredregion.mdx | 23 + ...teendpointvalidationfailedresponsedata.mdx | 10 + ...eendpointvalidationfailedresponseerror.mdx | 10 + .../deleteprivateendpointresponse.mdx | 9 + .../deleteprivateendpointresponsedata.mdx | 9 + .../listprivateendpointsresponse.mdx | 9 + docs/components/managedprivateendpoint.mdx | 17 + .../managedprivateendpointresponse.mdx | 9 + docs/components/privateendpoint.mdx | 20 + docs/components/privateendpointactivation.mdx | 12 + docs/components/privateendpointcheck.mdx | 14 + .../components/privateendpointcheckreason.mdx | 36 + .../privateendpointdeclaredregion.mdx | 23 + docs/components/privateendpointpricing.mdx | 13 + docs/components/privateendpointresponse.mdx | 9 + docs/components/privateendpointstatus.mdx | 23 + docs/components/privateendpointsummary.mdx | 15 + docs/components/privateendpointvalidation.mdx | 10 + .../privateendpointvalidationnullable.mdx | 10 + .../privateendpointvalidationresponse.mdx | 9 + .../updateprivateendpointpricingrequest.mdx | 9 + .../updateprivateendpointrequest.mdx | 12 + ...teprivateendpointrequestdeclaredregion.mdx | 23 + .../validateprivateendpointrequest.mdx | 9 + docs/errors/badgateway.mdx | 21 + docs/errors/conflict.mdx | 21 + ...eendpointvalidationfailedresponseerror.mdx | 10 + docs/errors/internalservererror.mdx | 21 + docs/errors/notfound.mdx | 21 + docs/errors/unprocessableentity.mdx | 21 + .../activateprivateendpointglobals.mdx | 11 + .../activateprivateendpointrequest.mdx | 12 + .../createprivateendpointglobals.mdx | 11 + .../createprivateendpointrequest.mdx | 13 + .../deleteprivateendpointglobals.mdx | 11 + .../deleteprivateendpointrequest.mdx | 13 + .../disableprivateendpointglobals.mdx | 11 + .../disableprivateendpointrequest.mdx | 12 + docs/operations/draftonly.mdx | 22 + .../enableprivateendpointglobals.mdx | 11 + .../enableprivateendpointrequest.mdx | 12 + docs/operations/getprivateendpointglobals.mdx | 11 + docs/operations/getprivateendpointrequest.mdx | 12 + .../listprivateendpointsglobals.mdx | 11 + .../listprivateendpointsrequest.mdx | 11 + .../updateprivateendpointglobals.mdx | 11 + .../updateprivateendpointpricingglobals.mdx | 11 + .../updateprivateendpointpricingrequest.mdx | 13 + .../updateprivateendpointrequest.mdx | 13 + .../validateprivateendpointglobals.mdx | 11 + .../validateprivateendpointrequest.mdx | 13 + docs/sdks/privateendpoints/README.mdx | 574 +++ pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 168 + .../createprivateendpointrequest.py | 107 + ...eendpointvalidationfailedresponse_error.py | 50 + .../deleteprivateendpointresponse.py | 23 + .../listprivateendpointsresponse.py | 18 + .../components/managedprivateendpoint.py | 72 + .../managedprivateendpointresponse.py | 17 + src/openrouter/components/privateendpoint.py | 91 + .../components/privateendpointactivation.py | 19 + .../components/privateendpointcheck.py | 74 + .../components/privateendpointcheckreason.py | 29 + .../privateendpointdeclaredregion.py | 16 + .../components/privateendpointpricing.py | 24 + .../components/privateendpointresponse.py | 14 + .../components/privateendpointstatus.py | 16 + .../components/privateendpointsummary.py | 61 + .../components/privateendpointvalidation.py | 20 + .../privateendpointvalidationnullable.py | 20 + .../privateendpointvalidationresponse.py | 17 + .../updateprivateendpointpricingrequest.py | 19 + .../updateprivateendpointrequest.py | 77 + .../validateprivateendpointrequest.py | 15 + src/openrouter/errors/__init__.py | 40 + .../errors/createprivateendpoint.py | 151 + ...eendpointvalidationfailedresponse_error.py | 32 + src/openrouter/operations/__init__.py | 143 + .../operations/activateprivateendpoint.py | 144 + .../operations/createprivateendpoint.py | 162 + .../operations/deleteprivateendpoint.py | 172 + .../operations/disableprivateendpoint.py | 144 + .../operations/enableprivateendpoint.py | 144 + .../operations/getprivateendpoint.py | 144 + .../operations/listprivateendpoints.py | 137 + .../operations/updateprivateendpoint.py | 160 + .../updateprivateendpointpricing.py | 158 + .../operations/validateprivateendpoint.py | 158 + src/openrouter/private_endpoints.py | 3301 +++++++++++++++++ src/openrouter/sdk.py | 4 + uv.lock | 2 +- 99 files changed, 9658 insertions(+), 31 deletions(-) create mode 100644 docs/components/createprivateendpointrequest.mdx create mode 100644 docs/components/createprivateendpointrequestdeclaredregion.mdx create mode 100644 docs/components/createprivateendpointvalidationfailedresponsedata.mdx create mode 100644 docs/components/createprivateendpointvalidationfailedresponseerror.mdx create mode 100644 docs/components/deleteprivateendpointresponse.mdx create mode 100644 docs/components/deleteprivateendpointresponsedata.mdx create mode 100644 docs/components/listprivateendpointsresponse.mdx create mode 100644 docs/components/managedprivateendpoint.mdx create mode 100644 docs/components/managedprivateendpointresponse.mdx create mode 100644 docs/components/privateendpoint.mdx create mode 100644 docs/components/privateendpointactivation.mdx create mode 100644 docs/components/privateendpointcheck.mdx create mode 100644 docs/components/privateendpointcheckreason.mdx create mode 100644 docs/components/privateendpointdeclaredregion.mdx create mode 100644 docs/components/privateendpointpricing.mdx create mode 100644 docs/components/privateendpointresponse.mdx create mode 100644 docs/components/privateendpointstatus.mdx create mode 100644 docs/components/privateendpointsummary.mdx create mode 100644 docs/components/privateendpointvalidation.mdx create mode 100644 docs/components/privateendpointvalidationnullable.mdx create mode 100644 docs/components/privateendpointvalidationresponse.mdx create mode 100644 docs/components/updateprivateendpointpricingrequest.mdx create mode 100644 docs/components/updateprivateendpointrequest.mdx create mode 100644 docs/components/updateprivateendpointrequestdeclaredregion.mdx create mode 100644 docs/components/validateprivateendpointrequest.mdx create mode 100644 docs/errors/badgateway.mdx create mode 100644 docs/errors/conflict.mdx create mode 100644 docs/errors/createprivateendpointvalidationfailedresponseerror.mdx create mode 100644 docs/errors/internalservererror.mdx create mode 100644 docs/errors/notfound.mdx create mode 100644 docs/errors/unprocessableentity.mdx create mode 100644 docs/operations/activateprivateendpointglobals.mdx create mode 100644 docs/operations/activateprivateendpointrequest.mdx create mode 100644 docs/operations/createprivateendpointglobals.mdx create mode 100644 docs/operations/createprivateendpointrequest.mdx create mode 100644 docs/operations/deleteprivateendpointglobals.mdx create mode 100644 docs/operations/deleteprivateendpointrequest.mdx create mode 100644 docs/operations/disableprivateendpointglobals.mdx create mode 100644 docs/operations/disableprivateendpointrequest.mdx create mode 100644 docs/operations/draftonly.mdx create mode 100644 docs/operations/enableprivateendpointglobals.mdx create mode 100644 docs/operations/enableprivateendpointrequest.mdx create mode 100644 docs/operations/getprivateendpointglobals.mdx create mode 100644 docs/operations/getprivateendpointrequest.mdx create mode 100644 docs/operations/listprivateendpointsglobals.mdx create mode 100644 docs/operations/listprivateendpointsrequest.mdx create mode 100644 docs/operations/updateprivateendpointglobals.mdx create mode 100644 docs/operations/updateprivateendpointpricingglobals.mdx create mode 100644 docs/operations/updateprivateendpointpricingrequest.mdx create mode 100644 docs/operations/updateprivateendpointrequest.mdx create mode 100644 docs/operations/validateprivateendpointglobals.mdx create mode 100644 docs/operations/validateprivateendpointrequest.mdx create mode 100644 docs/sdks/privateendpoints/README.mdx create mode 100644 src/openrouter/components/createprivateendpointrequest.py create mode 100644 src/openrouter/components/createprivateendpointvalidationfailedresponse_error.py create mode 100644 src/openrouter/components/deleteprivateendpointresponse.py create mode 100644 src/openrouter/components/listprivateendpointsresponse.py create mode 100644 src/openrouter/components/managedprivateendpoint.py create mode 100644 src/openrouter/components/managedprivateendpointresponse.py create mode 100644 src/openrouter/components/privateendpoint.py create mode 100644 src/openrouter/components/privateendpointactivation.py create mode 100644 src/openrouter/components/privateendpointcheck.py create mode 100644 src/openrouter/components/privateendpointcheckreason.py create mode 100644 src/openrouter/components/privateendpointdeclaredregion.py create mode 100644 src/openrouter/components/privateendpointpricing.py create mode 100644 src/openrouter/components/privateendpointresponse.py create mode 100644 src/openrouter/components/privateendpointstatus.py create mode 100644 src/openrouter/components/privateendpointsummary.py create mode 100644 src/openrouter/components/privateendpointvalidation.py create mode 100644 src/openrouter/components/privateendpointvalidationnullable.py create mode 100644 src/openrouter/components/privateendpointvalidationresponse.py create mode 100644 src/openrouter/components/updateprivateendpointpricingrequest.py create mode 100644 src/openrouter/components/updateprivateendpointrequest.py create mode 100644 src/openrouter/components/validateprivateendpointrequest.py create mode 100644 src/openrouter/errors/createprivateendpoint.py create mode 100644 src/openrouter/errors/createprivateendpointvalidationfailedresponse_error.py create mode 100644 src/openrouter/operations/activateprivateendpoint.py create mode 100644 src/openrouter/operations/createprivateendpoint.py create mode 100644 src/openrouter/operations/deleteprivateendpoint.py create mode 100644 src/openrouter/operations/disableprivateendpoint.py create mode 100644 src/openrouter/operations/enableprivateendpoint.py create mode 100644 src/openrouter/operations/getprivateendpoint.py create mode 100644 src/openrouter/operations/listprivateendpoints.py create mode 100644 src/openrouter/operations/updateprivateendpoint.py create mode 100644 src/openrouter/operations/updateprivateendpointpricing.py create mode 100644 src/openrouter/operations/validateprivateendpoint.py create mode 100644 src/openrouter/private_endpoints.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1431d6a4..c17f0ae1 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: a2401ad3aac4fc5fe0c163088e172a32 + docChecksum: c3356957a0e3b86ce6da12f3d1aa1fc1 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.2.35 - configChecksum: 99fb51d8358af3e7ea94d8916f060ef6 + releaseVersion: 1.3.0 + configChecksum: 9d5f5553d383e15f2a7df8ac2f5a3746 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: bdd49b4a-07e2-4bec-9a1c-917e19d0a319 - pristine_commit_hash: 336d6e1dfa93962b568293da86ac841d91076c54 - pristine_tree_hash: 367e2dba4b71e2a346e6f4517501e55b698718ff + generation_id: cd12ab81-ee6c-4d46-be7c-60749e9ea3fe + pristine_commit_hash: ac9548ca76361592e90c1f0399d4bcf1fbf23d27 + pristine_tree_hash: 477aeaf0e041f94a12af985906c7654957bef9f4 features: python: acceptHeaders: 3.0.0 @@ -27,6 +27,7 @@ features: downloadStreams: 1.0.1 enumUnions: 0.1.1 envVarSecurityUsage: 0.3.3 + errorUnions: 1.0.2 flatRequests: 1.0.1 flattening: 3.1.1 globalSecurity: 3.0.7 @@ -2433,6 +2434,22 @@ trackedFiles: id: ed0298bf47bf last_write_checksum: sha1:01fc963af14788ca0453a09fe4f7a60e4420244a pristine_git_object: c31f263d23205ebfa16eb7e4ae5f33a11fb19764 + docs/components/createprivateendpointrequest.mdx: + id: 14dbb5bba6c1 + last_write_checksum: sha1:383b1208492f41531e7b5b74bbe5d8fa6e728246 + pristine_git_object: 6c0147e3adf05e7caf81c42f677ebcc69951ad07 + docs/components/createprivateendpointrequestdeclaredregion.mdx: + id: 58cea9c8b74d + last_write_checksum: sha1:7b835ef8af060b80af19bbbb1eae9ec24eabf747 + pristine_git_object: 3b4a77049a796a0434d0df0a87c86d9de12f5a90 + docs/components/createprivateendpointvalidationfailedresponsedata.mdx: + id: c07a66a2a212 + last_write_checksum: sha1:11138bbbe148da74ebd37c43f501279f431fc4cc + pristine_git_object: eff4f07a08ed5ba1eb3d594b5accd9ecaad913b9 + docs/components/createprivateendpointvalidationfailedresponseerror.mdx: + id: c24012eb9019 + last_write_checksum: sha1:4b2fdea88c117364b6334e0eb9d3de023f0152cf + pristine_git_object: 40ca96c8760fe481dba21eebb6db9936687cef3b docs/components/createscimgroupmappingrequest.mdx: id: 652e24fba424 last_write_checksum: sha1:cc05315f9faccdaf7a2acf77f4eb1099a355dc18 @@ -2685,6 +2702,14 @@ trackedFiles: id: 0f606ad36822 last_write_checksum: sha1:99269cd4a1958da8aa09cb828709ca8a734541ff pristine_git_object: 4d572b68887b463586c64afbe73498fe70b7f8d3 + docs/components/deleteprivateendpointresponse.mdx: + id: aab4bfa5bdd4 + last_write_checksum: sha1:35382bd3586d8a5dcdad4632d547e6cbef1250ee + pristine_git_object: d4e2b88164ee0dbb19abd05abc0757e7f96d4be8 + docs/components/deleteprivateendpointresponsedata.mdx: + id: d75e02f25e62 + last_write_checksum: sha1:717c0c102a766270c60168e746c1c19576e632f6 + pristine_git_object: bdef67898e0912f7216ca2c9660cd7b2ae07ceee docs/components/deletescimgroupmappingresponse.mdx: id: 3cd77320d674 last_write_checksum: sha1:b9812c5692d64fed0e49cde56531b83f57605bdc @@ -4021,6 +4046,10 @@ trackedFiles: id: a6eb4fad37a7 last_write_checksum: sha1:b6e1c0dacac17485fceedc43c19f73684c950149 pristine_git_object: 768df799d61dcc27510f108d123d4182e8f9eba3 + docs/components/listprivateendpointsresponse.mdx: + id: 1f0f578cdc03 + last_write_checksum: sha1:e16fd5c13091ecbeaa552b40c4e1423773633a3e + pristine_git_object: 5eae1fca7e5f32dea33c1cf68d288a9fa979702f docs/components/listscimgroupmappingsresponse.mdx: id: 7ac1b5a82a51 last_write_checksum: sha1:421ce0c03370b2307f26cadafe5cc0d6429f6a2b @@ -4073,6 +4102,14 @@ trackedFiles: id: 235a699032ea last_write_checksum: sha1:40352038f0f4b5f813b106b63ef2a790372788d7 pristine_git_object: 0645e0cddf32a6cfda57cc7554808c61b99ee039 + docs/components/managedprivateendpoint.mdx: + id: c2bb24179857 + last_write_checksum: sha1:5a406e066b2149135c5b8984bfb736185901ecaa + pristine_git_object: 31440c7b7496fe35d042183aaaf31a919336500b + docs/components/managedprivateendpointresponse.mdx: + id: f798eb0c37e5 + last_write_checksum: sha1:be722b659f7e961ea318b221eb039e9571b729b6 + pristine_git_object: f14bc4a6c7f9cbfe84341e6ca5bdd11cf32ff2e4 docs/components/maxprice.mdx: id: 4c021ec1bf65 last_write_checksum: sha1:3d6adde1002316d1880a95f5015889f052eb217a @@ -5737,6 +5774,54 @@ trackedFiles: id: c6ec097bacaf last_write_checksum: sha1:fc7d89ac02ff585424b5bc8cc9b0ac82338c7b6f pristine_git_object: 6a99a2737d18a3c227bf7fcabf58b481d3c7d94b + docs/components/privateendpoint.mdx: + id: 139c5b16dd66 + last_write_checksum: sha1:0b78a7ad4a5508cd530d6b121d5b171d56b00d8d + pristine_git_object: 89ec31591eb14ddf3e17ba0ff01dd1079314832a + docs/components/privateendpointactivation.mdx: + id: c5cea1d4e39d + last_write_checksum: sha1:832ee01779e755b70618c0fb80ac937ba70b15cb + pristine_git_object: 22af2c3b4ede0a2cde69d080c9a3dc60e2d1a8e3 + docs/components/privateendpointcheck.mdx: + id: 8221e9b4d716 + last_write_checksum: sha1:83a8214d6f3c97c6d56c8001f55019f28a087aa5 + pristine_git_object: 2131ef57c721601615e78e1336a41874c84e9235 + docs/components/privateendpointcheckreason.mdx: + id: "287778805047" + last_write_checksum: sha1:b74afe4459b4505186ec53978982afa6cf7f0e75 + pristine_git_object: bddfe2448682987da6a9c04aeb8ce24bea53b327 + docs/components/privateendpointdeclaredregion.mdx: + id: 6bc8d66ba11d + last_write_checksum: sha1:049bc2538e8098eb26254f01c49c81ad3d3df57b + pristine_git_object: d82f235f03d49c49a8051659a00a64753630d9b8 + docs/components/privateendpointpricing.mdx: + id: 16264ba816a0 + last_write_checksum: sha1:437150761f58fdec4106968311845cb1c59da33a + pristine_git_object: 15a8329bc1c3462e0fe11c21be108b3bb7a91b3b + docs/components/privateendpointresponse.mdx: + id: 5844d85b61d8 + last_write_checksum: sha1:4393e19b080374b66726b448399f9465ed2d2028 + pristine_git_object: ebc7588e01d90f525cd143acf20968af466f9cbe + docs/components/privateendpointstatus.mdx: + id: 170564aaaa0f + last_write_checksum: sha1:3cdf3d3142af4ece802933887e1659bca0ea26be + pristine_git_object: 0e506ec40eec711423c4e24590d1d25e66f8abc9 + docs/components/privateendpointsummary.mdx: + id: bae9c856a518 + last_write_checksum: sha1:269a7182adbdfaef7fd3f70f5bd00cfd01a2a497 + pristine_git_object: d88a936da2b944d786aaffe03e49789b097df816 + docs/components/privateendpointvalidation.mdx: + id: 0cd006e42c34 + last_write_checksum: sha1:de04c710c61d1e63b4d932116d25668f0e8d1e82 + pristine_git_object: dd31ec90b67492338cce0bbd53112a12609dab67 + docs/components/privateendpointvalidationnullable.mdx: + id: 577bfe7e104f + last_write_checksum: sha1:647ae9474113ff8e3e999dc3967c0baea7ec70ba + pristine_git_object: a7e2dfdc132acdf9fbf3532972af4df8d109da49 + docs/components/privateendpointvalidationresponse.mdx: + id: 427cb057c9e7 + last_write_checksum: sha1:fdd015dfe7b94035aef344ed4af7eeae8c037d39 + pristine_git_object: 97db30857af13859d5d0442300b9406052d32fad docs/components/progress.mdx: id: 0b8df88cc38e last_write_checksum: sha1:f7aa4681aa80d62f2a7c69b809b002f6758fe7fc @@ -7057,6 +7142,18 @@ trackedFiles: id: be9661c3676e last_write_checksum: sha1:579f2873ba3bd2694b66d17d26e3b0e99d91f29f pristine_git_object: f45af37c1fe62687b3c02068619b56ea1eef42d5 + docs/components/updateprivateendpointpricingrequest.mdx: + id: 1ed6ca2fbacb + last_write_checksum: sha1:5fd60dc4e75d09ceb512ab85008836d78969983c + pristine_git_object: 96fbfd32997780ac55660c2f202da78d780676dc + docs/components/updateprivateendpointrequest.mdx: + id: 8a1aa4763af9 + last_write_checksum: sha1:a7e5f59788d831200451567601a9ad91959edbb5 + pristine_git_object: ea23134f74e896b88f3ad49ecf5fc5c1331e2449 + docs/components/updateprivateendpointrequestdeclaredregion.mdx: + id: bb4329841f25 + last_write_checksum: sha1:b0db12e42df729be3b5ee9557f5426c6a10eebfe + pristine_git_object: 6627ee9dbb618278fe272acde18f649c5db57552 docs/components/updatescimgroupmappingrequest.mdx: id: 4318f4ed22f5 last_write_checksum: sha1:80947ab2421cee078a515582fc49381bfc2641a7 @@ -7125,6 +7222,10 @@ trackedFiles: id: a0c417921ea8 last_write_checksum: sha1:dba97f2b96e20e9ea4c21f9298e0be1d2a0d5966 pristine_git_object: 535f547efad65780088e6098364532ec4c91a6dc + docs/components/validateprivateendpointrequest.mdx: + id: 06270a63295b + last_write_checksum: sha1:3025e3488c31795e9687a5d32d81b9e05eecfe77 + pristine_git_object: d41a02a62e07c9f893ba098727ae64a22a93684e docs/components/variables.mdx: id: 3312b9777716 last_write_checksum: sha1:6ba9bb63173376b0dcb7ac22b859bfef3e3820eb @@ -7361,6 +7462,10 @@ trackedFiles: id: ac41486c3c1f last_write_checksum: sha1:2c98029247dc9be031bf9967db47f660ac7e2158 pristine_git_object: d742b5c2b96dbc33bdb8c3f9e7cd09681772e8d2 + docs/errors/badgateway.mdx: + id: 1b6118a99ede + last_write_checksum: sha1:696df8cdd9ad2e87c8bcb3163b68a95c14c56664 + pristine_git_object: e7dd4c3d47aab9f1aef14a9b6dcb03a4fc7c5fcb docs/errors/badgatewayresponseerror.mdx: id: d60591f67794 last_write_checksum: sha1:fa8405fadd704b16b0f6bbd71e923f76a3c8fc41 @@ -7377,10 +7482,18 @@ trackedFiles: id: 7621fe876155 last_write_checksum: sha1:4a2ff7fde01d9c212a4c36ebdf1cf42267b7cb48 pristine_git_object: 9c093bb2bec3aa9ad2263bda351053853d109733 + docs/errors/conflict.mdx: + id: 3cd0c5086026 + last_write_checksum: sha1:6412b587f7a535baf6033baacc98c58cbcb3d847 + pristine_git_object: 03e6ee3a2434b96f85bf3c3fbacab470115c7ed5 docs/errors/conflictresponseerror.mdx: id: 130bd0076f35 last_write_checksum: sha1:7e864ef86f3fc50e28bb4e9b1ae06fa88a46efe5 pristine_git_object: c6f96de8872f7e4039dc2cf35f6640985afe8e83 + docs/errors/createprivateendpointvalidationfailedresponseerror.mdx: + id: f831a0a69a77 + last_write_checksum: sha1:948e32db1c446b76e6a509053483a657604cf26c + pristine_git_object: 4c63b4d5bddd11cd7271d52e6ef279ceefedf574 docs/errors/edgenetworktimeoutresponseerror.mdx: id: 203457916ba1 last_write_checksum: sha1:bbaf327200c0ef9170debc1269fd0a7a4ee3ec04 @@ -7397,6 +7510,10 @@ trackedFiles: id: 98f44bb2779b last_write_checksum: sha1:5df38347f00816a1c77de490f21a2a3f1a14e170 pristine_git_object: 3584e71b6b73845bd7871fa1bd25ad91f500dc01 + docs/errors/internalservererror.mdx: + id: 3e87324bad56 + last_write_checksum: sha1:1f240a49221015bd01433d4e3847d1ecd9c7d77e + pristine_git_object: 3e9d033086e7d46fd6211cbaf0d8558cb76812e6 docs/errors/internalserverresponseerror.mdx: id: e3cb72f51ee2 last_write_checksum: sha1:144494af097e80aa9fdb921d094b2473bc598165 @@ -7409,6 +7526,10 @@ trackedFiles: id: 628a6023e104 last_write_checksum: sha1:bf1a5dd26e7c994c2bef5eef51e3a70dbccd2ceb pristine_git_object: 9de3964c049fda5bbb0bd5d37b845f2fdc572bb4 + docs/errors/notfound.mdx: + id: d11022907acc + last_write_checksum: sha1:42f60aa69b20c85464337077d2bef1d6cad21043 + pristine_git_object: a7e05bd1b40f4fb0ae0ca04961aa1dd178121f94 docs/errors/notfoundresponseerror.mdx: id: a387a1eb646c last_write_checksum: sha1:c31fd704f361e6d1d568d734c469fa9c37095f9f @@ -7445,6 +7566,10 @@ trackedFiles: id: 67ef9f36961b last_write_checksum: sha1:1fe41010da6eda651220e004e33b6c781c395056 pristine_git_object: a24d0576d4f80a63377b94ea1b5219bde4ae93fc + docs/errors/unprocessableentity.mdx: + id: 9e7130cff259 + last_write_checksum: sha1:f105ce532b3f0927dc41f39b4034155cf541a561 + pristine_git_object: 36064b7f50ef339d91500aa6714448e0c8c4a368 docs/errors/unprocessableentityresponseerror.mdx: id: 83abdd4bab47 last_write_checksum: sha1:86927f98cb0a5a2db951e1e3f916630e3bdbedb5 @@ -7457,6 +7582,14 @@ trackedFiles: id: eb84a3cc692c last_write_checksum: sha1:3cc5ffa2cf98a80d59818495896591a5e2c807c6 pristine_git_object: 5342a8f5681d437adc719527c45d23aac0ebe84c + docs/operations/activateprivateendpointglobals.mdx: + id: e25948904dd1 + last_write_checksum: sha1:8192e68cfba0ebfc3e43457c1a0391947dae28f0 + pristine_git_object: 611b1a254f3e34dfe3f76415087652e029856f5c + docs/operations/activateprivateendpointrequest.mdx: + id: ec264e1bf04f + last_write_checksum: sha1:3d4a497006d4bdb7f924ee343990963f8090c365 + pristine_git_object: fce127cf1340f9ae0ffe98cf87465f08b864f001 docs/operations/alloweddataregion.mdx: id: 9bb0791d7b23 last_write_checksum: sha1:74f92842ef5b92abfdbe951f754b240f83673194 @@ -7773,6 +7906,14 @@ trackedFiles: id: 6f3505cc8829 last_write_checksum: sha1:fcac68bcfe08ab50974d6b395244217e1731e4dd pristine_git_object: 54dde0eb3c1b5ac1d83e5724e4d085f151d881ea + docs/operations/createprivateendpointglobals.mdx: + id: b0efb5dcb7f7 + last_write_checksum: sha1:82857131da4ecceb76972f0a9a2e5cf4249400d6 + pristine_git_object: 700ae51c2795c131443f07bf19e59f5901aae49f + docs/operations/createprivateendpointrequest.mdx: + id: 3cb88260cf95 + last_write_checksum: sha1:e6efd5230f0c398402853439ef5bb0fd6e9b763e + pristine_git_object: 175cee0cd862974335be7f1300a958b168fb1fbe docs/operations/creatererankglobals.mdx: id: 4cb9d6ca73a4 last_write_checksum: sha1:6af3dafb586c07947123d4aa815cbd85212e4332 @@ -7925,6 +8066,14 @@ trackedFiles: id: 86192950ff34 last_write_checksum: sha1:c39ee4ad159c25a9bb988a1b0b32eab4ea45f58f pristine_git_object: 6dee392d1c4bbd32eda1cfac08e8daa1e3ad139e + docs/operations/deleteprivateendpointglobals.mdx: + id: 19a0cf7a5211 + last_write_checksum: sha1:2b7a8e1f4560b9484df37470aed9a2325a0fe0fe + pristine_git_object: 8d1c1ca0e98407223b582634333bb797b73e9465 + docs/operations/deleteprivateendpointrequest.mdx: + id: 2286e40fc2e2 + last_write_checksum: sha1:34334789fa5b7b1667543d327c1558b7b159ffd8 + pristine_git_object: 81a137ab94ba2d1f8f187ce3dbf29977ea03300f docs/operations/deletescimgroupmappingglobals.mdx: id: 97ed538b3737 last_write_checksum: sha1:91c7cbdd9cf6ec660575814c49ab65e2c099cea2 @@ -7965,6 +8114,14 @@ trackedFiles: id: 52770d31c173 last_write_checksum: sha1:106fc68d68ade35f65f54fbd79d0d310d7a9d620 pristine_git_object: 0f57411072fee59d70a2753c015a55ed750e435f + docs/operations/disableprivateendpointglobals.mdx: + id: e97fcec52f20 + last_write_checksum: sha1:cf0526843f9e152bebb05cf86e3e52c90e8a17ac + pristine_git_object: 5ce04b276e949508b7dd6c2adaa2470a192de075 + docs/operations/disableprivateendpointrequest.mdx: + id: 5daa17455e6c + last_write_checksum: sha1:b714e64cf8e2316f70e4b32056a4fc6fed13f87a + pristine_git_object: a7188f2b048f6e47dfd15b85fd7a23e6034d15e5 docs/operations/displayformat.mdx: id: 0bcd4e2cc7e4 last_write_checksum: sha1:f473409aa6a76c7efeedb3be29cab7d90e336581 @@ -8001,10 +8158,22 @@ trackedFiles: id: 04df99863d55 last_write_checksum: sha1:159fcd5fefb7050b22caf66819479e922ef58047 pristine_git_object: 4e0f83f3709a3122fd26e0795cd3834cb2931844 + docs/operations/draftonly.mdx: + id: da2ad1179cc5 + last_write_checksum: sha1:155cd5ab18b8adf0e387684a98c069f21906ac66 + pristine_git_object: 945e3990120851866105205d296478f5ceded378 docs/operations/embedding.mdx: id: 591dd7891964 last_write_checksum: sha1:8c8196e7ea5cf8a0a43a4495d721e4fa19530ffc pristine_git_object: 166a8bd49cf3baede0bf5b2b6ec21743f8fe00f6 + docs/operations/enableprivateendpointglobals.mdx: + id: 93a46c08baa4 + last_write_checksum: sha1:055839808788acc0015509378c983695c32dd6ad + pristine_git_object: 8ff7549f87972060bae2feae975b5f7b1e9cb52a + docs/operations/enableprivateendpointrequest.mdx: + id: 37c8953ec4b9 + last_write_checksum: sha1:062114cc5ad115944d68cca969c97b41eeec75d8 + pristine_git_object: 6ab00a007e983bc49ea54300bcc85367d808b2f2 docs/operations/encodingformat.mdx: id: 099473ef03ca last_write_checksum: sha1:c9c5058c7e63b56beefe18d726003ccd57860191 @@ -8253,6 +8422,14 @@ trackedFiles: id: 970105a3a642 last_write_checksum: sha1:001bb931da274741dca567c87c4149c11c5e67d1 pristine_git_object: c7cf40110dc4a82e2d4abdd06e98d9a28637a016 + docs/operations/getprivateendpointglobals.mdx: + id: 5d8a9d4f2aec + last_write_checksum: sha1:539f46eebe4a12048d56175c8a13e7b9cbd701b6 + pristine_git_object: 81ff79ea5597f49fe695db0c70db5e08b1b77483 + docs/operations/getprivateendpointrequest.mdx: + id: e53713bf6f69 + last_write_checksum: sha1:63ecaa773b81b44c918ceec893b007731d327522 + pristine_git_object: eb6aa4354ad20273b24ba73dce8ded5097d18c6b docs/operations/getrankingsdailycategory.mdx: id: 37dbd531ea7d last_write_checksum: sha1:3c4ffc04da2558c3357a8759ba9984ea15b58db4 @@ -8661,6 +8838,14 @@ trackedFiles: id: b6ecb3a03b2b last_write_checksum: sha1:e44b07ff960b84e2b48a81627b4b90e1de10a52d pristine_git_object: 794d77eb2d90d230d1abb28fd3b0bc895ba49ee5 + docs/operations/listprivateendpointsglobals.mdx: + id: 5d0479663b92 + last_write_checksum: sha1:c36fe39dd67f498e7828093f56ebf089ec423cb2 + pristine_git_object: 6306718f7f46e6de864121a4a60504cbbc5989ef + docs/operations/listprivateendpointsrequest.mdx: + id: 1a64f95a5b61 + last_write_checksum: sha1:de5706244c2b11fbd3cb94b64596bf88ee7664eb + pristine_git_object: bc225950e6eab664163dc45050c00ebbc1b3f41d docs/operations/listprovidersdata.mdx: id: 79d7624ebbdc last_write_checksum: sha1:2159620f48a37374a43dc2e6e8880ec6ec2e1f63 @@ -9013,6 +9198,22 @@ trackedFiles: id: d83497c7a77d last_write_checksum: sha1:de57252c9ee61e445b637c961ffb2a5e16a8b6f7 pristine_git_object: 16926383142c262c3c0f352bb40319fa48082fcd + docs/operations/updateprivateendpointglobals.mdx: + id: fb671a4175d8 + last_write_checksum: sha1:0614e90273c73cebc8fe2bb7bc430fffd5886b46 + pristine_git_object: 3624f9a241b204b21dabe33f62f7b638dd821905 + docs/operations/updateprivateendpointpricingglobals.mdx: + id: d438b0badcdd + last_write_checksum: sha1:53023f35d75c8a8b8704c5984ecc37582cf531bc + pristine_git_object: 3fea3054b12f2f24a9ee4b90df9c0faf2fc4667c + docs/operations/updateprivateendpointpricingrequest.mdx: + id: 29d65219dddb + last_write_checksum: sha1:8726a22b89325ab75a8ead12c9d4269e32568383 + pristine_git_object: 4b77bff2c6bc93b022b7244994b99715ad9dff59 + docs/operations/updateprivateendpointrequest.mdx: + id: ecd591dc8dd4 + last_write_checksum: sha1:9cdfd0f03555bb20ae9fd7dd8f1d8602ddeacd47 + pristine_git_object: 45632457e800bb4b076129192911b9b742f5b35d docs/operations/updatescimgroupmappingglobals.mdx: id: 01643bdf3b7d last_write_checksum: sha1:5865e4a382c162a7f92ec7dc8a08516570bd9c56 @@ -9057,6 +9258,14 @@ trackedFiles: id: 5b5490f35b61 last_write_checksum: sha1:70ef5b79b5514976823edf8da81f7bd8d9f93015 pristine_git_object: 8541eefab0e7110d9a895d66bebd1779e456a264 + docs/operations/validateprivateendpointglobals.mdx: + id: a50f4dbe0909 + last_write_checksum: sha1:137f6673360ef9544a89220e7a5ce5e1c81012c4 + pristine_git_object: e539875f6cc0417a1215bac1d789e267bef6c2a5 + docs/operations/validateprivateendpointrequest.mdx: + id: 11e224cdab3c + last_write_checksum: sha1:c31a95f048853f4b3ff21943d944f94b7062453c + pristine_git_object: d61a27f50bb0b546ed853b4c33f4f25ba8d371be docs/operations/value1.mdx: id: 447e93c2bc33 last_write_checksum: sha1:7bd609444ab271023bd5496797ec18383fd2670d @@ -9177,6 +9386,10 @@ trackedFiles: id: eeb505928d52 last_write_checksum: sha1:65e7d837befd019c63cc694f18cf713b979dcc15 pristine_git_object: ae5b31b25dda5ce9df2a247a13217f613c68b141 + docs/sdks/privateendpoints/README.mdx: + id: 54dee70b8cc7 + last_write_checksum: sha1:3ee195b23b8124d351823bb7ef8fb956ef281c3c + pristine_git_object: a0cd92faace314f7f90e259eb6926517c7e78335 docs/sdks/providers/README.mdx: id: 5ea9af111324 last_write_checksum: sha1:570b55655ee7602d3807c3218e450741f634eed6 @@ -9223,8 +9436,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:b54f008b7fdbfbaaf1849253c8be898d7c563f6b - pristine_git_object: 286a6312a3e2dd9fb39d8e599c5d25837301a9a4 + last_write_checksum: sha1:97b2b26c97c162638c417d551f5d0d43a6552362 + pristine_git_object: 9a4c2d4a4a872d83521c96df8d5ca708d125df6c scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -9251,8 +9464,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:1a989db800ca9c5696c3ff58b3fa7c7be557268f - pristine_git_object: 32799938ba4a93c783193c958052d98e16441205 + last_write_checksum: sha1:0ea1d6150dcbb51486224c29c1cd38333a00ae7f + pristine_git_object: c76512db319d82b3b6cebe4018d70281b8b105bf src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -9299,8 +9512,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:b65ee612b76b0c889742f132aec0e481770c8f1e - pristine_git_object: 58ea8afb885c27d87573cbcdb7d230ec29c14d03 + last_write_checksum: sha1:5b875fd512ef570b68331f22b0dd89ce57c13d60 + pristine_git_object: 0ee454721b11eefb36836850db65456c8d692464 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -10321,6 +10534,14 @@ trackedFiles: id: 4b6609465770 last_write_checksum: sha1:169981e2df08762f8cc251f2dccc9c0848a16902 pristine_git_object: ffdb3753adda06f3d93b505ab17657337c66067c + src/openrouter/components/createprivateendpointrequest.py: + id: b97ebc39b8da + last_write_checksum: sha1:53407c09059886537423c3262b8056f9dd96610d + pristine_git_object: bf06bf702c0653e1d96b54c79e37591fa7ae2fd0 + src/openrouter/components/createprivateendpointvalidationfailedresponse_error.py: + id: 9960b9ef29f1 + last_write_checksum: sha1:337c9b2191e51407481b588d7f47beeba37bc1f1 + pristine_git_object: 2648161b1a975eaa62fcaaec7d011dabc15b6b79 src/openrouter/components/createscimgroupmappingrequest.py: id: 57d83beb2d2d last_write_checksum: sha1:152e425925cc126310cee52fb6a98f6187a09261 @@ -10433,6 +10654,10 @@ trackedFiles: id: daf99e240820 last_write_checksum: sha1:485d3e763c2edd7ccd69926e2ea872eb6d031fdc pristine_git_object: 28a54ebbcd00a3b64b50c6f221b4e1e7856797a8 + src/openrouter/components/deleteprivateendpointresponse.py: + id: 0c5145c7241b + last_write_checksum: sha1:6ac945b23e9c84390ee4fbd2f436a0e975413505 + pristine_git_object: d596d9756c1bfb3bbb1076b684fbdcea8fea4a4e src/openrouter/components/deletescimgroupmappingresponse.py: id: aef026b5e627 last_write_checksum: sha1:ccf8a4261d6c889d320fcce82bd8f73ae13cb07f @@ -11025,6 +11250,10 @@ trackedFiles: id: c99fabaf956a last_write_checksum: sha1:de6c8f9f4b6ef6ef16d62918a1dd16e0ec619c88 pristine_git_object: d75ab3b91f58885e0d43d10d399f3f67a87349e8 + src/openrouter/components/listprivateendpointsresponse.py: + id: c1f34ca67614 + last_write_checksum: sha1:4974e6cc7656eac7d06e8dd2937c2383d878e3e1 + pristine_git_object: 26d0cb4bd8e30db492ddfbaa0eb52d4292626864 src/openrouter/components/listscimgroupmappingsresponse.py: id: 7170aaa087e9 last_write_checksum: sha1:4cf71a1acd3e413f920c8ac02bd3e8f497b8a124 @@ -11053,6 +11282,14 @@ trackedFiles: id: 762eac87313a last_write_checksum: sha1:30ceeda02254c422c84805de1904663d6936edf5 pristine_git_object: c961db613cc3d95cf072b8ec6eb295fb60adcd5e + src/openrouter/components/managedprivateendpoint.py: + id: 8f51e80352b5 + last_write_checksum: sha1:9be5275e051d78819fcb1e327a25cef194a051d8 + pristine_git_object: 28894d4bdc918f7f49ce1a389aa6b65a8047760c + src/openrouter/components/managedprivateendpointresponse.py: + id: 94976ac1b391 + last_write_checksum: sha1:25ae24e3bf45795169d86dbe9dd02f77cdd43ac8 + pristine_git_object: 7d96227fb0c5a240dd66565488927eb67df58441 src/openrouter/components/mcpapprovalrequestitem.py: id: 30c0962de16a last_write_checksum: sha1:d823d5a2d589949bc94d4f76dde21f8654695272 @@ -11645,6 +11882,54 @@ trackedFiles: id: 8984e4cc7422 last_write_checksum: sha1:e12629320e02396a2aa1dfcbacd6873fba0d4aba pristine_git_object: e86eb424bc592492f2903c8b3e30ec23de814991 + src/openrouter/components/privateendpoint.py: + id: 29da7e1d796a + last_write_checksum: sha1:091561e469aa3c68e28453f9cac27b4c5f243a76 + pristine_git_object: 1b85906b47046fbd404651979e52f8eb302a8397 + src/openrouter/components/privateendpointactivation.py: + id: e0dabb5cbaaf + last_write_checksum: sha1:930c5499cc0920bace93a88c89f0671da13535a1 + pristine_git_object: 55d1f8afc4053201160cb9a2042e43c4dee98ccb + src/openrouter/components/privateendpointcheck.py: + id: e36ad99df8c6 + last_write_checksum: sha1:0269e31406ee46a58f2a2f55e7767229d6727428 + pristine_git_object: 485ab4af399229e11a9986b5329b1451591740c5 + src/openrouter/components/privateendpointcheckreason.py: + id: 52f81232e913 + last_write_checksum: sha1:494026537044fbe1da8740fff300e8ea8b260a5d + pristine_git_object: 6ffcf06c517bb10538ee5b759b913a7fee8d1398 + src/openrouter/components/privateendpointdeclaredregion.py: + id: 265271c1f0ed + last_write_checksum: sha1:7b7a787dfecf4f3f62b70811498a563f5df35491 + pristine_git_object: 6a8d44a0b8ed4313318a9ebc0220de6b098cd01a + src/openrouter/components/privateendpointpricing.py: + id: 2d8979e18f5b + last_write_checksum: sha1:7542707a55468cf3356b599d5455637981e41b73 + pristine_git_object: aae91e5c9665b3104b90d055c8f2aadcdf574614 + src/openrouter/components/privateendpointresponse.py: + id: 38a49c864b72 + last_write_checksum: sha1:e9cbd209c0e4128c69645f4b4fb59508b40bb6eb + pristine_git_object: 75b7eaee3b2aea9aa60a6b3a94e947148e9b15a9 + src/openrouter/components/privateendpointstatus.py: + id: c997d801be04 + last_write_checksum: sha1:d31ca8b19b14c86ecb41e2f5825071c109b5881d + pristine_git_object: 6fce70ae8bb27d59d3edd2fc25346bc365586c6c + src/openrouter/components/privateendpointsummary.py: + id: ad5aa342bfd4 + last_write_checksum: sha1:26802ba74f7a774cb43957afca5355149fe70507 + pristine_git_object: 3a62143a45b152e7a32c4b652419fb56ec91e6dd + src/openrouter/components/privateendpointvalidation.py: + id: c9afb5f7d655 + last_write_checksum: sha1:7d4cb05d352ea7ff2d959c55290ecd74345bd557 + pristine_git_object: e77d1d3ce77c534664e6b6b0074751bb4ccc170a + src/openrouter/components/privateendpointvalidationnullable.py: + id: e0077858df0c + last_write_checksum: sha1:532242dc119ab2afee0ba13b45f1403d15e68544 + pristine_git_object: dbbcc93d99599e815282dd3098b505acd1bdb55a + src/openrouter/components/privateendpointvalidationresponse.py: + id: 371ee92c4493 + last_write_checksum: sha1:4bd041ee69f5adf310f1f647ea6d31419b843df8 + pristine_git_object: 6e8b78ced26a0853ead11ec27400f8bf98f1fa83 src/openrouter/components/promptcachebreakpoint.py: id: f1e589a13300 last_write_checksum: sha1:ea0f5d81093058c261edd1937b4c7148989a203a @@ -12217,6 +12502,14 @@ trackedFiles: id: 187c51d2b3a4 last_write_checksum: sha1:cadc62b37feddb4281e471d15627a9a1bef32cb1 pristine_git_object: 95abc42170d9ebeadee791d15c2bbc643720f1dc + src/openrouter/components/updateprivateendpointpricingrequest.py: + id: dc1e04b12316 + last_write_checksum: sha1:9b850873548f0fd6ccba35cc46abe9ecf1618091 + pristine_git_object: 3d096268edfbd2126133cf6da1bb66753ab315d6 + src/openrouter/components/updateprivateendpointrequest.py: + id: 51a950d71ff3 + last_write_checksum: sha1:1c6dd23b8d4ed56a1895bb59831181cbd8163529 + pristine_git_object: 83382c9fe2d9e5ace0dab2aae73d619f6cc1561f src/openrouter/components/updatescimgroupmappingrequest.py: id: e014a151bfdd last_write_checksum: sha1:cc62d7f12e168cbe7899f9d96144a480c32159e1 @@ -12245,6 +12538,10 @@ trackedFiles: id: fe4578e64ea3 last_write_checksum: sha1:6c7d8e616c55f8239c7bf46ebf237fa536b6c462 pristine_git_object: a0491cc8fd3bd9986146cb1176e27d5b9c9beb60 + src/openrouter/components/validateprivateendpointrequest.py: + id: 5d2f6ca184f7 + last_write_checksum: sha1:c638d9e565e13e3ac2e2e5630aec9e4a4487d303 + pristine_git_object: 13f895170a7160c3f03f365c1c10e4bc3e1c7092 src/openrouter/components/vaultsecret.py: id: 9fcf1780b21c last_write_checksum: sha1:8b04cf06d4dac935e5e4d6a7fe690167a6a56ca6 @@ -12415,8 +12712,8 @@ trackedFiles: pristine_git_object: 5c3a48759ba31aa633627707b68885b6cc367ddf src/openrouter/errors/__init__.py: id: 366154d0d60a - last_write_checksum: sha1:fa1cd59f081cdd78e65dc96982436a135c09c52a - pristine_git_object: 736f0a1509b923a539be4e02c824018f0a974d00 + last_write_checksum: sha1:44d46c6021b38dd281b9aab349c8029932fe3019 + pristine_git_object: 4adf2743b16704053d2029373794834ab693548e src/openrouter/errors/badgatewayresponse_error.py: id: 818c3605ce23 last_write_checksum: sha1:f0307bff4a47f950c514d7d47de5690cac871bbb @@ -12437,6 +12734,14 @@ trackedFiles: id: 2411f691a552 last_write_checksum: sha1:d2e3d6f7128cc321d37ec1397ee5826428764729 pristine_git_object: 09348be56a2f3a68e2df3d6b268fece842764669 + src/openrouter/errors/createprivateendpoint.py: + id: bc9d2a44c7b6 + last_write_checksum: sha1:ea72e04cbca8e1f7697930e8c24790a3331ca90f + pristine_git_object: e020e4e8ce23c05eca9b26bafd57447d1e15a68c + src/openrouter/errors/createprivateendpointvalidationfailedresponse_error.py: + id: 12cf6c010e76 + last_write_checksum: sha1:ed554486f175f167ce42b0c097379bf9d4efff7c + pristine_git_object: ec41f38f8faeb0c553e52ba651f7875ae9583ef9 src/openrouter/errors/edgenetworktimeoutresponse_error.py: id: 2a740d29452a last_write_checksum: sha1:e8d9e63398fd03823e74e41ef7db8be0a40e91aa @@ -12571,8 +12876,12 @@ trackedFiles: pristine_git_object: 8680343bbc90107ae6413bd5686012b1fd75d665 src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:2e8c81f954915a0d74656fce25cdb588c03070e3 - pristine_git_object: 9f8212cdb280d19e7fb3f1eb2b2231e37855582d + last_write_checksum: sha1:05a46c28a7f4c12a206f33662458835835a4e1af + pristine_git_object: 7f5a4f0e09cb5f8ee82cdcb5ef0559f4e222cc71 + src/openrouter/operations/activateprivateendpoint.py: + id: 3b39eec5d66f + last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 + pristine_git_object: 18eb4f5765fa783f6d40838a688d8844c558c8c5 src/openrouter/operations/bulkaddworkspacemembers.py: id: e0ed56117619 last_write_checksum: sha1:5c44eb0d40fdece3ac084615f6c6082be4cf1d5a @@ -12673,6 +12982,10 @@ trackedFiles: id: 42f8d73c9c81 last_write_checksum: sha1:05916f443a7d08b3f5a86bec00b617e267f59e33 pristine_git_object: becc8c5f5af5402ce510eda9784ba2ff675d6a94 + src/openrouter/operations/createprivateendpoint.py: + id: 4c2fd54c9685 + last_write_checksum: sha1:a38c6ca4c053147511279a12f492c8f8d6d8410e + pristine_git_object: 999c151fe23bb69aa5b3553cb22aeaaf4163adaa src/openrouter/operations/creatererank.py: id: 99b5d368a168 last_write_checksum: sha1:2a28c11eea1e64fdf5b5795912915d605d8df579 @@ -12733,6 +13046,10 @@ trackedFiles: id: efcdc4e7e19d last_write_checksum: sha1:975fb2edbcb96c6e890d1ed6ce2101ae261600d8 pristine_git_object: 92560ae6d7ad4399f3f1f8a2bf9347ac5f0d7283 + src/openrouter/operations/deleteprivateendpoint.py: + id: c61fc1252b0e + last_write_checksum: sha1:c6142890856e97d65522da974e0454484230ecfa + pristine_git_object: d24ba0719ae73603e9c2a05f66d7f69a556dab4e src/openrouter/operations/deletescimgroupmapping.py: id: 5006e36e243e last_write_checksum: sha1:e3842ba18645e0c26de1810acce50da3b90e2cfc @@ -12749,6 +13066,10 @@ trackedFiles: id: 4043f35925db last_write_checksum: sha1:01da41cff8d3a2c3e22a8999e70a3bf09bd2200c pristine_git_object: 26383186da7c0669802d9804e828e5b4281da6b8 + src/openrouter/operations/disableprivateendpoint.py: + id: 514b9d7be0b1 + last_write_checksum: sha1:d007c2a5b3a49551923729d3b2ceaa6812785847 + pristine_git_object: 9db63217306536ea59fa6c64f87ea711bc87ec4e src/openrouter/operations/downloadcontainerfilecontent.py: id: 6cbf0cdcba2b last_write_checksum: sha1:1f0e09b71d4e72178c2fec233beb56b86b6357df @@ -12757,6 +13078,10 @@ trackedFiles: id: 6ff3d391a23f last_write_checksum: sha1:a1152e6af4d5a47bdaaab7ef35dfed739f1abff4 pristine_git_object: 47e67150e4cbfc92be1fb932bf0898a34e115e23 + src/openrouter/operations/enableprivateendpoint.py: + id: 02f4c7f54845 + last_write_checksum: sha1:5aa4e2175ba075fe776ac330f32b07bf9c136906 + pristine_git_object: 4994f76e2e486e11137167c27ae95161c4c29699 src/openrouter/operations/exchangeauthcodeforapikey.py: id: 37bdd1517a07 last_write_checksum: sha1:fb531dadbabcc38e5a57b0bd3eda846790fac93a @@ -12841,6 +13166,10 @@ trackedFiles: id: 220006e17d37 last_write_checksum: sha1:b7a8663b5a480eb0dfc5ede991ed40600c35b31d pristine_git_object: cbcc9abe2ab38d7e7bd3cbc79acfda4da6b630e0 + src/openrouter/operations/getprivateendpoint.py: + id: cec9e371c5f6 + last_write_checksum: sha1:d07ec56edb56cc14a1ce268c60289c63e0c386fb + pristine_git_object: 91f86d25b38c41430f6529105f75b7eb53753fe9 src/openrouter/operations/getrankingsdaily.py: id: 61dd0325de08 last_write_checksum: sha1:352d2aeaebf68140c78343f31cc8ba344dc3d9ae @@ -12981,6 +13310,10 @@ trackedFiles: id: 697cf707300b last_write_checksum: sha1:da897aa354eef6c675649e1a1c09ff97eff7add4 pristine_git_object: 22c7b85ea089a8917a37f7c12555f06dfa69e670 + src/openrouter/operations/listprivateendpoints.py: + id: e8ea708382f5 + last_write_checksum: sha1:a8ad625eef75179574d1389a513995ef0eeeca52 + pristine_git_object: 5f70f10c60bb2d8ccc378e2b5ea00cc99f92ec57 src/openrouter/operations/listproviders.py: id: cf6e2db15118 last_write_checksum: sha1:decee82d2b55738162cc47f02f56c592d53f9ee9 @@ -13069,6 +13402,14 @@ trackedFiles: id: 18e06708d1b4 last_write_checksum: sha1:d490e19e8698ed5193df9d06673f975cb3a1410f pristine_git_object: e2819c904941d06f664a29312d9515150412ac44 + src/openrouter/operations/updateprivateendpoint.py: + id: c907f6c383b3 + last_write_checksum: sha1:cf6b47a32acb5fda4c5fc29bf9f8b170fa838a76 + pristine_git_object: f916dfcbe0f5a459756adbdeda9320c5bab6c0e5 + src/openrouter/operations/updateprivateendpointpricing.py: + id: 8c04cca6c180 + last_write_checksum: sha1:748d5e531ee17d61982327f319a882bb5492ad4b + pristine_git_object: 144cf09790cbf4d2cdb13d91171d9e7609d32370 src/openrouter/operations/updatescimgroupmapping.py: id: 5887929f6dff last_write_checksum: sha1:c989609f3c53c3e455f0ad77595a1ce07a21b6e9 @@ -13085,6 +13426,10 @@ trackedFiles: id: 67d4a2962257 last_write_checksum: sha1:698761207e9dcd052defc978a67571a34d7557d9 pristine_git_object: c313acf301e694348a91497e0459e6c1140b9223 + src/openrouter/operations/validateprivateendpoint.py: + id: 3f18701922c4 + last_write_checksum: sha1:53f28f15380b33d82dba2173dab36f1585d52752 + pristine_git_object: de47082ac5d1636fbeaa4fe1604fd4e3edcadcc8 src/openrouter/organization.py: id: 6f4c63c416e8 last_write_checksum: sha1:2dd1147964cee9fe658f3f8251f0d5bb43169f0d @@ -13093,6 +13438,10 @@ trackedFiles: id: bd0c40379dcd last_write_checksum: sha1:307215f3fac400989dbdb85eb13dbf9fbbc4b038 pristine_git_object: 38cc2e32a7d072feef1331b24b3ec22cfb789588 + src/openrouter/private_endpoints.py: + id: fdbce8846ed0 + last_write_checksum: sha1:f24e5496b1b57429d578c6422aef9ecb3b204760 + pristine_git_object: a6e38e8ee4ad2b23724bc542f651ea1b0a2f5053 src/openrouter/providers.py: id: debc4c48f149 last_write_checksum: sha1:11dbc607825edee8dcc84b39ee8171e097c47acf @@ -13115,8 +13464,8 @@ trackedFiles: pristine_git_object: a28df9a26e2dd834e5bc8974c3a61d18609c79c0 src/openrouter/sdk.py: id: ee9846c4c9c5 - last_write_checksum: sha1:d726e8a4f02fab14ad4813392f61aa6c09bca675 - pristine_git_object: 8e8741154836b6a417cf0c38c3abe2abe56c1033 + last_write_checksum: sha1:95b32fe060d0c2c11f136411102992b4b0220652 + pristine_git_object: 78cbf5d32cbf0e22a7786aa17a92b3218135ebb4 src/openrouter/sdkconfiguration.py: id: 55773bb98d7c last_write_checksum: sha1:c01826125c31a8b8bc99d9d679782c8758fae001 @@ -16569,8 +16918,260 @@ examples: application/json: {"error": {"code": 404, "message": "Intern not found"}} "500": application/json: {"error": {"code": 404, "message": "Intern not found"}} + listPrivateEndpoints: + speakeasy-default-list-private-endpoints: + responses: + "200": + application/json: {"data": [{"created_at": "2026-09-24T10:30:00Z", "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "provider_name": "Azure", "status": "active"}]} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createPrivateEndpoint: + speakeasy-default-create-private-endpoint: + requestBody: + application/json: {"model_permaslug": "openai/gpt-4o-2024-08-06", "provider_slug": "azure", "upstream_model_id": "gpt-4o-prod"} + responses: + "201": + application/json: {"data": {"created_at": "2026-09-24T10:30:00Z", "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "provider_name": "Azure", "status": "active", "declared_region": "us", "declared_zdr": true}} + "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"}} + deletePrivateEndpoint: + speakeasy-default-delete-private-endpoint: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + responses: + "200": + application/json: {"data": {"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11"}} + "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"}} + getPrivateEndpoint: + speakeasy-default-get-private-endpoint: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + responses: + "200": + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "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", "upstream_model_id": "gpt-4o-prod"}} + "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."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + updatePrivateEndpoint: + speakeasy-default-update-private-endpoint: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + requestBody: + application/json: {"upstream_model_id": "gpt-4o-prod"} + responses: + "200": + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "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", "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"}} + activatePrivateEndpoint: + speakeasy-default-activate-private-endpoint: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + responses: + "200": + application/json: {"data": {"created_at": "2026-09-24T10:30:00Z", "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "provider_name": "Azure", "status": "active", "declared_region": "us", "declared_zdr": true}} + "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"}} + disablePrivateEndpoint: + speakeasy-default-disable-private-endpoint: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + responses: + "200": + application/json: {"data": {"created_at": "2026-09-24T10:30:00Z", "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "provider_name": "Azure", "status": "active", "declared_region": "us", "declared_zdr": true}} + "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"}} + enablePrivateEndpoint: + speakeasy-default-enable-private-endpoint: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + responses: + "200": + application/json: {"data": {"created_at": "2026-09-24T10:30:00Z", "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "provider_name": "Azure", "status": "active", "declared_region": "us", "declared_zdr": true}} + "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"}} + updatePrivateEndpointPricing: + speakeasy-default-update-private-endpoint-pricing: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + requestBody: + application/json: {"pricing": {"completion": "0.00001", "prompt": "0.0000025"}} + responses: + "200": + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "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", "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"}} + validatePrivateEndpoint: + speakeasy-default-validate-private-endpoint: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + requestBody: + application/json: {"workspace_id": "550e8400-e29b-41d4-a716-446655440000"} + responses: + "200": + application/json: {"data": {"checks": [{"name": "auth_ok", "passed": true}], "passed": true}} + "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"}} examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.batch.create_batches()`: `response.results[].response.body.union(class (2)).content[].union(web_fetch_tool_result).content.union(web_fetch_tool_result_error).error_code.enum(content_too_large)` **Added** - * `open_router.batch.get_batches()`: `response.results[].response.body.union(class (2)).content[].union(web_fetch_tool_result).content.union(web_fetch_tool_result_error).error_code.enum(content_too_large)` **Added** + * `open_router.private_endpoints.list()`: **Added** + * `open_router.private_endpoints.create()`: **Added** + * `open_router.private_endpoints.delete()`: **Added** + * `open_router.private_endpoints.get()`: **Added** + * `open_router.private_endpoints.update()`: **Added** + * `open_router.private_endpoints.activate()`: **Added** + * `open_router.private_endpoints.disable()`: **Added** + * `open_router.private_endpoints.enable()`: **Added** + * `open_router.private_endpoints.update_pricing()`: **Added** + * `open_router.private_endpoints.validate()`: **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8d373ecb..eb101e15 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.2.35 + version: 1.3.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 575df297..cf7da4d7 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -9474,6 +9474,80 @@ components: required: - 'data' type: 'object' + CreatePrivateEndpointRequest: + properties: + activate: + $ref: '#/components/schemas/PrivateEndpointActivation' + 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_region: + description: 'Attest where this deployment processes data.' + enum: + - 'global' + - 'europe' + - 'us' + - null + example: 'us' + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow + declared_zdr: + description: 'Attest that this deployment retains no prompt or completion data.' + type: + - 'boolean' + - 'null' + model_permaslug: + description: 'Permanent slug of the model this endpoint serves.' + example: 'openai/gpt-4o-2024-08-06' + minLength: 1 + type: 'string' + pricing: + $ref: '#/components/schemas/PrivateEndpointPricing' + provider_slug: + description: 'Slug of the upstream provider.' + example: 'azure' + minLength: 1 + type: 'string' + upstream_model_id: + description: 'Model or deployment identifier sent to the upstream provider.' + example: 'gpt-4o-prod' + minLength: 1 + type: 'string' + required: + - 'model_permaslug' + - 'provider_slug' + - 'upstream_model_id' + type: 'object' + CreatePrivateEndpointValidationFailedResponse: + properties: + data: + properties: + endpoint: + $ref: '#/components/schemas/ManagedPrivateEndpoint' + validation: + $ref: '#/components/schemas/PrivateEndpointValidationNullable' + required: + - 'endpoint' + - 'validation' + type: 'object' + error: + properties: + code: + type: 'integer' + message: + type: 'string' + required: + - 'code' + - 'message' + type: 'object' + required: + - 'error' + - 'data' + type: 'object' CreateScimGroupMappingRequest: properties: role: @@ -10239,6 +10313,21 @@ components: required: - 'deleted' type: 'object' + DeletePrivateEndpointResponse: + properties: + data: + properties: + id: + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' + type: 'string' + required: + - 'id' + type: 'object' + required: + - 'data' + type: 'object' DeleteScimGroupMappingResponse: properties: deleted: @@ -15338,6 +15427,15 @@ components: - 'data' - 'total_count' type: 'object' + ListPrivateEndpointsResponse: + properties: + data: + items: + $ref: '#/components/schemas/PrivateEndpointSummary' + type: 'array' + required: + - 'data' + type: 'object' ListScimGroupMappingsResponse: properties: data: @@ -15533,6 +15631,29 @@ components: - 'id' - 'output' type: 'object' + ManagedPrivateEndpoint: + allOf: + - $ref: '#/components/schemas/PrivateEndpointSummary' + - properties: + declared_region: + $ref: '#/components/schemas/PrivateEndpointDeclaredRegion' + declared_zdr: + description: 'Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.' + example: true + type: + - 'boolean' + - 'null' + required: + - 'declared_zdr' + - 'declared_region' + type: 'object' + ManagedPrivateEndpointResponse: + properties: + data: + $ref: '#/components/schemas/ManagedPrivateEndpoint' + required: + - 'data' + type: 'object' McpApprovalRequestItem: description: 'Request for approval to execute an MCP tool' example: @@ -24443,6 +24564,284 @@ components: format: 'double' type: 'number' type: 'object' + PrivateEndpoint: + example: + base_url: 'https://contoso.openai.azure.com' + 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' + upstream_model_id: 'gpt-4o-prod' + properties: + base_url: + description: 'HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).' + example: 'https://contoso.openai.azure.com' + type: + - 'string' + - 'null' + declared_region: + $ref: '#/components/schemas/PrivateEndpointDeclaredRegion' + declared_zdr: + description: 'Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.' + example: true + type: + - 'boolean' + - 'null' + id: + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' + type: 'string' + model_name: + description: 'Display name of the model, or `null` when the model is no longer listed.' + example: 'OpenAI: GPT-4o' + type: + - 'string' + - 'null' + model_permaslug: + description: 'Permanent slug of the model this endpoint serves.' + example: 'openai/gpt-4o-2024-08-06' + type: 'string' + model_slug: + description: 'Public model slug, or `null` when the model is no longer listed.' + example: 'openai/gpt-4o' + type: + - 'string' + - 'null' + pricing: + $ref: '#/components/schemas/PrivateEndpointPricing' + provider_name: + description: 'Display name of the upstream provider.' + example: 'Azure' + type: 'string' + provider_slug: + description: 'Slug of the upstream provider, or `null` when the provider is no longer listed.' + example: 'azure' + type: + - 'string' + - 'null' + status: + $ref: '#/components/schemas/PrivateEndpointStatus' + upstream_model_id: + description: 'Model or deployment identifier sent to the upstream provider.' + example: 'gpt-4o-prod' + type: 'string' + required: + - 'id' + - 'status' + - 'model_permaslug' + - 'model_slug' + - 'model_name' + - 'provider_name' + - 'provider_slug' + - 'base_url' + - 'upstream_model_id' + - 'declared_zdr' + - 'declared_region' + - 'pricing' + 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.' + example: + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + properties: + workspace_id: + description: 'Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account.' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + required: + - 'workspace_id' + type: 'object' + PrivateEndpointCheck: + example: + name: 'auth_ok' + passed: true + properties: + actual_model: + description: 'Model the upstream reported serving, when it differs from the request.' + type: + - 'string' + - 'null' + name: + description: 'Check name.' + example: 'auth_ok' + type: 'string' + passed: + type: 'boolean' + reason: + $ref: '#/components/schemas/PrivateEndpointCheckReason' + upstream_message: + description: 'Error message returned by your deployment when the call failed.' + type: + - 'string' + - 'null' + upstream_status: + description: 'HTTP status returned by your deployment when the call failed.' + maximum: 599 + minimum: 400 + type: 'integer' + required: + - 'name' + - 'passed' + type: 'object' + PrivateEndpointCheckReason: + description: 'Why the check failed.' + enum: + - 'database_error' + - 'endpoint_limit_reached' + - 'invalid_base_url' + - 'model_not_found' + - 'provider_not_found' + - 'endpoint_not_found' + - 'workspace_not_found' + - 'no_byok_key' + - 'key_decryption_failed' + - 'upstream_error' + - 'invalid_response' + - 'invalid_stream' + - 'missing_usage' + - 'model_mismatch' + - 'not_validated' + - 'validation_stale' + example: 'no_byok_key' + type: 'string' + x-speakeasy-unknown-values: allow + PrivateEndpointDeclaredRegion: + description: 'Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.' + enum: + - 'global' + - 'europe' + - 'us' + - null + example: 'us' + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow + PrivateEndpointPricing: + description: 'Negotiated per-token rates reported for requests routed to this endpoint.' + example: + completion: '0.00001' + prompt: '0.0000025' + properties: + completion: + description: 'USD per completion token, as a decimal string.' + example: '0.00001' + pattern: '^\d+(\.\d+)?$' + type: 'string' + prompt: + description: 'USD per prompt token, as a decimal string.' + example: '0.0000025' + pattern: '^\d+(\.\d+)?$' + type: 'string' + required: + - 'prompt' + - 'completion' + type: 'object' + PrivateEndpointResponse: + properties: + data: + $ref: '#/components/schemas/PrivateEndpoint' + required: + - 'data' + type: 'object' + PrivateEndpointStatus: + description: 'Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.' + enum: + - 'draft' + - 'active' + - 'disabled' + example: 'active' + type: 'string' + x-speakeasy-unknown-values: allow + PrivateEndpointSummary: + properties: + created_at: + description: 'ISO timestamp of when the endpoint was created.' + example: '2026-09-24T10:30:00Z' + type: 'string' + id: + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' + type: 'string' + model_name: + description: 'Display name of the model, or `null` when the model is no longer listed.' + example: 'OpenAI: GPT-4o' + type: + - 'string' + - 'null' + model_permaslug: + description: 'Permanent slug of the model this endpoint serves.' + example: 'openai/gpt-4o-2024-08-06' + type: 'string' + model_slug: + description: 'Public model slug, or `null` when the model is no longer listed.' + example: 'openai/gpt-4o' + type: + - 'string' + - 'null' + provider_name: + description: 'Display name of the upstream provider.' + example: 'Azure' + type: 'string' + status: + $ref: '#/components/schemas/PrivateEndpointStatus' + required: + - 'id' + - 'status' + - 'model_permaslug' + - 'model_slug' + - 'model_name' + - 'provider_name' + - 'created_at' + type: 'object' + PrivateEndpointValidation: + properties: + checks: + items: + $ref: '#/components/schemas/PrivateEndpointCheck' + type: 'array' + passed: + description: 'Whether every check passed.' + example: true + type: 'boolean' + required: + - 'passed' + - 'checks' + type: 'object' + PrivateEndpointValidationNullable: + properties: + checks: + items: + $ref: '#/components/schemas/PrivateEndpointCheck' + type: 'array' + passed: + description: 'Whether every check passed.' + example: true + type: 'boolean' + required: + - 'passed' + - 'checks' + type: + - 'object' + - 'null' + PrivateEndpointValidationResponse: + properties: + data: + $ref: '#/components/schemas/PrivateEndpointValidation' + required: + - 'data' + type: 'object' PromptCacheBreakpoint: description: 'Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.' example: @@ -30044,6 +30443,45 @@ components: required: - 'data' type: 'object' + UpdatePrivateEndpointPricingRequest: + properties: + pricing: + $ref: '#/components/schemas/PrivateEndpointPricing' + required: + - 'pricing' + type: 'object' + UpdatePrivateEndpointRequest: + 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_region: + description: 'Attest where this deployment processes data.' + enum: + - 'global' + - 'europe' + - 'us' + - null + example: 'us' + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow + declared_zdr: + description: 'Attest that this deployment retains no prompt or completion data.' + type: + - 'boolean' + - 'null' + 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' UpdateScimGroupMappingRequest: properties: role: @@ -30308,6 +30746,16 @@ components: output_tokens_details: reasoning_tokens: 0 total_tokens: 35 + ValidatePrivateEndpointRequest: + properties: + workspace_id: + description: 'Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account.' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + required: + - 'workspace_id' + type: 'object' VaultSecret: additionalProperties: false description: 'Metadata for one stored secret. The secret value is never returned. `fingerprint` is an HMAC-SHA-256 of the value keyed with that vault''s own data key, so it is comparable only within one vault: equal fingerprints in one vault mean equal values, and rewriting the same value keeps its fingerprint. The same value stored in two vaults (for example a workspace secret and its intern copy) carries different fingerprints, so comparing fingerprints across vaults cannot show that a copy matches or that a rotation propagated. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.' @@ -44797,6 +45245,1107 @@ paths: - $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`. [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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is 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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is 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: + 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: 'Get 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' + 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' + 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' + '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: 'Update a draft private endpoint' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'update' + 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' + 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/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: + 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: 'Activate a validated private endpoint' + tags: + - 'Private Endpoints' + 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' + 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/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: + 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: 'Disable a private endpoint' + tags: + - 'Private Endpoints' + 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' + 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/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: + 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: 'Enable a private endpoint' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'enable' + 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. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updatePrivateEndpointPricing' + 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' + 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' + '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: 'Set private endpoint pricing' + 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' + 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' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePrivateEndpointRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PrivateEndpointValidationResponse' + description: 'Validation checks' + '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: 'Validate a draft private endpoint' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'validate' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /providers: get: operationId: 'listProviders' @@ -49719,6 +51268,8 @@ tags: name: 'Organization' - description: 'Presets endpoints' name: 'Presets' + - description: 'Private Endpoints endpoints' + name: 'Private Endpoints' - description: 'Provider information endpoints' name: 'Providers' - description: 'Rerank endpoints' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 9005510b..55738b9b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:910e264f9a00f7e834896aac83ecef253242985385f788646e3a04172a7b64c3 - sourceBlobDigest: sha256:5ebe36b2519c0198269ec50ff659ee4bef5aec35a3f43248bc5aea07e2cbcda1 + sourceRevisionDigest: sha256:77833092b90f7e68c3d4892bd2f092d7bfee0703b8d027f05e8247f34b063ded + sourceBlobDigest: sha256:1bb6c8de10cfe9440ea0a95a3ae644ccad440c7851e9225e22087764493f1f05 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:910e264f9a00f7e834896aac83ecef253242985385f788646e3a04172a7b64c3 - sourceBlobDigest: sha256:5ebe36b2519c0198269ec50ff659ee4bef5aec35a3f43248bc5aea07e2cbcda1 + sourceRevisionDigest: sha256:77833092b90f7e68c3d4892bd2f092d7bfee0703b8d027f05e8247f34b063ded + sourceBlobDigest: sha256:1bb6c8de10cfe9440ea0a95a3ae644ccad440c7851e9225e22087764493f1f05 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:f7ef594a9da944bd1489828f43830d7c53792be215ee0cd684ac1d974d854563 + codeSamplesRevisionDigest: sha256:421137ec0ba899d41251c3a83c819b71b205a0fe355971bbe8b248add9e1152d workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index a06fa8fc..ec944953 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2759,4 +2759,14 @@ Based on: ### Generated - [python v1.2.35] . ### Releases -- [PyPI v1.2.35] https://pypi.org/project/openrouter/1.2.35 - . \ No newline at end of file +- [PyPI v1.2.35] https://pypi.org/project/openrouter/1.2.35 - . + +## 2026-09-28 22:11:48 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.0] . +### Releases +- [PyPI v1.3.0] https://pypi.org/project/openrouter/1.3.0 - . \ No newline at end of file diff --git a/docs/components/createprivateendpointrequest.mdx b/docs/components/createprivateendpointrequest.mdx new file mode 100644 index 00000000..6c0147e3 --- /dev/null +++ b/docs/components/createprivateendpointrequest.mdx @@ -0,0 +1,16 @@ +--- +title: "CreatePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `activate` | [Optional[components.PrivateEndpointActivation]](../components/privateendpointactivation.mdx) | :heavy_minus_sign: | 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. | \{
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | +| `base_url` | *Optional[str]* | :heavy_minus_sign: | 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.CreatePrivateEndpointRequestDeclaredRegion]](../components/createprivateendpointrequestdeclaredregion.mdx) | :heavy_minus_sign: | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Attest that this deployment retains no prompt or completion data. | | +| `model_permaslug` | *str* | :heavy_check_mark: | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `pricing` | [Optional[components.PrivateEndpointPricing]](../components/privateendpointpricing.mdx) | :heavy_minus_sign: | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `provider_slug` | *str* | :heavy_check_mark: | Slug of the upstream provider. | azure | +| `upstream_model_id` | *str* | :heavy_check_mark: | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/createprivateendpointrequestdeclaredregion.mdx b/docs/components/createprivateendpointrequestdeclaredregion.mdx new file mode 100644 index 00000000..3b4a7704 --- /dev/null +++ b/docs/components/createprivateendpointrequestdeclaredregion.mdx @@ -0,0 +1,23 @@ +--- +title: "CreatePrivateEndpointRequestDeclaredRegion" +--- + +Attest where this deployment processes data. + +## Example Usage + +```python +from openrouter.components import CreatePrivateEndpointRequestDeclaredRegion + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: CreatePrivateEndpointRequestDeclaredRegion = "global" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"global"` +- `"europe"` +- `"us"` diff --git a/docs/components/createprivateendpointvalidationfailedresponsedata.mdx b/docs/components/createprivateendpointvalidationfailedresponsedata.mdx new file mode 100644 index 00000000..eff4f07a --- /dev/null +++ b/docs/components/createprivateendpointvalidationfailedresponsedata.mdx @@ -0,0 +1,10 @@ +--- +title: "CreatePrivateEndpointValidationFailedResponseData" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `endpoint` | [components.ManagedPrivateEndpoint](../components/managedprivateendpoint.mdx) | :heavy_check_mark: | N/A | +| `validation` | [Nullable[components.PrivateEndpointValidationNullable]](../components/privateendpointvalidationnullable.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/createprivateendpointvalidationfailedresponseerror.mdx b/docs/components/createprivateendpointvalidationfailedresponseerror.mdx new file mode 100644 index 00000000..40ca96c8 --- /dev/null +++ b/docs/components/createprivateendpointvalidationfailedresponseerror.mdx @@ -0,0 +1,10 @@ +--- +title: "CreatePrivateEndpointValidationFailedResponseError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `code` | *int* | :heavy_check_mark: | N/A | +| `message` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/deleteprivateendpointresponse.mdx b/docs/components/deleteprivateendpointresponse.mdx new file mode 100644 index 00000000..d4e2b881 --- /dev/null +++ b/docs/components/deleteprivateendpointresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "DeletePrivateEndpointResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `data` | [components.DeletePrivateEndpointResponseData](../components/deleteprivateendpointresponsedata.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/deleteprivateendpointresponsedata.mdx b/docs/components/deleteprivateendpointresponsedata.mdx new file mode 100644 index 00000000..bdef6789 --- /dev/null +++ b/docs/components/deleteprivateendpointresponsedata.mdx @@ -0,0 +1,9 @@ +--- +title: "DeletePrivateEndpointResponseData" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | \ No newline at end of file diff --git a/docs/components/listprivateendpointsresponse.mdx b/docs/components/listprivateendpointsresponse.mdx new file mode 100644 index 00000000..5eae1fca --- /dev/null +++ b/docs/components/listprivateendpointsresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "ListPrivateEndpointsResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `data` | List[[components.PrivateEndpointSummary](../components/privateendpointsummary.mdx)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/managedprivateendpoint.mdx b/docs/components/managedprivateendpoint.mdx new file mode 100644 index 00000000..31440c7b --- /dev/null +++ b/docs/components/managedprivateendpoint.mdx @@ -0,0 +1,17 @@ +--- +title: "ManagedPrivateEndpoint" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | *str* | :heavy_check_mark: | ISO timestamp of when the endpoint was created. | 2026-09-24T10:30:00Z | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `model_name` | *Nullable[str]* | :heavy_check_mark: | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | +| `model_permaslug` | *str* | :heavy_check_mark: | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `model_slug` | *Nullable[str]* | :heavy_check_mark: | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | +| `provider_name` | *str* | :heavy_check_mark: | Display name of the upstream provider. | Azure | +| `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | :heavy_check_mark: | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | +| `declared_region` | [Nullable[components.PrivateEndpointDeclaredRegion]](../components/privateendpointdeclaredregion.mdx) | :heavy_check_mark: | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | +| `declared_zdr` | *Nullable[bool]* | :heavy_check_mark: | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | \ No newline at end of file diff --git a/docs/components/managedprivateendpointresponse.mdx b/docs/components/managedprivateendpointresponse.mdx new file mode 100644 index 00000000..f14bc4a6 --- /dev/null +++ b/docs/components/managedprivateendpointresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "ManagedPrivateEndpointResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `data` | [components.ManagedPrivateEndpoint](../components/managedprivateendpoint.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/privateendpoint.mdx b/docs/components/privateendpoint.mdx new file mode 100644 index 00000000..89ec3159 --- /dev/null +++ b/docs/components/privateendpoint.mdx @@ -0,0 +1,20 @@ +--- +title: "PrivateEndpoint" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `base_url` | *Nullable[str]* | :heavy_check_mark: | 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_region` | [Nullable[components.PrivateEndpointDeclaredRegion]](../components/privateendpointdeclaredregion.mdx) | :heavy_check_mark: | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | +| `declared_zdr` | *Nullable[bool]* | :heavy_check_mark: | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `model_name` | *Nullable[str]* | :heavy_check_mark: | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | +| `model_permaslug` | *str* | :heavy_check_mark: | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `model_slug` | *Nullable[str]* | :heavy_check_mark: | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | +| `pricing` | [components.PrivateEndpointPricing](../components/privateendpointpricing.mdx) | :heavy_check_mark: | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `provider_name` | *str* | :heavy_check_mark: | Display name of the upstream provider. | Azure | +| `provider_slug` | *Nullable[str]* | :heavy_check_mark: | Slug of the upstream provider, or `null` when the provider is no longer listed. | azure | +| `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | :heavy_check_mark: | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | +| `upstream_model_id` | *str* | :heavy_check_mark: | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/privateendpointactivation.mdx b/docs/components/privateendpointactivation.mdx new file mode 100644 index 00000000..22af2c3b --- /dev/null +++ b/docs/components/privateendpointactivation.mdx @@ -0,0 +1,12 @@ +--- +title: "PrivateEndpointActivation" +--- + +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. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `workspace_id` | *str* | :heavy_check_mark: | Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/components/privateendpointcheck.mdx b/docs/components/privateendpointcheck.mdx new file mode 100644 index 00000000..2131ef57 --- /dev/null +++ b/docs/components/privateendpointcheck.mdx @@ -0,0 +1,14 @@ +--- +title: "PrivateEndpointCheck" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `actual_model` | *OptionalNullable[str]* | :heavy_minus_sign: | Model the upstream reported serving, when it differs from the request. | | +| `name` | *str* | :heavy_check_mark: | Check name. | auth_ok | +| `passed` | *bool* | :heavy_check_mark: | N/A | | +| `reason` | [Optional[components.PrivateEndpointCheckReason]](../components/privateendpointcheckreason.mdx) | :heavy_minus_sign: | Why the check failed. | no_byok_key | +| `upstream_message` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message returned by your deployment when the call failed. | | +| `upstream_status` | *Optional[int]* | :heavy_minus_sign: | HTTP status returned by your deployment when the call failed. | | \ No newline at end of file diff --git a/docs/components/privateendpointcheckreason.mdx b/docs/components/privateendpointcheckreason.mdx new file mode 100644 index 00000000..bddfe244 --- /dev/null +++ b/docs/components/privateendpointcheckreason.mdx @@ -0,0 +1,36 @@ +--- +title: "PrivateEndpointCheckReason" +--- + +Why the check failed. + +## Example Usage + +```python +from openrouter.components import PrivateEndpointCheckReason + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrivateEndpointCheckReason = "database_error" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"database_error"` +- `"endpoint_limit_reached"` +- `"invalid_base_url"` +- `"model_not_found"` +- `"provider_not_found"` +- `"endpoint_not_found"` +- `"workspace_not_found"` +- `"no_byok_key"` +- `"key_decryption_failed"` +- `"upstream_error"` +- `"invalid_response"` +- `"invalid_stream"` +- `"missing_usage"` +- `"model_mismatch"` +- `"not_validated"` +- `"validation_stale"` diff --git a/docs/components/privateendpointdeclaredregion.mdx b/docs/components/privateendpointdeclaredregion.mdx new file mode 100644 index 00000000..d82f235f --- /dev/null +++ b/docs/components/privateendpointdeclaredregion.mdx @@ -0,0 +1,23 @@ +--- +title: "PrivateEndpointDeclaredRegion" +--- + +Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. + +## Example Usage + +```python +from openrouter.components import PrivateEndpointDeclaredRegion + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrivateEndpointDeclaredRegion = "global" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"global"` +- `"europe"` +- `"us"` diff --git a/docs/components/privateendpointpricing.mdx b/docs/components/privateendpointpricing.mdx new file mode 100644 index 00000000..15a8329b --- /dev/null +++ b/docs/components/privateendpointpricing.mdx @@ -0,0 +1,13 @@ +--- +title: "PrivateEndpointPricing" +--- + +Negotiated per-token rates reported for requests routed to this endpoint. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `completion` | *str* | :heavy_check_mark: | USD per completion token, as a decimal string. | 0.00001 | +| `prompt` | *str* | :heavy_check_mark: | USD per prompt token, as a decimal string. | 0.0000025 | \ No newline at end of file diff --git a/docs/components/privateendpointresponse.mdx b/docs/components/privateendpointresponse.mdx new file mode 100644 index 00000000..ebc7588e --- /dev/null +++ b/docs/components/privateendpointresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "PrivateEndpointResponse" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.PrivateEndpoint](../components/privateendpoint.mdx) | :heavy_check_mark: | N/A | \{
"base_url": "https://contoso.openai.azure.com",
"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",
"upstream_model_id": "gpt-4o-prod"
} | \ No newline at end of file diff --git a/docs/components/privateendpointstatus.mdx b/docs/components/privateendpointstatus.mdx new file mode 100644 index 00000000..0e506ec4 --- /dev/null +++ b/docs/components/privateendpointstatus.mdx @@ -0,0 +1,23 @@ +--- +title: "PrivateEndpointStatus" +--- + +Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. + +## Example Usage + +```python +from openrouter.components import PrivateEndpointStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrivateEndpointStatus = "draft" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"draft"` +- `"active"` +- `"disabled"` diff --git a/docs/components/privateendpointsummary.mdx b/docs/components/privateendpointsummary.mdx new file mode 100644 index 00000000..d88a936d --- /dev/null +++ b/docs/components/privateendpointsummary.mdx @@ -0,0 +1,15 @@ +--- +title: "PrivateEndpointSummary" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | *str* | :heavy_check_mark: | ISO timestamp of when the endpoint was created. | 2026-09-24T10:30:00Z | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `model_name` | *Nullable[str]* | :heavy_check_mark: | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | +| `model_permaslug` | *str* | :heavy_check_mark: | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `model_slug` | *Nullable[str]* | :heavy_check_mark: | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | +| `provider_name` | *str* | :heavy_check_mark: | Display name of the upstream provider. | Azure | +| `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | :heavy_check_mark: | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | \ No newline at end of file diff --git a/docs/components/privateendpointvalidation.mdx b/docs/components/privateendpointvalidation.mdx new file mode 100644 index 00000000..dd31ec90 --- /dev/null +++ b/docs/components/privateendpointvalidation.mdx @@ -0,0 +1,10 @@ +--- +title: "PrivateEndpointValidation" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `checks` | List[[components.PrivateEndpointCheck](../components/privateendpointcheck.mdx)] | :heavy_check_mark: | N/A | | +| `passed` | *bool* | :heavy_check_mark: | Whether every check passed. | true | \ No newline at end of file diff --git a/docs/components/privateendpointvalidationnullable.mdx b/docs/components/privateendpointvalidationnullable.mdx new file mode 100644 index 00000000..a7e2dfdc --- /dev/null +++ b/docs/components/privateendpointvalidationnullable.mdx @@ -0,0 +1,10 @@ +--- +title: "PrivateEndpointValidationNullable" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `checks` | List[[components.PrivateEndpointCheck](../components/privateendpointcheck.mdx)] | :heavy_check_mark: | N/A | | +| `passed` | *bool* | :heavy_check_mark: | Whether every check passed. | true | \ No newline at end of file diff --git a/docs/components/privateendpointvalidationresponse.mdx b/docs/components/privateendpointvalidationresponse.mdx new file mode 100644 index 00000000..97db3085 --- /dev/null +++ b/docs/components/privateendpointvalidationresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "PrivateEndpointValidationResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `data` | [components.PrivateEndpointValidation](../components/privateendpointvalidation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/updateprivateendpointpricingrequest.mdx b/docs/components/updateprivateendpointpricingrequest.mdx new file mode 100644 index 00000000..96fbfd32 --- /dev/null +++ b/docs/components/updateprivateendpointpricingrequest.mdx @@ -0,0 +1,9 @@ +--- +title: "UpdatePrivateEndpointPricingRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `pricing` | [components.PrivateEndpointPricing](../components/privateendpointpricing.mdx) | :heavy_check_mark: | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"completion": "0.00001",
"prompt": "0.0000025"
} | \ No newline at end of file diff --git a/docs/components/updateprivateendpointrequest.mdx b/docs/components/updateprivateendpointrequest.mdx new file mode 100644 index 00000000..ea23134f --- /dev/null +++ b/docs/components/updateprivateendpointrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "UpdatePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `base_url` | *Optional[str]* | :heavy_minus_sign: | 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) | :heavy_minus_sign: | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Attest that this deployment retains no prompt or completion data. | | +| `upstream_model_id` | *str* | :heavy_check_mark: | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/updateprivateendpointrequestdeclaredregion.mdx b/docs/components/updateprivateendpointrequestdeclaredregion.mdx new file mode 100644 index 00000000..6627ee9d --- /dev/null +++ b/docs/components/updateprivateendpointrequestdeclaredregion.mdx @@ -0,0 +1,23 @@ +--- +title: "UpdatePrivateEndpointRequestDeclaredRegion" +--- + +Attest where this deployment processes data. + +## Example Usage + +```python +from openrouter.components import UpdatePrivateEndpointRequestDeclaredRegion + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: UpdatePrivateEndpointRequestDeclaredRegion = "global" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"global"` +- `"europe"` +- `"us"` diff --git a/docs/components/validateprivateendpointrequest.mdx b/docs/components/validateprivateendpointrequest.mdx new file mode 100644 index 00000000..d41a02a6 --- /dev/null +++ b/docs/components/validateprivateendpointrequest.mdx @@ -0,0 +1,9 @@ +--- +title: "ValidatePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `workspace_id` | *str* | :heavy_check_mark: | Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/errors/badgateway.mdx b/docs/errors/badgateway.mdx new file mode 100644 index 00000000..e7dd4c3d --- /dev/null +++ b/docs/errors/badgateway.mdx @@ -0,0 +1,21 @@ +--- +title: "BadGateway" +--- + +An upstream dependency failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks. + + +## Supported Types + +### `errors.CreatePrivateEndpointValidationFailedResponseError` + +```python +value: errors.CreatePrivateEndpointValidationFailedResponseError = /* values here */ +``` + +### `errors.BadGatewayResponseError` + +```python +value: errors.BadGatewayResponseError = /* values here */ +``` + diff --git a/docs/errors/conflict.mdx b/docs/errors/conflict.mdx new file mode 100644 index 00000000..03e6ee3a --- /dev/null +++ b/docs/errors/conflict.mdx @@ -0,0 +1,21 @@ +--- +title: "Conflict" +--- + +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. + + +## Supported Types + +### `errors.CreatePrivateEndpointValidationFailedResponseError` + +```python +value: errors.CreatePrivateEndpointValidationFailedResponseError = /* values here */ +``` + +### `errors.ConflictResponseError` + +```python +value: errors.ConflictResponseError = /* values here */ +``` + diff --git a/docs/errors/createprivateendpointvalidationfailedresponseerror.mdx b/docs/errors/createprivateendpointvalidationfailedresponseerror.mdx new file mode 100644 index 00000000..4c63b4d5 --- /dev/null +++ b/docs/errors/createprivateendpointvalidationfailedresponseerror.mdx @@ -0,0 +1,10 @@ +--- +title: "CreatePrivateEndpointValidationFailedResponseError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `data` | [components.CreatePrivateEndpointValidationFailedResponseData](../components/createprivateendpointvalidationfailedresponsedata.mdx) | :heavy_check_mark: | N/A | +| `error` | [components.CreatePrivateEndpointValidationFailedResponseError](../components/createprivateendpointvalidationfailedresponseerror.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/errors/internalservererror.mdx b/docs/errors/internalservererror.mdx new file mode 100644 index 00000000..3e9d0330 --- /dev/null +++ b/docs/errors/internalservererror.mdx @@ -0,0 +1,21 @@ +--- +title: "InternalServerError" +--- + +Internal server error. When `activate` was passed and the draft was created, `data` carries it and any validation checks. + + +## Supported Types + +### `errors.CreatePrivateEndpointValidationFailedResponseError` + +```python +value: errors.CreatePrivateEndpointValidationFailedResponseError = /* values here */ +``` + +### `errors.InternalServerResponseError` + +```python +value: errors.InternalServerResponseError = /* values here */ +``` + diff --git a/docs/errors/notfound.mdx b/docs/errors/notfound.mdx new file mode 100644 index 00000000..a7e05bd1 --- /dev/null +++ b/docs/errors/notfound.mdx @@ -0,0 +1,21 @@ +--- +title: "NotFound" +--- + +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. + + +## Supported Types + +### `errors.CreatePrivateEndpointValidationFailedResponseError` + +```python +value: errors.CreatePrivateEndpointValidationFailedResponseError = /* values here */ +``` + +### `errors.NotFoundResponseError` + +```python +value: errors.NotFoundResponseError = /* values here */ +``` + diff --git a/docs/errors/unprocessableentity.mdx b/docs/errors/unprocessableentity.mdx new file mode 100644 index 00000000..36064b7f --- /dev/null +++ b/docs/errors/unprocessableentity.mdx @@ -0,0 +1,21 @@ +--- +title: "UnprocessableEntity" +--- + +The request was invalid, or validation failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks. + + +## Supported Types + +### `errors.CreatePrivateEndpointValidationFailedResponseError` + +```python +value: errors.CreatePrivateEndpointValidationFailedResponseError = /* values here */ +``` + +### `errors.UnprocessableEntityResponseError` + +```python +value: errors.UnprocessableEntityResponseError = /* values here */ +``` + diff --git a/docs/operations/activateprivateendpointglobals.mdx b/docs/operations/activateprivateendpointglobals.mdx new file mode 100644 index 00000000..611b1a25 --- /dev/null +++ b/docs/operations/activateprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ActivatePrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/activateprivateendpointrequest.mdx b/docs/operations/activateprivateendpointrequest.mdx new file mode 100644 index 00000000..fce127cf --- /dev/null +++ b/docs/operations/activateprivateendpointrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "ActivatePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | \ No newline at end of file diff --git a/docs/operations/createprivateendpointglobals.mdx b/docs/operations/createprivateendpointglobals.mdx new file mode 100644 index 00000000..700ae51c --- /dev/null +++ b/docs/operations/createprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "CreatePrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createprivateendpointrequest.mdx b/docs/operations/createprivateendpointrequest.mdx new file mode 100644 index 00000000..175cee0c --- /dev/null +++ b/docs/operations/createprivateendpointrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "CreatePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | 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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | +| `create_private_endpoint_request` | [components.CreatePrivateEndpointRequest](../components/createprivateendpointrequest.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/deleteprivateendpointglobals.mdx b/docs/operations/deleteprivateendpointglobals.mdx new file mode 100644 index 00000000..8d1c1ca0 --- /dev/null +++ b/docs/operations/deleteprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "DeletePrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/deleteprivateendpointrequest.mdx b/docs/operations/deleteprivateendpointrequest.mdx new file mode 100644 index 00000000..81a137ab --- /dev/null +++ b/docs/operations/deleteprivateendpointrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "DeletePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `draft_only` | [Optional[operations.DraftOnly]](../operations/draftonly.mdx) | :heavy_minus_sign: | When `true`, only delete the endpoint if it is still a draft (409 otherwise). | | \ No newline at end of file diff --git a/docs/operations/disableprivateendpointglobals.mdx b/docs/operations/disableprivateendpointglobals.mdx new file mode 100644 index 00000000..5ce04b27 --- /dev/null +++ b/docs/operations/disableprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "DisablePrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/disableprivateendpointrequest.mdx b/docs/operations/disableprivateendpointrequest.mdx new file mode 100644 index 00000000..a7188f2b --- /dev/null +++ b/docs/operations/disableprivateendpointrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "DisablePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | \ No newline at end of file diff --git a/docs/operations/draftonly.mdx b/docs/operations/draftonly.mdx new file mode 100644 index 00000000..945e3990 --- /dev/null +++ b/docs/operations/draftonly.mdx @@ -0,0 +1,22 @@ +--- +title: "DraftOnly" +--- + +When `true`, only delete the endpoint if it is still a draft (409 otherwise). + +## Example Usage + +```python +from openrouter.operations import DraftOnly + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: DraftOnly = "true" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"true"` +- `"false"` diff --git a/docs/operations/enableprivateendpointglobals.mdx b/docs/operations/enableprivateendpointglobals.mdx new file mode 100644 index 00000000..8ff7549f --- /dev/null +++ b/docs/operations/enableprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "EnablePrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/enableprivateendpointrequest.mdx b/docs/operations/enableprivateendpointrequest.mdx new file mode 100644 index 00000000..6ab00a00 --- /dev/null +++ b/docs/operations/enableprivateendpointrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "EnablePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | \ No newline at end of file diff --git a/docs/operations/getprivateendpointglobals.mdx b/docs/operations/getprivateendpointglobals.mdx new file mode 100644 index 00000000..81ff79ea --- /dev/null +++ b/docs/operations/getprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "GetPrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getprivateendpointrequest.mdx b/docs/operations/getprivateendpointrequest.mdx new file mode 100644 index 00000000..eb6aa435 --- /dev/null +++ b/docs/operations/getprivateendpointrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "GetPrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | \ No newline at end of file diff --git a/docs/operations/listprivateendpointsglobals.mdx b/docs/operations/listprivateendpointsglobals.mdx new file mode 100644 index 00000000..6306718f --- /dev/null +++ b/docs/operations/listprivateendpointsglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ListPrivateEndpointsGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listprivateendpointsrequest.mdx b/docs/operations/listprivateendpointsrequest.mdx new file mode 100644 index 00000000..bc225950 --- /dev/null +++ b/docs/operations/listprivateendpointsrequest.mdx @@ -0,0 +1,11 @@ +--- +title: "ListPrivateEndpointsRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateprivateendpointglobals.mdx b/docs/operations/updateprivateendpointglobals.mdx new file mode 100644 index 00000000..3624f9a2 --- /dev/null +++ b/docs/operations/updateprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "UpdatePrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateprivateendpointpricingglobals.mdx b/docs/operations/updateprivateendpointpricingglobals.mdx new file mode 100644 index 00000000..3fea3054 --- /dev/null +++ b/docs/operations/updateprivateendpointpricingglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "UpdatePrivateEndpointPricingGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateprivateendpointpricingrequest.mdx b/docs/operations/updateprivateendpointpricingrequest.mdx new file mode 100644 index 00000000..4b77bff2 --- /dev/null +++ b/docs/operations/updateprivateendpointpricingrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "UpdatePrivateEndpointPricingRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `update_private_endpoint_pricing_request` | [components.UpdatePrivateEndpointPricingRequest](../components/updateprivateendpointpricingrequest.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/updateprivateendpointrequest.mdx b/docs/operations/updateprivateendpointrequest.mdx new file mode 100644 index 00000000..45632457 --- /dev/null +++ b/docs/operations/updateprivateendpointrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "UpdatePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `update_private_endpoint_request` | [components.UpdatePrivateEndpointRequest](../components/updateprivateendpointrequest.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/validateprivateendpointglobals.mdx b/docs/operations/validateprivateendpointglobals.mdx new file mode 100644 index 00000000..e539875f --- /dev/null +++ b/docs/operations/validateprivateendpointglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ValidatePrivateEndpointGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/validateprivateendpointrequest.mdx b/docs/operations/validateprivateendpointrequest.mdx new file mode 100644 index 00000000..d61a27f5 --- /dev/null +++ b/docs/operations/validateprivateendpointrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "ValidatePrivateEndpointRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `validate_private_endpoint_request` | [components.ValidatePrivateEndpointRequest](../components/validateprivateendpointrequest.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdks/privateendpoints/README.mdx b/docs/sdks/privateendpoints/README.mdx new file mode 100644 index 00000000..a0cd92fa --- /dev/null +++ b/docs/sdks/privateendpoints/README.mdx @@ -0,0 +1,574 @@ +--- +title: "PrivateEndpoints" +description: "Private Endpoints endpoints" +--- + +## Overview + +Private Endpoints endpoints + +### Available Operations + +* [list](#list) - List private 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 +* [activate](#activate) - Activate a validated private endpoint +* [disable](#disable) - Disable a private endpoint +* [enable](#enable) - Enable a private endpoint +* [update_pricing](#update_pricing) - Set private endpoint pricing +* [validate](#validate) - Validate a draft private endpoint + +## list + +List the organization's private endpoints, including drafts. 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_endpoints.list() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[components.ListPrivateEndpointsResponse](../../components/listprivateendpointsresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create + +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`. [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_endpoints.create(model_permaslug="openai/gpt-4o-2024-08-06", provider_slug="azure", upstream_model_id="gpt-4o-prod") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model_permaslug` | *str* | :heavy_check_mark: | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `provider_slug` | *str* | :heavy_check_mark: | Slug of the upstream provider. | azure | +| `upstream_model_id` | *str* | :heavy_check_mark: | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | 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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | +| `activate` | [Optional[components.PrivateEndpointActivation]](../../components/privateendpointactivation.mdx) | :heavy_minus_sign: | 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. | \{
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | +| `base_url` | *Optional[str]* | :heavy_minus_sign: | 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.CreatePrivateEndpointRequestDeclaredRegion]](../../components/createprivateendpointrequestdeclaredregion.mdx) | :heavy_minus_sign: | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Attest that this deployment retains no prompt or completion data. | | +| `pricing` | [Optional[components.PrivateEndpointPricing]](../../components/privateendpointpricing.mdx) | :heavy_minus_sign: | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.ManagedPrivateEndpointResponse](../../components/managedprivateendpointresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.CreatePrivateEndpointValidationFailedResponseError | 404 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.CreatePrivateEndpointValidationFailedResponseError | 409 | application/json | +| errors.ConflictResponseError | 409 | application/json | +| errors.CreatePrivateEndpointValidationFailedResponseError | 422 | application/json | +| errors.UnprocessableEntityResponseError | 422 | application/json | +| errors.CreatePrivateEndpointValidationFailedResponseError | 500 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.CreatePrivateEndpointValidationFailedResponseError | 502 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete + +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. + +### 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_endpoints.delete(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `draft_only` | [Optional[operations.DraftOnly]](../../operations/draftonly.mdx) | :heavy_minus_sign: | When `true`, only delete the endpoint if it is still a draft (409 otherwise). | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.DeletePrivateEndpointResponse](../../components/deleteprivateendpointresponse.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.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## get + +Get one private endpoint with its upstream configuration and current pricing. [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_endpoints.get(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.PrivateEndpointResponse](../../components/privateendpointresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.RequestTimeoutResponseError | 408 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## 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. + +### 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_endpoints.update(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", upstream_model_id="gpt-4o-prod") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `upstream_model_id` | *str* | :heavy_check_mark: | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `base_url` | *Optional[str]* | :heavy_minus_sign: | 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) | :heavy_minus_sign: | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Attest that this deployment retains no prompt or completion data. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.PrivateEndpointResponse](../../components/privateendpointresponse.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.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## activate + +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. + +### 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_endpoints.activate(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.ManagedPrivateEndpointResponse](../../components/managedprivateendpointresponse.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.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## disable + +Stop routing to an active endpoint without deleting 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_endpoints.disable(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.ManagedPrivateEndpointResponse](../../components/managedprivateendpointresponse.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.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## enable + +Resume routing to a disabled endpoint. [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_endpoints.enable(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.ManagedPrivateEndpointResponse](../../components/managedprivateendpointresponse.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.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## update_pricing + +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. [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_endpoints.update_pricing(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", pricing={ + "completion": "0.00001", + "prompt": "0.0000025", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `pricing` | [components.PrivateEndpointPricing](../../components/privateendpointpricing.mdx) | :heavy_check_mark: | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.PrivateEndpointResponse](../../components/privateendpointresponse.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.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## validate + +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. + +### 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_endpoints.validate(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", workspace_id="550e8400-e29b-41d4-a716-446655440000") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `workspace_id` | *str* | :heavy_check_mark: | Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account. | 550e8400-e29b-41d4-a716-446655440000 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.PrivateEndpointValidationResponse](../../components/privateendpointvalidationresponse.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.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 286a6312..9a4c2d4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.2.35" +version = "1.3.0" 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 32799938..c76512db 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.2.35" +__version__: str = "1.3.0" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.2.35 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.0 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 58ea8afb..0ee45472 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1369,6 +1369,17 @@ CreatePresetFromInferenceResponse, CreatePresetFromInferenceResponseTypedDict, ) + from .createprivateendpointrequest import ( + CreatePrivateEndpointRequest, + CreatePrivateEndpointRequestDeclaredRegion, + CreatePrivateEndpointRequestTypedDict, + ) + from .createprivateendpointvalidationfailedresponse_error import ( + CreatePrivateEndpointValidationFailedResponseData, + CreatePrivateEndpointValidationFailedResponseDataTypedDict, + CreatePrivateEndpointValidationFailedResponseError, + CreatePrivateEndpointValidationFailedResponseErrorTypedDict, + ) from .createscimgroupmappingrequest import ( CreateScimGroupMappingRequest, CreateScimGroupMappingRequestRole, @@ -1537,6 +1548,12 @@ DeleteObservabilityDestinationResponse, DeleteObservabilityDestinationResponseTypedDict, ) + from .deleteprivateendpointresponse import ( + DeletePrivateEndpointResponse, + DeletePrivateEndpointResponseData, + DeletePrivateEndpointResponseDataTypedDict, + DeletePrivateEndpointResponseTypedDict, + ) from .deletescimgroupmappingresponse import ( DeleteScimGroupMappingResponse, DeleteScimGroupMappingResponseTypedDict, @@ -2244,6 +2261,10 @@ ListPresetVersionsResponse, ListPresetVersionsResponseTypedDict, ) + from .listprivateendpointsresponse import ( + ListPrivateEndpointsResponse, + ListPrivateEndpointsResponseTypedDict, + ) from .listscimgroupmappingsresponse import ( ListScimGroupMappingsResponse, ListScimGroupMappingsResponseTypedDict, @@ -2277,6 +2298,14 @@ LocalShellCallOutputItemType, LocalShellCallOutputItemTypedDict, ) + from .managedprivateendpoint import ( + ManagedPrivateEndpoint, + ManagedPrivateEndpointTypedDict, + ) + from .managedprivateendpointresponse import ( + ManagedPrivateEndpointResponse, + ManagedPrivateEndpointResponseTypedDict, + ) from .mcpapprovalrequestitem import ( McpApprovalRequestItem, McpApprovalRequestItemType, @@ -3252,6 +3281,42 @@ PreviewWebSearchUserLocationTypedDict, ) from .pricingoverride import PricingOverride, PricingOverrideTypedDict, UtcDay + from .privateendpoint import PrivateEndpoint, PrivateEndpointTypedDict + from .privateendpointactivation import ( + PrivateEndpointActivation, + PrivateEndpointActivationTypedDict, + ) + from .privateendpointcheck import ( + PrivateEndpointCheck, + PrivateEndpointCheckTypedDict, + ) + from .privateendpointcheckreason import PrivateEndpointCheckReason + from .privateendpointdeclaredregion import PrivateEndpointDeclaredRegion + from .privateendpointpricing import ( + PrivateEndpointPricing, + PrivateEndpointPricingTypedDict, + ) + from .privateendpointresponse import ( + PrivateEndpointResponse, + PrivateEndpointResponseTypedDict, + ) + from .privateendpointstatus import PrivateEndpointStatus + from .privateendpointsummary import ( + PrivateEndpointSummary, + PrivateEndpointSummaryTypedDict, + ) + from .privateendpointvalidation import ( + PrivateEndpointValidation, + PrivateEndpointValidationTypedDict, + ) + from .privateendpointvalidationnullable import ( + PrivateEndpointValidationNullable, + PrivateEndpointValidationNullableTypedDict, + ) + from .privateendpointvalidationresponse import ( + PrivateEndpointValidationResponse, + PrivateEndpointValidationResponseTypedDict, + ) from .promptcachebreakpoint import ( PromptCacheBreakpoint, PromptCacheBreakpointMode, @@ -3861,6 +3926,15 @@ UpdateObservabilityDestinationResponse, UpdateObservabilityDestinationResponseTypedDict, ) + from .updateprivateendpointpricingrequest import ( + UpdatePrivateEndpointPricingRequest, + UpdatePrivateEndpointPricingRequestTypedDict, + ) + from .updateprivateendpointrequest import ( + UpdatePrivateEndpointRequest, + UpdatePrivateEndpointRequestDeclaredRegion, + UpdatePrivateEndpointRequestTypedDict, + ) from .updatescimgroupmappingrequest import ( UpdateScimGroupMappingRequest, UpdateScimGroupMappingRequestRole, @@ -3888,6 +3962,10 @@ UpsertWorkspaceBudgetResponseTypedDict, ) from .urlcitation import URLCitation, URLCitationType, URLCitationTypedDict + from .validateprivateendpointrequest import ( + ValidatePrivateEndpointRequest, + ValidatePrivateEndpointRequestTypedDict, + ) from .vaultsecret import VaultSecret, VaultSecretTypedDict from .vaultsecretcopyrequest import ( VaultSecretCopyRequest, @@ -4974,6 +5052,13 @@ "CreateObservabilityDestinationResponseTypedDict", "CreatePresetFromInferenceResponse", "CreatePresetFromInferenceResponseTypedDict", + "CreatePrivateEndpointRequest", + "CreatePrivateEndpointRequestDeclaredRegion", + "CreatePrivateEndpointRequestTypedDict", + "CreatePrivateEndpointValidationFailedResponseData", + "CreatePrivateEndpointValidationFailedResponseDataTypedDict", + "CreatePrivateEndpointValidationFailedResponseError", + "CreatePrivateEndpointValidationFailedResponseErrorTypedDict", "CreateScimGroupMappingRequest", "CreateScimGroupMappingRequestRole", "CreateScimGroupMappingRequestTypedDict", @@ -5078,6 +5163,10 @@ "DeleteInternResponseTypedDict", "DeleteObservabilityDestinationResponse", "DeleteObservabilityDestinationResponseTypedDict", + "DeletePrivateEndpointResponse", + "DeletePrivateEndpointResponseData", + "DeletePrivateEndpointResponseDataTypedDict", + "DeletePrivateEndpointResponseTypedDict", "DeleteScimGroupMappingResponse", "DeleteScimGroupMappingResponseTypedDict", "DeleteWorkspaceBudgetResponse", @@ -5615,6 +5704,8 @@ "ListPresetVersionsResponseTypedDict", "ListPresetsResponse", "ListPresetsResponseTypedDict", + "ListPrivateEndpointsResponse", + "ListPrivateEndpointsResponseTypedDict", "ListScimGroupMappingsResponse", "ListScimGroupMappingsResponseTypedDict", "ListScimGroupsResponse", @@ -5639,6 +5730,10 @@ "LogprobsContent", "LogprobsContentTypedDict", "LogprobsTypedDict", + "ManagedPrivateEndpoint", + "ManagedPrivateEndpointResponse", + "ManagedPrivateEndpointResponseTypedDict", + "ManagedPrivateEndpointTypedDict", "MaxPrice", "MaxPriceTypedDict", "McpApprovalRequestItem", @@ -6282,6 +6377,27 @@ "PricingOverrideTypedDict", "PricingTypedDict", "PrimaryMetric", + "PrivateEndpoint", + "PrivateEndpointActivation", + "PrivateEndpointActivationTypedDict", + "PrivateEndpointCheck", + "PrivateEndpointCheckReason", + "PrivateEndpointCheckTypedDict", + "PrivateEndpointDeclaredRegion", + "PrivateEndpointPricing", + "PrivateEndpointPricingTypedDict", + "PrivateEndpointResponse", + "PrivateEndpointResponseTypedDict", + "PrivateEndpointStatus", + "PrivateEndpointSummary", + "PrivateEndpointSummaryTypedDict", + "PrivateEndpointTypedDict", + "PrivateEndpointValidation", + "PrivateEndpointValidationNullable", + "PrivateEndpointValidationNullableTypedDict", + "PrivateEndpointValidationResponse", + "PrivateEndpointValidationResponseTypedDict", + "PrivateEndpointValidationTypedDict", "Progress", "ProgressTypedDict", "PromptCacheBreakpoint", @@ -6845,6 +6961,11 @@ "UpdateObservabilityDestinationRequestTypedDict", "UpdateObservabilityDestinationResponse", "UpdateObservabilityDestinationResponseTypedDict", + "UpdatePrivateEndpointPricingRequest", + "UpdatePrivateEndpointPricingRequestTypedDict", + "UpdatePrivateEndpointRequest", + "UpdatePrivateEndpointRequestDeclaredRegion", + "UpdatePrivateEndpointRequestTypedDict", "UpdateScimGroupMappingRequest", "UpdateScimGroupMappingRequestRole", "UpdateScimGroupMappingRequestTypedDict", @@ -6871,6 +6992,8 @@ "UserLocation", "UserLocationTypedDict", "UtcDay", + "ValidatePrivateEndpointRequest", + "ValidatePrivateEndpointRequestTypedDict", "Variables", "VariablesTypedDict", "VaultSecret", @@ -7931,6 +8054,13 @@ "CreateObservabilityDestinationResponseTypedDict": ".createobservabilitydestinationresponse", "CreatePresetFromInferenceResponse": ".createpresetfrominferenceresponse", "CreatePresetFromInferenceResponseTypedDict": ".createpresetfrominferenceresponse", + "CreatePrivateEndpointRequest": ".createprivateendpointrequest", + "CreatePrivateEndpointRequestDeclaredRegion": ".createprivateendpointrequest", + "CreatePrivateEndpointRequestTypedDict": ".createprivateendpointrequest", + "CreatePrivateEndpointValidationFailedResponseData": ".createprivateendpointvalidationfailedresponse_error", + "CreatePrivateEndpointValidationFailedResponseDataTypedDict": ".createprivateendpointvalidationfailedresponse_error", + "CreatePrivateEndpointValidationFailedResponseError": ".createprivateendpointvalidationfailedresponse_error", + "CreatePrivateEndpointValidationFailedResponseErrorTypedDict": ".createprivateendpointvalidationfailedresponse_error", "CreateScimGroupMappingRequest": ".createscimgroupmappingrequest", "CreateScimGroupMappingRequestRole": ".createscimgroupmappingrequest", "CreateScimGroupMappingRequestTypedDict": ".createscimgroupmappingrequest", @@ -8052,6 +8182,10 @@ "DeleteInternResponseTypedDict": ".deleteinternresponse", "DeleteObservabilityDestinationResponse": ".deleteobservabilitydestinationresponse", "DeleteObservabilityDestinationResponseTypedDict": ".deleteobservabilitydestinationresponse", + "DeletePrivateEndpointResponse": ".deleteprivateendpointresponse", + "DeletePrivateEndpointResponseData": ".deleteprivateendpointresponse", + "DeletePrivateEndpointResponseDataTypedDict": ".deleteprivateendpointresponse", + "DeletePrivateEndpointResponseTypedDict": ".deleteprivateendpointresponse", "DeleteScimGroupMappingResponse": ".deletescimgroupmappingresponse", "DeleteScimGroupMappingResponseTypedDict": ".deletescimgroupmappingresponse", "DeleteWorkspaceBudgetResponse": ".deleteworkspacebudgetresponse", @@ -8569,6 +8703,8 @@ "ListPresetsResponseTypedDict": ".listpresetsresponse", "ListPresetVersionsResponse": ".listpresetversionsresponse", "ListPresetVersionsResponseTypedDict": ".listpresetversionsresponse", + "ListPrivateEndpointsResponse": ".listprivateendpointsresponse", + "ListPrivateEndpointsResponseTypedDict": ".listprivateendpointsresponse", "ListScimGroupMappingsResponse": ".listscimgroupmappingsresponse", "ListScimGroupMappingsResponseTypedDict": ".listscimgroupmappingsresponse", "ListScimGroupsResponse": ".listscimgroupsresponse", @@ -8588,6 +8724,10 @@ "LocalShellCallOutputItem": ".localshellcalloutputitem", "LocalShellCallOutputItemType": ".localshellcalloutputitem", "LocalShellCallOutputItemTypedDict": ".localshellcalloutputitem", + "ManagedPrivateEndpoint": ".managedprivateendpoint", + "ManagedPrivateEndpointTypedDict": ".managedprivateendpoint", + "ManagedPrivateEndpointResponse": ".managedprivateendpointresponse", + "ManagedPrivateEndpointResponseTypedDict": ".managedprivateendpointresponse", "McpApprovalRequestItem": ".mcpapprovalrequestitem", "McpApprovalRequestItemType": ".mcpapprovalrequestitem", "McpApprovalRequestItemTypedDict": ".mcpapprovalrequestitem", @@ -9361,6 +9501,27 @@ "PricingOverride": ".pricingoverride", "PricingOverrideTypedDict": ".pricingoverride", "UtcDay": ".pricingoverride", + "PrivateEndpoint": ".privateendpoint", + "PrivateEndpointTypedDict": ".privateendpoint", + "PrivateEndpointActivation": ".privateendpointactivation", + "PrivateEndpointActivationTypedDict": ".privateendpointactivation", + "PrivateEndpointCheck": ".privateendpointcheck", + "PrivateEndpointCheckTypedDict": ".privateendpointcheck", + "PrivateEndpointCheckReason": ".privateendpointcheckreason", + "PrivateEndpointDeclaredRegion": ".privateendpointdeclaredregion", + "PrivateEndpointPricing": ".privateendpointpricing", + "PrivateEndpointPricingTypedDict": ".privateendpointpricing", + "PrivateEndpointResponse": ".privateendpointresponse", + "PrivateEndpointResponseTypedDict": ".privateendpointresponse", + "PrivateEndpointStatus": ".privateendpointstatus", + "PrivateEndpointSummary": ".privateendpointsummary", + "PrivateEndpointSummaryTypedDict": ".privateendpointsummary", + "PrivateEndpointValidation": ".privateendpointvalidation", + "PrivateEndpointValidationTypedDict": ".privateendpointvalidation", + "PrivateEndpointValidationNullable": ".privateendpointvalidationnullable", + "PrivateEndpointValidationNullableTypedDict": ".privateendpointvalidationnullable", + "PrivateEndpointValidationResponse": ".privateendpointvalidationresponse", + "PrivateEndpointValidationResponseTypedDict": ".privateendpointvalidationresponse", "PromptCacheBreakpoint": ".promptcachebreakpoint", "PromptCacheBreakpointMode": ".promptcachebreakpoint", "PromptCacheBreakpointTypedDict": ".promptcachebreakpoint", @@ -9793,6 +9954,11 @@ "UpdateObservabilityDestinationRequestTypedDict": ".updateobservabilitydestinationrequest", "UpdateObservabilityDestinationResponse": ".updateobservabilitydestinationresponse", "UpdateObservabilityDestinationResponseTypedDict": ".updateobservabilitydestinationresponse", + "UpdatePrivateEndpointPricingRequest": ".updateprivateendpointpricingrequest", + "UpdatePrivateEndpointPricingRequestTypedDict": ".updateprivateendpointpricingrequest", + "UpdatePrivateEndpointRequest": ".updateprivateendpointrequest", + "UpdatePrivateEndpointRequestDeclaredRegion": ".updateprivateendpointrequest", + "UpdatePrivateEndpointRequestTypedDict": ".updateprivateendpointrequest", "UpdateScimGroupMappingRequest": ".updatescimgroupmappingrequest", "UpdateScimGroupMappingRequestRole": ".updatescimgroupmappingrequest", "UpdateScimGroupMappingRequestTypedDict": ".updatescimgroupmappingrequest", @@ -9810,6 +9976,8 @@ "URLCitation": ".urlcitation", "URLCitationType": ".urlcitation", "URLCitationTypedDict": ".urlcitation", + "ValidatePrivateEndpointRequest": ".validateprivateendpointrequest", + "ValidatePrivateEndpointRequestTypedDict": ".validateprivateendpointrequest", "VaultSecret": ".vaultsecret", "VaultSecretTypedDict": ".vaultsecret", "VaultSecretCopyRequest": ".vaultsecretcopyrequest", diff --git a/src/openrouter/components/createprivateendpointrequest.py b/src/openrouter/components/createprivateendpointrequest.py new file mode 100644 index 00000000..bf06bf70 --- /dev/null +++ b/src/openrouter/components/createprivateendpointrequest.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointactivation import ( + PrivateEndpointActivation, + PrivateEndpointActivationTypedDict, +) +from .privateendpointpricing import ( + PrivateEndpointPricing, + PrivateEndpointPricingTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +CreatePrivateEndpointRequestDeclaredRegion = Union[ + Literal[ + "global", + "europe", + "us", + ], + UnrecognizedStr, +] +r"""Attest where this deployment processes data.""" + + +class CreatePrivateEndpointRequestTypedDict(TypedDict): + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + provider_slug: str + r"""Slug of the upstream provider.""" + upstream_model_id: str + r"""Model or deployment identifier sent to the upstream provider.""" + activate: NotRequired[PrivateEndpointActivationTypedDict] + r"""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.""" + 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_region: NotRequired[Nullable[CreatePrivateEndpointRequestDeclaredRegion]] + 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] + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + + +class CreatePrivateEndpointRequest(BaseModel): + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + + provider_slug: str + r"""Slug of the upstream provider.""" + + upstream_model_id: str + r"""Model or deployment identifier sent to the upstream provider.""" + + activate: Optional[PrivateEndpointActivation] = None + r"""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.""" + + 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_region: OptionalNullable[CreatePrivateEndpointRequestDeclaredRegion] = ( + UNSET + ) + r"""Attest where this deployment processes data.""" + + declared_zdr: OptionalNullable[bool] = UNSET + r"""Attest that this deployment retains no prompt or completion data.""" + + pricing: Optional[PrivateEndpointPricing] = None + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["activate", "base_url", "declared_region", "declared_zdr", "pricing"] + ) + nullable_fields = set(["declared_region", "declared_zdr"]) + 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/createprivateendpointvalidationfailedresponse_error.py b/src/openrouter/components/createprivateendpointvalidationfailedresponse_error.py new file mode 100644 index 00000000..2648161b --- /dev/null +++ b/src/openrouter/components/createprivateendpointvalidationfailedresponse_error.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .managedprivateendpoint import ( + ManagedPrivateEndpoint, + ManagedPrivateEndpointTypedDict, +) +from .privateendpointvalidationnullable import ( + PrivateEndpointValidationNullable, + PrivateEndpointValidationNullableTypedDict, +) +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class CreatePrivateEndpointValidationFailedResponseDataTypedDict(TypedDict): + endpoint: ManagedPrivateEndpointTypedDict + validation: Nullable[PrivateEndpointValidationNullableTypedDict] + + +class CreatePrivateEndpointValidationFailedResponseData(BaseModel): + endpoint: ManagedPrivateEndpoint + + validation: Nullable[PrivateEndpointValidationNullable] + + @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 CreatePrivateEndpointValidationFailedResponseErrorTypedDict(TypedDict): + code: int + message: str + + +class CreatePrivateEndpointValidationFailedResponseError(BaseModel): + code: int + + message: str diff --git a/src/openrouter/components/deleteprivateendpointresponse.py b/src/openrouter/components/deleteprivateendpointresponse.py new file mode 100644 index 00000000..d596d975 --- /dev/null +++ b/src/openrouter/components/deleteprivateendpointresponse.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class DeletePrivateEndpointResponseDataTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + + +class DeletePrivateEndpointResponseData(BaseModel): + id: str + r"""Stable identifier of the private endpoint.""" + + +class DeletePrivateEndpointResponseTypedDict(TypedDict): + data: DeletePrivateEndpointResponseDataTypedDict + + +class DeletePrivateEndpointResponse(BaseModel): + data: DeletePrivateEndpointResponseData diff --git a/src/openrouter/components/listprivateendpointsresponse.py b/src/openrouter/components/listprivateendpointsresponse.py new file mode 100644 index 00000000..26d0cb4b --- /dev/null +++ b/src/openrouter/components/listprivateendpointsresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointsummary import ( + PrivateEndpointSummary, + PrivateEndpointSummaryTypedDict, +) +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListPrivateEndpointsResponseTypedDict(TypedDict): + data: List[PrivateEndpointSummaryTypedDict] + + +class ListPrivateEndpointsResponse(BaseModel): + data: List[PrivateEndpointSummary] diff --git a/src/openrouter/components/managedprivateendpoint.py b/src/openrouter/components/managedprivateendpoint.py new file mode 100644 index 00000000..28894d4b --- /dev/null +++ b/src/openrouter/components/managedprivateendpoint.py @@ -0,0 +1,72 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointdeclaredregion import PrivateEndpointDeclaredRegion +from .privateendpointstatus import PrivateEndpointStatus +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class ManagedPrivateEndpointTypedDict(TypedDict): + created_at: str + r"""ISO timestamp of when the endpoint was created.""" + id: str + r"""Stable identifier of the private endpoint.""" + model_name: Nullable[str] + r"""Display name of the model, or `null` when the model is no longer listed.""" + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + model_slug: Nullable[str] + r"""Public model slug, or `null` when the model is no longer listed.""" + provider_name: str + r"""Display name of the upstream provider.""" + status: PrivateEndpointStatus + r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" + declared_region: Nullable[PrivateEndpointDeclaredRegion] + r"""Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.""" + declared_zdr: Nullable[bool] + r"""Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.""" + + +class ManagedPrivateEndpoint(BaseModel): + created_at: str + r"""ISO timestamp of when the endpoint was created.""" + + id: str + r"""Stable identifier of the private endpoint.""" + + model_name: Nullable[str] + r"""Display name of the model, or `null` when the model is no longer listed.""" + + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + + model_slug: Nullable[str] + r"""Public model slug, or `null` when the model is no longer listed.""" + + provider_name: str + r"""Display name of the upstream provider.""" + + status: PrivateEndpointStatus + r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" + + declared_region: Nullable[PrivateEndpointDeclaredRegion] + r"""Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.""" + + declared_zdr: Nullable[bool] + r"""Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.""" + + @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/managedprivateendpointresponse.py b/src/openrouter/components/managedprivateendpointresponse.py new file mode 100644 index 00000000..7d96227f --- /dev/null +++ b/src/openrouter/components/managedprivateendpointresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .managedprivateendpoint import ( + ManagedPrivateEndpoint, + ManagedPrivateEndpointTypedDict, +) +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class ManagedPrivateEndpointResponseTypedDict(TypedDict): + data: ManagedPrivateEndpointTypedDict + + +class ManagedPrivateEndpointResponse(BaseModel): + data: ManagedPrivateEndpoint diff --git a/src/openrouter/components/privateendpoint.py b/src/openrouter/components/privateendpoint.py new file mode 100644 index 00000000..1b85906b --- /dev/null +++ b/src/openrouter/components/privateendpoint.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointdeclaredregion import PrivateEndpointDeclaredRegion +from .privateendpointpricing import ( + PrivateEndpointPricing, + PrivateEndpointPricingTypedDict, +) +from .privateendpointstatus import PrivateEndpointStatus +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class PrivateEndpointTypedDict(TypedDict): + base_url: Nullable[str] + r"""HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).""" + declared_region: Nullable[PrivateEndpointDeclaredRegion] + r"""Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.""" + declared_zdr: Nullable[bool] + r"""Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.""" + id: str + r"""Stable identifier of the private endpoint.""" + model_name: Nullable[str] + r"""Display name of the model, or `null` when the model is no longer listed.""" + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + model_slug: Nullable[str] + r"""Public model slug, or `null` when the model is no longer listed.""" + pricing: PrivateEndpointPricingTypedDict + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + provider_name: str + 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.""" + status: PrivateEndpointStatus + r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" + upstream_model_id: str + r"""Model or deployment identifier sent to the upstream provider.""" + + +class PrivateEndpoint(BaseModel): + base_url: Nullable[str] + r"""HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).""" + + declared_region: Nullable[PrivateEndpointDeclaredRegion] + r"""Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.""" + + declared_zdr: Nullable[bool] + r"""Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.""" + + id: str + r"""Stable identifier of the private endpoint.""" + + model_name: Nullable[str] + r"""Display name of the model, or `null` when the model is no longer listed.""" + + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + + model_slug: Nullable[str] + r"""Public model slug, or `null` when the model is no longer listed.""" + + pricing: PrivateEndpointPricing + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + + provider_name: str + 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.""" + + status: PrivateEndpointStatus + r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" + + upstream_model_id: str + r"""Model or deployment identifier sent to the upstream provider.""" + + @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/privateendpointactivation.py b/src/openrouter/components/privateendpointactivation.py new file mode 100644 index 00000000..55d1f8af --- /dev/null +++ b/src/openrouter/components/privateendpointactivation.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class PrivateEndpointActivationTypedDict(TypedDict): + r"""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.""" + + workspace_id: str + r"""Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account.""" + + +class PrivateEndpointActivation(BaseModel): + r"""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.""" + + workspace_id: str + r"""Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account.""" diff --git a/src/openrouter/components/privateendpointcheck.py b/src/openrouter/components/privateendpointcheck.py new file mode 100644 index 00000000..485ab4af --- /dev/null +++ b/src/openrouter/components/privateendpointcheck.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointcheckreason import PrivateEndpointCheckReason +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 PrivateEndpointCheckTypedDict(TypedDict): + name: str + r"""Check name.""" + passed: bool + actual_model: NotRequired[Nullable[str]] + r"""Model the upstream reported serving, when it differs from the request.""" + reason: NotRequired[PrivateEndpointCheckReason] + r"""Why the check failed.""" + upstream_message: NotRequired[Nullable[str]] + r"""Error message returned by your deployment when the call failed.""" + upstream_status: NotRequired[int] + r"""HTTP status returned by your deployment when the call failed.""" + + +class PrivateEndpointCheck(BaseModel): + name: str + r"""Check name.""" + + passed: bool + + actual_model: OptionalNullable[str] = UNSET + r"""Model the upstream reported serving, when it differs from the request.""" + + reason: Optional[PrivateEndpointCheckReason] = None + r"""Why the check failed.""" + + upstream_message: OptionalNullable[str] = UNSET + r"""Error message returned by your deployment when the call failed.""" + + upstream_status: Optional[int] = None + r"""HTTP status returned by your deployment when the call failed.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["actual_model", "reason", "upstream_message", "upstream_status"] + ) + nullable_fields = set(["actual_model", "upstream_message"]) + 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/privateendpointcheckreason.py b/src/openrouter/components/privateendpointcheckreason.py new file mode 100644 index 00000000..6ffcf06c --- /dev/null +++ b/src/openrouter/components/privateendpointcheckreason.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +PrivateEndpointCheckReason = Union[ + Literal[ + "database_error", + "endpoint_limit_reached", + "invalid_base_url", + "model_not_found", + "provider_not_found", + "endpoint_not_found", + "workspace_not_found", + "no_byok_key", + "key_decryption_failed", + "upstream_error", + "invalid_response", + "invalid_stream", + "missing_usage", + "model_mismatch", + "not_validated", + "validation_stale", + ], + UnrecognizedStr, +] +r"""Why the check failed.""" diff --git a/src/openrouter/components/privateendpointdeclaredregion.py b/src/openrouter/components/privateendpointdeclaredregion.py new file mode 100644 index 00000000..6a8d44a0 --- /dev/null +++ b/src/openrouter/components/privateendpointdeclaredregion.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +PrivateEndpointDeclaredRegion = Union[ + Literal[ + "global", + "europe", + "us", + ], + UnrecognizedStr, +] +r"""Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.""" diff --git a/src/openrouter/components/privateendpointpricing.py b/src/openrouter/components/privateendpointpricing.py new file mode 100644 index 00000000..aae91e5c --- /dev/null +++ b/src/openrouter/components/privateendpointpricing.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class PrivateEndpointPricingTypedDict(TypedDict): + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + + completion: str + r"""USD per completion token, as a decimal string.""" + prompt: str + r"""USD per prompt token, as a decimal string.""" + + +class PrivateEndpointPricing(BaseModel): + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + + completion: str + r"""USD per completion token, as a decimal string.""" + + prompt: str + r"""USD per prompt token, as a decimal string.""" diff --git a/src/openrouter/components/privateendpointresponse.py b/src/openrouter/components/privateendpointresponse.py new file mode 100644 index 00000000..75b7eaee --- /dev/null +++ b/src/openrouter/components/privateendpointresponse.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpoint import PrivateEndpoint, PrivateEndpointTypedDict +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class PrivateEndpointResponseTypedDict(TypedDict): + data: PrivateEndpointTypedDict + + +class PrivateEndpointResponse(BaseModel): + data: PrivateEndpoint diff --git a/src/openrouter/components/privateendpointstatus.py b/src/openrouter/components/privateendpointstatus.py new file mode 100644 index 00000000..6fce70ae --- /dev/null +++ b/src/openrouter/components/privateendpointstatus.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +PrivateEndpointStatus = Union[ + Literal[ + "draft", + "active", + "disabled", + ], + UnrecognizedStr, +] +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/privateendpointsummary.py b/src/openrouter/components/privateendpointsummary.py new file mode 100644 index 00000000..3a62143a --- /dev/null +++ b/src/openrouter/components/privateendpointsummary.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointstatus import PrivateEndpointStatus +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class PrivateEndpointSummaryTypedDict(TypedDict): + created_at: str + r"""ISO timestamp of when the endpoint was created.""" + id: str + r"""Stable identifier of the private endpoint.""" + model_name: Nullable[str] + r"""Display name of the model, or `null` when the model is no longer listed.""" + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + model_slug: Nullable[str] + r"""Public model slug, or `null` when the model is no longer listed.""" + provider_name: str + r"""Display name of the upstream provider.""" + status: PrivateEndpointStatus + r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" + + +class PrivateEndpointSummary(BaseModel): + created_at: str + r"""ISO timestamp of when the endpoint was created.""" + + id: str + r"""Stable identifier of the private endpoint.""" + + model_name: Nullable[str] + r"""Display name of the model, or `null` when the model is no longer listed.""" + + model_permaslug: str + r"""Permanent slug of the model this endpoint serves.""" + + model_slug: Nullable[str] + r"""Public model slug, or `null` when the model is no longer listed.""" + + provider_name: str + r"""Display name of the upstream provider.""" + + status: PrivateEndpointStatus + r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" + + @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/privateendpointvalidation.py b/src/openrouter/components/privateendpointvalidation.py new file mode 100644 index 00000000..e77d1d3c --- /dev/null +++ b/src/openrouter/components/privateendpointvalidation.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointcheck import PrivateEndpointCheck, PrivateEndpointCheckTypedDict +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class PrivateEndpointValidationTypedDict(TypedDict): + checks: List[PrivateEndpointCheckTypedDict] + passed: bool + r"""Whether every check passed.""" + + +class PrivateEndpointValidation(BaseModel): + checks: List[PrivateEndpointCheck] + + passed: bool + r"""Whether every check passed.""" diff --git a/src/openrouter/components/privateendpointvalidationnullable.py b/src/openrouter/components/privateendpointvalidationnullable.py new file mode 100644 index 00000000..dbbcc93d --- /dev/null +++ b/src/openrouter/components/privateendpointvalidationnullable.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointcheck import PrivateEndpointCheck, PrivateEndpointCheckTypedDict +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class PrivateEndpointValidationNullableTypedDict(TypedDict): + checks: List[PrivateEndpointCheckTypedDict] + passed: bool + r"""Whether every check passed.""" + + +class PrivateEndpointValidationNullable(BaseModel): + checks: List[PrivateEndpointCheck] + + passed: bool + r"""Whether every check passed.""" diff --git a/src/openrouter/components/privateendpointvalidationresponse.py b/src/openrouter/components/privateendpointvalidationresponse.py new file mode 100644 index 00000000..6e8b78ce --- /dev/null +++ b/src/openrouter/components/privateendpointvalidationresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointvalidation import ( + PrivateEndpointValidation, + PrivateEndpointValidationTypedDict, +) +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class PrivateEndpointValidationResponseTypedDict(TypedDict): + data: PrivateEndpointValidationTypedDict + + +class PrivateEndpointValidationResponse(BaseModel): + data: PrivateEndpointValidation diff --git a/src/openrouter/components/updateprivateendpointpricingrequest.py b/src/openrouter/components/updateprivateendpointpricingrequest.py new file mode 100644 index 00000000..3d096268 --- /dev/null +++ b/src/openrouter/components/updateprivateendpointpricingrequest.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointpricing import ( + PrivateEndpointPricing, + PrivateEndpointPricingTypedDict, +) +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class UpdatePrivateEndpointPricingRequestTypedDict(TypedDict): + pricing: PrivateEndpointPricingTypedDict + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" + + +class UpdatePrivateEndpointPricingRequest(BaseModel): + pricing: PrivateEndpointPricing + r"""Negotiated per-token rates reported for requests routed to this endpoint.""" diff --git a/src/openrouter/components/updateprivateendpointrequest.py b/src/openrouter/components/updateprivateendpointrequest.py new file mode 100644 index 00000000..83382c9f --- /dev/null +++ b/src/openrouter/components/updateprivateendpointrequest.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +UpdatePrivateEndpointRequestDeclaredRegion = Union[ + Literal[ + "global", + "europe", + "us", + ], + UnrecognizedStr, +] +r"""Attest where this deployment processes data.""" + + +class UpdatePrivateEndpointRequestTypedDict(TypedDict): + upstream_model_id: str + r"""Model or deployment identifier sent to the upstream provider.""" + 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_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.""" + + +class UpdatePrivateEndpointRequest(BaseModel): + upstream_model_id: str + r"""Model or deployment identifier sent to the upstream provider.""" + + 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_region: OptionalNullable[UpdatePrivateEndpointRequestDeclaredRegion] = ( + UNSET + ) + r"""Attest where this deployment processes data.""" + + declared_zdr: OptionalNullable[bool] = UNSET + r"""Attest that this deployment retains no prompt or completion data.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["base_url", "declared_region", "declared_zdr"]) + nullable_fields = set(["declared_region", "declared_zdr"]) + 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/validateprivateendpointrequest.py b/src/openrouter/components/validateprivateendpointrequest.py new file mode 100644 index 00000000..13f89517 --- /dev/null +++ b/src/openrouter/components/validateprivateendpointrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class ValidatePrivateEndpointRequestTypedDict(TypedDict): + workspace_id: str + r"""Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account.""" + + +class ValidatePrivateEndpointRequest(BaseModel): + workspace_id: str + r"""Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account.""" diff --git a/src/openrouter/errors/__init__.py b/src/openrouter/errors/__init__.py index 736f0a15..4adf2743 100644 --- a/src/openrouter/errors/__init__.py +++ b/src/openrouter/errors/__init__.py @@ -20,6 +20,22 @@ BatchPaymentRequiredResponseErrorData, ) from .conflictresponse_error import ConflictResponseError, ConflictResponseErrorData + from .createprivateendpoint import ( + BadGateway, + BadGatewayUnion, + Conflict, + ConflictUnion, + InternalServerError, + InternalServerErrorUnion, + NotFound, + NotFoundUnion, + UnprocessableEntity, + UnprocessableEntityUnion, + ) + from .createprivateendpointvalidationfailedresponse_error import ( + CreatePrivateEndpointValidationFailedResponseError, + CreatePrivateEndpointValidationFailedResponseErrorData, + ) from .edgenetworktimeoutresponse_error import ( EdgeNetworkTimeoutResponseError, EdgeNetworkTimeoutResponseErrorData, @@ -81,16 +97,22 @@ ) __all__ = [ + "BadGateway", "BadGatewayResponseError", "BadGatewayResponseErrorData", + "BadGatewayUnion", "BadRequestResponseError", "BadRequestResponseErrorData", "BatchErrorResponse", "BatchErrorResponseData", "BatchPaymentRequiredResponseError", "BatchPaymentRequiredResponseErrorData", + "Conflict", "ConflictResponseError", "ConflictResponseErrorData", + "ConflictUnion", + "CreatePrivateEndpointValidationFailedResponseError", + "CreatePrivateEndpointValidationFailedResponseErrorData", "EdgeNetworkTimeoutResponseError", "EdgeNetworkTimeoutResponseErrorData", "ForbiddenResponseError", @@ -103,11 +125,15 @@ "InternChatErrorResponseData", "InternLifecycleError", "InternLifecycleErrorData", + "InternalServerError", + "InternalServerErrorUnion", "InternalServerResponseError", "InternalServerResponseErrorData", "NoResponseError", + "NotFound", "NotFoundResponseError", "NotFoundResponseErrorData", + "NotFoundUnion", "OAuthErrorResponse", "OAuthErrorResponseData", "OpenRouterDefaultError", @@ -127,8 +153,10 @@ "TooManyRequestsResponseErrorData", "UnauthorizedResponseError", "UnauthorizedResponseErrorData", + "UnprocessableEntity", "UnprocessableEntityResponseError", "UnprocessableEntityResponseErrorData", + "UnprocessableEntityUnion", ] _dynamic_imports: dict[str, str] = { @@ -142,6 +170,18 @@ "BatchPaymentRequiredResponseErrorData": ".batchpaymentrequiredresponse_error", "ConflictResponseError": ".conflictresponse_error", "ConflictResponseErrorData": ".conflictresponse_error", + "BadGateway": ".createprivateendpoint", + "BadGatewayUnion": ".createprivateendpoint", + "Conflict": ".createprivateendpoint", + "ConflictUnion": ".createprivateendpoint", + "InternalServerError": ".createprivateendpoint", + "InternalServerErrorUnion": ".createprivateendpoint", + "NotFound": ".createprivateendpoint", + "NotFoundUnion": ".createprivateendpoint", + "UnprocessableEntity": ".createprivateendpoint", + "UnprocessableEntityUnion": ".createprivateendpoint", + "CreatePrivateEndpointValidationFailedResponseError": ".createprivateendpointvalidationfailedresponse_error", + "CreatePrivateEndpointValidationFailedResponseErrorData": ".createprivateendpointvalidationfailedresponse_error", "EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error", "EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponse_error", "ForbiddenResponseError": ".forbiddenresponse_error", diff --git a/src/openrouter/errors/createprivateendpoint.py b/src/openrouter/errors/createprivateendpoint.py new file mode 100644 index 00000000..e020e4e8 --- /dev/null +++ b/src/openrouter/errors/createprivateendpoint.py @@ -0,0 +1,151 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .badgatewayresponse_error import BadGatewayResponseErrorData +from .conflictresponse_error import ConflictResponseErrorData +from .createprivateendpointvalidationfailedresponse_error import ( + CreatePrivateEndpointValidationFailedResponseErrorData, +) +from .internalserverresponse_error import InternalServerResponseErrorData +from .notfoundresponse_error import NotFoundResponseErrorData +from .unprocessableentityresponse_error import UnprocessableEntityResponseErrorData +from dataclasses import dataclass, field +import httpx +from openrouter.errors import OpenRouterError +from typing import Optional, Union +from typing_extensions import TypeAliasType + + +BadGatewayUnion = TypeAliasType( + "BadGatewayUnion", + Union[ + CreatePrivateEndpointValidationFailedResponseErrorData, + BadGatewayResponseErrorData, + ], +) +r"""An upstream dependency failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.""" + + +@dataclass(unsafe_hash=True) +class BadGateway(OpenRouterError): + r"""An upstream dependency failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.""" + + data: BadGatewayUnion = field(hash=False) + + def __init__( + self, + data: BadGatewayUnion, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) + + +InternalServerErrorUnion = TypeAliasType( + "InternalServerErrorUnion", + Union[ + CreatePrivateEndpointValidationFailedResponseErrorData, + InternalServerResponseErrorData, + ], +) +r"""Internal server error. When `activate` was passed and the draft was created, `data` carries it and any validation checks.""" + + +@dataclass(unsafe_hash=True) +class InternalServerError(OpenRouterError): + r"""Internal server error. When `activate` was passed and the draft was created, `data` carries it and any validation checks.""" + + data: InternalServerErrorUnion = field(hash=False) + + def __init__( + self, + data: InternalServerErrorUnion, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) + + +UnprocessableEntityUnion = TypeAliasType( + "UnprocessableEntityUnion", + Union[ + CreatePrivateEndpointValidationFailedResponseErrorData, + UnprocessableEntityResponseErrorData, + ], +) +r"""The request was invalid, or validation failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.""" + + +@dataclass(unsafe_hash=True) +class UnprocessableEntity(OpenRouterError): + r"""The request was invalid, or validation failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.""" + + data: UnprocessableEntityUnion = field(hash=False) + + def __init__( + self, + data: UnprocessableEntityUnion, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) + + +ConflictUnion = TypeAliasType( + "ConflictUnion", + Union[ + CreatePrivateEndpointValidationFailedResponseErrorData, + ConflictResponseErrorData, + ], +) +r"""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.""" + + +@dataclass(unsafe_hash=True) +class Conflict(OpenRouterError): + r"""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.""" + + data: ConflictUnion = field(hash=False) + + def __init__( + self, + data: ConflictUnion, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) + + +NotFoundUnion = TypeAliasType( + "NotFoundUnion", + Union[ + CreatePrivateEndpointValidationFailedResponseErrorData, + NotFoundResponseErrorData, + ], +) +r"""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.""" + + +@dataclass(unsafe_hash=True) +class NotFound(OpenRouterError): + r"""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.""" + + data: NotFoundUnion = field(hash=False) + + def __init__( + self, + data: NotFoundUnion, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/openrouter/errors/createprivateendpointvalidationfailedresponse_error.py b/src/openrouter/errors/createprivateendpointvalidationfailedresponse_error.py new file mode 100644 index 00000000..ec41f38f --- /dev/null +++ b/src/openrouter/errors/createprivateendpointvalidationfailedresponse_error.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from openrouter.components import ( + createprivateendpointvalidationfailedresponse_error as components_createprivateendpointvalidationfailedresponse_error, +) +from openrouter.errors import OpenRouterError +from openrouter.types import BaseModel +from typing import Optional + + +class CreatePrivateEndpointValidationFailedResponseErrorData(BaseModel): + data: components_createprivateendpointvalidationfailedresponse_error.CreatePrivateEndpointValidationFailedResponseData + error: components_createprivateendpointvalidationfailedresponse_error.CreatePrivateEndpointValidationFailedResponseError + + +@dataclass(unsafe_hash=True) +class CreatePrivateEndpointValidationFailedResponseError(OpenRouterError): + data: CreatePrivateEndpointValidationFailedResponseErrorData = field(hash=False) + + def __init__( + self, + data: CreatePrivateEndpointValidationFailedResponseErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.error.message) or fallback + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 9f8212cd..7f5a4f0e 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -5,6 +5,12 @@ from openrouter.utils.dynamic_imports import lazy_getattr, lazy_dir if TYPE_CHECKING: + from .activateprivateendpoint import ( + ActivatePrivateEndpointGlobals, + ActivatePrivateEndpointGlobalsTypedDict, + ActivatePrivateEndpointRequest, + ActivatePrivateEndpointRequestTypedDict, + ) from .bulkaddworkspacemembers import ( BulkAddWorkspaceMembersGlobals, BulkAddWorkspaceMembersGlobalsTypedDict, @@ -216,6 +222,12 @@ CreatePresetsResponsesRequest, CreatePresetsResponsesRequestTypedDict, ) + from .createprivateendpoint import ( + CreatePrivateEndpointGlobals, + CreatePrivateEndpointGlobalsTypedDict, + CreatePrivateEndpointRequest, + CreatePrivateEndpointRequestTypedDict, + ) from .creatererank import ( CreateRerankGlobals, CreateRerankGlobalsTypedDict, @@ -328,6 +340,13 @@ DeleteObservabilityDestinationRequest, DeleteObservabilityDestinationRequestTypedDict, ) + from .deleteprivateendpoint import ( + DeletePrivateEndpointGlobals, + DeletePrivateEndpointGlobalsTypedDict, + DeletePrivateEndpointRequest, + DeletePrivateEndpointRequestTypedDict, + DraftOnly, + ) from .deletescimgroupmapping import ( DeleteScimGroupMappingGlobals, DeleteScimGroupMappingGlobalsTypedDict, @@ -355,6 +374,12 @@ DeleteWorkspaceBudgetRequest, DeleteWorkspaceBudgetRequestTypedDict, ) + from .disableprivateendpoint import ( + DisablePrivateEndpointGlobals, + DisablePrivateEndpointGlobalsTypedDict, + DisablePrivateEndpointRequest, + DisablePrivateEndpointRequestTypedDict, + ) from .downloadcontainerfilecontent import ( DownloadContainerFileContentGlobals, DownloadContainerFileContentGlobalsTypedDict, @@ -367,6 +392,12 @@ DownloadFileContentRequest, DownloadFileContentRequestTypedDict, ) + from .enableprivateendpoint import ( + EnablePrivateEndpointGlobals, + EnablePrivateEndpointGlobalsTypedDict, + EnablePrivateEndpointRequest, + EnablePrivateEndpointRequestTypedDict, + ) from .exchangeauthcodeforapikey import ( ExchangeAuthCodeForAPIKeyCodeChallengeMethod, ExchangeAuthCodeForAPIKeyGlobals, @@ -546,6 +577,12 @@ GetPresetVersionRequest, GetPresetVersionRequestTypedDict, ) + from .getprivateendpoint import ( + GetPrivateEndpointGlobals, + GetPrivateEndpointGlobalsTypedDict, + GetPrivateEndpointRequest, + GetPrivateEndpointRequestTypedDict, + ) from .getrankingsdaily import ( ContextBucket, GetRankingsDailyCategory, @@ -814,6 +851,12 @@ ListPresetVersionsResponse, ListPresetVersionsResponseTypedDict, ) + from .listprivateendpoints import ( + ListPrivateEndpointsGlobals, + ListPrivateEndpointsGlobalsTypedDict, + ListPrivateEndpointsRequest, + ListPrivateEndpointsRequestTypedDict, + ) from .listproviders import ( Datacenter, Headquarters, @@ -1000,6 +1043,18 @@ UpdateObservabilityDestinationRequest, UpdateObservabilityDestinationRequestTypedDict, ) + from .updateprivateendpoint import ( + UpdatePrivateEndpointGlobals, + UpdatePrivateEndpointGlobalsTypedDict, + UpdatePrivateEndpointRequest, + UpdatePrivateEndpointRequestTypedDict, + ) + from .updateprivateendpointpricing import ( + UpdatePrivateEndpointPricingGlobals, + UpdatePrivateEndpointPricingGlobalsTypedDict, + UpdatePrivateEndpointPricingRequest, + UpdatePrivateEndpointPricingRequestTypedDict, + ) from .updatescimgroupmapping import ( UpdateScimGroupMappingGlobals, UpdateScimGroupMappingGlobalsTypedDict, @@ -1028,8 +1083,18 @@ UpsertWorkspaceBudgetRequest, UpsertWorkspaceBudgetRequestTypedDict, ) + from .validateprivateendpoint import ( + ValidatePrivateEndpointGlobals, + ValidatePrivateEndpointGlobalsTypedDict, + ValidatePrivateEndpointRequest, + ValidatePrivateEndpointRequestTypedDict, + ) __all__ = [ + "ActivatePrivateEndpointGlobals", + "ActivatePrivateEndpointGlobalsTypedDict", + "ActivatePrivateEndpointRequest", + "ActivatePrivateEndpointRequestTypedDict", "AllowedDataRegion", "Arena", "BenchmarkType", @@ -1183,6 +1248,10 @@ "CreatePresetsResponsesGlobalsTypedDict", "CreatePresetsResponsesRequest", "CreatePresetsResponsesRequestTypedDict", + "CreatePrivateEndpointGlobals", + "CreatePrivateEndpointGlobalsTypedDict", + "CreatePrivateEndpointRequest", + "CreatePrivateEndpointRequestTypedDict", "CreateRerankGlobals", "CreateRerankGlobalsTypedDict", "CreateRerankRequest", @@ -1258,6 +1327,10 @@ "DeleteObservabilityDestinationGlobalsTypedDict", "DeleteObservabilityDestinationRequest", "DeleteObservabilityDestinationRequestTypedDict", + "DeletePrivateEndpointGlobals", + "DeletePrivateEndpointGlobalsTypedDict", + "DeletePrivateEndpointRequest", + "DeletePrivateEndpointRequestTypedDict", "DeleteScimGroupMappingGlobals", "DeleteScimGroupMappingGlobalsTypedDict", "DeleteScimGroupMappingRequest", @@ -1277,6 +1350,10 @@ "Dimension", "DimensionTypedDict", "Direction", + "DisablePrivateEndpointGlobals", + "DisablePrivateEndpointGlobalsTypedDict", + "DisablePrivateEndpointRequest", + "DisablePrivateEndpointRequestTypedDict", "DisplayFormat", "Distillable", "Document", @@ -1293,8 +1370,13 @@ "DownloadFileContentGlobalsTypedDict", "DownloadFileContentRequest", "DownloadFileContentRequestTypedDict", + "DraftOnly", "Embedding", "EmbeddingTypedDict", + "EnablePrivateEndpointGlobals", + "EnablePrivateEndpointGlobalsTypedDict", + "EnablePrivateEndpointRequest", + "EnablePrivateEndpointRequestTypedDict", "EncodingFormat", "ExchangeAuthCodeForAPIKeyCodeChallengeMethod", "ExchangeAuthCodeForAPIKeyGlobals", @@ -1413,6 +1495,10 @@ "GetPresetVersionGlobalsTypedDict", "GetPresetVersionRequest", "GetPresetVersionRequestTypedDict", + "GetPrivateEndpointGlobals", + "GetPrivateEndpointGlobalsTypedDict", + "GetPrivateEndpointRequest", + "GetPrivateEndpointRequestTypedDict", "GetRankingsDailyCategory", "GetRankingsDailyGlobals", "GetRankingsDailyGlobalsTypedDict", @@ -1611,6 +1697,10 @@ "ListPresetsRequestTypedDict", "ListPresetsResponse", "ListPresetsResponseTypedDict", + "ListPrivateEndpointsGlobals", + "ListPrivateEndpointsGlobalsTypedDict", + "ListPrivateEndpointsRequest", + "ListPrivateEndpointsRequestTypedDict", "ListProvidersData", "ListProvidersDataTypedDict", "ListProvidersGlobals", @@ -1767,6 +1857,14 @@ "UpdateObservabilityDestinationGlobalsTypedDict", "UpdateObservabilityDestinationRequest", "UpdateObservabilityDestinationRequestTypedDict", + "UpdatePrivateEndpointGlobals", + "UpdatePrivateEndpointGlobalsTypedDict", + "UpdatePrivateEndpointPricingGlobals", + "UpdatePrivateEndpointPricingGlobalsTypedDict", + "UpdatePrivateEndpointPricingRequest", + "UpdatePrivateEndpointPricingRequestTypedDict", + "UpdatePrivateEndpointRequest", + "UpdatePrivateEndpointRequestTypedDict", "UpdateScimGroupMappingGlobals", "UpdateScimGroupMappingGlobalsTypedDict", "UpdateScimGroupMappingRequest", @@ -1788,6 +1886,10 @@ "UpsertWorkspaceBudgetRequest", "UpsertWorkspaceBudgetRequestTypedDict", "UsageLimitType", + "ValidatePrivateEndpointGlobals", + "ValidatePrivateEndpointGlobalsTypedDict", + "ValidatePrivateEndpointRequest", + "ValidatePrivateEndpointRequestTypedDict", "Value1", "Value1TypedDict", "Value2", @@ -1800,6 +1902,10 @@ ] _dynamic_imports: dict[str, str] = { + "ActivatePrivateEndpointGlobals": ".activateprivateendpoint", + "ActivatePrivateEndpointGlobalsTypedDict": ".activateprivateendpoint", + "ActivatePrivateEndpointRequest": ".activateprivateendpoint", + "ActivatePrivateEndpointRequestTypedDict": ".activateprivateendpoint", "BulkAddWorkspaceMembersGlobals": ".bulkaddworkspacemembers", "BulkAddWorkspaceMembersGlobalsTypedDict": ".bulkaddworkspacemembers", "BulkAddWorkspaceMembersRequest": ".bulkaddworkspacemembers", @@ -1961,6 +2067,10 @@ "CreatePresetsResponsesGlobalsTypedDict": ".createpresetsresponses", "CreatePresetsResponsesRequest": ".createpresetsresponses", "CreatePresetsResponsesRequestTypedDict": ".createpresetsresponses", + "CreatePrivateEndpointGlobals": ".createprivateendpoint", + "CreatePrivateEndpointGlobalsTypedDict": ".createprivateendpoint", + "CreatePrivateEndpointRequest": ".createprivateendpoint", + "CreatePrivateEndpointRequestTypedDict": ".createprivateendpoint", "CreateRerankGlobals": ".creatererank", "CreateRerankGlobalsTypedDict": ".creatererank", "CreateRerankRequest": ".creatererank", @@ -2043,6 +2153,11 @@ "DeleteObservabilityDestinationGlobalsTypedDict": ".deleteobservabilitydestination", "DeleteObservabilityDestinationRequest": ".deleteobservabilitydestination", "DeleteObservabilityDestinationRequestTypedDict": ".deleteobservabilitydestination", + "DeletePrivateEndpointGlobals": ".deleteprivateendpoint", + "DeletePrivateEndpointGlobalsTypedDict": ".deleteprivateendpoint", + "DeletePrivateEndpointRequest": ".deleteprivateendpoint", + "DeletePrivateEndpointRequestTypedDict": ".deleteprivateendpoint", + "DraftOnly": ".deleteprivateendpoint", "DeleteScimGroupMappingGlobals": ".deletescimgroupmapping", "DeleteScimGroupMappingGlobalsTypedDict": ".deletescimgroupmapping", "DeleteScimGroupMappingRequest": ".deletescimgroupmapping", @@ -2062,6 +2177,10 @@ "DeleteWorkspaceBudgetGlobalsTypedDict": ".deleteworkspacebudget", "DeleteWorkspaceBudgetRequest": ".deleteworkspacebudget", "DeleteWorkspaceBudgetRequestTypedDict": ".deleteworkspacebudget", + "DisablePrivateEndpointGlobals": ".disableprivateendpoint", + "DisablePrivateEndpointGlobalsTypedDict": ".disableprivateendpoint", + "DisablePrivateEndpointRequest": ".disableprivateendpoint", + "DisablePrivateEndpointRequestTypedDict": ".disableprivateendpoint", "DownloadContainerFileContentGlobals": ".downloadcontainerfilecontent", "DownloadContainerFileContentGlobalsTypedDict": ".downloadcontainerfilecontent", "DownloadContainerFileContentRequest": ".downloadcontainerfilecontent", @@ -2070,6 +2189,10 @@ "DownloadFileContentGlobalsTypedDict": ".downloadfilecontent", "DownloadFileContentRequest": ".downloadfilecontent", "DownloadFileContentRequestTypedDict": ".downloadfilecontent", + "EnablePrivateEndpointGlobals": ".enableprivateendpoint", + "EnablePrivateEndpointGlobalsTypedDict": ".enableprivateendpoint", + "EnablePrivateEndpointRequest": ".enableprivateendpoint", + "EnablePrivateEndpointRequestTypedDict": ".enableprivateendpoint", "ExchangeAuthCodeForAPIKeyCodeChallengeMethod": ".exchangeauthcodeforapikey", "ExchangeAuthCodeForAPIKeyGlobals": ".exchangeauthcodeforapikey", "ExchangeAuthCodeForAPIKeyGlobalsTypedDict": ".exchangeauthcodeforapikey", @@ -2207,6 +2330,10 @@ "GetPresetVersionGlobalsTypedDict": ".getpresetversion", "GetPresetVersionRequest": ".getpresetversion", "GetPresetVersionRequestTypedDict": ".getpresetversion", + "GetPrivateEndpointGlobals": ".getprivateendpoint", + "GetPrivateEndpointGlobalsTypedDict": ".getprivateendpoint", + "GetPrivateEndpointRequest": ".getprivateendpoint", + "GetPrivateEndpointRequestTypedDict": ".getprivateendpoint", "ContextBucket": ".getrankingsdaily", "GetRankingsDailyCategory": ".getrankingsdaily", "GetRankingsDailyGlobals": ".getrankingsdaily", @@ -2405,6 +2532,10 @@ "ListPresetVersionsRequestTypedDict": ".listpresetversions", "ListPresetVersionsResponse": ".listpresetversions", "ListPresetVersionsResponseTypedDict": ".listpresetversions", + "ListPrivateEndpointsGlobals": ".listprivateendpoints", + "ListPrivateEndpointsGlobalsTypedDict": ".listprivateendpoints", + "ListPrivateEndpointsRequest": ".listprivateendpoints", + "ListPrivateEndpointsRequestTypedDict": ".listprivateendpoints", "Datacenter": ".listproviders", "Headquarters": ".listproviders", "ListProvidersData": ".listproviders", @@ -2547,6 +2678,14 @@ "UpdateObservabilityDestinationGlobalsTypedDict": ".updateobservabilitydestination", "UpdateObservabilityDestinationRequest": ".updateobservabilitydestination", "UpdateObservabilityDestinationRequestTypedDict": ".updateobservabilitydestination", + "UpdatePrivateEndpointGlobals": ".updateprivateendpoint", + "UpdatePrivateEndpointGlobalsTypedDict": ".updateprivateendpoint", + "UpdatePrivateEndpointRequest": ".updateprivateendpoint", + "UpdatePrivateEndpointRequestTypedDict": ".updateprivateendpoint", + "UpdatePrivateEndpointPricingGlobals": ".updateprivateendpointpricing", + "UpdatePrivateEndpointPricingGlobalsTypedDict": ".updateprivateendpointpricing", + "UpdatePrivateEndpointPricingRequest": ".updateprivateendpointpricing", + "UpdatePrivateEndpointPricingRequestTypedDict": ".updateprivateendpointpricing", "UpdateScimGroupMappingGlobals": ".updatescimgroupmapping", "UpdateScimGroupMappingGlobalsTypedDict": ".updatescimgroupmapping", "UpdateScimGroupMappingRequest": ".updatescimgroupmapping", @@ -2567,6 +2706,10 @@ "UpsertWorkspaceBudgetGlobalsTypedDict": ".upsertworkspacebudget", "UpsertWorkspaceBudgetRequest": ".upsertworkspacebudget", "UpsertWorkspaceBudgetRequestTypedDict": ".upsertworkspacebudget", + "ValidatePrivateEndpointGlobals": ".validateprivateendpoint", + "ValidatePrivateEndpointGlobalsTypedDict": ".validateprivateendpoint", + "ValidatePrivateEndpointRequest": ".validateprivateendpoint", + "ValidatePrivateEndpointRequestTypedDict": ".validateprivateendpoint", } diff --git a/src/openrouter/operations/activateprivateendpoint.py b/src/openrouter/operations/activateprivateendpoint.py new file mode 100644 index 00000000..18eb4f57 --- /dev/null +++ b/src/openrouter/operations/activateprivateendpoint.py @@ -0,0 +1,144 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ActivatePrivateEndpointGlobalsTypedDict(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 ActivatePrivateEndpointGlobals(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 ActivatePrivateEndpointRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + 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 ActivatePrivateEndpointRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/createprivateendpoint.py b/src/openrouter/operations/createprivateendpoint.py new file mode 100644 index 00000000..999c151f --- /dev/null +++ b/src/openrouter/operations/createprivateendpoint.py @@ -0,0 +1,162 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + createprivateendpointrequest as components_createprivateendpointrequest, +) +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 CreatePrivateEndpointGlobalsTypedDict(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 CreatePrivateEndpointGlobals(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 CreatePrivateEndpointRequestTypedDict(TypedDict): + create_private_endpoint_request: ( + components_createprivateendpointrequest.CreatePrivateEndpointRequestTypedDict + ) + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + idempotency_key: NotRequired[str] + r"""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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison.""" + + +class CreatePrivateEndpointRequest(BaseModel): + create_private_endpoint_request: Annotated[ + components_createprivateendpointrequest.CreatePrivateEndpointRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + idempotency_key: Annotated[ + Optional[str], + pydantic.Field(alias="idempotency-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "idempotency-key", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/deleteprivateendpoint.py b/src/openrouter/operations/deleteprivateendpoint.py new file mode 100644 index 00000000..d24ba071 --- /dev/null +++ b/src/openrouter/operations/deleteprivateendpoint.py @@ -0,0 +1,172 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DeletePrivateEndpointGlobalsTypedDict(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 DeletePrivateEndpointGlobals(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 + + +DraftOnly = Union[ + Literal[ + "true", + "false", + ], + UnrecognizedStr, +] +r"""When `true`, only delete the endpoint if it is still a draft (409 otherwise).""" + + +class DeletePrivateEndpointRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + 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. + + """ + draft_only: NotRequired[DraftOnly] + r"""When `true`, only delete the endpoint if it is still a draft (409 otherwise).""" + + +class DeletePrivateEndpointRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + 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. + + """ + + draft_only: Annotated[ + Optional[DraftOnly], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""When `true`, only delete the endpoint if it is still a draft (409 otherwise).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "draft_only", + ] + ) + 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/disableprivateendpoint.py b/src/openrouter/operations/disableprivateendpoint.py new file mode 100644 index 00000000..9db63217 --- /dev/null +++ b/src/openrouter/operations/disableprivateendpoint.py @@ -0,0 +1,144 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DisablePrivateEndpointGlobalsTypedDict(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 DisablePrivateEndpointGlobals(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 DisablePrivateEndpointRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + 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 DisablePrivateEndpointRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/enableprivateendpoint.py b/src/openrouter/operations/enableprivateendpoint.py new file mode 100644 index 00000000..4994f76e --- /dev/null +++ b/src/openrouter/operations/enableprivateendpoint.py @@ -0,0 +1,144 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class EnablePrivateEndpointGlobalsTypedDict(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 EnablePrivateEndpointGlobals(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 EnablePrivateEndpointRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + 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 EnablePrivateEndpointRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/getprivateendpoint.py b/src/openrouter/operations/getprivateendpoint.py new file mode 100644 index 00000000..91f86d25 --- /dev/null +++ b/src/openrouter/operations/getprivateendpoint.py @@ -0,0 +1,144 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetPrivateEndpointGlobalsTypedDict(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 GetPrivateEndpointGlobals(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 GetPrivateEndpointRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + 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 GetPrivateEndpointRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/listprivateendpoints.py b/src/openrouter/operations/listprivateendpoints.py new file mode 100644 index 00000000..5f70f10c --- /dev/null +++ b/src/openrouter/operations/listprivateendpoints.py @@ -0,0 +1,137 @@ +"""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 +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPrivateEndpointsGlobalsTypedDict(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 ListPrivateEndpointsGlobals(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 ListPrivateEndpointsRequestTypedDict(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 ListPrivateEndpointsRequest(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 diff --git a/src/openrouter/operations/updateprivateendpoint.py b/src/openrouter/operations/updateprivateendpoint.py new file mode 100644 index 00000000..f916dfcb --- /dev/null +++ b/src/openrouter/operations/updateprivateendpoint.py @@ -0,0 +1,160 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + updateprivateendpointrequest as components_updateprivateendpointrequest, +) +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 UpdatePrivateEndpointGlobalsTypedDict(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 UpdatePrivateEndpointGlobals(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 UpdatePrivateEndpointRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + update_private_endpoint_request: ( + components_updateprivateendpointrequest.UpdatePrivateEndpointRequestTypedDict + ) + 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 UpdatePrivateEndpointRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + update_private_endpoint_request: Annotated[ + components_updateprivateendpointrequest.UpdatePrivateEndpointRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/updateprivateendpointpricing.py b/src/openrouter/operations/updateprivateendpointpricing.py new file mode 100644 index 00000000..144cf097 --- /dev/null +++ b/src/openrouter/operations/updateprivateendpointpricing.py @@ -0,0 +1,158 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + updateprivateendpointpricingrequest as components_updateprivateendpointpricingrequest, +) +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 UpdatePrivateEndpointPricingGlobalsTypedDict(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 UpdatePrivateEndpointPricingGlobals(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 UpdatePrivateEndpointPricingRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + update_private_endpoint_pricing_request: components_updateprivateendpointpricingrequest.UpdatePrivateEndpointPricingRequestTypedDict + 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 UpdatePrivateEndpointPricingRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + update_private_endpoint_pricing_request: Annotated[ + components_updateprivateendpointpricingrequest.UpdatePrivateEndpointPricingRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/validateprivateendpoint.py b/src/openrouter/operations/validateprivateendpoint.py new file mode 100644 index 00000000..de47082a --- /dev/null +++ b/src/openrouter/operations/validateprivateendpoint.py @@ -0,0 +1,158 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + validateprivateendpointrequest as components_validateprivateendpointrequest, +) +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 ValidatePrivateEndpointGlobalsTypedDict(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 ValidatePrivateEndpointGlobals(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 ValidatePrivateEndpointRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + validate_private_endpoint_request: components_validateprivateendpointrequest.ValidatePrivateEndpointRequestTypedDict + 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 ValidatePrivateEndpointRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + validate_private_endpoint_request: Annotated[ + components_validateprivateendpointrequest.ValidatePrivateEndpointRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/private_endpoints.py b/src/openrouter/private_endpoints.py new file mode 100644 index 00000000..a6e38e8e --- /dev/null +++ b/src/openrouter/private_endpoints.py @@ -0,0 +1,3301 @@ +"""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 PrivateEndpoints(BaseSDK): + r"""Private Endpoints 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, + ) -> components.ListPrivateEndpointsResponse: + r"""List private endpoints + + List the organization's private endpoints, including drafts. 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.ListPrivateEndpointsRequest( + 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-endpoints", + 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.ListPrivateEndpointsGlobals( + 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="listPrivateEndpoints", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ListPrivateEndpointsResponse, 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, "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, "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, + ) -> components.ListPrivateEndpointsResponse: + r"""List private endpoints + + List the organization's private endpoints, including drafts. 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.ListPrivateEndpointsRequest( + 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-endpoints", + 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.ListPrivateEndpointsGlobals( + 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="listPrivateEndpoints", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ListPrivateEndpointsResponse, 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, "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, "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, + *, + model_permaslug: str, + provider_slug: str, + upstream_model_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + idempotency_key: Optional[str] = None, + activate: Optional[ + Union[ + components.PrivateEndpointActivation, + components.PrivateEndpointActivationTypedDict, + ] + ] = None, + base_url: Optional[str] = None, + declared_region: OptionalNullable[ + components.CreatePrivateEndpointRequestDeclaredRegion + ] = UNSET, + declared_zdr: OptionalNullable[bool] = UNSET, + pricing: Optional[ + Union[ + components.PrivateEndpointPricing, + components.PrivateEndpointPricingTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Create a private endpoint + + 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`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param model_permaslug: Permanent slug of the model this endpoint serves. + :param provider_slug: Slug of the upstream provider. + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param idempotency_key: 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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison. + :param activate: 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. + :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_region: Attest where this deployment processes data. + :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. + :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.CreatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + idempotency_key=idempotency_key, + create_private_endpoint_request=components.CreatePrivateEndpointRequest( + activate=utils.get_pydantic_model( + activate, Optional[components.PrivateEndpointActivation] + ), + base_url=base_url, + declared_region=declared_region, + declared_zdr=declared_zdr, + model_permaslug=model_permaslug, + pricing=utils.get_pydantic_model( + pricing, Optional[components.PrivateEndpointPricing] + ), + provider_slug=provider_slug, + upstream_model_id=upstream_model_id, + ), + ) + + req = self._build_request( + method="POST", + path="/private-endpoints", + 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.CreatePrivateEndpointGlobals( + 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_endpoint_request, + False, + False, + "json", + components.CreatePrivateEndpointRequest, + ), + 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="createPrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + 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( + components.ManagedPrivateEndpointResponse, 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.NotFoundUnion, http_res) + raise errors.NotFound(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.ConflictUnion, http_res) + raise errors.Conflict(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityUnion, http_res + ) + raise errors.UnprocessableEntity(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorUnion, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.BadGatewayUnion, http_res) + raise errors.BadGateway(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, + *, + model_permaslug: str, + provider_slug: str, + upstream_model_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + idempotency_key: Optional[str] = None, + activate: Optional[ + Union[ + components.PrivateEndpointActivation, + components.PrivateEndpointActivationTypedDict, + ] + ] = None, + base_url: Optional[str] = None, + declared_region: OptionalNullable[ + components.CreatePrivateEndpointRequestDeclaredRegion + ] = UNSET, + declared_zdr: OptionalNullable[bool] = UNSET, + pricing: Optional[ + Union[ + components.PrivateEndpointPricing, + components.PrivateEndpointPricingTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Create a private endpoint + + 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`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param model_permaslug: Permanent slug of the model this endpoint serves. + :param provider_slug: Slug of the upstream provider. + :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. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param idempotency_key: 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, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison. + :param activate: 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. + :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_region: Attest where this deployment processes data. + :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. + :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.CreatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + idempotency_key=idempotency_key, + create_private_endpoint_request=components.CreatePrivateEndpointRequest( + activate=utils.get_pydantic_model( + activate, Optional[components.PrivateEndpointActivation] + ), + base_url=base_url, + declared_region=declared_region, + declared_zdr=declared_zdr, + model_permaslug=model_permaslug, + pricing=utils.get_pydantic_model( + pricing, Optional[components.PrivateEndpointPricing] + ), + provider_slug=provider_slug, + upstream_model_id=upstream_model_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/private-endpoints", + 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.CreatePrivateEndpointGlobals( + 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_endpoint_request, + False, + False, + "json", + components.CreatePrivateEndpointRequest, + ), + 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="createPrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + 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( + components.ManagedPrivateEndpointResponse, 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.NotFoundUnion, http_res) + raise errors.NotFound(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.ConflictUnion, http_res) + raise errors.Conflict(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.UnprocessableEntityUnion, http_res + ) + raise errors.UnprocessableEntity(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorUnion, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "502", "application/json"): + response_data = unmarshal_json_response(errors.BadGatewayUnion, http_res) + raise errors.BadGateway(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, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + draft_only: Optional[operations.DraftOnly] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.DeletePrivateEndpointResponse: + r"""Delete a private endpoint + + 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. + + :param id: Stable identifier of the private endpoint. + :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 draft_only: When `true`, only delete the endpoint if it is still a draft (409 otherwise). + :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.DeletePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + draft_only=draft_only, + ) + + req = self._build_request( + method="DELETE", + path="/private-endpoints/{id}", + 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.DeletePrivateEndpointGlobals( + 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="deletePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.DeletePrivateEndpointResponse, 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, "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, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + draft_only: Optional[operations.DraftOnly] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.DeletePrivateEndpointResponse: + r"""Delete a private endpoint + + 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. + + :param id: Stable identifier of the private endpoint. + :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 draft_only: When `true`, only delete the endpoint if it is still a draft (409 otherwise). + :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.DeletePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + draft_only=draft_only, + ) + + req = self._build_request_async( + method="DELETE", + path="/private-endpoints/{id}", + 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.DeletePrivateEndpointGlobals( + 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="deletePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.DeletePrivateEndpointResponse, 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, "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, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.PrivateEndpointResponse: + r"""Get a private endpoint + + Get one private endpoint with its upstream configuration and current pricing. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :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.GetPrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request( + method="GET", + path="/private-endpoints/{id}", + 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.GetPrivateEndpointGlobals( + 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="getPrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.PrivateEndpointResponse, 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, "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, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.PrivateEndpointResponse: + r"""Get a private endpoint + + Get one private endpoint with its upstream configuration and current pricing. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :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.GetPrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/private-endpoints/{id}", + 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.GetPrivateEndpointGlobals( + 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="getPrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.PrivateEndpointResponse, 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, "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, + *, + 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_region: OptionalNullable[ + components.UpdatePrivateEndpointRequestDeclaredRegion + ] = UNSET, + declared_zdr: OptionalNullable[bool] = UNSET, + 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 + + 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. + + :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. + + :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 your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). + :param declared_region: Attest where this deployment processes data. + :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :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.UpdatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + update_private_endpoint_request=components.UpdatePrivateEndpointRequest( + base_url=base_url, + declared_region=declared_region, + declared_zdr=declared_zdr, + upstream_model_id=upstream_model_id, + ), + ) + + req = self._build_request( + method="PATCH", + path="/private-endpoints/{id}", + 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.UpdatePrivateEndpointGlobals( + 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_endpoint_request, + False, + False, + "json", + components.UpdatePrivateEndpointRequest, + ), + 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="updatePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.PrivateEndpointResponse, 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, "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, + *, + 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_region: OptionalNullable[ + components.UpdatePrivateEndpointRequestDeclaredRegion + ] = UNSET, + declared_zdr: OptionalNullable[bool] = UNSET, + 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 + + 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. + + :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. + + :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 your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). + :param declared_region: Attest where this deployment processes data. + :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :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.UpdatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + update_private_endpoint_request=components.UpdatePrivateEndpointRequest( + base_url=base_url, + declared_region=declared_region, + declared_zdr=declared_zdr, + upstream_model_id=upstream_model_id, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/private-endpoints/{id}", + 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.UpdatePrivateEndpointGlobals( + 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_endpoint_request, + False, + False, + "json", + components.UpdatePrivateEndpointRequest, + ), + 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="updatePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.PrivateEndpointResponse, 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, "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 activate( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Activate a validated private endpoint + + 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. + + :param id: Stable identifier of the private endpoint. + :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.ActivatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request( + method="POST", + path="/private-endpoints/{id}/activate", + 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.ActivatePrivateEndpointGlobals( + 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="activatePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ManagedPrivateEndpointResponse, 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, "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 activate_async( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Activate a validated private endpoint + + 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. + + :param id: Stable identifier of the private endpoint. + :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.ActivatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request_async( + method="POST", + path="/private-endpoints/{id}/activate", + 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.ActivatePrivateEndpointGlobals( + 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="activatePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ManagedPrivateEndpointResponse, 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, "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 disable( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Disable a private endpoint + + Stop routing to an active endpoint without deleting it. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :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.DisablePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request( + method="POST", + path="/private-endpoints/{id}/disable", + 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.DisablePrivateEndpointGlobals( + 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="disablePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ManagedPrivateEndpointResponse, 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, "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 disable_async( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Disable a private endpoint + + Stop routing to an active endpoint without deleting it. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :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.DisablePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request_async( + method="POST", + path="/private-endpoints/{id}/disable", + 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.DisablePrivateEndpointGlobals( + 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="disablePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ManagedPrivateEndpointResponse, 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, "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 enable( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Enable a private endpoint + + Resume routing to a disabled endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :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.EnablePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request( + method="POST", + path="/private-endpoints/{id}/enable", + 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.EnablePrivateEndpointGlobals( + 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="enablePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ManagedPrivateEndpointResponse, 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, "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 enable_async( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.ManagedPrivateEndpointResponse: + r"""Enable a private endpoint + + Resume routing to a disabled endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :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.EnablePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request_async( + method="POST", + path="/private-endpoints/{id}/enable", + 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.EnablePrivateEndpointGlobals( + 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="enablePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.ManagedPrivateEndpointResponse, 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, "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 update_pricing( + self, + *, + id: str, + pricing: Union[ + components.PrivateEndpointPricing, + components.PrivateEndpointPricingTypedDict, + ], + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.PrivateEndpointResponse: + r"""Set private endpoint pricing + + 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. [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. + :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.UpdatePrivateEndpointPricingRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + update_private_endpoint_pricing_request=components.UpdatePrivateEndpointPricingRequest( + pricing=utils.get_pydantic_model( + pricing, components.PrivateEndpointPricing + ), + ), + ) + + req = self._build_request( + method="PUT", + path="/private-endpoints/{id}/pricing", + 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.UpdatePrivateEndpointPricingGlobals( + 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_endpoint_pricing_request, + False, + False, + "json", + components.UpdatePrivateEndpointPricingRequest, + ), + 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="updatePrivateEndpointPricing", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.PrivateEndpointResponse, 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, "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_pricing_async( + self, + *, + id: str, + pricing: Union[ + components.PrivateEndpointPricing, + components.PrivateEndpointPricingTypedDict, + ], + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.PrivateEndpointResponse: + r"""Set private endpoint pricing + + 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. [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. + :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.UpdatePrivateEndpointPricingRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + update_private_endpoint_pricing_request=components.UpdatePrivateEndpointPricingRequest( + pricing=utils.get_pydantic_model( + pricing, components.PrivateEndpointPricing + ), + ), + ) + + req = self._build_request_async( + method="PUT", + path="/private-endpoints/{id}/pricing", + 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.UpdatePrivateEndpointPricingGlobals( + 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_endpoint_pricing_request, + False, + False, + "json", + components.UpdatePrivateEndpointPricingRequest, + ), + 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="updatePrivateEndpointPricing", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(components.PrivateEndpointResponse, 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, "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 validate( + self, + *, + id: str, + workspace_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.PrivateEndpointValidationResponse: + r"""Validate a draft private endpoint + + 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. + + :param id: Stable identifier of the private endpoint. + :param workspace_id: Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account. + :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.ValidatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + validate_private_endpoint_request=components.ValidatePrivateEndpointRequest( + workspace_id=workspace_id, + ), + ) + + req = self._build_request( + method="POST", + path="/private-endpoints/{id}/validate", + 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.ValidatePrivateEndpointGlobals( + 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.validate_private_endpoint_request, + False, + False, + "json", + components.ValidatePrivateEndpointRequest, + ), + 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="validatePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.PrivateEndpointValidationResponse, 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, "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 validate_async( + self, + *, + id: str, + workspace_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.PrivateEndpointValidationResponse: + r"""Validate a draft private endpoint + + 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. + + :param id: Stable identifier of the private endpoint. + :param workspace_id: Workspace whose BYOK credential is used for the live validation call. The workspace must belong to your account. + :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.ValidatePrivateEndpointRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + validate_private_endpoint_request=components.ValidatePrivateEndpointRequest( + workspace_id=workspace_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/private-endpoints/{id}/validate", + 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.ValidatePrivateEndpointGlobals( + 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.validate_private_endpoint_request, + False, + False, + "json", + components.ValidatePrivateEndpointRequest, + ), + 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="validatePrivateEndpoint", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Private Endpoints"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + components.PrivateEndpointValidationResponse, 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, "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 8e874115..78cbf5d3 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -40,6 +40,7 @@ from openrouter.observability import Observability from openrouter.organization import Organization from openrouter.presets import Presets + from openrouter.private_endpoints import PrivateEndpoints from openrouter.providers import Providers from openrouter.rerank import Rerank from openrouter.responses import Responses @@ -105,6 +106,8 @@ class OpenRouter(BaseSDK): r"""Organization endpoints""" presets: "Presets" r"""Presets endpoints""" + private_endpoints: "PrivateEndpoints" + r"""Private Endpoints endpoints""" providers: "Providers" r"""Provider information endpoints""" rerank: "Rerank" @@ -148,6 +151,7 @@ class OpenRouter(BaseSDK): "observability": ("openrouter.observability", "Observability"), "organization": ("openrouter.organization", "Organization"), "presets": ("openrouter.presets", "Presets"), + "private_endpoints": ("openrouter.private_endpoints", "PrivateEndpoints"), "providers": ("openrouter.providers", "Providers"), "rerank": ("openrouter.rerank", "Rerank"), "responses": ("openrouter.responses", "Responses"), diff --git a/uv.lock b/uv.lock index f0c2a0a5..eeb07e36 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.2.35" +version = "1.3.0" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 483691a256391cecce5e4ef198f02b6e84a8647f Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:14:34 +0000 Subject: [PATCH 2/3] empty commit to trigger [run-tests] workflow From 34252850aa940adea37283fe9db75826887ba75c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:14:50 +0000 Subject: [PATCH 3/3] Chore: regenerate docs navigation Auto-generated-by: update-generated-files-action; https://github.com/OpenRouterTeam/python-sdk/actions/runs/36491209205 --- docs/docs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs.json b/docs/docs.json index 59f920a7..af21c6d8 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -34,6 +34,7 @@ "sdks/observability/README", "sdks/organization/README", "sdks/presets/README", + "sdks/privateendpoints/README", "sdks/providers/README", "sdks/rerank/README", "sdks/responses/README",