diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 89d80c49..f2003965 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: 39e8b78cea1a6da8f155774d0a4b4053 + docChecksum: d04fdb5b71ee0fec2d30db32b6bcf758 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.84 - configChecksum: a5d96cccf4690c760acec1ff11bda5c8 + releaseVersion: 1.3.85 + configChecksum: e4f0938a8d6413fe4a86cce5d55f3c61 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 01b2c4bb-ebfe-4d5a-b196-3a36a8724cd2 - pristine_commit_hash: 287dbf152fe38450277ddb285e5ee5195d05d9ae - pristine_tree_hash: 2f56c414732e9058f4e91d97f39089075b1b54d2 + generation_id: 90ad43b8-e7cc-4514-abde-92b9d8147631 + pristine_commit_hash: 4246f0a1f1814889b723c9b9031c2dbe32d5e40f + pristine_tree_hash: 8b04b2a5ea57d9bf3075455aa6b251a350db1614 features: python: acceptHeaders: 3.0.0 @@ -2656,8 +2656,8 @@ trackedFiles: pristine_git_object: c31f263d23205ebfa16eb7e4ae5f33a11fb19764 docs/components/createprivateendpointrequest.mdx: id: 14dbb5bba6c1 - last_write_checksum: sha1:ddea9a5d58465fbfb47a927c848a11b359673187 - pristine_git_object: e9a0f79d968084059dcea0599f73de594800b089 + last_write_checksum: sha1:88fc532ba40b90da033a3b7ceff37fc55dbd9cc3 + pristine_git_object: 161326fd98fc7328437bdbbbf2ebddbb0ee30a18 docs/components/createprivateendpointrequestdeclaredregion.mdx: id: 58cea9c8b74d last_write_checksum: sha1:7b835ef8af060b80af19bbbb1eae9ec24eabf747 @@ -4228,8 +4228,8 @@ trackedFiles: pristine_git_object: 0645e0cddf32a6cfda57cc7554808c61b99ee039 docs/components/managedprivateendpoint.mdx: id: c2bb24179857 - last_write_checksum: sha1:5a406e066b2149135c5b8984bfb736185901ecaa - pristine_git_object: 31440c7b7496fe35d042183aaaf31a919336500b + last_write_checksum: sha1:3eff93f035e549d53ba5501ead4374447ce88bed + pristine_git_object: 2f6ee9b37fbb9c480cc53be8a1a96eb81eb67a6b docs/components/managedprivateendpointresponse.mdx: id: f798eb0c37e5 last_write_checksum: sha1:be722b659f7e961ea318b221eb039e9571b729b6 @@ -6156,8 +6156,8 @@ trackedFiles: pristine_git_object: 6a99a2737d18a3c227bf7fcabf58b481d3c7d94b docs/components/privateendpoint.mdx: id: 139c5b16dd66 - last_write_checksum: sha1:9a7d6ec85eba27f801982e6d6c1312856c58e539 - pristine_git_object: c877a16f69c1952f0e3a5e0f4e55217ffe5ebed9 + last_write_checksum: sha1:a9607704d48c33415042b88bce9c1933b05ca811 + pristine_git_object: 1c7f8c44eb8886f8a9f86e0ded3d45b668216141 docs/components/privateendpointactivation.mdx: id: c5cea1d4e39d last_write_checksum: sha1:832ee01779e755b70618c0fb80ac937ba70b15cb @@ -6170,18 +6170,26 @@ trackedFiles: id: "287778805047" last_write_checksum: sha1:b74afe4459b4505186ec53978982afa6cf7f0e75 pristine_git_object: bddfe2448682987da6a9c04aeb8ce24bea53b327 + docs/components/privateendpointdeclaredparameter.mdx: + id: ae4ffd7444e4 + last_write_checksum: sha1:81aff8656953885ffa17b0b6c1b46470852c1f25 + pristine_git_object: 19e8f1c3c5fe01d2875994564af75f19964ce536 docs/components/privateendpointdeclaredregion.mdx: id: 6bc8d66ba11d last_write_checksum: sha1:049bc2538e8098eb26254f01c49c81ad3d3df57b pristine_git_object: d82f235f03d49c49a8051659a00a64753630d9b8 + docs/components/privateendpointparametercheck.mdx: + id: e199d78b0577 + last_write_checksum: sha1:0e0bec0ca32b253d9001840b111a3e332e6aab35 + pristine_git_object: 9dc71f4e2d02ae3a1b879df8b9c188fe13d3afa0 docs/components/privateendpointpricing.mdx: id: 16264ba816a0 last_write_checksum: sha1:e1fc22fca61fcbf36c2b3d48908af0b1de0f8370 pristine_git_object: 98c2b6bacd5e87a81285558abed783d7c5e24bc3 docs/components/privateendpointresponse.mdx: id: 5844d85b61d8 - last_write_checksum: sha1:e303f61ad992a12c3f9e1008beba2b3b277c9157 - pristine_git_object: 7d641919aded35cecc7b9ca046af4af368b2be0d + last_write_checksum: sha1:7fa2872175184c96286c32d67975d7b462cf8830 + pristine_git_object: 42dd4c3c0f93406ec8006f914d590477c198b7eb docs/components/privateendpointstatus.mdx: id: 170564aaaa0f last_write_checksum: sha1:3cdf3d3142af4ece802933887e1659bca0ea26be @@ -6192,12 +6200,12 @@ trackedFiles: pristine_git_object: d88a936da2b944d786aaffe03e49789b097df816 docs/components/privateendpointvalidation.mdx: id: 0cd006e42c34 - last_write_checksum: sha1:de04c710c61d1e63b4d932116d25668f0e8d1e82 - pristine_git_object: dd31ec90b67492338cce0bbd53112a12609dab67 + last_write_checksum: sha1:ad94a7bfb8eec15de12e1aa3885900dddc504b70 + pristine_git_object: 361a60feca463be0907564ebb1cbe2388b2d0a87 docs/components/privateendpointvalidationnullable.mdx: id: 577bfe7e104f - last_write_checksum: sha1:647ae9474113ff8e3e999dc3967c0baea7ec70ba - pristine_git_object: a7e2dfdc132acdf9fbf3532972af4df8d109da49 + last_write_checksum: sha1:09b549ffa36a15a286a33fdad51c78e35ed6d134 + pristine_git_object: 2ea00cff5b9ff5499ff7495204c4c9d913eda821 docs/components/privateendpointvalidationresponse.mdx: id: 427cb057c9e7 last_write_checksum: sha1:fdd015dfe7b94035aef344ed4af7eeae8c037d39 @@ -7718,6 +7726,10 @@ trackedFiles: id: 38c4ebf7f509 last_write_checksum: sha1:4b0aa79182315301b6824bd933676a5b2b5bdd3a pristine_git_object: d46fb370c21fa0d04b29ece85364a693737dfe79 + docs/components/updateprivateendpointparametersrequest.mdx: + id: f28148578ff0 + last_write_checksum: sha1:979f224d1db14d9b9e2b4195f1f56747800cd59f + pristine_git_object: 9e2c1ac4036ac7748791a48316b20b6c556c6f30 docs/components/updateprivateendpointpricingrequest.mdx: id: 1ed6ca2fbacb last_write_checksum: sha1:328f4f68996672e5a5b31ada9b80cae99233348a @@ -8496,8 +8508,8 @@ trackedFiles: pristine_git_object: 700ae51c2795c131443f07bf19e59f5901aae49f docs/operations/createprivateendpointrequest.mdx: id: 3cb88260cf95 - last_write_checksum: sha1:e6efd5230f0c398402853439ef5bb0fd6e9b763e - pristine_git_object: 175cee0cd862974335be7f1300a958b168fb1fbe + last_write_checksum: sha1:f60805e77fae87a8eb9c9d00a2528a82869b400c + pristine_git_object: b936af39acf6c56d09a91bc616d66b09a26b15b7 docs/operations/creatererankglobals.mdx: id: 4cb9d6ca73a4 last_write_checksum: sha1:6af3dafb586c07947123d4aa815cbd85212e4332 @@ -9822,6 +9834,14 @@ trackedFiles: id: fb671a4175d8 last_write_checksum: sha1:0614e90273c73cebc8fe2bb7bc430fffd5886b46 pristine_git_object: 3624f9a241b204b21dabe33f62f7b638dd821905 + docs/operations/updateprivateendpointparametersglobals.mdx: + id: d57d2eb9d772 + last_write_checksum: sha1:15506a1841da5dd5bc95aa964ce23893d70ba929 + pristine_git_object: 03c7cc7a3244a1dc5b196fb0e3bb7d1999338ccc + docs/operations/updateprivateendpointparametersrequest.mdx: + id: 7fa38e027542 + last_write_checksum: sha1:e7ce19200e2f8583d1a66915357835de8019fe10 + pristine_git_object: 9a0e0aea07723f9ac2f401a73d94f331dd628370 docs/operations/updateprivateendpointpricingglobals.mdx: id: d438b0badcdd last_write_checksum: sha1:53023f35d75c8a8b8704c5984ecc37582cf531bc @@ -10008,8 +10028,8 @@ trackedFiles: pristine_git_object: 27c97e3ee4761cd46f2d5d96be093e1663c6ed93 docs/sdks/privateendpoints/README.mdx: id: 54dee70b8cc7 - last_write_checksum: sha1:2f58390d196d1c08a304b9d3c2f495281fe0c8db - pristine_git_object: 8996a61b1f8f3270f905963de0dee573427b4d86 + last_write_checksum: sha1:48a23b4ac96cda69a6f76a3725bbb4c4c5f6a73f + pristine_git_object: 0bcec24343c9b8abd80f4633676d73158a04c929 docs/sdks/providers/README.mdx: id: 5ea9af111324 last_write_checksum: sha1:570b55655ee7602d3807c3218e450741f634eed6 @@ -10060,8 +10080,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:199681af9436f81350f72748a42103ae013ed197 - pristine_git_object: 02809d52b88f98f8861e673d61cd8e100c8f5a29 + last_write_checksum: sha1:a19c1a6460b4ce8e3fab234ff34a01d32b2309ae + pristine_git_object: c309706f3391a2aefc0414c6642181f28b589df7 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10088,8 +10108,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:98fbfc39547e01e562e1769fb47df919898842d9 - pristine_git_object: 86afd260c68a15c51df81fac522d0f299136c458 + last_write_checksum: sha1:1384b4106d94ecc76878ac3b788dd72f941921f2 + pristine_git_object: baf73dbe9fc37a87d59a5587d3e8cff77090029f src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -10136,8 +10156,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:0adc9b2e076c2f45193cfadb4b7f6923a54178e4 - pristine_git_object: 66f727d993f7230d54452ba0bc46b15bd2d8f514 + last_write_checksum: sha1:08ab289f80b3f9edb2967758f2228fe9fc062a88 + pristine_git_object: 95a9160cfcf6628f8df76b6a42b7052d515b9733 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -11252,8 +11272,8 @@ trackedFiles: pristine_git_object: ffdb3753adda06f3d93b505ab17657337c66067c src/openrouter/components/createprivateendpointrequest.py: id: b97ebc39b8da - last_write_checksum: sha1:53407c09059886537423c3262b8056f9dd96610d - pristine_git_object: bf06bf702c0653e1d96b54c79e37591fa7ae2fd0 + last_write_checksum: sha1:6a0723f03ce26c12953aeba515fd3468df94277b + pristine_git_object: 5cbb248c75129bd8e545cce149a4ca123a335f5e src/openrouter/components/createprivateendpointvalidationfailedresponse_error.py: id: 9960b9ef29f1 last_write_checksum: sha1:337c9b2191e51407481b588d7f47beeba37bc1f1 @@ -11928,8 +11948,8 @@ trackedFiles: pristine_git_object: c961db613cc3d95cf072b8ec6eb295fb60adcd5e src/openrouter/components/managedprivateendpoint.py: id: 8f51e80352b5 - last_write_checksum: sha1:9be5275e051d78819fcb1e327a25cef194a051d8 - pristine_git_object: 28894d4bdc918f7f49ce1a389aa6b65a8047760c + last_write_checksum: sha1:b0ce608a49b165fe30567bcf4b57d8c04b9b2ff8 + pristine_git_object: 7354dde037adb2f9618cabb08fe024373c76fa8c src/openrouter/components/managedprivateendpointresponse.py: id: 94976ac1b391 last_write_checksum: sha1:25ae24e3bf45795169d86dbe9dd02f77cdd43ac8 @@ -12584,8 +12604,8 @@ trackedFiles: pristine_git_object: e86eb424bc592492f2903c8b3e30ec23de814991 src/openrouter/components/privateendpoint.py: id: 29da7e1d796a - last_write_checksum: sha1:091561e469aa3c68e28453f9cac27b4c5f243a76 - pristine_git_object: 1b85906b47046fbd404651979e52f8eb302a8397 + last_write_checksum: sha1:d4c09da6190c340f72a9b8430ab14ac53cab9e5e + pristine_git_object: 6fb58a0fc661cea4fce3ee2ce604a18eebf77e2f src/openrouter/components/privateendpointactivation.py: id: e0dabb5cbaaf last_write_checksum: sha1:930c5499cc0920bace93a88c89f0671da13535a1 @@ -12598,10 +12618,18 @@ trackedFiles: id: 52f81232e913 last_write_checksum: sha1:494026537044fbe1da8740fff300e8ea8b260a5d pristine_git_object: 6ffcf06c517bb10538ee5b759b913a7fee8d1398 + src/openrouter/components/privateendpointdeclaredparameter.py: + id: 968808bc8e46 + last_write_checksum: sha1:5a777d609c01df7fa2ec271bbee97f0e9aab41f3 + pristine_git_object: c0a1a100086c2752ed6d0bd7f484be744f423d52 src/openrouter/components/privateendpointdeclaredregion.py: id: 265271c1f0ed last_write_checksum: sha1:7b7a787dfecf4f3f62b70811498a563f5df35491 pristine_git_object: 6a8d44a0b8ed4313318a9ebc0220de6b098cd01a + src/openrouter/components/privateendpointparametercheck.py: + id: e547f98a2a47 + last_write_checksum: sha1:624acb29167b3c79d2e836471aeb5f7193ad8363 + pristine_git_object: 3c0c8bdd5b2b6b0cbf7e03233d9deef9fe6fe9b0 src/openrouter/components/privateendpointpricing.py: id: 2d8979e18f5b last_write_checksum: sha1:9573cef75311eee6c467e4a051308dbfd9a22ec4 @@ -12620,12 +12648,12 @@ trackedFiles: pristine_git_object: 3a62143a45b152e7a32c4b652419fb56ec91e6dd src/openrouter/components/privateendpointvalidation.py: id: c9afb5f7d655 - last_write_checksum: sha1:7d4cb05d352ea7ff2d959c55290ecd74345bd557 - pristine_git_object: e77d1d3ce77c534664e6b6b0074751bb4ccc170a + last_write_checksum: sha1:c92dea97aac382d1324915f6083d61c026063f65 + pristine_git_object: cf2a27ce4fef522aa87f2f607bef9d8db2309bd3 src/openrouter/components/privateendpointvalidationnullable.py: id: e0077858df0c - last_write_checksum: sha1:532242dc119ab2afee0ba13b45f1403d15e68544 - pristine_git_object: dbbcc93d99599e815282dd3098b505acd1bdb55a + last_write_checksum: sha1:5da23f410d5b5730ac47dbbfd3bb8b8c7a1a5931 + pristine_git_object: b03498af2ea0ce2588c6983cf238cfd03ae99efd src/openrouter/components/privateendpointvalidationresponse.py: id: 371ee92c4493 last_write_checksum: sha1:4bd041ee69f5adf310f1f647ea6d31419b843df8 @@ -13262,6 +13290,10 @@ trackedFiles: id: 2d255d9e4ac4 last_write_checksum: sha1:896ed9e6dd5c9b9df3884fe241a8f36d2e266f1b pristine_git_object: ee583b9b6f862c2ade099938c4c62d61ea9cbfa2 + src/openrouter/components/updateprivateendpointparametersrequest.py: + id: 5ef821e2e35c + last_write_checksum: sha1:af9d883d7a2df9c6e0ce936aa96bdf0267607a82 + pristine_git_object: 82f068b828e5597f2f8f5e3fbee5b55c32884d26 src/openrouter/components/updateprivateendpointpricingrequest.py: id: dc1e04b12316 last_write_checksum: sha1:9b850873548f0fd6ccba35cc46abe9ecf1618091 @@ -13640,8 +13672,8 @@ trackedFiles: pristine_git_object: 4a35ede011d09dddab042e2c00413ce4f6be655e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:43ffeba90ee98353a23fcec744d42e61e4e30173 - pristine_git_object: 6ddf9ad70fae1a604773fc55b42ad6a770e71dd5 + last_write_checksum: sha1:ffec0200ac8c0d182d9d0e3c4637b1ad8794b6f4 + pristine_git_object: 77272197136efc8570ea7084d9cc0460c8ec8d2c src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -13744,8 +13776,8 @@ trackedFiles: pristine_git_object: becc8c5f5af5402ce510eda9784ba2ff675d6a94 src/openrouter/operations/createprivateendpoint.py: id: 4c2fd54c9685 - last_write_checksum: sha1:a38c6ca4c053147511279a12f492c8f8d6d8410e - pristine_git_object: 999c151fe23bb69aa5b3553cb22aeaaf4163adaa + last_write_checksum: sha1:67f35439996a6db0ac7c40f65d331d9a5573a3f8 + pristine_git_object: cd6cc2ee4a12a1419bfd134c7bc8b353e040630f src/openrouter/operations/creatererank.py: id: 99b5d368a168 last_write_checksum: sha1:2a28c11eea1e64fdf5b5795912915d605d8df579 @@ -14170,6 +14202,10 @@ trackedFiles: id: c907f6c383b3 last_write_checksum: sha1:cf6b47a32acb5fda4c5fc29bf9f8b170fa838a76 pristine_git_object: f916dfcbe0f5a459756adbdeda9320c5bab6c0e5 + src/openrouter/operations/updateprivateendpointparameters.py: + id: 3e8cc18ac39c + last_write_checksum: sha1:2cb70245dec21fa448905d5a986cd11d35061971 + pristine_git_object: c2fbf756c061c354b1b3dfcd8d9bd8817df029a8 src/openrouter/operations/updateprivateendpointpricing.py: id: 8c04cca6c180 last_write_checksum: sha1:748d5e531ee17d61982327f319a882bb5492ad4b @@ -14204,8 +14240,8 @@ trackedFiles: pristine_git_object: 26ecf767f8e1f98145acfa7d0fa14ffcf13955d6 src/openrouter/private_endpoints.py: id: fdbce8846ed0 - last_write_checksum: sha1:6b011534aab484c622e489b9abfb1545b1a77416 - pristine_git_object: d0c3002830ff39926729be91f7dd122d394f58ff + last_write_checksum: sha1:02f930fd4055a5383aa5cd58501d6894ed9597b2 + pristine_git_object: 9f233355fdeae279bcbf361ddd08e3eac9903c43 src/openrouter/providers.py: id: debc4c48f149 last_write_checksum: sha1:11dbc607825edee8dcc84b39ee8171e097c47acf @@ -17939,7 +17975,7 @@ examples: 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"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "403": @@ -17959,7 +17995,7 @@ examples: 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"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -18065,7 +18101,7 @@ examples: 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"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -18700,15 +18736,33 @@ examples: application/json: {"error": {"code": 404, "message": "Intern not found"}} "500": application/json: {"error": {"code": 404, "message": "Intern not found"}} + updatePrivateEndpointParameters: + speakeasy-default-update-private-endpoint-parameters: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + requestBody: + application/json: {"declared_parameters": ["temperature", "seed"]} + responses: + "200": + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} + "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.endpoints.list_zdr_endpoints()`: `error.status[503]` **Added** - * `open_router.endpoints.list()`: `error.status[503]` **Added** - * `open_router.generations.submit_feedback()`: `error` **Changed** - * `open_router.models.list()`: `error.status[503]` **Added** - * `open_router.models.list_for_user()`: `error.status[503]` **Added** - * `open_router.presets.list()`: `error.status[503]` **Added** - * `open_router.presets.get()`: `error.status[503]` **Added** - * `open_router.presets.list_versions()`: `error.status[503]` **Added** - * `open_router.presets.get_version()`: `error.status[503]` **Added** +releaseNotes: "## Python SDK Changes:\n* `open_router.private_endpoints.update_parameters()`: **Added**\n* `open_router.private_endpoints.create()`: \n * `request` **Changed**\n * `response.data.max_completion_tokens` **Added**\n * `error.union(CreatePrivateEndpointValidationFailedResponse).data` **Changed**\n* `open_router.private_endpoints.get()`: `response.data` **Changed**\n* `open_router.private_endpoints.update()`: `response.data` **Changed**\n* `open_router.private_endpoints.activate()`: `response.data.max_completion_tokens` **Added**\n* `open_router.private_endpoints.disable()`: `response.data.max_completion_tokens` **Added**\n* `open_router.private_endpoints.enable()`: `response.data.max_completion_tokens` **Added**\n* `open_router.private_endpoints.update_pricing()`: `response.data` **Changed**\n* `open_router.private_endpoints.validate()`: `response.data.parameters` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index bdd08d7d..a6748669 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.84 + version: 1.3.85 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 98f76cae..3fdaf440 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -10391,6 +10391,15 @@ components: example: 'https://contoso.openai.azure.com' minLength: 1 type: 'string' + declared_parameters: + description: 'Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.' + example: + - 'temperature' + - 'seed' + items: + $ref: '#/components/schemas/PrivateEndpointDeclaredParameter' + maxItems: 25 + type: 'array' declared_region: description: 'Attest where this deployment processes data.' enum: @@ -10408,6 +10417,12 @@ components: type: - 'boolean' - 'null' + max_completion_tokens: + description: 'Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.' + example: 131072 + maximum: 2147483647 + minimum: 1 + type: 'integer' model_permaslug: description: 'Permanent slug of the model this endpoint serves.' example: 'openai/gpt-4o-2024-08-06' @@ -16176,6 +16191,12 @@ components: type: - 'boolean' - 'null' + max_completion_tokens: + description: 'Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.' + example: 131072 + type: + - 'integer' + - 'null' required: - 'declared_zdr' - 'declared_region' @@ -25584,9 +25605,13 @@ components: PrivateEndpoint: example: base_url: 'https://contoso.openai.azure.com' + declared_parameters: + - 'temperature' + - 'seed' declared_region: 'us' declared_zdr: true id: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + max_completion_tokens: 131072 model_name: 'OpenAI: GPT-4o' model_permaslug: 'openai/gpt-4o-2024-08-06' model_slug: 'openai/gpt-4o' @@ -25598,6 +25623,10 @@ components: provider_name: 'Azure' provider_slug: 'azure' status: 'active' + tested_parameters: + - 'tools' + - 'tool_choice' + - 'response_format' upstream_model_id: 'gpt-4o-prod' properties: base_url: @@ -25606,6 +25635,14 @@ components: type: - 'string' - 'null' + declared_parameters: + description: 'Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared.' + example: + - 'temperature' + - 'seed' + items: + type: 'string' + type: 'array' declared_region: $ref: '#/components/schemas/PrivateEndpointDeclaredRegion' declared_zdr: @@ -25619,6 +25656,12 @@ components: example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' format: 'uuid' type: 'string' + max_completion_tokens: + description: 'Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.' + example: 131072 + type: + - 'integer' + - 'null' model_name: description: 'Display name of the model, or `null` when the model is no longer listed.' example: 'OpenAI: GPT-4o' @@ -25649,6 +25692,15 @@ components: - 'null' status: $ref: '#/components/schemas/PrivateEndpointStatus' + tested_parameters: + description: 'Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes.' + example: + - 'tools' + - 'tool_choice' + - 'response_format' + items: + type: 'string' + type: 'array' upstream_model_id: description: 'Model or deployment identifier sent to the upstream provider.' example: 'gpt-4o-prod' @@ -25666,6 +25718,8 @@ components: - 'declared_zdr' - 'declared_region' - 'pricing' + - 'tested_parameters' + - 'declared_parameters' 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.' @@ -25734,6 +25788,37 @@ components: example: 'no_byok_key' type: 'string' x-speakeasy-unknown-values: allow + PrivateEndpointDeclaredParameter: + description: 'A chat request parameter the endpoint accepts.' + enum: + - 'temperature' + - 'top_p' + - 'top_k' + - 'min_p' + - 'top_a' + - 'frequency_penalty' + - 'presence_penalty' + - 'repetition_penalty' + - 'max_tokens' + - 'max_completion_tokens' + - 'logit_bias' + - 'logprobs' + - 'top_logprobs' + - 'prediction' + - 'seed' + - 'response_format' + - 'structured_outputs' + - 'stop' + - 'tools' + - 'tool_choice' + - 'parallel_tool_calls' + - 'reasoning' + - 'reasoning_effort' + - 'web_search_options' + - 'verbosity' + example: 'seed' + type: 'string' + x-speakeasy-unknown-values: allow PrivateEndpointDeclaredRegion: description: 'Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.' enum: @@ -25746,6 +25831,20 @@ components: - 'string' - 'null' x-speakeasy-unknown-values: allow + PrivateEndpointParameterCheck: + example: + parameter: 'response_format' + supported: true + properties: + parameter: + example: 'response_format' + type: 'string' + supported: + type: 'boolean' + required: + - 'parameter' + - 'supported' + type: 'object' PrivateEndpointPricing: description: 'Negotiated per-token rates reported for requests routed to this endpoint.' example: @@ -25842,6 +25941,11 @@ components: items: $ref: '#/components/schemas/PrivateEndpointCheck' type: 'array' + parameters: + description: 'Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.' + items: + $ref: '#/components/schemas/PrivateEndpointParameterCheck' + type: 'array' passed: description: 'Whether every check passed.' example: true @@ -25856,6 +25960,11 @@ components: items: $ref: '#/components/schemas/PrivateEndpointCheck' type: 'array' + parameters: + description: 'Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.' + items: + $ref: '#/components/schemas/PrivateEndpointParameterCheck' + type: 'array' passed: description: 'Whether every check passed.' example: true @@ -32203,6 +32312,20 @@ components: required: - 'is_filtered_model_catalog_enabled' type: 'object' + UpdatePrivateEndpointParametersRequest: + properties: + declared_parameters: + description: 'Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.' + example: + - 'temperature' + - 'seed' + items: + $ref: '#/components/schemas/PrivateEndpointDeclaredParameter' + maxItems: 25 + type: 'array' + required: + - 'declared_parameters' + type: 'object' UpdatePrivateEndpointPricingRequest: properties: pricing: @@ -46658,12 +46781,12 @@ paths: 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.' + - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' in: 'header' name: 'idempotency-key' required: false schema: - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison.' + description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' example: 'wayfair-gpt-4o-eastus-2026-09' maxLength: 255 minLength: 1 @@ -47450,6 +47573,131 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /private-endpoints/{id}/parameters: + put: + description: 'Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updatePrivateEndpointParameters' + parameters: + - description: 'Stable identifier of the private endpoint.' + in: 'path' + name: 'id' + required: true + schema: + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePrivateEndpointParametersRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PrivateEndpointResponse' + description: 'The endpoint with its new declared parameters' + '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 supported parameters' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'updateParameters' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /private-endpoints/{id}/pricing: put: description: 'Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy''s default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required.' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 44547f75..b8bf8d6c 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:abb60a7768f107bd2d66cbcd903e100c5c7a512dec64f8eaa1436fd05f3dabf9 - sourceBlobDigest: sha256:0d90a449d2f9cf4a76fd674977bcb0cfdc4844683439c5dbcf2fc5591abf43f2 + sourceRevisionDigest: sha256:e9b2ba761a2af21c4e12a7d5cb8541cc1f37fc6e5996638e884afe37c98f6834 + sourceBlobDigest: sha256:a14495314a3eb09c85284d3543e3aca445d9ff0005dccbcb6a8466e491642ad0 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:abb60a7768f107bd2d66cbcd903e100c5c7a512dec64f8eaa1436fd05f3dabf9 - sourceBlobDigest: sha256:0d90a449d2f9cf4a76fd674977bcb0cfdc4844683439c5dbcf2fc5591abf43f2 + sourceRevisionDigest: sha256:e9b2ba761a2af21c4e12a7d5cb8541cc1f37fc6e5996638e884afe37c98f6834 + sourceBlobDigest: sha256:a14495314a3eb09c85284d3543e3aca445d9ff0005dccbcb6a8466e491642ad0 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:9777facf5329b32d41113790ca0a3ac81c8e19e1a9450d84bd56cd38f2e35b63 + codeSamplesRevisionDigest: sha256:7b5a08db4a0076a8089bb9f56618983c2a381989d549769afd059c5c20b874b6 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 125a9444..ec601f8b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3609,4 +3609,14 @@ Based on: ### Generated - [python v1.3.84] . ### Releases -- [PyPI v1.3.84] https://pypi.org/project/openrouter/1.3.84 - . \ No newline at end of file +- [PyPI v1.3.84] https://pypi.org/project/openrouter/1.3.84 - . + +## 2026-10-27 14:03:58 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.85] . +### Releases +- [PyPI v1.3.85] https://pypi.org/project/openrouter/1.3.85 - . \ No newline at end of file diff --git a/docs/components/createprivateendpointrequest.mdx b/docs/components/createprivateendpointrequest.mdx index 1a71ebbb..52cd703a 100644 --- a/docs/components/createprivateendpointrequest.mdx +++ b/docs/components/createprivateendpointrequest.mdx @@ -4,13 +4,15 @@ title: "CreatePrivateEndpointRequest" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `activate` | [Optional[components.PrivateEndpointActivation]](../components/privateendpointactivation.mdx) | ➖ | 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]* | ➖ | 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) | ➖ | Attest where this deployment processes data. | us | -| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | -| `model_permaslug` | *str* | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | -| `pricing` | [Optional[components.PrivateEndpointPricing]](../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `provider_slug` | *str* | ✅ | Slug of the upstream provider. | azure | -| `upstream_model_id` | *str* | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `activate` | [Optional[components.PrivateEndpointActivation]](../components/privateendpointactivation.mdx) | ➖ | 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]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../components/privateendpointdeclaredparameter.mdx)] | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | +| `declared_region` | [OptionalNullable[components.CreatePrivateEndpointRequestDeclaredRegion]](../components/createprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | +| `max_completion_tokens` | *Optional[int]* | ➖ | Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. | 131072 | +| `model_permaslug` | *str* | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `pricing` | [Optional[components.PrivateEndpointPricing]](../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `provider_slug` | *str* | ✅ | Slug of the upstream provider. | azure | +| `upstream_model_id` | *str* | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/managedprivateendpoint.mdx b/docs/components/managedprivateendpoint.mdx index 384f5ea9..b11082cf 100644 --- a/docs/components/managedprivateendpoint.mdx +++ b/docs/components/managedprivateendpoint.mdx @@ -14,4 +14,5 @@ title: "ManagedPrivateEndpoint" | `provider_name` | *str* | ✅ | Display name of the upstream provider. | Azure | | `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | ✅ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | | `declared_region` | [Nullable[components.PrivateEndpointDeclaredRegion]](../components/privateendpointdeclaredregion.mdx) | ✅ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | -| `declared_zdr` | *Nullable[bool]* | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | \ No newline at end of file +| `declared_zdr` | *Nullable[bool]* | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | +| `max_completion_tokens` | *OptionalNullable[int]* | ➖ | Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. | 131072 | \ No newline at end of file diff --git a/docs/components/privateendpoint.mdx b/docs/components/privateendpoint.mdx index 2e9974f4..d0b63423 100644 --- a/docs/components/privateendpoint.mdx +++ b/docs/components/privateendpoint.mdx @@ -4,17 +4,20 @@ title: "PrivateEndpoint" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `base_url` | *Nullable[str]* | ✅ | HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | -| `declared_region` | [Nullable[components.PrivateEndpointDeclaredRegion]](../components/privateendpointdeclaredregion.mdx) | ✅ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | -| `declared_zdr` | *Nullable[bool]* | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | -| `id` | *str* | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `model_name` | *Nullable[str]* | ✅ | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | -| `model_permaslug` | *str* | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | -| `model_slug` | *Nullable[str]* | ✅ | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | -| `pricing` | [components.PrivateEndpointPricing](../components/privateendpointpricing.mdx) | ✅ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `provider_name` | *str* | ✅ | Display name of the upstream provider. | Azure | -| `provider_slug` | *Nullable[str]* | ✅ | Slug of the upstream provider, or `null` when the provider is no longer listed. | azure | -| `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | ✅ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | -| `upstream_model_id` | *str* | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `base_url` | *Nullable[str]* | ✅ | HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `declared_parameters` | List[*str*] | ✅ | Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared. | [
"temperature",
"seed"
] | +| `declared_region` | [Nullable[components.PrivateEndpointDeclaredRegion]](../components/privateendpointdeclaredregion.mdx) | ✅ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | +| `declared_zdr` | *Nullable[bool]* | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | +| `id` | *str* | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `max_completion_tokens` | *OptionalNullable[int]* | ➖ | Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. | 131072 | +| `model_name` | *Nullable[str]* | ✅ | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | +| `model_permaslug` | *str* | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `model_slug` | *Nullable[str]* | ✅ | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | +| `pricing` | [components.PrivateEndpointPricing](../components/privateendpointpricing.mdx) | ✅ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `provider_name` | *str* | ✅ | Display name of the upstream provider. | Azure | +| `provider_slug` | *Nullable[str]* | ✅ | Slug of the upstream provider, or `null` when the provider is no longer listed. | azure | +| `status` | [components.PrivateEndpointStatus](../components/privateendpointstatus.mdx) | ✅ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | +| `tested_parameters` | List[*str*] | ✅ | Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes. | [
"tools",
"tool_choice",
"response_format"
] | +| `upstream_model_id` | *str* | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/components/privateendpointdeclaredparameter.mdx b/docs/components/privateendpointdeclaredparameter.mdx new file mode 100644 index 00000000..19e8f1c3 --- /dev/null +++ b/docs/components/privateendpointdeclaredparameter.mdx @@ -0,0 +1,45 @@ +--- +title: "PrivateEndpointDeclaredParameter" +--- + +A chat request parameter the endpoint accepts. + +## Example Usage + +```python +from openrouter.components import PrivateEndpointDeclaredParameter + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrivateEndpointDeclaredParameter = "temperature" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"temperature"` +- `"top_p"` +- `"top_k"` +- `"min_p"` +- `"top_a"` +- `"frequency_penalty"` +- `"presence_penalty"` +- `"repetition_penalty"` +- `"max_tokens"` +- `"max_completion_tokens"` +- `"logit_bias"` +- `"logprobs"` +- `"top_logprobs"` +- `"prediction"` +- `"seed"` +- `"response_format"` +- `"structured_outputs"` +- `"stop"` +- `"tools"` +- `"tool_choice"` +- `"parallel_tool_calls"` +- `"reasoning"` +- `"reasoning_effort"` +- `"web_search_options"` +- `"verbosity"` diff --git a/docs/components/privateendpointparametercheck.mdx b/docs/components/privateendpointparametercheck.mdx new file mode 100644 index 00000000..ba1d76c6 --- /dev/null +++ b/docs/components/privateendpointparametercheck.mdx @@ -0,0 +1,10 @@ +--- +title: "PrivateEndpointParameterCheck" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `parameter` | *str* | ✅ | N/A | response_format | +| `supported` | *bool* | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/privateendpointresponse.mdx b/docs/components/privateendpointresponse.mdx index 0f64d6f3..6d20a0f0 100644 --- a/docs/components/privateendpointresponse.mdx +++ b/docs/components/privateendpointresponse.mdx @@ -4,6 +4,6 @@ title: "PrivateEndpointResponse" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [components.PrivateEndpoint](../components/privateendpoint.mdx) | ✅ | N/A | \{
"base_url": "https://contoso.openai.azure.com",
"declared_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": \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"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 +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.PrivateEndpoint](../components/privateendpoint.mdx) | ✅ | N/A | \{
"base_url": "https://contoso.openai.azure.com",
"declared_parameters": [
"temperature",
"seed"
],
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"max_completion_tokens": 131072,
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"status": "active",
"tested_parameters": [
"tools",
"tool_choice",
"response_format"
],
"upstream_model_id": "gpt-4o-prod"
} | \ No newline at end of file diff --git a/docs/components/privateendpointvalidation.mdx b/docs/components/privateendpointvalidation.mdx index e0037589..7504fa42 100644 --- a/docs/components/privateendpointvalidation.mdx +++ b/docs/components/privateendpointvalidation.mdx @@ -4,7 +4,8 @@ title: "PrivateEndpointValidation" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `checks` | List[[components.PrivateEndpointCheck](../components/privateendpointcheck.mdx)] | ✅ | N/A | | -| `passed` | *bool* | ✅ | Whether every check passed. | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `checks` | List[[components.PrivateEndpointCheck](../components/privateendpointcheck.mdx)] | ✅ | N/A | | +| `parameters` | List[[components.PrivateEndpointParameterCheck](../components/privateendpointparametercheck.mdx)] | ➖ | Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven. | | +| `passed` | *bool* | ✅ | Whether every check passed. | true | \ No newline at end of file diff --git a/docs/components/privateendpointvalidationnullable.mdx b/docs/components/privateendpointvalidationnullable.mdx index b677c603..61d17f5f 100644 --- a/docs/components/privateendpointvalidationnullable.mdx +++ b/docs/components/privateendpointvalidationnullable.mdx @@ -4,7 +4,8 @@ title: "PrivateEndpointValidationNullable" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `checks` | List[[components.PrivateEndpointCheck](../components/privateendpointcheck.mdx)] | ✅ | N/A | | -| `passed` | *bool* | ✅ | Whether every check passed. | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `checks` | List[[components.PrivateEndpointCheck](../components/privateendpointcheck.mdx)] | ✅ | N/A | | +| `parameters` | List[[components.PrivateEndpointParameterCheck](../components/privateendpointparametercheck.mdx)] | ➖ | Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven. | | +| `passed` | *bool* | ✅ | Whether every check passed. | true | \ No newline at end of file diff --git a/docs/components/updateprivateendpointparametersrequest.mdx b/docs/components/updateprivateendpointparametersrequest.mdx new file mode 100644 index 00000000..47da0e56 --- /dev/null +++ b/docs/components/updateprivateendpointparametersrequest.mdx @@ -0,0 +1,9 @@ +--- +title: "UpdatePrivateEndpointParametersRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../components/privateendpointdeclaredparameter.mdx)] | ✅ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | \ No newline at end of file diff --git a/docs/operations/createprivateendpointrequest.mdx b/docs/operations/createprivateendpointrequest.mdx index 8039e542..1af3deb4 100644 --- a/docs/operations/createprivateendpointrequest.mdx +++ b/docs/operations/createprivateendpointrequest.mdx @@ -4,10 +4,10 @@ title: "CreatePrivateEndpointRequest" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `idempotency_key` | *Optional[str]* | ➖ | 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) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `idempotency_key` | *Optional[str]* | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | +| `create_private_endpoint_request` | [components.CreatePrivateEndpointRequest](../components/createprivateendpointrequest.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/operations/updateprivateendpointparametersglobals.mdx b/docs/operations/updateprivateendpointparametersglobals.mdx new file mode 100644 index 00000000..57f4741d --- /dev/null +++ b/docs/operations/updateprivateendpointparametersglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "UpdatePrivateEndpointParametersGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateprivateendpointparametersrequest.mdx b/docs/operations/updateprivateendpointparametersrequest.mdx new file mode 100644 index 00000000..7650fb01 --- /dev/null +++ b/docs/operations/updateprivateendpointparametersrequest.mdx @@ -0,0 +1,13 @@ +--- +title: "UpdatePrivateEndpointParametersRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `update_private_endpoint_parameters_request` | [components.UpdatePrivateEndpointParametersRequest](../components/updateprivateendpointparametersrequest.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/sdks/privateendpoints/README.mdx b/docs/sdks/privateendpoints/README.mdx index abee0df3..b02372d4 100644 --- a/docs/sdks/privateendpoints/README.mdx +++ b/docs/sdks/privateendpoints/README.mdx @@ -17,6 +17,7 @@ Private Endpoints endpoints * [activate](#activate) - Activate a validated private endpoint * [disable](#disable) - Disable a private endpoint * [enable](#enable) - Enable a private endpoint +* [update_parameters](#update_parameters) - Set private endpoint supported parameters * [update_pricing](#update_pricing) - Set private endpoint pricing * [validate](#validate) - Validate a draft private endpoint @@ -95,21 +96,23 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model_permaslug` | *str* | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | -| `provider_slug` | *str* | ✅ | Slug of the upstream provider. | azure | -| `upstream_model_id` | *str* | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `idempotency_key` | *Optional[str]* | ➖ | 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) | ➖ | 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]* | ➖ | 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) | ➖ | Attest where this deployment processes data. | us | -| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | -| `pricing` | [Optional[components.PrivateEndpointPricing]](../../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `model_permaslug` | *str* | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `provider_slug` | *str* | ✅ | Slug of the upstream provider. | azure | +| `upstream_model_id` | *str* | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `idempotency_key` | *Optional[str]* | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | +| `activate` | [Optional[components.PrivateEndpointActivation]](../../components/privateendpointactivation.mdx) | ➖ | 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]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../../components/privateendpointdeclaredparameter.mdx)] | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | +| `declared_region` | [OptionalNullable[components.CreatePrivateEndpointRequestDeclaredRegion]](../../components/createprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | +| `max_completion_tokens` | *Optional[int]* | ➖ | Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. | 131072 | +| `pricing` | [Optional[components.PrivateEndpointPricing]](../../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -460,6 +463,64 @@ with OpenRouter( | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | +## update_parameters + +Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### 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_parameters(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", declared_parameters=[ + "temperature", + "seed", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../../components/privateendpointdeclaredparameter.mdx)] | ✅ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.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 | \*/\* | + ## 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. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy's default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required. diff --git a/pyproject.toml b/pyproject.toml index 02809d52..c309706f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.84" +version = "1.3.85" 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 86afd260..baf73dbe 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.84" +__version__: str = "1.3.85" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.84 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.85 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 66f727d9..95a9160c 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -3486,7 +3486,12 @@ PrivateEndpointCheckTypedDict, ) from .privateendpointcheckreason import PrivateEndpointCheckReason + from .privateendpointdeclaredparameter import PrivateEndpointDeclaredParameter from .privateendpointdeclaredregion import PrivateEndpointDeclaredRegion + from .privateendpointparametercheck import ( + PrivateEndpointParameterCheck, + PrivateEndpointParameterCheckTypedDict, + ) from .privateendpointpricing import ( PrivateEndpointPricing, PrivateEndpointPricingTypedDict, @@ -4190,6 +4195,10 @@ UpdateOrganizationSettingsRequest, UpdateOrganizationSettingsRequestTypedDict, ) + from .updateprivateendpointparametersrequest import ( + UpdatePrivateEndpointParametersRequest, + UpdatePrivateEndpointParametersRequestTypedDict, + ) from .updateprivateendpointpricingrequest import ( UpdatePrivateEndpointPricingRequest, UpdatePrivateEndpointPricingRequestTypedDict, @@ -6796,7 +6805,10 @@ "PrivateEndpointCheck", "PrivateEndpointCheckReason", "PrivateEndpointCheckTypedDict", + "PrivateEndpointDeclaredParameter", "PrivateEndpointDeclaredRegion", + "PrivateEndpointParameterCheck", + "PrivateEndpointParameterCheckTypedDict", "PrivateEndpointPricing", "PrivateEndpointPricingTypedDict", "PrivateEndpointResponse", @@ -7450,6 +7462,8 @@ "UpdateObservabilityDestinationResponseTypedDict", "UpdateOrganizationSettingsRequest", "UpdateOrganizationSettingsRequestTypedDict", + "UpdatePrivateEndpointParametersRequest", + "UpdatePrivateEndpointParametersRequestTypedDict", "UpdatePrivateEndpointPricingRequest", "UpdatePrivateEndpointPricingRequestTypedDict", "UpdatePrivateEndpointRequest", @@ -10165,7 +10179,10 @@ "PrivateEndpointCheck": ".privateendpointcheck", "PrivateEndpointCheckTypedDict": ".privateendpointcheck", "PrivateEndpointCheckReason": ".privateendpointcheckreason", + "PrivateEndpointDeclaredParameter": ".privateendpointdeclaredparameter", "PrivateEndpointDeclaredRegion": ".privateendpointdeclaredregion", + "PrivateEndpointParameterCheck": ".privateendpointparametercheck", + "PrivateEndpointParameterCheckTypedDict": ".privateendpointparametercheck", "PrivateEndpointPricing": ".privateendpointpricing", "PrivateEndpointPricingTypedDict": ".privateendpointpricing", "PrivateEndpointResponse": ".privateendpointresponse", @@ -10670,6 +10687,8 @@ "UpdateObservabilityDestinationResponseTypedDict": ".updateobservabilitydestinationresponse", "UpdateOrganizationSettingsRequest": ".updateorganizationsettingsrequest", "UpdateOrganizationSettingsRequestTypedDict": ".updateorganizationsettingsrequest", + "UpdatePrivateEndpointParametersRequest": ".updateprivateendpointparametersrequest", + "UpdatePrivateEndpointParametersRequestTypedDict": ".updateprivateendpointparametersrequest", "UpdatePrivateEndpointPricingRequest": ".updateprivateendpointpricingrequest", "UpdatePrivateEndpointPricingRequestTypedDict": ".updateprivateendpointpricingrequest", "UpdatePrivateEndpointRequest": ".updateprivateendpointrequest", diff --git a/src/openrouter/components/createprivateendpointrequest.py b/src/openrouter/components/createprivateendpointrequest.py index bf06bf70..5cbb248c 100644 --- a/src/openrouter/components/createprivateendpointrequest.py +++ b/src/openrouter/components/createprivateendpointrequest.py @@ -5,6 +5,7 @@ PrivateEndpointActivation, PrivateEndpointActivationTypedDict, ) +from .privateendpointdeclaredparameter import PrivateEndpointDeclaredParameter from .privateendpointpricing import ( PrivateEndpointPricing, PrivateEndpointPricingTypedDict, @@ -18,7 +19,7 @@ UnrecognizedStr, ) from pydantic import model_serializer -from typing import Literal, Optional, Union +from typing import List, Literal, Optional, Union from typing_extensions import NotRequired, TypedDict @@ -44,10 +45,14 @@ class CreatePrivateEndpointRequestTypedDict(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.""" base_url: NotRequired[str] r"""HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).""" + declared_parameters: NotRequired[List[PrivateEndpointDeclaredParameter]] + r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" declared_region: NotRequired[Nullable[CreatePrivateEndpointRequestDeclaredRegion]] r"""Attest where this deployment processes data.""" declared_zdr: NotRequired[Nullable[bool]] r"""Attest that this deployment retains no prompt or completion data.""" + max_completion_tokens: NotRequired[int] + r"""Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.""" pricing: NotRequired[PrivateEndpointPricingTypedDict] r"""Negotiated per-token rates reported for requests routed to this endpoint.""" @@ -68,6 +73,9 @@ class CreatePrivateEndpointRequest(BaseModel): base_url: Optional[str] = None r"""HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).""" + declared_parameters: Optional[List[PrivateEndpointDeclaredParameter]] = None + r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" + declared_region: OptionalNullable[CreatePrivateEndpointRequestDeclaredRegion] = ( UNSET ) @@ -76,13 +84,24 @@ class CreatePrivateEndpointRequest(BaseModel): declared_zdr: OptionalNullable[bool] = UNSET r"""Attest that this deployment retains no prompt or completion data.""" + max_completion_tokens: Optional[int] = None + r"""Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.""" + pricing: 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"] + [ + "activate", + "base_url", + "declared_parameters", + "declared_region", + "declared_zdr", + "max_completion_tokens", + "pricing", + ] ) nullable_fields = set(["declared_region", "declared_zdr"]) serialized = handler(self) diff --git a/src/openrouter/components/managedprivateendpoint.py b/src/openrouter/components/managedprivateendpoint.py index 28894d4b..7354dde0 100644 --- a/src/openrouter/components/managedprivateendpoint.py +++ b/src/openrouter/components/managedprivateendpoint.py @@ -3,9 +3,15 @@ from __future__ import annotations from .privateendpointdeclaredregion import PrivateEndpointDeclaredRegion from .privateendpointstatus import PrivateEndpointStatus -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from pydantic import model_serializer -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict class ManagedPrivateEndpointTypedDict(TypedDict): @@ -27,6 +33,8 @@ class ManagedPrivateEndpointTypedDict(TypedDict): 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.""" + max_completion_tokens: NotRequired[Nullable[int]] + r"""Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.""" class ManagedPrivateEndpoint(BaseModel): @@ -57,16 +65,38 @@ class ManagedPrivateEndpoint(BaseModel): declared_zdr: Nullable[bool] r"""Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.""" + max_completion_tokens: OptionalNullable[int] = UNSET + r"""Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): + optional_fields = set(["max_completion_tokens"]) + nullable_fields = set( + [ + "model_name", + "model_slug", + "declared_region", + "declared_zdr", + "max_completion_tokens", + ] + ) serialized = handler(self) m = {} for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) if val != UNSET_SENTINEL: - m[k] = val + 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/privateendpoint.py b/src/openrouter/components/privateendpoint.py index 1b85906b..6fb58a0f 100644 --- a/src/openrouter/components/privateendpoint.py +++ b/src/openrouter/components/privateendpoint.py @@ -7,14 +7,23 @@ PrivateEndpointPricingTypedDict, ) from .privateendpointstatus import PrivateEndpointStatus -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from pydantic import model_serializer -from typing_extensions import TypedDict +from typing import List +from typing_extensions import NotRequired, 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_parameters: List[str] + r"""Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared.""" declared_region: Nullable[PrivateEndpointDeclaredRegion] r"""Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.""" declared_zdr: Nullable[bool] @@ -35,14 +44,21 @@ class PrivateEndpointTypedDict(TypedDict): 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.""" + tested_parameters: List[str] + r"""Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes.""" upstream_model_id: str r"""Model or deployment identifier sent to the upstream provider.""" + max_completion_tokens: NotRequired[Nullable[int]] + r"""Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.""" 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_parameters: List[str] + r"""Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared.""" + declared_region: Nullable[PrivateEndpointDeclaredRegion] r"""Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.""" @@ -73,19 +89,46 @@ class PrivateEndpoint(BaseModel): status: PrivateEndpointStatus r"""Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.""" + tested_parameters: List[str] + r"""Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes.""" + upstream_model_id: str r"""Model or deployment identifier sent to the upstream provider.""" + max_completion_tokens: OptionalNullable[int] = UNSET + r"""Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): + optional_fields = set(["max_completion_tokens"]) + nullable_fields = set( + [ + "base_url", + "declared_region", + "declared_zdr", + "max_completion_tokens", + "model_name", + "model_slug", + "provider_slug", + ] + ) serialized = handler(self) m = {} for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) if val != UNSET_SENTINEL: - m[k] = val + 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/privateendpointdeclaredparameter.py b/src/openrouter/components/privateendpointdeclaredparameter.py new file mode 100644 index 00000000..c0a1a100 --- /dev/null +++ b/src/openrouter/components/privateendpointdeclaredparameter.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +PrivateEndpointDeclaredParameter = Union[ + Literal[ + "temperature", + "top_p", + "top_k", + "min_p", + "top_a", + "frequency_penalty", + "presence_penalty", + "repetition_penalty", + "max_tokens", + "max_completion_tokens", + "logit_bias", + "logprobs", + "top_logprobs", + "prediction", + "seed", + "response_format", + "structured_outputs", + "stop", + "tools", + "tool_choice", + "parallel_tool_calls", + "reasoning", + "reasoning_effort", + "web_search_options", + "verbosity", + ], + UnrecognizedStr, +] +r"""A chat request parameter the endpoint accepts.""" diff --git a/src/openrouter/components/privateendpointparametercheck.py b/src/openrouter/components/privateendpointparametercheck.py new file mode 100644 index 00000000..3c0c8bdd --- /dev/null +++ b/src/openrouter/components/privateendpointparametercheck.py @@ -0,0 +1,16 @@ +"""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 PrivateEndpointParameterCheckTypedDict(TypedDict): + parameter: str + supported: bool + + +class PrivateEndpointParameterCheck(BaseModel): + parameter: str + + supported: bool diff --git a/src/openrouter/components/privateendpointvalidation.py b/src/openrouter/components/privateendpointvalidation.py index e77d1d3c..cf2a27ce 100644 --- a/src/openrouter/components/privateendpointvalidation.py +++ b/src/openrouter/components/privateendpointvalidation.py @@ -2,15 +2,22 @@ from __future__ import annotations from .privateendpointcheck import PrivateEndpointCheck, PrivateEndpointCheckTypedDict -from openrouter.types import BaseModel -from typing import List -from typing_extensions import TypedDict +from .privateendpointparametercheck import ( + PrivateEndpointParameterCheck, + PrivateEndpointParameterCheckTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict class PrivateEndpointValidationTypedDict(TypedDict): checks: List[PrivateEndpointCheckTypedDict] passed: bool r"""Whether every check passed.""" + parameters: NotRequired[List[PrivateEndpointParameterCheckTypedDict]] + r"""Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.""" class PrivateEndpointValidation(BaseModel): @@ -18,3 +25,22 @@ class PrivateEndpointValidation(BaseModel): passed: bool r"""Whether every check passed.""" + + parameters: Optional[List[PrivateEndpointParameterCheck]] = None + r"""Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parameters"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/privateendpointvalidationnullable.py b/src/openrouter/components/privateendpointvalidationnullable.py index dbbcc93d..b03498af 100644 --- a/src/openrouter/components/privateendpointvalidationnullable.py +++ b/src/openrouter/components/privateendpointvalidationnullable.py @@ -2,15 +2,22 @@ from __future__ import annotations from .privateendpointcheck import PrivateEndpointCheck, PrivateEndpointCheckTypedDict -from openrouter.types import BaseModel -from typing import List -from typing_extensions import TypedDict +from .privateendpointparametercheck import ( + PrivateEndpointParameterCheck, + PrivateEndpointParameterCheckTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict class PrivateEndpointValidationNullableTypedDict(TypedDict): checks: List[PrivateEndpointCheckTypedDict] passed: bool r"""Whether every check passed.""" + parameters: NotRequired[List[PrivateEndpointParameterCheckTypedDict]] + r"""Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.""" class PrivateEndpointValidationNullable(BaseModel): @@ -18,3 +25,22 @@ class PrivateEndpointValidationNullable(BaseModel): passed: bool r"""Whether every check passed.""" + + parameters: Optional[List[PrivateEndpointParameterCheck]] = None + r"""Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parameters"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/updateprivateendpointparametersrequest.py b/src/openrouter/components/updateprivateendpointparametersrequest.py new file mode 100644 index 00000000..82f068b8 --- /dev/null +++ b/src/openrouter/components/updateprivateendpointparametersrequest.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .privateendpointdeclaredparameter import PrivateEndpointDeclaredParameter +from openrouter.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class UpdatePrivateEndpointParametersRequestTypedDict(TypedDict): + declared_parameters: List[PrivateEndpointDeclaredParameter] + r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" + + +class UpdatePrivateEndpointParametersRequest(BaseModel): + declared_parameters: List[PrivateEndpointDeclaredParameter] + r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 6ddf9ad7..77272197 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -1060,6 +1060,12 @@ UpdatePrivateEndpointRequest, UpdatePrivateEndpointRequestTypedDict, ) + from .updateprivateendpointparameters import ( + UpdatePrivateEndpointParametersGlobals, + UpdatePrivateEndpointParametersGlobalsTypedDict, + UpdatePrivateEndpointParametersRequest, + UpdatePrivateEndpointParametersRequestTypedDict, + ) from .updateprivateendpointpricing import ( UpdatePrivateEndpointPricingGlobals, UpdatePrivateEndpointPricingGlobalsTypedDict, @@ -1881,6 +1887,10 @@ "UpdateOrganizationSettingsResponseTypedDict", "UpdatePrivateEndpointGlobals", "UpdatePrivateEndpointGlobalsTypedDict", + "UpdatePrivateEndpointParametersGlobals", + "UpdatePrivateEndpointParametersGlobalsTypedDict", + "UpdatePrivateEndpointParametersRequest", + "UpdatePrivateEndpointParametersRequestTypedDict", "UpdatePrivateEndpointPricingGlobals", "UpdatePrivateEndpointPricingGlobalsTypedDict", "UpdatePrivateEndpointPricingRequest", @@ -2715,6 +2725,10 @@ "UpdatePrivateEndpointGlobalsTypedDict": ".updateprivateendpoint", "UpdatePrivateEndpointRequest": ".updateprivateendpoint", "UpdatePrivateEndpointRequestTypedDict": ".updateprivateendpoint", + "UpdatePrivateEndpointParametersGlobals": ".updateprivateendpointparameters", + "UpdatePrivateEndpointParametersGlobalsTypedDict": ".updateprivateendpointparameters", + "UpdatePrivateEndpointParametersRequest": ".updateprivateendpointparameters", + "UpdatePrivateEndpointParametersRequestTypedDict": ".updateprivateendpointparameters", "UpdatePrivateEndpointPricingGlobals": ".updateprivateendpointpricing", "UpdatePrivateEndpointPricingGlobalsTypedDict": ".updateprivateendpointpricing", "UpdatePrivateEndpointPricingRequest": ".updateprivateendpointpricing", diff --git a/src/openrouter/operations/createprivateendpoint.py b/src/openrouter/operations/createprivateendpoint.py index 999c151f..cd6cc2ee 100644 --- a/src/openrouter/operations/createprivateendpoint.py +++ b/src/openrouter/operations/createprivateendpoint.py @@ -94,7 +94,7 @@ class CreatePrivateEndpointRequestTypedDict(TypedDict): """ 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.""" + 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, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.""" class CreatePrivateEndpointRequest(BaseModel): @@ -136,7 +136,7 @@ class CreatePrivateEndpointRequest(BaseModel): 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.""" + 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, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/operations/updateprivateendpointparameters.py b/src/openrouter/operations/updateprivateendpointparameters.py new file mode 100644 index 00000000..c2fbf756 --- /dev/null +++ b/src/openrouter/operations/updateprivateendpointparameters.py @@ -0,0 +1,158 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + updateprivateendpointparametersrequest as components_updateprivateendpointparametersrequest, +) +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 UpdatePrivateEndpointParametersGlobalsTypedDict(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 UpdatePrivateEndpointParametersGlobals(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 UpdatePrivateEndpointParametersRequestTypedDict(TypedDict): + id: str + r"""Stable identifier of the private endpoint.""" + update_private_endpoint_parameters_request: components_updateprivateendpointparametersrequest.UpdatePrivateEndpointParametersRequestTypedDict + 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 UpdatePrivateEndpointParametersRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Stable identifier of the private endpoint.""" + + update_private_endpoint_parameters_request: Annotated[ + components_updateprivateendpointparametersrequest.UpdatePrivateEndpointParametersRequest, + 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 index d0c30028..9f233355 100644 --- a/src/openrouter/private_endpoints.py +++ b/src/openrouter/private_endpoints.py @@ -6,7 +6,7 @@ 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 +from typing import Any, Iterable, List, Mapping, Optional, Union class PrivateEndpoints(BaseSDK): @@ -293,10 +293,14 @@ def create( ] ] = None, base_url: Optional[str] = None, + declared_parameters: Optional[ + Iterable[components.PrivateEndpointDeclaredParameter] + ] = None, declared_region: OptionalNullable[ components.CreatePrivateEndpointRequestDeclaredRegion ] = UNSET, declared_zdr: OptionalNullable[bool] = UNSET, + max_completion_tokens: Optional[int] = None, pricing: Optional[ Union[ components.PrivateEndpointPricing, @@ -322,11 +326,13 @@ def create( :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 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, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. :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_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. :param declared_region: Attest where this deployment processes data. :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :param max_completion_tokens: Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -353,8 +359,13 @@ def create( activate, Optional[components.PrivateEndpointActivation] ), base_url=base_url, + declared_parameters=utils.unmarshal( + declared_parameters, + Optional[List[components.PrivateEndpointDeclaredParameter]], + ), declared_region=declared_region, declared_zdr=declared_zdr, + max_completion_tokens=max_completion_tokens, model_permaslug=model_permaslug, pricing=utils.get_pydantic_model( pricing, Optional[components.PrivateEndpointPricing] @@ -496,10 +507,14 @@ async def create_async( ] ] = None, base_url: Optional[str] = None, + declared_parameters: Optional[ + Iterable[components.PrivateEndpointDeclaredParameter] + ] = None, declared_region: OptionalNullable[ components.CreatePrivateEndpointRequestDeclaredRegion ] = UNSET, declared_zdr: OptionalNullable[bool] = UNSET, + max_completion_tokens: Optional[int] = None, pricing: Optional[ Union[ components.PrivateEndpointPricing, @@ -525,11 +540,13 @@ async def create_async( :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 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, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. :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_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. :param declared_region: Attest where this deployment processes data. :param declared_zdr: Attest that this deployment retains no prompt or completion data. + :param max_completion_tokens: Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -556,8 +573,13 @@ async def create_async( activate, Optional[components.PrivateEndpointActivation] ), base_url=base_url, + declared_parameters=utils.unmarshal( + declared_parameters, + Optional[List[components.PrivateEndpointDeclaredParameter]], + ), declared_region=declared_region, declared_zdr=declared_zdr, + max_completion_tokens=max_completion_tokens, model_permaslug=model_permaslug, pricing=utils.get_pydantic_model( pricing, Optional[components.PrivateEndpointPricing] @@ -2606,6 +2628,352 @@ async def enable_async( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + def update_parameters( + self, + *, + id: str, + declared_parameters: Iterable[components.PrivateEndpointDeclaredParameter], + 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 supported parameters + + Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. + :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.UpdatePrivateEndpointParametersRequest( + 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_parameters_request=components.UpdatePrivateEndpointParametersRequest( + declared_parameters=utils.unmarshal( + declared_parameters, + List[components.PrivateEndpointDeclaredParameter], + ), + ), + ) + + req = self._build_request( + method="PUT", + path="/private-endpoints/{id}/parameters", + 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.UpdatePrivateEndpointParametersGlobals( + 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_parameters_request, + False, + False, + "json", + components.UpdatePrivateEndpointParametersRequest, + ), + 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="updatePrivateEndpointParameters", + 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_parameters_async( + self, + *, + id: str, + declared_parameters: Iterable[components.PrivateEndpointDeclaredParameter], + 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 supported parameters + + Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param id: Stable identifier of the private endpoint. + :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. + :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.UpdatePrivateEndpointParametersRequest( + 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_parameters_request=components.UpdatePrivateEndpointParametersRequest( + declared_parameters=utils.unmarshal( + declared_parameters, + List[components.PrivateEndpointDeclaredParameter], + ), + ), + ) + + req = self._build_request_async( + method="PUT", + path="/private-endpoints/{id}/parameters", + 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.UpdatePrivateEndpointParametersGlobals( + 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_parameters_request, + False, + False, + "json", + components.UpdatePrivateEndpointParametersRequest, + ), + 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="updatePrivateEndpointParameters", + 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 update_pricing( self, *, diff --git a/uv.lock b/uv.lock index 0e539e44..ef5cd345 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.84" +version = "1.3.85" source = { editable = "." } dependencies = [ { name = "httpcore" },