diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0f265ebb6..914814ef1 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: ccde1016b1e3767a647954d3c0a1110e + docChecksum: 1907f47a4e83dee6cc5911cb8ae99c4c docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.157 - configChecksum: 98aeb5fc1435e989a8fcd86d34eae2fd + releaseVersion: 1.3.158 + configChecksum: 3a10b88b4794f247e7bb612a2df75eea repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 05ef2bed-4986-471d-bb8a-b39a7d498ff0 - pristine_commit_hash: 8439197151761d2fd63276ccba8048d5fd31d33b - pristine_tree_hash: 3c4bb5e6b3afc72056b07c5345d68cbc52c3862a + generation_id: e676e82b-379b-4970-aa81-42690dab0637 + pristine_commit_hash: 1241f39d3edd441e0a2739d4a713bda311544ad3 + pristine_tree_hash: ab7563c8935e8d4a8b5042ed87de607c46f817df features: python: acceptHeaders: 3.0.0 @@ -1876,8 +1876,8 @@ trackedFiles: pristine_git_object: f48cd9f2d8f491aa8a1f7027e44f92df2e24a30c docs/components/changeguardrailpolicyassignmentrequest.mdx: id: 35619bc1d436 - last_write_checksum: sha1:253a32b8a6d92ecdd1c3038449404b876b695fe5 - pristine_git_object: f6d576cacd4c60034c2d4ce535cf390e98d6f481 + last_write_checksum: sha1:c6d8eddeafa30eb160014832ea85f9a389cf999a + pristine_git_object: d5058d1193ca1d089dcea91d7999a9f528cb2553 docs/components/changeguardrailpolicyassignmentrequestpolicytype.mdx: id: a42946d02f73 last_write_checksum: sha1:2ce4a2ac9c210a76ac1df21d544d6ac992d1245e @@ -2748,8 +2748,8 @@ trackedFiles: pristine_git_object: 63f7c7711d78d68cd27c258f391696266b406e52 docs/components/createbudgetguardrailpolicyrequest.mdx: id: de0b70ea9516 - last_write_checksum: sha1:20d3c84d410ea39de3881eae257a8a91ccbe3b9e - pristine_git_object: 159383d929d00a6dd6ddcf49bb86a51d8974cf15 + last_write_checksum: sha1:e17d3cf2469850459ca87ae822308db524812c77 + pristine_git_object: c28957d766cbaa6f395805b8d961c61553d5772b docs/components/createbudgetguardrailpolicyrequestpolicytype.mdx: id: 24911ea91f67 last_write_checksum: sha1:e36dfd48c97b8a20ce0b16cb542697bf489d61e5 @@ -2780,16 +2780,16 @@ trackedFiles: pristine_git_object: 2501a2a5a0c6557094a66cb5b8f529fa5516e9e8 docs/components/createmodelavailabilityguardrailpolicyrequest.mdx: id: 4f756b818b48 - last_write_checksum: sha1:b03a271cbdbc8f1304d259734c8f6c2fe1ec82b1 - pristine_git_object: 1232d172f647f37616c28f09a801584cb01537fe + last_write_checksum: sha1:b96efef9c2f7fd7b84c88bb24dcb7e8407a8e981 + pristine_git_object: 0cb9d5f7b54afac3e1abed6ee565877babec88fb docs/components/createmodelavailabilityguardrailpolicyrequestpolicytype.mdx: id: ebf64ca3901b last_write_checksum: sha1:4ef123af623ab01b715274dcd9f129afbae76fb2 pristine_git_object: bd2d34bf9bdff620f0668862333a1afb81db98a5 docs/components/createmoderationguardrailpolicyrequest.mdx: id: ce01f7d82903 - last_write_checksum: sha1:c2254f766742a5f28648acb35a8f864f183d251e - pristine_git_object: 6aa3e42c7281c677193d1cefd6efddf6566f5deb + last_write_checksum: sha1:3062f4d19ffd32d2f153e7ed857047ef00d965d4 + pristine_git_object: 3f83a4d848b5278734186def3bd7d9c8c0e1fa1c docs/components/createmoderationguardrailpolicyrequestpolicytype.mdx: id: 178698f14336 last_write_checksum: sha1:a6ced09bc3e134b5b9f6740099461a8c180edc06 @@ -8880,8 +8880,8 @@ trackedFiles: pristine_git_object: d83b029130cebd5e3786d316165080a8bd25aa2f docs/components/updatebudgetguardrailpolicyrequest.mdx: id: 519fb4a45a36 - last_write_checksum: sha1:bddc8c9f1255437c5b9e7c0e2b44b4f0dedcc140 - pristine_git_object: 9d0aae756b2150d32d2183f554a11c00f8e41333 + last_write_checksum: sha1:4c32ddd4fb90668d97b7d1e97ac715638f536cf2 + pristine_git_object: 68aff39c75f4c57ea9dbea6742c257f7fe48fd6e docs/components/updatebyokkeyrequest.mdx: id: db0862ec6814 last_write_checksum: sha1:37fc220e5368699ba46f141cb2beebdbe271632e @@ -8908,12 +8908,12 @@ trackedFiles: pristine_git_object: 537a5707008550b81c5eaf25a4c8668b1b92849c docs/components/updatemodelavailabilityguardrailpolicyrequest.mdx: id: b794752808db - last_write_checksum: sha1:417be1743e3fa1dddf29cda3869d745be67e8942 - pristine_git_object: 46261200d151c2190e5a7670537025af246149ff + last_write_checksum: sha1:38331b198b2b78d58c5e3dab2700176e97a67922 + pristine_git_object: cfe8d6c6d022de3df1d0fb5469e1429b8d15f33d docs/components/updatemoderationguardrailpolicyrequest.mdx: id: ce45cbddb95a - last_write_checksum: sha1:230402bc542776d5faed9485284948aed13248ae - pristine_git_object: c39a57e70ffce0421a35733713ccc1b682eb77fa + last_write_checksum: sha1:ec63cc4867074504baa77ef183014c41e2c0ff05 + pristine_git_object: a6369339cd14c92db7c2c735173440c00544a6e2 docs/components/updateobservabilitydestinationrequest.mdx: id: b54091567003 last_write_checksum: sha1:4a9c4dd11807734487e23f088c5aa6150114b73f @@ -9924,8 +9924,8 @@ trackedFiles: pristine_git_object: 113dc43f77d47e7bc73a463bc9781916e59cfb5e docs/operations/deletebudgetpolicyrequest.mdx: id: 2c45c97a631b - last_write_checksum: sha1:1b1cfc73b37d44ad91cc3f22deddd733dded0dab - pristine_git_object: 44e320de48da9dabc308c895968c6587ef0fd616 + last_write_checksum: sha1:f2f2998052be150eafa5eec84e2347d89284b708 + pristine_git_object: 1e8d5768e6f65df021eebcfb6768b8bc437a0afc docs/operations/deletebyokkeyglobals.mdx: id: dd77cb8066bd last_write_checksum: sha1:4e20791ebaabc8603037484a05b5951001d58120 @@ -9984,16 +9984,16 @@ trackedFiles: pristine_git_object: dd70a9037b4d47ad83fd63b1b060d3db7f7b4718 docs/operations/deletemodelavailabilitypolicyrequest.mdx: id: f0c18f153d72 - last_write_checksum: sha1:ef227050bb64816b23203f0258b61dec7e26fce9 - pristine_git_object: a86e140f85e9aca8ec3bb3b7c93d8a4e9d5425ab + last_write_checksum: sha1:10101a0e7b463dda30c29b86487c305ad5f3b7bb + pristine_git_object: 049f1d2de9baa21d4ff40478b729afa58d54ec8d docs/operations/deletemoderationpolicyglobals.mdx: id: 15cd90bb4410 last_write_checksum: sha1:7b32dec1c2dfb133ff60f34636e235410a0265dc pristine_git_object: ce3ac45b69a46bbcaad29f07440eba97257e4836 docs/operations/deletemoderationpolicyrequest.mdx: id: 085c50549aba - last_write_checksum: sha1:566bbe59b5c16c6546256d0545a9f447e389185e - pristine_git_object: 8532fcc7495a8c0f33fde2c6281d2d27c00e1c55 + last_write_checksum: sha1:c0ad9fcd24b10e638bdf393cf0daa6793b4993f3 + pristine_git_object: 673b0e007c178ee27635fd41bc17bd32089a2e91 docs/operations/deleteobservabilitydestinationglobals.mdx: id: c76d2f794054 last_write_checksum: sha1:02f08cd5ab9f563783cc4f76e29f99c29d2a1ab9 @@ -10188,8 +10188,8 @@ trackedFiles: pristine_git_object: aefef6cbce3c5817aa2d7358d9f27f52758ea1f9 docs/operations/getapikeypolicyassignmentrequest.mdx: id: 6c6b7de2c3e6 - last_write_checksum: sha1:d2888f3e766ae9777bdd3cdf2b25bbaab9092b09 - pristine_git_object: 7a431538dc6e09016c695440a3dffd15d5b8ca54 + last_write_checksum: sha1:27f5c082eb0dfe3a0123edc7b35d114a9d55a105 + pristine_git_object: 74e3988cdf4fff9486b8f5ac72dcf7dbc328c758 docs/operations/getapprankingscategory.mdx: id: f533cbc2f61c last_write_checksum: sha1:dddef3ed7370f63a996d8201282702598ba3823d @@ -10232,8 +10232,8 @@ trackedFiles: pristine_git_object: 11aa46f63c7bd56476d53367637914ecdbfdd6c2 docs/operations/getbudgetpolicyrequest.mdx: id: 6299723c20f0 - last_write_checksum: sha1:5a82b025b442889cd8a70800f2392481ed0561e7 - pristine_git_object: 53da1b872040d26a997ed299a152d8de444b8188 + last_write_checksum: sha1:3715196455da45206d6622897d85d71db9fb9911 + pristine_git_object: 240119ab41f91adcd4a2fc672431744ef71714cc docs/operations/getbyokkeyglobals.mdx: id: ac592fd40012 last_write_checksum: sha1:105293ad014a98662b974036943224241d10b538 @@ -10340,16 +10340,16 @@ trackedFiles: pristine_git_object: 8f1249a1c51f3985c6500c61e7ad099b3e86740c docs/operations/getmemberpolicyassignmentrequest.mdx: id: cb85e9c92abf - last_write_checksum: sha1:0f17f7471ed16b3f3abcb1633f103fadf4f07910 - pristine_git_object: dee837e8ce990675b0c4e1505d5f9e9d60e83c53 + last_write_checksum: sha1:1553e3441330fa4430420ba8a51a25c27b7a3a39 + pristine_git_object: 4d0d209249ae69b0259448abca5ab6322adc1c88 docs/operations/getmodelavailabilitypolicyglobals.mdx: id: f44e22466764 last_write_checksum: sha1:536f206e900238aecd1ac9b6b063df383b72091b pristine_git_object: c7180967b0b965bbd46b8564411c9b6197770336 docs/operations/getmodelavailabilitypolicyrequest.mdx: id: 14a82b0a3939 - last_write_checksum: sha1:b9097a91b35f713ee591c222dc7c5d16a601217e - pristine_git_object: 77afcf905dfc9cc0a00dda260089d6992adaf248 + last_write_checksum: sha1:b8e49b7498e31d38eb48e2d459776452d8e93de7 + pristine_git_object: 849e9403aab84614e06a9f59bda88f6984138d9e docs/operations/getmodelglobals.mdx: id: 18648d7998ae last_write_checksum: sha1:0efec4790215ca9fc19813432cc224cdfaf73215 @@ -10384,8 +10384,8 @@ trackedFiles: pristine_git_object: 9ed605c3de987398bce22918d0a374f021a91159 docs/operations/getmoderationpolicyrequest.mdx: id: 55b9548807b9 - last_write_checksum: sha1:cda42b1c8f3b9f6efc4625e9c07390118a6bb38d - pristine_git_object: 002e39ad622b0cd342d59c71430eb017e2345378 + last_write_checksum: sha1:0d1b02c335275c26c2492da0a3fb77ec3399b0af + pristine_git_object: d9ac79bf08375fdf230571578d70a5906b32b633 docs/operations/getobservabilitydestinationglobals.mdx: id: d7ba84a5b9dc last_write_checksum: sha1:5ee778a89cb0c0ebd9245524aa55bc432f3aebfc @@ -10604,8 +10604,8 @@ trackedFiles: pristine_git_object: b63e94c1de6221afb02f64079b1e0595cd8b1f2f docs/operations/listbudgetpoliciesrequest.mdx: id: aeb3d4ba7eab - last_write_checksum: sha1:6f257860ba984d459fee4ab1a7e773d5b8c1b832 - pristine_git_object: 27212a740dc2e4809bab7c3aa1fe10e102aa54be + last_write_checksum: sha1:2c8447e4c68ba1e6f87f6e3ec93ec4de2661d679 + pristine_git_object: 888106fd14af578fa353c33b4b55759f2afdea34 docs/operations/listbudgetpoliciesresponse.mdx: id: 8104180b185d last_write_checksum: sha1:ec29f6d2d8dbe76e6e1cf6cf13e4c7eebfe1e4dc @@ -10796,8 +10796,8 @@ trackedFiles: pristine_git_object: e497a4ed046fb3d7738ae92668f8fd93f02cd8d9 docs/operations/listkeyassignmentsrequest.mdx: id: 3732b309bffd - last_write_checksum: sha1:7e36f5ea643b46621197448a6f8e6be4dd1373c7 - pristine_git_object: 31080be449bcb8e9dcc19dad6b3b191f61ff0921 + last_write_checksum: sha1:288df451e41ddb205dc8edb55d962b28a7591f7f + pristine_git_object: 2176af6601a93773ccfa0fcf0cb9102630fc0eaf docs/operations/listkeyassignmentsresponse.mdx: id: 47ddfae598d1 last_write_checksum: sha1:ea80c506b7981b4c4aa3efc8719ce74b3a09a583 @@ -10808,8 +10808,8 @@ trackedFiles: pristine_git_object: 93d863c441e3e97281e1a44fdbefc3e9147316b6 docs/operations/listmemberassignmentsrequest.mdx: id: eb73c6f654c5 - last_write_checksum: sha1:7665498f4ea32363948da54929c7827eb0f0b054 - pristine_git_object: e0c6b6afbd59e5878c0e3afcf0d65c2e350c91c6 + last_write_checksum: sha1:be697a7cedd8999915170f4005d0a5f87a910275 + pristine_git_object: cd87f7607addced17e25f3f2e7eda992598d079e docs/operations/listmemberassignmentsresponse.mdx: id: ec7bd9eaadcf last_write_checksum: sha1:112593b762bb415fc377a2dbb77d7ad8779737e1 @@ -10820,8 +10820,8 @@ trackedFiles: pristine_git_object: f13ee104f069696c2138d28ae04b3dc4933c7e0e docs/operations/listmodelavailabilitypoliciesrequest.mdx: id: 02796595a709 - last_write_checksum: sha1:6bf86b2fa20459e0dd66617eed6ffd5582a36775 - pristine_git_object: 7158e2ca1a9b317feb14aff7ac5b333f4819983a + last_write_checksum: sha1:009c36ee69726f2e7f24851544215f4c19dfdc70 + pristine_git_object: 27af59a821ff4b4110d118f7b2f76b1e45edbc9e docs/operations/listmodelavailabilitypoliciesresponse.mdx: id: c2f14936c042 last_write_checksum: sha1:3667f4a49b3213bf224c28c12d032e47ad370558 @@ -10860,8 +10860,8 @@ trackedFiles: pristine_git_object: 294535c4431d4e69f893130b756c1041d9e0c4fc docs/operations/listmoderationpoliciesrequest.mdx: id: 1b72b699ef4f - last_write_checksum: sha1:8d96ca2d2b04a6dd6436e5b529f6125918403834 - pristine_git_object: 9de40c8054c690a5d3750fe3a320a2e3286e71ac + last_write_checksum: sha1:14599b72ea68faf4bf941ab871254373666a487c + pristine_git_object: 4eef614f9ca7cc38a8752341eb7372c145d5f935 docs/operations/listmoderationpoliciesresponse.mdx: id: e59e14a9d948 last_write_checksum: sha1:eb5a272f2be7a0ddb4d6aee6ee83bf32c749eac1 @@ -11304,8 +11304,8 @@ trackedFiles: pristine_git_object: daf63d2d520fa5e00d343cd921e825245e828200 docs/operations/updatekeysrequestbody.mdx: id: dc55066cca3d - last_write_checksum: sha1:a9795843f32267656dbe189d06669bdb64f1638e - pristine_git_object: 9cf47d247a40b89d241953eb4b1584ac2295896f + last_write_checksum: sha1:8cef14b447a023db0c4d3a7cfcc8502131f8ca29 + pristine_git_object: 25cb4d0e13cbc3778d30c2fbfbbba98e937ab7de docs/operations/updatekeysresponse.mdx: id: a97d51fea627 last_write_checksum: sha1:44631562c5f1edb827ac0f66d9b2b6974bcab417 @@ -11432,8 +11432,8 @@ trackedFiles: pristine_git_object: ccdae17cd63930fb0d65fe1171735373c233e38b docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 - last_write_checksum: sha1:09195a526bc468df6743e47dbdee79949f66e77c - pristine_git_object: 2f4950880ee5164aa8988d13d4eba940778d5f17 + last_write_checksum: sha1:0b5ed3f2c7273047e472fe10da442706cfec9504 + pristine_git_object: c57d9d064d27b93eee0d99f597c6f7785c27503b docs/sdks/batch/README.mdx: id: e367aa4f4295 last_write_checksum: sha1:e5084fc19c2bfc9aa28e90a86d4accb5c9153130 @@ -11480,8 +11480,8 @@ trackedFiles: pristine_git_object: c9cd08e0c5ddc58ceffd85ee9ac7bf99e6f7180b docs/sdks/endpoints/README.mdx: id: 62dfac9f7b71 - last_write_checksum: sha1:f981a319498648437f037b226c6788e9e8b324a2 - pristine_git_object: 1ddfabeb0a3ed79e4325a59f7a46a45b1635fd2d + last_write_checksum: sha1:3cf3ac86ba33ebc2c82d1d2d54ba779b1fc7ce33 + pristine_git_object: 5051e52152fcbaad7f68cb953aed3b56ae692553 docs/sdks/externalusers/README.mdx: id: 16a97e1de35f last_write_checksum: sha1:f28388cae1e8a1593017a2d0e08a33b678802d1c @@ -11500,12 +11500,12 @@ trackedFiles: pristine_git_object: 620461d10a770f6ef9df53ef054775bf0df7ac1f docs/sdks/guardrailpolicies/README.mdx: id: 0e5ed6ce5965 - last_write_checksum: sha1:2e1457d9e610551d1cf723858696637a3026faaa - pristine_git_object: 0fa8a42f96cb4f234775f8bb07f8d985eb041bc3 + last_write_checksum: sha1:3b6cdcfddd7c382d4e9b4ca8d087c9eb55c66968 + pristine_git_object: 04af1956ac221b8912203963d46e14848a9bef6e docs/sdks/guardrails/README.mdx: id: a0cd4218b8fa - last_write_checksum: sha1:1e7487cbc4699df83c7a798431b280cc2b5da8b2 - pristine_git_object: 19715d9b3b226b45633808f7bab4507fb358c878 + last_write_checksum: sha1:6e7f46003b7412280c9634dc2189682da0da7590 + pristine_git_object: 3f96698736d6078dfb33689dd2fdca320bac0a03 docs/sdks/images/README.mdx: id: 534a6c102c4f last_write_checksum: sha1:079630beece943bdc653184e6d6448df72a62bd5 @@ -11588,8 +11588,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:1c87dbce46855a46bcb3e11a53b8b01c01a787cf - pristine_git_object: 358d49fbcfd5d24f1d01e003acf0b93af434cf5d + last_write_checksum: sha1:cd5b8633ceff256dff2a0103944ee74b5d8c8b1b + pristine_git_object: 012ac97d77cda261b76034dd421fdb146cd523e4 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -11616,8 +11616,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:4fe70108eb1b0c95a86b8bf44193d84c8a00142a - pristine_git_object: 3ac8b95c67bd6fc7d72e4de29a2e6dffc4f6c33d + last_write_checksum: sha1:02c62d4de13334c9b81476a962de80a3f8c6d347 + pristine_git_object: cb6ca0330db13722868bb9eb1a2ea39615238fbe src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -11628,8 +11628,8 @@ trackedFiles: pristine_git_object: 6dc3ecedfec396bd5a0f46c89178563f84c72dd7 src/openrouter/api_keys.py: id: 876fac88fff6 - last_write_checksum: sha1:eee27956e31d7525d8cfbc9177d5b79db2b3aab3 - pristine_git_object: 73c16d709a3b6f578233a79c00211dadd67e77a5 + last_write_checksum: sha1:f2ec48a54a682e5d3474e5f9809f66f287d690e2 + pristine_git_object: 9c0180614cfceec282a805ffa569840decedeb8a src/openrouter/basesdk.py: id: c5733c5a1e12 last_write_checksum: sha1:65769ff2cb5473f85b364c6213a0ddc8c68644ea @@ -12444,8 +12444,8 @@ trackedFiles: pristine_git_object: a1cb577d9835d93914b06761e2cad3ceae2961e2 src/openrouter/components/changeguardrailpolicyassignmentrequest.py: id: e74dfdf48a81 - last_write_checksum: sha1:540e746feb9d8cbfe48b378d3ac5ce665b4fd375 - pristine_git_object: 27381f63769c36e2dbeb6c86df3788849a33ce6b + last_write_checksum: sha1:e4b3cfaf5979165dbeca1ac89c4187e40ba2b5d0 + pristine_git_object: 7ecc46a115f59724762c33de2eed3a6bb5c6dba4 src/openrouter/components/changeguardrailpolicyassignmentresponse.py: id: 8ea6504bed9d last_write_checksum: sha1:5b15572ac8f586bf9a3e2c806f196edb02ded7a9 @@ -12820,8 +12820,8 @@ trackedFiles: pristine_git_object: 15b66bb18088bd61cccfa17e1cb5ef26c02abc84 src/openrouter/components/createbudgetguardrailpolicyrequest.py: id: 8fc88141b2b2 - last_write_checksum: sha1:52cd45cffdcadc4a3a3c8b1d4b9589d51d3e9ea1 - pristine_git_object: 57c04236f445d54cec57bc07a886822e35f494cb + last_write_checksum: sha1:a411f159e4a35b0adc03230975b49a59bf08dadf + pristine_git_object: 1baab50ee7abc3c8a00dbff58dfb84eaf639677b src/openrouter/components/createbyokkeyrequest.py: id: 238e868445b4 last_write_checksum: sha1:5c4443b37e857776901973b9c70d3df60756249d @@ -12844,12 +12844,12 @@ trackedFiles: pristine_git_object: d6c4a4dc73222668daddc2a1788d314ff30e8fe6 src/openrouter/components/createmodelavailabilityguardrailpolicyrequest.py: id: caedf451c860 - last_write_checksum: sha1:93e71da8dc1a93f3f6120f8104723928225a34e4 - pristine_git_object: a5935ebd04a7359a275257ff9a8943f38139e4a6 + last_write_checksum: sha1:e35758408158d2acc093693fa98d61e7d3a45540 + pristine_git_object: 8a28539e0900a86d025156b4fcb95c607720e047 src/openrouter/components/createmoderationguardrailpolicyrequest.py: id: 6ceafafe2ebc - last_write_checksum: sha1:dc90bb657cd1359d864ab4e5d597ae9dd388a970 - pristine_git_object: 0266b86d75b79dca3c8d55889824ad60b277834d + last_write_checksum: sha1:b624f706a0dd378f7437233a8b9889f1f65a70f7 + pristine_git_object: 5a1db586e1e6a97ccb298c62f116212ed852a611 src/openrouter/components/createobservabilitydestinationrequest.py: id: 58587fb98a32 last_write_checksum: sha1:e82a9713a3c5ac67dbbb4fcb29f8237d973c3e65 @@ -15224,8 +15224,8 @@ trackedFiles: pristine_git_object: 696d3c578c6b09f9768e52a7dd000284fb62f1b7 src/openrouter/components/updatebudgetguardrailpolicyrequest.py: id: 74e228d5233a - last_write_checksum: sha1:18b6d59609ba91b19a0950dc68d907d19126a122 - pristine_git_object: c85421a39da95e74a65a34d9988f49d50503983d + last_write_checksum: sha1:08f3d9d42f2fa190ef9c4acc8ce5c1c7b521d1f5 + pristine_git_object: 426fd8de3b8dc00cba5ebc7803750e0e8b761d9b src/openrouter/components/updatebyokkeyrequest.py: id: 5edad69c278d last_write_checksum: sha1:b2005ad6a3a3c7da49786f4d8dd4e9f3fce33f84 @@ -15248,12 +15248,12 @@ trackedFiles: pristine_git_object: df833960211cc7ed2a2a42fddbeafda0092e1c0c src/openrouter/components/updatemodelavailabilityguardrailpolicyrequest.py: id: c91a629df056 - last_write_checksum: sha1:98dc29197df44bdd46296b263722509151e124b1 - pristine_git_object: 761d47a3b8acc1893a117dc2986d03ccdef70cde + last_write_checksum: sha1:435bfbc821d4419074edafb0951d20ade4233d47 + pristine_git_object: 9f9d16972e4fe84a0347e15d3c8e38440b6dee60 src/openrouter/components/updatemoderationguardrailpolicyrequest.py: id: 66bc0f230053 - last_write_checksum: sha1:db5be8422ada7321c69401ceb24aeb9f0cfb55b8 - pristine_git_object: ddfa0c4e3bf239603859762fe59a9b52d0b356ad + last_write_checksum: sha1:75a3e57014496c0356da5576eceac08b76c46da8 + pristine_git_object: b5b3c434ba42ebfd3ea5b809a812d5722e813298 src/openrouter/components/updateobservabilitydestinationrequest.py: id: d7a39fe04386 last_write_checksum: sha1:24d9caae99e5030d7c1156d42b672e2187db86bf @@ -15492,8 +15492,8 @@ trackedFiles: pristine_git_object: 71d905b15e0a7b3c140823ddb45fb34b239fe021 src/openrouter/endpoints.py: id: 465bbf2b7939 - last_write_checksum: sha1:5fbcc02b5496724a81058c500254e7831fbd7233 - pristine_git_object: 2242260aa44d791e47477313e7595fb5c58b7339 + last_write_checksum: sha1:0632be9f0f9b0bc8a282a5840a759d7a2833c645 + pristine_git_object: 6597bc3d049c7cfcd9c192be377926a10174a5f3 src/openrouter/errors/__init__.py: id: 366154d0d60a last_write_checksum: sha1:2bf92aa2923c6564ce5b91ae5c27e95257fe0f19 @@ -15624,12 +15624,12 @@ trackedFiles: pristine_git_object: 8c989db92d681ffe9a956bae5c16c8f09f3627ca src/openrouter/guardrail_policies.py: id: 0505548eb66e - last_write_checksum: sha1:137cc46c93a5173f8125e43d99a2647cc6650714 - pristine_git_object: 9f5800f27db62a5159098c5cea96ed0dc312149d + last_write_checksum: sha1:5fab90d49ee791b30c9140343421e93f2e4b6d7d + pristine_git_object: b2b812577f8ea24153dce094cbab1fb2b229e769 src/openrouter/guardrails.py: id: 705839f34e66 - last_write_checksum: sha1:c9e827a99a58270771866911589c6b31ceee16c3 - pristine_git_object: af664037202c670135045f7a351f0b07ff6c8e88 + last_write_checksum: sha1:c11ab4c572e56f83f4a8eb83403383046e6f427f + pristine_git_object: 1e2bebdccc0885cd499cd71c44dcc8c98d8e5ad9 src/openrouter/httpclient.py: id: e9311185443d last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 @@ -15840,8 +15840,8 @@ trackedFiles: pristine_git_object: 9edaaae8038739d10a508b42a778447ba7ffc8d2 src/openrouter/operations/deletebudgetpolicy.py: id: 8263602af356 - last_write_checksum: sha1:be5e6767efb582dff05728c6d41228db4f0b9226 - pristine_git_object: 90fd1f9ef14a22dee2c55e9d1b5bfc5ec7635085 + last_write_checksum: sha1:b0fdb50bfff9cd015112fc2609d58bf901044827 + pristine_git_object: a6925175c0adda6808567bf4a999b6db63b58b4d src/openrouter/operations/deletebyokkey.py: id: b1b2c6b06913 last_write_checksum: sha1:90aad5198d43e289d99c7b2eb66353de7593a68b @@ -15868,12 +15868,12 @@ trackedFiles: pristine_git_object: 998021c4bbe713d9a81ebb79348e6f9e246964bc src/openrouter/operations/deletemodelavailabilitypolicy.py: id: 8193af92abdc - last_write_checksum: sha1:4b65c977e15126d6aa336adfb8b9d380c8d98c7c - pristine_git_object: 3827862e22c87a17a037631c7eaae49f3c92a556 + last_write_checksum: sha1:30b14573f35b7563519fcf536213e587d5cba234 + pristine_git_object: 9da2b2fdf44b00728a73c4a31e65f01649377a27 src/openrouter/operations/deletemoderationpolicy.py: id: bc7c7773127a - last_write_checksum: sha1:82cc8a103c3084001faceb23b7d47c9af56ffc3d - pristine_git_object: 481cb406c438b657c5c54685743a9d81f0c3b43d + last_write_checksum: sha1:2d0a9650f87e97895b4ca252fb38f34cb20c2206 + pristine_git_object: f391a8daf8153c5566a4d8963cf5e2f14afa46b1 src/openrouter/operations/deleteobservabilitydestination.py: id: efcdc4e7e19d last_write_checksum: sha1:975fb2edbcb96c6e890d1ed6ce2101ae261600d8 @@ -15932,8 +15932,8 @@ trackedFiles: pristine_git_object: d4b717427347a5183eff59d470945a183af4607d src/openrouter/operations/getapikeypolicyassignment.py: id: ad6711113aec - last_write_checksum: sha1:119c722522881ee2b8eba8a2312ac38910873362 - pristine_git_object: 7b87d4d5493916a11c65464116c1eaafb530f6af + last_write_checksum: sha1:18d9215c0b3894dd1af2fd99e331b9854daad40b + pristine_git_object: b4e7379c156acc0e04c84a38180d9b8467f43653 src/openrouter/operations/getapprankings.py: id: 5ffd23dafcc1 last_write_checksum: sha1:ab86de57d9c8502a130a61f4405f3ca40c2ff5dc @@ -15948,8 +15948,8 @@ trackedFiles: pristine_git_object: 51f1f39f8f61ebb2edc9770ad79e09bd7886fd2d src/openrouter/operations/getbudgetpolicy.py: id: e17092f50a72 - last_write_checksum: sha1:e3ce8b4931dea448df38b4b5a852870c4c85445c - pristine_git_object: 5d830347d5af127d76735e23e15af88860bb195d + last_write_checksum: sha1:5afb8cb870f2b3b0a533c95ec1ce85a2ed41135e + pristine_git_object: 832c1d73ce1e1e1821c0257b4998eea6da14a3f5 src/openrouter/operations/getbyokkey.py: id: d141452bd88a last_write_checksum: sha1:d6d391b230d90f51945144e63e9c53772650bd7b @@ -15988,24 +15988,24 @@ trackedFiles: pristine_git_object: 924bb00ec6b3bcb57c9fb8442407b9c3ccc92b9d src/openrouter/operations/getmemberpolicyassignment.py: id: d2e2fd55dd30 - last_write_checksum: sha1:5082c311195fc27da06587e687b98471d377dd62 - pristine_git_object: c485047732f07103e69dd62196d9139f2cd26328 + last_write_checksum: sha1:b706e4bba9ac879ae043d488dd5e83f095bf752f + pristine_git_object: babf428c57a2435e388cc104cab671616218b03f src/openrouter/operations/getmodel.py: id: 90c926cd726f last_write_checksum: sha1:3ba2f12410841c49e329821b8eaec5f87d5882c1 pristine_git_object: d5a47b01285b12f05d46240e253a934be63f0a00 src/openrouter/operations/getmodelavailabilitypolicy.py: id: 65d0a0dcfab6 - last_write_checksum: sha1:0b58c0763f995398f3142775bf35f9c5145e3986 - pristine_git_object: 5a3c822a888d653886c87328a0c8ce4fae7894d3 + last_write_checksum: sha1:e12fe16e06115124f4727942cb62296b4e5551fb + pristine_git_object: 607d128d5100c8275490b56b11fcec7ef735aaa6 src/openrouter/operations/getmodels.py: id: 5bd5dfcb0125 last_write_checksum: sha1:ab0df91438a333015c3c7b8e6ef262c300f684a6 pristine_git_object: 51ad0ee78c5e47e0e42b1a2b12133467670402d4 src/openrouter/operations/getmoderationpolicy.py: id: 423190ca3bf3 - last_write_checksum: sha1:347d2fdb6c0040682881ab381c5dd8d1b6a40fc1 - pristine_git_object: 9e1e83005f4f97de02c81ac60a16ebadf894e687 + last_write_checksum: sha1:c7b742130072c52879d95fbe3b8f60296cca4353 + pristine_git_object: 39face005c1803eca0f58f484857443fcc3c08c0 src/openrouter/operations/getobservabilitydestination.py: id: 15b49f22aca9 last_write_checksum: sha1:351b050b646c9e2dbffaf27633cbd38b30047169 @@ -16084,8 +16084,8 @@ trackedFiles: pristine_git_object: 1dfdcafa35e010924f76a24ed007796e8ad40254 src/openrouter/operations/listbudgetpolicies.py: id: a41bedda97cb - last_write_checksum: sha1:18f31f3a12507dd0ceb0b952893e6a2e8e27ca32 - pristine_git_object: cb0680de640f772e1beceb23f5c024d0f0cca82b + last_write_checksum: sha1:f33cb1b50dfda56a5b805e083358b491019cfeb8 + pristine_git_object: 40c8b5cfeb97707548889ada0c049b5d1b739b17 src/openrouter/operations/listbyokkeys.py: id: b6dd42b3e05f last_write_checksum: sha1:7745e4d87c2b70747b8aec4fb53121ec0920c244 @@ -16152,16 +16152,16 @@ trackedFiles: pristine_git_object: 4c8177f198d86270e1401cb8dcecbe0b0655eecb src/openrouter/operations/listkeyassignments.py: id: e26c11d1bd3c - last_write_checksum: sha1:378b13828e43296aa120e24a0b2d7a55bca85212 - pristine_git_object: 25352cf38435a7fece7f5c4512ac0710c60ecbe0 + last_write_checksum: sha1:92178774a8e1a6e4c3133b0ef50495d790cc2e06 + pristine_git_object: 0a8634cb3b74bd2fc0348e9a4b7e6882c369c427 src/openrouter/operations/listmemberassignments.py: id: a993b5549126 - last_write_checksum: sha1:5a6e2469b141dcee32fd54d75b8fdd726c14d8c5 - pristine_git_object: 4ccc06b53c5f45c9fa99dc29623e5b442ed39462 + last_write_checksum: sha1:f722b4eb830d82fe51f1686dc62c3624d8a73db6 + pristine_git_object: 36ac3bea0f61eec85d04e63fcea705bcf87d361d src/openrouter/operations/listmodelavailabilitypolicies.py: id: 895490cb05ed - last_write_checksum: sha1:9bded515bbb800ba8cfd073cf20ca2559ee21be0 - pristine_git_object: dac3be4a1284c9a05758f958807e3ad14f0510c7 + last_write_checksum: sha1:8f66174bf2d35df778b6c41a62c572b17c206c40 + pristine_git_object: d92ff0720cdcd5a2c6534532aa57d87f0f134ad4 src/openrouter/operations/listmodelscount.py: id: d588d81b71c2 last_write_checksum: sha1:9428a1ab510072878e6bf57ab249e14978608b85 @@ -16172,8 +16172,8 @@ trackedFiles: pristine_git_object: c5b9f8c2f29e740fef85a4e2f2a427d94c6f04bb src/openrouter/operations/listmoderationpolicies.py: id: a091a9ee01d0 - last_write_checksum: sha1:e8300ea6f46fb792410d8ba4e1fd0a9200129e1a - pristine_git_object: d5419d4b5228b9027c15b3e2962297bcd8bd5cf5 + last_write_checksum: sha1:589611d2c8438f22d130d88497aecd6fbe15ff0e + pristine_git_object: 2f128dd65dde19eb3718cb0c3c2858e30213f6f1 src/openrouter/operations/listoauthjwks.py: id: 329ac9d6fa76 last_write_checksum: sha1:8d6b08b6637a0ff49f88313a9f1bed03349655f1 @@ -16292,8 +16292,8 @@ trackedFiles: pristine_git_object: 3787f0ce396fca69bdd7bce99d8054fec4dd23d6 src/openrouter/operations/updatekeys.py: id: 56fb213253a8 - last_write_checksum: sha1:8a49a1d8fecd7314d177d488ecec30214f4e918b - pristine_git_object: e9ed9da08d2a39aa0f9dc295fdd4e006e8dd49f5 + last_write_checksum: sha1:f893c7690f733ba25a43ff9ce70fa20ac3af3f4c + pristine_git_object: b0d89392b6004adb23b93b6aaec7ad00eccefebd src/openrouter/operations/updatemodelavailabilitypolicy.py: id: d1b2f4316f03 last_write_checksum: sha1:c778c8d1210644d625357a6782307d772fcbaa46 @@ -16783,6 +16783,8 @@ examples: application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} listEndpointsZdr: speakeasy-default-list-endpoints-zdr: responses: @@ -16794,6 +16796,8 @@ examples: application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} listProviders: speakeasy-default-list-providers: responses: @@ -21170,7 +21174,7 @@ examples: path: hash: "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93" requestBody: - application/json: {"assigned": true, "expected_assignment": {"opted_out": false, "policy_ids": [], "workspace_default_policy_ids": ["2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90"]}, "policy_id": "550e8400-e29b-41d4-a716-446655440000", "policy_type": "budget", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"assigned": true, "expected_assignment": {"opted_out": false, "policy_ids": [], "workspace_default_policy_ids": ["2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90"]}, "policy_id": "550e8400-e29b-41d4-a716-446655440000", "policy_type": "budget"} responses: "200": application/json: {"data": true} @@ -21213,7 +21217,7 @@ examples: path: member_id: "user_2abcDEFghiJKLmnoPQRstu" requestBody: - application/json: {"assigned": true, "expected_assignment": {"opted_out": false, "policy_ids": [], "workspace_default_policy_ids": ["2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90"]}, "policy_id": "550e8400-e29b-41d4-a716-446655440000", "policy_type": "budget", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"assigned": true, "expected_assignment": {"opted_out": false, "policy_ids": [], "workspace_default_policy_ids": ["2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90"]}, "policy_id": "550e8400-e29b-41d4-a716-446655440000", "policy_type": "budget"} responses: "200": application/json: {"data": true} @@ -21250,7 +21254,7 @@ examples: createBudgetPolicy: speakeasy-default-create-budget-policy: requestBody: - application/json: {"config": {"include_byok_in_budgets": false, "limit_usd": 200, "reset_interval": "monthly"}, "name": "Engineering monthly budget", "policy_type": "budget", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"config": {"include_byok_in_budgets": false, "limit_usd": 200, "reset_interval": "monthly"}, "name": "Engineering monthly budget", "policy_type": "budget"} responses: "201": application/json: {"data": {"config": {}, "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Engineering monthly budget", "policy_type": "budget"}} @@ -21314,7 +21318,7 @@ examples: path: id: "550e8400-e29b-41d4-a716-446655440000" requestBody: - application/json: {"config": {"include_byok_in_budgets": false, "limit_usd": 200, "reset_interval": "monthly"}, "name": "Engineering monthly budget", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"config": {"include_byok_in_budgets": false, "limit_usd": 200, "reset_interval": "monthly"}, "name": "Engineering monthly budget"} responses: "200": application/json: {"data": {"config": {}, "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Engineering monthly budget", "policy_type": "budget"}} @@ -21351,7 +21355,7 @@ examples: createModelAvailabilityPolicy: speakeasy-default-create-model-availability-policy: requestBody: - application/json: {"config": {}, "name": "Engineering monthly budget", "policy_type": "model_availability", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"config": {}, "name": "Engineering monthly budget", "policy_type": "model_availability"} responses: "201": application/json: {"data": {"config": {}, "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Engineering monthly budget", "policy_type": "model_availability"}} @@ -21415,7 +21419,7 @@ examples: path: id: "550e8400-e29b-41d4-a716-446655440000" requestBody: - application/json: {"config": {}, "name": "Engineering monthly budget", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"config": {}, "name": "Engineering monthly budget"} responses: "200": application/json: {"data": {"config": {}, "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Engineering monthly budget", "policy_type": "model_availability"}} @@ -21452,7 +21456,7 @@ examples: createModerationPolicy: speakeasy-default-create-moderation-policy: requestBody: - application/json: {"config": {}, "name": "Engineering monthly budget", "policy_type": "moderation", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"config": {}, "name": "Engineering monthly budget", "policy_type": "moderation"} responses: "201": application/json: {"data": {"config": {}, "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Engineering monthly budget", "policy_type": "moderation"}} @@ -21516,7 +21520,7 @@ examples: path: id: "550e8400-e29b-41d4-a716-446655440000" requestBody: - application/json: {"config": {}, "name": "Engineering monthly budget", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"} + application/json: {"config": {}, "name": "Engineering monthly budget"} responses: "200": application/json: {"data": {"config": {}, "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Engineering monthly budget", "policy_type": "moderation"}} @@ -21573,3 +21577,28 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Python SDK Changes: + * `open_router.endpoints.list_zdr_endpoints()`: `error.status[401]` **Added** + * `open_router.endpoints.list()`: `error.status[401]` **Added** + * `open_router.guardrails.list_key_assignments()`: `request.workspace_id` **Added** + * `open_router.guardrails.list_member_assignments()`: `request.workspace_id` **Added** + * `open_router.guardrail_policies.get_api_key_policy_assignment()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.change_api_key_policy_assignment()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.get_member_policy_assignment()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.change_member_policy_assignment()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.list_budget_policies()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.create_budget_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.delete_budget_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.get_budget_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.update_budget_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.list_model_availability_policies()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.create_model_availability_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.delete_model_availability_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.get_model_availability_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.update_model_availability_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.list_moderation_policies()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.create_moderation_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.delete_moderation_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.get_moderation_policy()`: `request.workspace_id` **Changed** + * `open_router.guardrail_policies.update_moderation_policy()`: `request.workspace_id` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a52443523..0212bb4a3 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.157 + version: 1.3.158 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 81dd29876..1820cc8e9 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -7587,12 +7587,11 @@ components: type: 'string' x-speakeasy-unknown-values: allow workspace_id: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' required: - - 'workspace_id' - 'policy_type' - 'policy_id' - 'assigned' @@ -10374,7 +10373,7 @@ components: - 'budget' type: 'string' workspace_id: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -10382,7 +10381,6 @@ components: - 'name' - 'policy_type' - 'config' - - 'workspace_id' type: 'object' CreateBYOKKeyRequest: example: @@ -10867,7 +10865,7 @@ components: - 'model_availability' type: 'string' workspace_id: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -10875,7 +10873,6 @@ components: - 'name' - 'policy_type' - 'config' - - 'workspace_id' type: 'object' CreateModerationGuardrailPolicyRequest: properties: @@ -10931,7 +10928,7 @@ components: - 'moderation' type: 'string' workspace_id: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -10939,7 +10936,6 @@ components: - 'name' - 'policy_type' - 'config' - - 'workspace_id' type: 'object' CreateObservabilityDestinationRequest: example: @@ -36417,14 +36413,13 @@ components: type: 'string' type: 'array' workspace_id: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' required: - 'name' - 'config' - - 'workspace_id' type: 'object' UpdateBYOKKeyRequest: example: @@ -36813,14 +36808,13 @@ components: type: 'string' type: 'array' workspace_id: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' required: - 'name' - 'config' - - 'workspace_id' type: 'object' UpdateModerationGuardrailPolicyRequest: properties: @@ -36872,14 +36866,13 @@ components: type: 'string' type: 'array' workspace_id: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' required: - 'name' - 'config' - - 'workspace_id' type: 'object' UpdateObservabilityDestinationRequest: example: @@ -43160,7 +43153,7 @@ paths: - $ref: "#/components/parameters/AppCategories" /credits/purchases: post: - description: 'Starts an agent credit purchase paid with a Machine Payments Protocol (MPP) credential on Tempo. The first call answers `402` with a `WWW-Authenticate: Payment ...` challenge; retry the same request, same `Idempotency-Key`, with the signed credential in `Payment-Authorization: Payment ...` (or in `Authorization: Payment ...` when the management key is sent as `X-Api-Key`). A paid request answers `202`: the transfer was broadcast and Stripe is still screening the payment, so credits arrive asynchronously. Poll the URL in the `Location` header, `GET /api/v1/credits/purchases/{id}`, until `status` is `credited` or `failed`.' + description: 'Starts an agent credit purchase paid with a Machine Payments Protocol (MPP) credential: USDC on Tempo, or a card when one is offered. The first call answers `402` with one `WWW-Authenticate: Payment ...` challenge per payment option; pay one of them and retry the same request, same `Idempotency-Key`, with the signed credential in `Payment-Authorization: Payment ...` (or in `Authorization: Payment ...` when the management key is sent as `X-Api-Key`). A paid request answers `202`: the transfer was broadcast or the card was charged, and the payment is still being confirmed, so credits arrive asynchronously. Poll the URL in the `Location` header, `GET /api/v1/credits/purchases/{id}`, until `status` is `credited` or `failed`.' operationId: 'createCreditsPurchases' parameters: - description: 'Identifies the purchase. Send the same value on the unpaid request and on the paid retry; use a new value for a new purchase.' @@ -43194,6 +43187,13 @@ paths: description: 'The purchase to poll: `GET /api/v1/credits/purchases/{id}`.' example: '/api/v1/credits/purchases/pi_3PqXyZ2eZvKYlo2C0abc1234' type: 'string' + Payment-Receipt: + description: 'The payment reference, on the request that paid: the Tempo transaction hash for USDC, or the PaymentIntent ID for a card. Absent when an earlier request already paid this purchase.' + required: false + schema: + description: 'The payment reference, on the request that paid: the Tempo transaction hash for USDC, or the PaymentIntent ID for a card. Absent when an earlier request already paid this purchase.' + example: '0x8f3c2b1a9e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a39281706f5e4d3' + type: 'string' '400': content: application/json: @@ -43229,10 +43229,10 @@ paths: example: '; rel="help"' type: 'string' WWW-Authenticate: - description: 'The MPP challenge: `Payment id="...", method="tempo", intent="charge", ...`.' + description: 'The MPP challenges, one per way to pay: `Payment id="...", method="tempo", intent="charge", ...` for USDC on Tempo and, when cards are offered, `Payment id="...", method="stripe", intent="charge", ...` for a card. Pay one of them.' required: true schema: - description: 'The MPP challenge: `Payment id="...", method="tempo", intent="charge", ...`.' + description: 'The MPP challenges, one per way to pay: `Payment id="...", method="tempo", intent="charge", ...` for USDC on Tempo and, when cards are offered, `Payment id="...", method="stripe", intent="charge", ...` for a card. Pay one of them.' type: 'string' '403': content: @@ -44555,6 +44555,16 @@ paths: - 'data' type: 'object' description: 'Returns a list of endpoints' + '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: @@ -47244,6 +47254,15 @@ paths: maximum: 100 minimum: 1 type: 'integer' + - description: 'Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' responses: '200': content: @@ -47359,6 +47378,15 @@ paths: maximum: 100 minimum: 1 type: 'integer' + - description: 'Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' responses: '200': content: @@ -47818,12 +47846,12 @@ paths: example: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' minLength: 1 type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -48010,12 +48038,12 @@ paths: example: 'user_2abcDEFghiJKLmnoPQRstu' minLength: 1 type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -48213,12 +48241,12 @@ paths: maximum: 100 minimum: 1 type: 'integer' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -48392,12 +48420,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -48485,12 +48513,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -48674,12 +48702,12 @@ paths: maximum: 100 minimum: 1 type: 'integer' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -48853,12 +48881,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -48946,12 +48974,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -49135,12 +49163,12 @@ paths: maximum: 100 minimum: 1 type: 'integer' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -49314,12 +49342,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -49407,12 +49435,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to' + - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' - required: true + required: false schema: - description: 'Workspace the policy belongs to' + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -51427,7 +51455,7 @@ paths: minLength: 1 type: 'string' workspace_id: - description: 'Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key''s current workspace is a no-op.' + description: 'Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key''s current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key''s current workspace is a no-op.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -52634,6 +52662,16 @@ paths: - 'data' type: 'object' description: 'Returns a list of endpoints' + '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: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b2988e7d2..c74d3801c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:89644ebfe4a1d1bb29e0f1a674f4cf209cc6ff613235f6b20b7bb69b65509334 - sourceBlobDigest: sha256:aea5677509f1c6492bb73a9727c5628c33e467350b75d95d67de2ac7697c33d0 + sourceRevisionDigest: sha256:bcdda78306d808317c4e0225a775e0c15284191a30ff779dd5ab7984e60df800 + sourceBlobDigest: sha256:83771007199fe64fa0a4060ceef7af9720275e3e135d40130720555d4dec4d4f tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:89644ebfe4a1d1bb29e0f1a674f4cf209cc6ff613235f6b20b7bb69b65509334 - sourceBlobDigest: sha256:aea5677509f1c6492bb73a9727c5628c33e467350b75d95d67de2ac7697c33d0 + sourceRevisionDigest: sha256:bcdda78306d808317c4e0225a775e0c15284191a30ff779dd5ab7984e60df800 + sourceBlobDigest: sha256:83771007199fe64fa0a4060ceef7af9720275e3e135d40130720555d4dec4d4f codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:b6e94d7141c0223a4e91342f180e1eb0a840dc0ec937b3ee72747dbd7542f6a9 + codeSamplesRevisionDigest: sha256:75973e64bab7a0d387c90cbd43f1ce058314892d0e6a562e1ed1b042e119ca99 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 8c752a368..622315940 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4339,4 +4339,14 @@ Based on: ### Generated - [python v1.3.157] . ### Releases -- [PyPI v1.3.157] https://pypi.org/project/openrouter/1.3.157 - . \ No newline at end of file +- [PyPI v1.3.157] https://pypi.org/project/openrouter/1.3.157 - . + +## 2026-11-11 07:48:47 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.158] . +### Releases +- [PyPI v1.3.158] https://pypi.org/project/openrouter/1.3.158 - . \ No newline at end of file diff --git a/docs/components/changeguardrailpolicyassignmentrequest.mdx b/docs/components/changeguardrailpolicyassignmentrequest.mdx index f6d576cac..d5058d119 100644 --- a/docs/components/changeguardrailpolicyassignmentrequest.mdx +++ b/docs/components/changeguardrailpolicyassignmentrequest.mdx @@ -4,10 +4,10 @@ title: "ChangeGuardrailPolicyAssignmentRequest" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `assigned` | *bool* | ✔️ | `true` assigns the policy to the subject, `false` removes it | true | -| `expected_assignment` | [components.GuardrailPolicyAssignmentState](../components/guardrailpolicyassignmentstate.mdx) | ✔️ | N/A | | -| `policy_id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `policy_type` | [components.ChangeGuardrailPolicyAssignmentRequestPolicyType](../components/changeguardrailpolicyassignmentrequestpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `assigned` | *bool* | ✔️ | `true` assigns the policy to the subject, `false` removes it | true | +| `expected_assignment` | [components.GuardrailPolicyAssignmentState](../components/guardrailpolicyassignmentstate.mdx) | ✔️ | N/A | | +| `policy_id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `policy_type` | [components.ChangeGuardrailPolicyAssignmentRequestPolicyType](../components/changeguardrailpolicyassignmentrequestpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/createbudgetguardrailpolicyrequest.mdx b/docs/components/createbudgetguardrailpolicyrequest.mdx index 159383d92..c28957d76 100644 --- a/docs/components/createbudgetguardrailpolicyrequest.mdx +++ b/docs/components/createbudgetguardrailpolicyrequest.mdx @@ -4,14 +4,14 @@ title: "CreateBudgetGuardrailPolicyRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | -| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | -| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `policy_type` | [components.CreateBudgetGuardrailPolicyRequestPolicyType](../components/createbudgetguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | +| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | +| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `policy_type` | [components.CreateBudgetGuardrailPolicyRequestPolicyType](../components/createbudgetguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/createmodelavailabilityguardrailpolicyrequest.mdx b/docs/components/createmodelavailabilityguardrailpolicyrequest.mdx index 1232d172f..0cb9d5f7b 100644 --- a/docs/components/createmodelavailabilityguardrailpolicyrequest.mdx +++ b/docs/components/createmodelavailabilityguardrailpolicyrequest.mdx @@ -14,4 +14,4 @@ title: "CreateModelAvailabilityGuardrailPolicyRequest" | `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | | `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | | `policy_type` | [components.CreateModelAvailabilityGuardrailPolicyRequestPolicyType](../components/createmodelavailabilityguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/createmoderationguardrailpolicyrequest.mdx b/docs/components/createmoderationguardrailpolicyrequest.mdx index 6aa3e42c7..3f83a4d84 100644 --- a/docs/components/createmoderationguardrailpolicyrequest.mdx +++ b/docs/components/createmoderationguardrailpolicyrequest.mdx @@ -4,14 +4,14 @@ title: "CreateModerationGuardrailPolicyRequest" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `config` | [components.GuardrailModerationPolicyConfig](../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | -| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | -| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `policy_type` | [components.CreateModerationGuardrailPolicyRequestPolicyType](../components/createmoderationguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `config` | [components.GuardrailModerationPolicyConfig](../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | +| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | +| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `policy_type` | [components.CreateModerationGuardrailPolicyRequestPolicyType](../components/createmoderationguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/updatebudgetguardrailpolicyrequest.mdx b/docs/components/updatebudgetguardrailpolicyrequest.mdx index 9d0aae756..68aff39c7 100644 --- a/docs/components/updatebudgetguardrailpolicyrequest.mdx +++ b/docs/components/updatebudgetguardrailpolicyrequest.mdx @@ -4,13 +4,13 @@ title: "UpdateBudgetGuardrailPolicyRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | -| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | -| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | +| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | +| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/updatemodelavailabilityguardrailpolicyrequest.mdx b/docs/components/updatemodelavailabilityguardrailpolicyrequest.mdx index 46261200d..cfe8d6c6d 100644 --- a/docs/components/updatemodelavailabilityguardrailpolicyrequest.mdx +++ b/docs/components/updatemodelavailabilityguardrailpolicyrequest.mdx @@ -13,4 +13,4 @@ title: "UpdateModelAvailabilityGuardrailPolicyRequest" | `name` | *str* | ✔️ | Policy name | Engineering monthly budget | | `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | | `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/updatemoderationguardrailpolicyrequest.mdx b/docs/components/updatemoderationguardrailpolicyrequest.mdx index c39a57e70..a6369339c 100644 --- a/docs/components/updatemoderationguardrailpolicyrequest.mdx +++ b/docs/components/updatemoderationguardrailpolicyrequest.mdx @@ -4,13 +4,13 @@ title: "UpdateModerationGuardrailPolicyRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `config` | [components.GuardrailModerationPolicyConfig](../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | -| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | -| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `config` | [components.GuardrailModerationPolicyConfig](../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | +| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | +| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/deletebudgetpolicyrequest.mdx b/docs/operations/deletebudgetpolicyrequest.mdx index 44e320de4..1e8d5768e 100644 --- a/docs/operations/deletebudgetpolicyrequest.mdx +++ b/docs/operations/deletebudgetpolicyrequest.mdx @@ -4,10 +4,10 @@ title: "DeleteBudgetPolicyRequest" ## 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* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/deletemodelavailabilitypolicyrequest.mdx b/docs/operations/deletemodelavailabilitypolicyrequest.mdx index a86e140f8..049f1d2de 100644 --- a/docs/operations/deletemodelavailabilitypolicyrequest.mdx +++ b/docs/operations/deletemodelavailabilitypolicyrequest.mdx @@ -4,10 +4,10 @@ title: "DeleteModelAvailabilityPolicyRequest" ## 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* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/deletemoderationpolicyrequest.mdx b/docs/operations/deletemoderationpolicyrequest.mdx index 8532fcc74..673b0e007 100644 --- a/docs/operations/deletemoderationpolicyrequest.mdx +++ b/docs/operations/deletemoderationpolicyrequest.mdx @@ -4,10 +4,10 @@ title: "DeleteModerationPolicyRequest" ## 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* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/getapikeypolicyassignmentrequest.mdx b/docs/operations/getapikeypolicyassignmentrequest.mdx index 7a431538d..74e3988cd 100644 --- a/docs/operations/getapikeypolicyassignmentrequest.mdx +++ b/docs/operations/getapikeypolicyassignmentrequest.mdx @@ -4,11 +4,11 @@ title: "GetAPIKeyPolicyAssignmentRequest" ## 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.
| | -| `hash` | *str* | ✔️ | API key hash | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `policy_type` | [operations.GetAPIKeyPolicyAssignmentPolicyType](../operations/getapikeypolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | \ 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.
| | +| `hash` | *str* | ✔️ | API key hash | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `policy_type` | [operations.GetAPIKeyPolicyAssignmentPolicyType](../operations/getapikeypolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | \ No newline at end of file diff --git a/docs/operations/getbudgetpolicyrequest.mdx b/docs/operations/getbudgetpolicyrequest.mdx index 53da1b872..240119ab4 100644 --- a/docs/operations/getbudgetpolicyrequest.mdx +++ b/docs/operations/getbudgetpolicyrequest.mdx @@ -4,10 +4,10 @@ title: "GetBudgetPolicyRequest" ## 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* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/getmemberpolicyassignmentrequest.mdx b/docs/operations/getmemberpolicyassignmentrequest.mdx index dee837e8c..4d0d20924 100644 --- a/docs/operations/getmemberpolicyassignmentrequest.mdx +++ b/docs/operations/getmemberpolicyassignmentrequest.mdx @@ -4,11 +4,11 @@ title: "GetMemberPolicyAssignmentRequest" ## 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.
| | -| `member_id` | *str* | ✔️ | Organization member user ID | user_2abcDEFghiJKLmnoPQRstu | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `policy_type` | [operations.GetMemberPolicyAssignmentPolicyType](../operations/getmemberpolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | \ 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.
| | +| `member_id` | *str* | ✔️ | Organization member user ID | user_2abcDEFghiJKLmnoPQRstu | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `policy_type` | [operations.GetMemberPolicyAssignmentPolicyType](../operations/getmemberpolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | \ No newline at end of file diff --git a/docs/operations/getmodelavailabilitypolicyrequest.mdx b/docs/operations/getmodelavailabilitypolicyrequest.mdx index 77afcf905..849e9403a 100644 --- a/docs/operations/getmodelavailabilitypolicyrequest.mdx +++ b/docs/operations/getmodelavailabilitypolicyrequest.mdx @@ -4,10 +4,10 @@ title: "GetModelAvailabilityPolicyRequest" ## 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* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/getmoderationpolicyrequest.mdx b/docs/operations/getmoderationpolicyrequest.mdx index 002e39ad6..d9ac79bf0 100644 --- a/docs/operations/getmoderationpolicyrequest.mdx +++ b/docs/operations/getmoderationpolicyrequest.mdx @@ -4,10 +4,10 @@ title: "GetModerationPolicyRequest" ## 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* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/listbudgetpoliciesrequest.mdx b/docs/operations/listbudgetpoliciesrequest.mdx index 27212a740..888106fd1 100644 --- a/docs/operations/listbudgetpoliciesrequest.mdx +++ b/docs/operations/listbudgetpoliciesrequest.mdx @@ -4,11 +4,11 @@ title: "ListBudgetPoliciesRequest" ## 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.
| | -| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/listkeyassignmentsrequest.mdx b/docs/operations/listkeyassignmentsrequest.mdx index 31080be44..2176af660 100644 --- a/docs/operations/listkeyassignmentsrequest.mdx +++ b/docs/operations/listkeyassignmentsrequest.mdx @@ -4,10 +4,11 @@ title: "ListKeyAssignmentsRequest" ## 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.
| | -| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | \ 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.
| | +| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/listmemberassignmentsrequest.mdx b/docs/operations/listmemberassignmentsrequest.mdx index e0c6b6afb..cd87f7607 100644 --- a/docs/operations/listmemberassignmentsrequest.mdx +++ b/docs/operations/listmemberassignmentsrequest.mdx @@ -4,10 +4,11 @@ title: "ListMemberAssignmentsRequest" ## 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.
| | -| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | \ 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.
| | +| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/listmodelavailabilitypoliciesrequest.mdx b/docs/operations/listmodelavailabilitypoliciesrequest.mdx index 7158e2ca1..27af59a82 100644 --- a/docs/operations/listmodelavailabilitypoliciesrequest.mdx +++ b/docs/operations/listmodelavailabilitypoliciesrequest.mdx @@ -4,11 +4,11 @@ title: "ListModelAvailabilityPoliciesRequest" ## 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.
| | -| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/listmoderationpoliciesrequest.mdx b/docs/operations/listmoderationpoliciesrequest.mdx index 9de40c805..4eef614f9 100644 --- a/docs/operations/listmoderationpoliciesrequest.mdx +++ b/docs/operations/listmoderationpoliciesrequest.mdx @@ -4,11 +4,11 @@ title: "ListModerationPoliciesRequest" ## 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.
| | -| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ 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.
| | +| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/operations/updatekeysrequestbody.mdx b/docs/operations/updatekeysrequestbody.mdx index 9cf47d247..25cb4d0e1 100644 --- a/docs/operations/updatekeysrequestbody.mdx +++ b/docs/operations/updatekeysrequestbody.mdx @@ -4,11 +4,11 @@ title: "UpdateKeysRequestBody" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `disabled` | *Optional[bool]* | ➖ | Whether to disable the API key | false | -| `include_byok_in_limit` | *Optional[bool]* | ➖ | Whether to include BYOK usage in the limit | true | -| `limit` | *OptionalNullable[float]* | ➖ | New spending limit for the API key in USD | 75 | -| `limit_reset` | [OptionalNullable[operations.UpdateKeysLimitReset]](../operations/updatekeyslimitreset.mdx) | ➖ | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily | -| `name` | *Optional[str]* | ➖ | New name for the API key | Updated API Key Name | -| `workspace_id` | *Optional[str]* | ➖ | Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `disabled` | *Optional[bool]* | ➖ | Whether to disable the API key | false | +| `include_byok_in_limit` | *Optional[bool]* | ➖ | Whether to include BYOK usage in the limit | true | +| `limit` | *OptionalNullable[float]* | ➖ | New spending limit for the API key in USD | 75 | +| `limit_reset` | [OptionalNullable[operations.UpdateKeysLimitReset]](../operations/updatekeyslimitreset.mdx) | ➖ | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily | +| `name` | *Optional[str]* | ➖ | New name for the API key | Updated API Key Name | +| `workspace_id` | *Optional[str]* | ➖ | Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key's current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/sdks/apikeys/README.mdx b/docs/sdks/apikeys/README.mdx index 2f4950880..c57d9d064 100644 --- a/docs/sdks/apikeys/README.mdx +++ b/docs/sdks/apikeys/README.mdx @@ -329,19 +329,19 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `hash` | *str* | ✔️ | The hash identifier of the API key to update | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | -| `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.
| | -| `disabled` | *Optional[bool]* | ➖ | Whether to disable the API key | false | -| `include_byok_in_limit` | *Optional[bool]* | ➖ | Whether to include BYOK usage in the limit | true | -| `limit` | *OptionalNullable[float]* | ➖ | New spending limit for the API key in USD | 75 | -| `limit_reset` | [OptionalNullable[operations.UpdateKeysLimitReset]](../../operations/updatekeyslimitreset.mdx) | ➖ | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily | -| `name` | *Optional[str]* | ➖ | New name for the API key | Updated API Key Name | -| `workspace_id` | *Optional[str]* | ➖ | Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `hash` | *str* | ✔️ | The hash identifier of the API key to update | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | +| `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.
| | +| `disabled` | *Optional[bool]* | ➖ | Whether to disable the API key | false | +| `include_byok_in_limit` | *Optional[bool]* | ➖ | Whether to include BYOK usage in the limit | true | +| `limit` | *OptionalNullable[float]* | ➖ | New spending limit for the API key in USD | 75 | +| `limit_reset` | [OptionalNullable[operations.UpdateKeysLimitReset]](../../operations/updatekeyslimitreset.mdx) | ➖ | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily | +| `name` | *Optional[str]* | ➖ | New name for the API key | Updated API Key Name | +| `workspace_id` | *Optional[str]* | ➖ | Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key's current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/endpoints/README.mdx b/docs/sdks/endpoints/README.mdx index 1ddfabeb0..5051e5215 100644 --- a/docs/sdks/endpoints/README.mdx +++ b/docs/sdks/endpoints/README.mdx @@ -54,6 +54,7 @@ with OpenRouter( | Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.ServiceUnavailableResponseError | 503 | application/json | @@ -103,6 +104,7 @@ with OpenRouter( | Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | diff --git a/docs/sdks/guardrailpolicies/README.mdx b/docs/sdks/guardrailpolicies/README.mdx index 0fa8a42f9..04af1956a 100644 --- a/docs/sdks/guardrailpolicies/README.mdx +++ b/docs/sdks/guardrailpolicies/README.mdx @@ -274,7 +274,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrail_policies.get_api_key_policy_assignment(hash="c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11", policy_type="budget") + res = open_router.guardrail_policies.get_api_key_policy_assignment(hash="c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", policy_type="budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") # Handle response print(res) @@ -283,15 +283,15 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `hash` | *str* | ✔️ | API key hash | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `policy_type` | [operations.GetAPIKeyPolicyAssignmentPolicyType](../../operations/getapikeypolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `hash` | *str* | ✔️ | API key hash | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | +| `policy_type` | [operations.GetAPIKeyPolicyAssignmentPolicyType](../../operations/getapikeypolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -332,7 +332,7 @@ with OpenRouter( "workspace_default_policy_ids": [ "2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90", ], - }, policy_id="550e8400-e29b-41d4-a716-446655440000", policy_type="budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + }, policy_id="550e8400-e29b-41d4-a716-446655440000", policy_type="budget") # Handle response print(res) @@ -341,18 +341,18 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `hash` | *str* | ✔️ | API key hash | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | -| `assigned` | *bool* | ✔️ | `true` assigns the policy to the subject, `false` removes it | true | -| `expected_assignment` | [components.GuardrailPolicyAssignmentState](../../components/guardrailpolicyassignmentstate.mdx) | ✔️ | N/A | | -| `policy_id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `policy_type` | [components.ChangeGuardrailPolicyAssignmentRequestPolicyType](../../components/changeguardrailpolicyassignmentrequestpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `hash` | *str* | ✔️ | API key hash | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | +| `assigned` | *bool* | ✔️ | `true` assigns the policy to the subject, `false` removes it | true | +| `expected_assignment` | [components.GuardrailPolicyAssignmentState](../../components/guardrailpolicyassignmentstate.mdx) | ✔️ | N/A | | +| `policy_id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `policy_type` | [components.ChangeGuardrailPolicyAssignmentRequestPolicyType](../../components/changeguardrailpolicyassignmentrequestpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -388,7 +388,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrail_policies.get_member_policy_assignment(member_id="user_2abcDEFghiJKLmnoPQRstu", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11", policy_type="budget") + res = open_router.guardrail_policies.get_member_policy_assignment(member_id="user_2abcDEFghiJKLmnoPQRstu", policy_type="budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") # Handle response print(res) @@ -397,15 +397,15 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `member_id` | *str* | ✔️ | Organization member user ID | user_2abcDEFghiJKLmnoPQRstu | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `policy_type` | [operations.GetMemberPolicyAssignmentPolicyType](../../operations/getmemberpolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `member_id` | *str* | ✔️ | Organization member user ID | user_2abcDEFghiJKLmnoPQRstu | +| `policy_type` | [operations.GetMemberPolicyAssignmentPolicyType](../../operations/getmemberpolicyassignmentpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -446,7 +446,7 @@ with OpenRouter( "workspace_default_policy_ids": [ "2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90", ], - }, policy_id="550e8400-e29b-41d4-a716-446655440000", policy_type="budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + }, policy_id="550e8400-e29b-41d4-a716-446655440000", policy_type="budget") # Handle response print(res) @@ -455,18 +455,18 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `member_id` | *str* | ✔️ | Organization member user ID | user_2abcDEFghiJKLmnoPQRstu | -| `assigned` | *bool* | ✔️ | `true` assigns the policy to the subject, `false` removes it | true | -| `expected_assignment` | [components.GuardrailPolicyAssignmentState](../../components/guardrailpolicyassignmentstate.mdx) | ✔️ | N/A | | -| `policy_id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `policy_type` | [components.ChangeGuardrailPolicyAssignmentRequestPolicyType](../../components/changeguardrailpolicyassignmentrequestpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `member_id` | *str* | ✔️ | Organization member user ID | user_2abcDEFghiJKLmnoPQRstu | +| `assigned` | *bool* | ✔️ | `true` assigns the policy to the subject, `false` removes it | true | +| `expected_assignment` | [components.GuardrailPolicyAssignmentState](../../components/guardrailpolicyassignmentstate.mdx) | ✔️ | N/A | | +| `policy_id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `policy_type` | [components.ChangeGuardrailPolicyAssignmentRequestPolicyType](../../components/changeguardrailpolicyassignmentrequestpolicytype.mdx) | ✔️ | Policy type the assignment is read or changed for | budget | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -513,15 +513,15 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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.
| | -| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | 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.
| | +| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -560,7 +560,7 @@ with OpenRouter( "include_byok_in_budgets": False, "limit_usd": 200.0, "reset_interval": "monthly", - }, name="Engineering monthly budget", policy_type="budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + }, name="Engineering monthly budget", policy_type="budget") # Handle response print(res) @@ -569,21 +569,21 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `policy_type` | [components.CreateBudgetGuardrailPolicyRequestPolicyType](../../components/createbudgetguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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.
| | -| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | -| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `policy_type` | [components.CreateBudgetGuardrailPolicyRequestPolicyType](../../components/createbudgetguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | +| `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.
| | +| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | +| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -628,14 +628,14 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -680,14 +680,14 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -726,7 +726,7 @@ with OpenRouter( "include_byok_in_budgets": False, "limit_usd": 200.0, "reset_interval": "monthly", - }, name="Engineering monthly budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + }, name="Engineering monthly budget") # Handle response print(res) @@ -735,21 +735,21 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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.
| | -| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | -| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `config` | [components.GuardrailBudgetPolicyAuthoringConfig](../../components/guardrailbudgetpolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
} | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `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.
| | +| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | +| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -796,15 +796,15 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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.
| | -| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | 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.
| | +| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -839,7 +839,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrail_policies.create_model_availability_policy(config={}, name="Engineering monthly budget", policy_type="model_availability", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + res = open_router.guardrail_policies.create_model_availability_policy(config={}, name="Engineering monthly budget", policy_type="model_availability") # Handle response print(res) @@ -853,7 +853,6 @@ with OpenRouter( | `config` | [components.GuardrailModelAvailabilityPolicyAuthoringConfig](../../components/guardrailmodelavailabilitypolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"allowed_models": [
"openai/gpt-4o",
"anthropic/claude-sonnet-4"
],
"allowed_providers": [
"openai",
"anthropic"
],
"enforce_zdr_anthropic": true,
"enforce_zdr_openai": true
} | | `name` | *str* | ✔️ | Policy name | Engineering monthly budget | | `policy_type` | [components.CreateModelAvailabilityGuardrailPolicyRequestPolicyType](../../components/createmodelavailabilityguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | | `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.
| | @@ -862,6 +861,7 @@ with OpenRouter( | `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | | `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | | `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -907,14 +907,14 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -959,14 +959,14 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -1001,7 +1001,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrail_policies.update_model_availability_policy(id="550e8400-e29b-41d4-a716-446655440000", config={}, name="Engineering monthly budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + res = open_router.guardrail_policies.update_model_availability_policy(id="550e8400-e29b-41d4-a716-446655440000", config={}, name="Engineering monthly budget") # Handle response print(res) @@ -1015,7 +1015,6 @@ with OpenRouter( | `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | | `config` | [components.GuardrailModelAvailabilityPolicyAuthoringConfig](../../components/guardrailmodelavailabilitypolicyauthoringconfig.mdx) | ✔️ | N/A | \{
"allowed_models": [
"openai/gpt-4o",
"anthropic/claude-sonnet-4"
],
"allowed_providers": [
"openai",
"anthropic"
],
"enforce_zdr_anthropic": true,
"enforce_zdr_openai": true
} | | `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | | `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.
| | @@ -1024,6 +1023,7 @@ with OpenRouter( | `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | | `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | | `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -1071,15 +1071,15 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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.
| | -| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | 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.
| | +| `offset` | *Optional[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -1114,7 +1114,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrail_policies.create_moderation_policy(config=components.GuardrailModerationPolicyConfig(), name="Engineering monthly budget", policy_type="moderation", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + res = open_router.guardrail_policies.create_moderation_policy(config=components.GuardrailModerationPolicyConfig(), name="Engineering monthly budget", policy_type="moderation") # Handle response print(res) @@ -1123,21 +1123,21 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `config` | [components.GuardrailModerationPolicyConfig](../../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `policy_type` | [components.CreateModerationGuardrailPolicyRequestPolicyType](../../components/createmoderationguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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.
| | -| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | -| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `config` | [components.GuardrailModerationPolicyConfig](../../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `policy_type` | [components.CreateModerationGuardrailPolicyRequestPolicyType](../../components/createmoderationguardrailpolicyrequestpolicytype.mdx) | ✔️ | N/A | | +| `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.
| | +| `api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `is_workspace_default` | *Optional[bool]* | ➖ | Make this the workspace default for its policy type. Defaults to `false`. | | +| `member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API keys that should not inherit the policy when it is the workspace default | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Members that should not inherit the policy when it is the workspace default | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -1182,14 +1182,14 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -1234,14 +1234,14 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `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.
| | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -1276,7 +1276,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrail_policies.update_moderation_policy(id="550e8400-e29b-41d4-a716-446655440000", config=components.GuardrailModerationPolicyConfig(), name="Engineering monthly budget", workspace_id="0df9e665-d932-5740-b2c7-b52af166bc11") + res = open_router.guardrail_policies.update_moderation_policy(id="550e8400-e29b-41d4-a716-446655440000", config=components.GuardrailModerationPolicyConfig(), name="Engineering monthly budget") # Handle response print(res) @@ -1285,21 +1285,21 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | -| `config` | [components.GuardrailModerationPolicyConfig](../../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | -| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | -| `workspace_id` | *str* | ✔️ | Workspace the policy belongs to | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `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.
| | -| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | -| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | -| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | Policy ID | 550e8400-e29b-41d4-a716-446655440000 | +| `config` | [components.GuardrailModerationPolicyConfig](../../components/guardrailmoderationpolicyconfig.mdx) | ✔️ | N/A | \{
"content_filter_builtins": [
\{
"action": "block",
"slug": "secrets"
}
]
} | +| `name` | *str* | ✔️ | Policy name | Engineering monthly budget | +| `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.
| | +| `api_key_hashes` | List[*str*] | ➖ | Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments. | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `is_workspace_default` | *Optional[bool]* | ➖ | Omit to keep the stored default status; `false` unsets the policy as the workspace default. | | +| `member_ids` | List[*str*] | ➖ | Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `opted_out_api_key_hashes` | List[*str*] | ➖ | API key hashes | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `opted_out_member_ids` | List[*str*] | ➖ | Organization member user IDs | [
"user_2abcDEFghiJKLmnoPQRstu"
] | +| `workspace_id` | *Optional[str]* | ➖ | Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/guardrails/README.mdx b/docs/sdks/guardrails/README.mdx index 19715d9b3..3f9669873 100644 --- a/docs/sdks/guardrails/README.mdx +++ b/docs/sdks/guardrails/README.mdx @@ -677,14 +677,15 @@ with OpenRouter( ### Parameters -| Parameter | 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.
| | -| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | 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.
| | +| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -730,14 +731,15 @@ with OpenRouter( ### Parameters -| Parameter | 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.
| | -| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | -| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | 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.
| | +| `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination | 0 | +| `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 100) | 50 | +| `workspace_id` | *Optional[str]* | ➖ | Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/pyproject.toml b/pyproject.toml index 358d49fbc..012ac97d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.157" +version = "1.3.158" 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 3ac8b95c6..cb6ca0330 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.157" +__version__: str = "1.3.158" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.157 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.158 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/api_keys.py b/src/openrouter/api_keys.py index 73c16d709..9c0180614 100644 --- a/src/openrouter/api_keys.py +++ b/src/openrouter/api_keys.py @@ -1556,7 +1556,7 @@ def update( :param limit: New spending limit for the API key in USD :param limit_reset: New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. :param name: New name for the API key - :param workspace_id: Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. + :param workspace_id: Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key's current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. :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 @@ -1737,7 +1737,7 @@ async def update_async( :param limit: New spending limit for the API key in USD :param limit_reset: New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. :param name: New name for the API key - :param workspace_id: Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. + :param workspace_id: Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key's current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op. :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 diff --git a/src/openrouter/components/changeguardrailpolicyassignmentrequest.py b/src/openrouter/components/changeguardrailpolicyassignmentrequest.py index 27381f637..7ecc46a11 100644 --- a/src/openrouter/components/changeguardrailpolicyassignmentrequest.py +++ b/src/openrouter/components/changeguardrailpolicyassignmentrequest.py @@ -5,9 +5,10 @@ GuardrailPolicyAssignmentState, GuardrailPolicyAssignmentStateTypedDict, ) -from openrouter.types import BaseModel, UnrecognizedStr -from typing import Literal, Union -from typing_extensions import TypedDict +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict ChangeGuardrailPolicyAssignmentRequestPolicyType = Union[ @@ -30,8 +31,8 @@ class ChangeGuardrailPolicyAssignmentRequestTypedDict(TypedDict): r"""Policy ID""" policy_type: ChangeGuardrailPolicyAssignmentRequestPolicyType r"""Policy type the assignment is read or changed for""" - workspace_id: str - r"""Workspace the policy belongs to""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class ChangeGuardrailPolicyAssignmentRequest(BaseModel): @@ -46,5 +47,21 @@ class ChangeGuardrailPolicyAssignmentRequest(BaseModel): policy_type: ChangeGuardrailPolicyAssignmentRequestPolicyType r"""Policy type the assignment is read or changed for""" - workspace_id: str - r"""Workspace the policy belongs to""" + workspace_id: Optional[str] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["workspace_id"]) + 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/createbudgetguardrailpolicyrequest.py b/src/openrouter/components/createbudgetguardrailpolicyrequest.py index 57c04236f..1baab50ee 100644 --- a/src/openrouter/components/createbudgetguardrailpolicyrequest.py +++ b/src/openrouter/components/createbudgetguardrailpolicyrequest.py @@ -19,8 +19,6 @@ class CreateBudgetGuardrailPolicyRequestTypedDict(TypedDict): name: str r"""Policy name""" policy_type: CreateBudgetGuardrailPolicyRequestPolicyType - workspace_id: str - r"""Workspace the policy belongs to""" api_key_hashes: NotRequired[List[str]] r"""API key hashes""" is_workspace_default: NotRequired[bool] @@ -31,6 +29,8 @@ class CreateBudgetGuardrailPolicyRequestTypedDict(TypedDict): r"""API keys that should not inherit the policy when it is the workspace default""" opted_out_member_ids: NotRequired[List[str]] r"""Members that should not inherit the policy when it is the workspace default""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class CreateBudgetGuardrailPolicyRequest(BaseModel): @@ -41,9 +41,6 @@ class CreateBudgetGuardrailPolicyRequest(BaseModel): policy_type: CreateBudgetGuardrailPolicyRequestPolicyType - workspace_id: str - r"""Workspace the policy belongs to""" - api_key_hashes: Optional[List[str]] = None r"""API key hashes""" @@ -59,6 +56,9 @@ class CreateBudgetGuardrailPolicyRequest(BaseModel): opted_out_member_ids: Optional[List[str]] = None r"""Members that should not inherit the policy when it is the workspace default""" + workspace_id: Optional[str] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -68,6 +68,7 @@ def serialize_model(self, handler): "member_ids", "opted_out_api_key_hashes", "opted_out_member_ids", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/components/createmodelavailabilityguardrailpolicyrequest.py b/src/openrouter/components/createmodelavailabilityguardrailpolicyrequest.py index a5935ebd0..8a28539e0 100644 --- a/src/openrouter/components/createmodelavailabilityguardrailpolicyrequest.py +++ b/src/openrouter/components/createmodelavailabilityguardrailpolicyrequest.py @@ -19,8 +19,6 @@ class CreateModelAvailabilityGuardrailPolicyRequestTypedDict(TypedDict): name: str r"""Policy name""" policy_type: CreateModelAvailabilityGuardrailPolicyRequestPolicyType - workspace_id: str - r"""Workspace the policy belongs to""" api_key_hashes: NotRequired[List[str]] r"""API key hashes""" is_workspace_default: NotRequired[bool] @@ -31,6 +29,8 @@ class CreateModelAvailabilityGuardrailPolicyRequestTypedDict(TypedDict): r"""API keys that should not inherit the policy when it is the workspace default""" opted_out_member_ids: NotRequired[List[str]] r"""Members that should not inherit the policy when it is the workspace default""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class CreateModelAvailabilityGuardrailPolicyRequest(BaseModel): @@ -41,9 +41,6 @@ class CreateModelAvailabilityGuardrailPolicyRequest(BaseModel): policy_type: CreateModelAvailabilityGuardrailPolicyRequestPolicyType - workspace_id: str - r"""Workspace the policy belongs to""" - api_key_hashes: Optional[List[str]] = None r"""API key hashes""" @@ -59,6 +56,9 @@ class CreateModelAvailabilityGuardrailPolicyRequest(BaseModel): opted_out_member_ids: Optional[List[str]] = None r"""Members that should not inherit the policy when it is the workspace default""" + workspace_id: Optional[str] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -68,6 +68,7 @@ def serialize_model(self, handler): "member_ids", "opted_out_api_key_hashes", "opted_out_member_ids", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/components/createmoderationguardrailpolicyrequest.py b/src/openrouter/components/createmoderationguardrailpolicyrequest.py index 0266b86d7..5a1db586e 100644 --- a/src/openrouter/components/createmoderationguardrailpolicyrequest.py +++ b/src/openrouter/components/createmoderationguardrailpolicyrequest.py @@ -19,8 +19,6 @@ class CreateModerationGuardrailPolicyRequestTypedDict(TypedDict): name: str r"""Policy name""" policy_type: CreateModerationGuardrailPolicyRequestPolicyType - workspace_id: str - r"""Workspace the policy belongs to""" api_key_hashes: NotRequired[List[str]] r"""API key hashes""" is_workspace_default: NotRequired[bool] @@ -31,6 +29,8 @@ class CreateModerationGuardrailPolicyRequestTypedDict(TypedDict): r"""API keys that should not inherit the policy when it is the workspace default""" opted_out_member_ids: NotRequired[List[str]] r"""Members that should not inherit the policy when it is the workspace default""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class CreateModerationGuardrailPolicyRequest(BaseModel): @@ -41,9 +41,6 @@ class CreateModerationGuardrailPolicyRequest(BaseModel): policy_type: CreateModerationGuardrailPolicyRequestPolicyType - workspace_id: str - r"""Workspace the policy belongs to""" - api_key_hashes: Optional[List[str]] = None r"""API key hashes""" @@ -59,6 +56,9 @@ class CreateModerationGuardrailPolicyRequest(BaseModel): opted_out_member_ids: Optional[List[str]] = None r"""Members that should not inherit the policy when it is the workspace default""" + workspace_id: Optional[str] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -68,6 +68,7 @@ def serialize_model(self, handler): "member_ids", "opted_out_api_key_hashes", "opted_out_member_ids", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/components/updatebudgetguardrailpolicyrequest.py b/src/openrouter/components/updatebudgetguardrailpolicyrequest.py index c85421a39..426fd8de3 100644 --- a/src/openrouter/components/updatebudgetguardrailpolicyrequest.py +++ b/src/openrouter/components/updatebudgetguardrailpolicyrequest.py @@ -15,8 +15,6 @@ class UpdateBudgetGuardrailPolicyRequestTypedDict(TypedDict): config: GuardrailBudgetPolicyAuthoringConfigTypedDict name: str r"""Policy name""" - workspace_id: str - r"""Workspace the policy belongs to""" api_key_hashes: NotRequired[List[str]] r"""Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.""" is_workspace_default: NotRequired[bool] @@ -27,6 +25,8 @@ class UpdateBudgetGuardrailPolicyRequestTypedDict(TypedDict): r"""API key hashes""" opted_out_member_ids: NotRequired[List[str]] r"""Organization member user IDs""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class UpdateBudgetGuardrailPolicyRequest(BaseModel): @@ -35,9 +35,6 @@ class UpdateBudgetGuardrailPolicyRequest(BaseModel): name: str r"""Policy name""" - workspace_id: str - r"""Workspace the policy belongs to""" - api_key_hashes: Optional[List[str]] = None r"""Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.""" @@ -53,6 +50,9 @@ class UpdateBudgetGuardrailPolicyRequest(BaseModel): opted_out_member_ids: Optional[List[str]] = None r"""Organization member user IDs""" + workspace_id: Optional[str] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -62,6 +62,7 @@ def serialize_model(self, handler): "member_ids", "opted_out_api_key_hashes", "opted_out_member_ids", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/components/updatemodelavailabilityguardrailpolicyrequest.py b/src/openrouter/components/updatemodelavailabilityguardrailpolicyrequest.py index 761d47a3b..9f9d16972 100644 --- a/src/openrouter/components/updatemodelavailabilityguardrailpolicyrequest.py +++ b/src/openrouter/components/updatemodelavailabilityguardrailpolicyrequest.py @@ -15,8 +15,6 @@ class UpdateModelAvailabilityGuardrailPolicyRequestTypedDict(TypedDict): config: GuardrailModelAvailabilityPolicyAuthoringConfigTypedDict name: str r"""Policy name""" - workspace_id: str - r"""Workspace the policy belongs to""" api_key_hashes: NotRequired[List[str]] r"""Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.""" is_workspace_default: NotRequired[bool] @@ -27,6 +25,8 @@ class UpdateModelAvailabilityGuardrailPolicyRequestTypedDict(TypedDict): r"""API key hashes""" opted_out_member_ids: NotRequired[List[str]] r"""Organization member user IDs""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class UpdateModelAvailabilityGuardrailPolicyRequest(BaseModel): @@ -35,9 +35,6 @@ class UpdateModelAvailabilityGuardrailPolicyRequest(BaseModel): name: str r"""Policy name""" - workspace_id: str - r"""Workspace the policy belongs to""" - api_key_hashes: Optional[List[str]] = None r"""Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.""" @@ -53,6 +50,9 @@ class UpdateModelAvailabilityGuardrailPolicyRequest(BaseModel): opted_out_member_ids: Optional[List[str]] = None r"""Organization member user IDs""" + workspace_id: Optional[str] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -62,6 +62,7 @@ def serialize_model(self, handler): "member_ids", "opted_out_api_key_hashes", "opted_out_member_ids", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/components/updatemoderationguardrailpolicyrequest.py b/src/openrouter/components/updatemoderationguardrailpolicyrequest.py index ddfa0c4e3..b5b3c434b 100644 --- a/src/openrouter/components/updatemoderationguardrailpolicyrequest.py +++ b/src/openrouter/components/updatemoderationguardrailpolicyrequest.py @@ -15,8 +15,6 @@ class UpdateModerationGuardrailPolicyRequestTypedDict(TypedDict): config: GuardrailModerationPolicyConfigTypedDict name: str r"""Policy name""" - workspace_id: str - r"""Workspace the policy belongs to""" api_key_hashes: NotRequired[List[str]] r"""Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.""" is_workspace_default: NotRequired[bool] @@ -27,6 +25,8 @@ class UpdateModerationGuardrailPolicyRequestTypedDict(TypedDict): r"""API key hashes""" opted_out_member_ids: NotRequired[List[str]] r"""Organization member user IDs""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class UpdateModerationGuardrailPolicyRequest(BaseModel): @@ -35,9 +35,6 @@ class UpdateModerationGuardrailPolicyRequest(BaseModel): name: str r"""Policy name""" - workspace_id: str - r"""Workspace the policy belongs to""" - api_key_hashes: Optional[List[str]] = None r"""Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.""" @@ -53,6 +50,9 @@ class UpdateModerationGuardrailPolicyRequest(BaseModel): opted_out_member_ids: Optional[List[str]] = None r"""Organization member user IDs""" + workspace_id: Optional[str] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -62,6 +62,7 @@ def serialize_model(self, handler): "member_ids", "opted_out_api_key_hashes", "opted_out_member_ids", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/endpoints.py b/src/openrouter/endpoints.py index 2242260aa..6597bc3d0 100644 --- a/src/openrouter/endpoints.py +++ b/src/openrouter/endpoints.py @@ -109,6 +109,11 @@ def list_zdr_endpoints( return unmarshal_json_response( operations.ListEndpointsZdrResponse, 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 @@ -234,6 +239,11 @@ async def list_zdr_endpoints_async( return unmarshal_json_response( operations.ListEndpointsZdrResponse, 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 @@ -363,6 +373,11 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return unmarshal_json_response(operations.ListEndpointsResponse, 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 @@ -497,6 +512,11 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return unmarshal_json_response(operations.ListEndpointsResponse, 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 diff --git a/src/openrouter/guardrail_policies.py b/src/openrouter/guardrail_policies.py index 9f5800f27..b2b812577 100644 --- a/src/openrouter/guardrail_policies.py +++ b/src/openrouter/guardrail_policies.py @@ -1294,11 +1294,11 @@ def get_api_key_policy_assignment( self, *, hash: str, - workspace_id: str, policy_type: operations.GetAPIKeyPolicyAssignmentPolicyType, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1309,7 +1309,6 @@ def get_api_key_policy_assignment( Get the policies of one type that apply to an API key in a workspace. Requires a management key with write access. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param hash: API key hash - :param workspace_id: Workspace the policy belongs to :param policy_type: Policy type the assignment is read or changed for :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. @@ -1318,6 +1317,7 @@ def get_api_key_policy_assignment( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -1440,11 +1440,11 @@ async def get_api_key_policy_assignment_async( self, *, hash: str, - workspace_id: str, policy_type: operations.GetAPIKeyPolicyAssignmentPolicyType, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1455,7 +1455,6 @@ async def get_api_key_policy_assignment_async( Get the policies of one type that apply to an API key in a workspace. Requires a management key with write access. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param hash: API key hash - :param workspace_id: Workspace the policy belongs to :param policy_type: Policy type the assignment is read or changed for :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. @@ -1464,6 +1463,7 @@ async def get_api_key_policy_assignment_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -1593,10 +1593,10 @@ def change_api_key_policy_assignment( ], policy_id: str, policy_type: components.ChangeGuardrailPolicyAssignmentRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1611,7 +1611,6 @@ def change_api_key_policy_assignment( :param expected_assignment: :param policy_id: Policy ID :param policy_type: Policy type the assignment is read or changed for - :param workspace_id: Workspace the policy belongs to :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. @@ -1619,6 +1618,7 @@ def change_api_key_policy_assignment( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -1767,10 +1767,10 @@ async def change_api_key_policy_assignment_async( ], policy_id: str, policy_type: components.ChangeGuardrailPolicyAssignmentRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1785,7 +1785,6 @@ async def change_api_key_policy_assignment_async( :param expected_assignment: :param policy_id: Policy ID :param policy_type: Policy type the assignment is read or changed for - :param workspace_id: Workspace the policy belongs to :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. @@ -1793,6 +1792,7 @@ async def change_api_key_policy_assignment_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -1934,11 +1934,11 @@ def get_member_policy_assignment( self, *, member_id: str, - workspace_id: str, policy_type: operations.GetMemberPolicyAssignmentPolicyType, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1949,7 +1949,6 @@ def get_member_policy_assignment( Get the policies of one type that apply to a member in a workspace. Requires a management key with write access. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param member_id: Organization member user ID - :param workspace_id: Workspace the policy belongs to :param policy_type: Policy type the assignment is read or changed for :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. @@ -1958,6 +1957,7 @@ def get_member_policy_assignment( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -2080,11 +2080,11 @@ async def get_member_policy_assignment_async( self, *, member_id: str, - workspace_id: str, policy_type: operations.GetMemberPolicyAssignmentPolicyType, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2095,7 +2095,6 @@ async def get_member_policy_assignment_async( Get the policies of one type that apply to a member in a workspace. Requires a management key with write access. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param member_id: Organization member user ID - :param workspace_id: Workspace the policy belongs to :param policy_type: Policy type the assignment is read or changed for :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. @@ -2104,6 +2103,7 @@ async def get_member_policy_assignment_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -2233,10 +2233,10 @@ def change_member_policy_assignment( ], policy_id: str, policy_type: components.ChangeGuardrailPolicyAssignmentRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2251,7 +2251,6 @@ def change_member_policy_assignment( :param expected_assignment: :param policy_id: Policy ID :param policy_type: Policy type the assignment is read or changed for - :param workspace_id: Workspace the policy belongs to :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. @@ -2259,6 +2258,7 @@ def change_member_policy_assignment( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -2407,10 +2407,10 @@ async def change_member_policy_assignment_async( ], policy_id: str, policy_type: components.ChangeGuardrailPolicyAssignmentRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2425,7 +2425,6 @@ async def change_member_policy_assignment_async( :param expected_assignment: :param policy_id: Policy ID :param policy_type: Policy type the assignment is read or changed for - :param workspace_id: Workspace the policy belongs to :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. @@ -2433,6 +2432,7 @@ async def change_member_policy_assignment_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -2573,12 +2573,12 @@ async def change_member_policy_assignment_async( def list_budget_policies( self, *, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2588,7 +2588,6 @@ def list_budget_policies( List the budget policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :param workspace_id: Workspace the policy belongs to :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. @@ -2598,6 +2597,7 @@ def list_budget_policies( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :param limit: Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -2689,12 +2689,12 @@ def next_func() -> Optional[operations.ListBudgetPoliciesResponse]: next_offset = offset + len(results[0]) return self.list_budget_policies( - workspace_id=workspace_id, http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -2750,12 +2750,12 @@ def next_func() -> Optional[operations.ListBudgetPoliciesResponse]: async def list_budget_policies_async( self, *, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2765,7 +2765,6 @@ async def list_budget_policies_async( List the budget policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :param workspace_id: Workspace the policy belongs to :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. @@ -2775,6 +2774,7 @@ async def list_budget_policies_async( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :param limit: Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -2869,12 +2869,12 @@ async def empty_result(): next_offset = offset + len(results[0]) return self.list_budget_policies_async( - workspace_id=workspace_id, http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -2936,7 +2936,6 @@ def create_budget_policy( ], name: str, policy_type: components.CreateBudgetGuardrailPolicyRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -2945,6 +2944,7 @@ def create_budget_policy( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2957,7 +2957,6 @@ def create_budget_policy( :param config: :param name: Policy name :param policy_type: - :param workspace_id: Workspace the policy belongs to :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. @@ -2970,6 +2969,7 @@ def create_budget_policy( :param member_ids: Organization member user IDs :param opted_out_api_key_hashes: API keys that should not inherit the policy when it is the workspace default :param opted_out_member_ids: Members that should not inherit the policy when it is the workspace default + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -3123,7 +3123,6 @@ async def create_budget_policy_async( ], name: str, policy_type: components.CreateBudgetGuardrailPolicyRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -3132,6 +3131,7 @@ async def create_budget_policy_async( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3144,7 +3144,6 @@ async def create_budget_policy_async( :param config: :param name: Policy name :param policy_type: - :param workspace_id: Workspace the policy belongs to :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. @@ -3157,6 +3156,7 @@ async def create_budget_policy_async( :param member_ids: Organization member user IDs :param opted_out_api_key_hashes: API keys that should not inherit the policy when it is the workspace default :param opted_out_member_ids: Members that should not inherit the policy when it is the workspace default + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -3305,10 +3305,10 @@ def delete_budget_policy( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3319,7 +3319,6 @@ def delete_budget_policy( Delete a budget policy. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -3327,6 +3326,7 @@ def delete_budget_policy( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -3453,10 +3453,10 @@ async def delete_budget_policy_async( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3467,7 +3467,6 @@ async def delete_budget_policy_async( Delete a budget policy. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -3475,6 +3474,7 @@ async def delete_budget_policy_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -3601,10 +3601,10 @@ def get_budget_policy( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3615,7 +3615,6 @@ def get_budget_policy( Get a budget policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -3623,6 +3622,7 @@ def get_budget_policy( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -3744,10 +3744,10 @@ async def get_budget_policy_async( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3758,7 +3758,6 @@ async def get_budget_policy_async( Get a budget policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -3766,6 +3765,7 @@ async def get_budget_policy_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -3892,7 +3892,6 @@ def update_budget_policy( components.GuardrailBudgetPolicyAuthoringConfigTypedDict, ], name: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -3901,6 +3900,7 @@ def update_budget_policy( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3913,7 +3913,6 @@ def update_budget_policy( :param id: Policy ID :param config: :param name: Policy name - :param workspace_id: Workspace the policy belongs to :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. @@ -3926,6 +3925,7 @@ def update_budget_policy( :param member_ids: Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. :param opted_out_api_key_hashes: API key hashes :param opted_out_member_ids: Organization member user IDs + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -4079,7 +4079,6 @@ async def update_budget_policy_async( components.GuardrailBudgetPolicyAuthoringConfigTypedDict, ], name: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -4088,6 +4087,7 @@ async def update_budget_policy_async( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4100,7 +4100,6 @@ async def update_budget_policy_async( :param id: Policy ID :param config: :param name: Policy name - :param workspace_id: Workspace the policy belongs to :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. @@ -4113,6 +4112,7 @@ async def update_budget_policy_async( :param member_ids: Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. :param opted_out_api_key_hashes: API key hashes :param opted_out_member_ids: Organization member user IDs + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -4260,12 +4260,12 @@ async def update_budget_policy_async( def list_model_availability_policies( self, *, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4275,7 +4275,6 @@ def list_model_availability_policies( List the model availability policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :param workspace_id: Workspace the policy belongs to :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. @@ -4285,6 +4284,7 @@ def list_model_availability_policies( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :param limit: Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -4376,12 +4376,12 @@ def next_func() -> Optional[operations.ListModelAvailabilityPoliciesResponse]: next_offset = offset + len(results[0]) return self.list_model_availability_policies( - workspace_id=workspace_id, http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -4437,12 +4437,12 @@ def next_func() -> Optional[operations.ListModelAvailabilityPoliciesResponse]: async def list_model_availability_policies_async( self, *, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4452,7 +4452,6 @@ async def list_model_availability_policies_async( List the model availability policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :param workspace_id: Workspace the policy belongs to :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. @@ -4462,6 +4461,7 @@ async def list_model_availability_policies_async( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :param limit: Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -4558,12 +4558,12 @@ async def empty_result(): next_offset = offset + len(results[0]) return self.list_model_availability_policies_async( - workspace_id=workspace_id, http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -4625,7 +4625,6 @@ def create_model_availability_policy( ], name: str, policy_type: components.CreateModelAvailabilityGuardrailPolicyRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -4634,6 +4633,7 @@ def create_model_availability_policy( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4646,7 +4646,6 @@ def create_model_availability_policy( :param config: :param name: Policy name :param policy_type: - :param workspace_id: Workspace the policy belongs to :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. @@ -4659,6 +4658,7 @@ def create_model_availability_policy( :param member_ids: Organization member user IDs :param opted_out_api_key_hashes: API keys that should not inherit the policy when it is the workspace default :param opted_out_member_ids: Members that should not inherit the policy when it is the workspace default + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -4812,7 +4812,6 @@ async def create_model_availability_policy_async( ], name: str, policy_type: components.CreateModelAvailabilityGuardrailPolicyRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -4821,6 +4820,7 @@ async def create_model_availability_policy_async( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4833,7 +4833,6 @@ async def create_model_availability_policy_async( :param config: :param name: Policy name :param policy_type: - :param workspace_id: Workspace the policy belongs to :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. @@ -4846,6 +4845,7 @@ async def create_model_availability_policy_async( :param member_ids: Organization member user IDs :param opted_out_api_key_hashes: API keys that should not inherit the policy when it is the workspace default :param opted_out_member_ids: Members that should not inherit the policy when it is the workspace default + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -4994,10 +4994,10 @@ def delete_model_availability_policy( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -5008,7 +5008,6 @@ def delete_model_availability_policy( Delete a model availability policy. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -5016,6 +5015,7 @@ def delete_model_availability_policy( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -5142,10 +5142,10 @@ async def delete_model_availability_policy_async( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -5156,7 +5156,6 @@ async def delete_model_availability_policy_async( Delete a model availability policy. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -5164,6 +5163,7 @@ async def delete_model_availability_policy_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -5290,10 +5290,10 @@ def get_model_availability_policy( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -5304,7 +5304,6 @@ def get_model_availability_policy( Get a model availability policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -5312,6 +5311,7 @@ def get_model_availability_policy( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -5433,10 +5433,10 @@ async def get_model_availability_policy_async( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -5447,7 +5447,6 @@ async def get_model_availability_policy_async( Get a model availability policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -5455,6 +5454,7 @@ async def get_model_availability_policy_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -5581,7 +5581,6 @@ def update_model_availability_policy( components.GuardrailModelAvailabilityPolicyAuthoringConfigTypedDict, ], name: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -5590,6 +5589,7 @@ def update_model_availability_policy( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -5602,7 +5602,6 @@ def update_model_availability_policy( :param id: Policy ID :param config: :param name: Policy name - :param workspace_id: Workspace the policy belongs to :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. @@ -5615,6 +5614,7 @@ def update_model_availability_policy( :param member_ids: Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. :param opted_out_api_key_hashes: API key hashes :param opted_out_member_ids: Organization member user IDs + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -5768,7 +5768,6 @@ async def update_model_availability_policy_async( components.GuardrailModelAvailabilityPolicyAuthoringConfigTypedDict, ], name: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -5777,6 +5776,7 @@ async def update_model_availability_policy_async( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -5789,7 +5789,6 @@ async def update_model_availability_policy_async( :param id: Policy ID :param config: :param name: Policy name - :param workspace_id: Workspace the policy belongs to :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. @@ -5802,6 +5801,7 @@ async def update_model_availability_policy_async( :param member_ids: Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. :param opted_out_api_key_hashes: API key hashes :param opted_out_member_ids: Organization member user IDs + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -5949,12 +5949,12 @@ async def update_model_availability_policy_async( def list_moderation_policies( self, *, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -5964,7 +5964,6 @@ def list_moderation_policies( List the moderation policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :param workspace_id: Workspace the policy belongs to :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. @@ -5974,6 +5973,7 @@ def list_moderation_policies( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :param limit: Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -6065,12 +6065,12 @@ def next_func() -> Optional[operations.ListModerationPoliciesResponse]: next_offset = offset + len(results[0]) return self.list_moderation_policies( - workspace_id=workspace_id, http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -6126,12 +6126,12 @@ def next_func() -> Optional[operations.ListModerationPoliciesResponse]: async def list_moderation_policies_async( self, *, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -6141,7 +6141,6 @@ async def list_moderation_policies_async( List the moderation policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :param workspace_id: Workspace the policy belongs to :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. @@ -6151,6 +6150,7 @@ async def list_moderation_policies_async( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :param limit: Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -6247,12 +6247,12 @@ async def empty_result(): next_offset = offset + len(results[0]) return self.list_moderation_policies_async( - workspace_id=workspace_id, http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -6314,7 +6314,6 @@ def create_moderation_policy( ], name: str, policy_type: components.CreateModerationGuardrailPolicyRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -6323,6 +6322,7 @@ def create_moderation_policy( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -6335,7 +6335,6 @@ def create_moderation_policy( :param config: :param name: Policy name :param policy_type: - :param workspace_id: Workspace the policy belongs to :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. @@ -6348,6 +6347,7 @@ def create_moderation_policy( :param member_ids: Organization member user IDs :param opted_out_api_key_hashes: API keys that should not inherit the policy when it is the workspace default :param opted_out_member_ids: Members that should not inherit the policy when it is the workspace default + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -6501,7 +6501,6 @@ async def create_moderation_policy_async( ], name: str, policy_type: components.CreateModerationGuardrailPolicyRequestPolicyType, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -6510,6 +6509,7 @@ async def create_moderation_policy_async( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -6522,7 +6522,6 @@ async def create_moderation_policy_async( :param config: :param name: Policy name :param policy_type: - :param workspace_id: Workspace the policy belongs to :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. @@ -6535,6 +6534,7 @@ async def create_moderation_policy_async( :param member_ids: Organization member user IDs :param opted_out_api_key_hashes: API keys that should not inherit the policy when it is the workspace default :param opted_out_member_ids: Members that should not inherit the policy when it is the workspace default + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -6683,10 +6683,10 @@ def delete_moderation_policy( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -6697,7 +6697,6 @@ def delete_moderation_policy( Delete a moderation policy. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -6705,6 +6704,7 @@ def delete_moderation_policy( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -6831,10 +6831,10 @@ async def delete_moderation_policy_async( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -6845,7 +6845,6 @@ async def delete_moderation_policy_async( Delete a moderation policy. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -6853,6 +6852,7 @@ async def delete_moderation_policy_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -6979,10 +6979,10 @@ def get_moderation_policy( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -6993,7 +6993,6 @@ def get_moderation_policy( Get a moderation policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -7001,6 +7000,7 @@ def get_moderation_policy( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -7122,10 +7122,10 @@ async def get_moderation_policy_async( self, *, id: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -7136,7 +7136,6 @@ async def get_moderation_policy_async( Get a moderation policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: Policy ID - :param workspace_id: Workspace the policy belongs to :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. @@ -7144,6 +7143,7 @@ async def get_moderation_policy_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -7270,7 +7270,6 @@ def update_moderation_policy( components.GuardrailModerationPolicyConfigTypedDict, ], name: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -7279,6 +7278,7 @@ def update_moderation_policy( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -7291,7 +7291,6 @@ def update_moderation_policy( :param id: Policy ID :param config: :param name: Policy name - :param workspace_id: Workspace the policy belongs to :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. @@ -7304,6 +7303,7 @@ def update_moderation_policy( :param member_ids: Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. :param opted_out_api_key_hashes: API key hashes :param opted_out_member_ids: Organization member user IDs + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 @@ -7457,7 +7457,6 @@ async def update_moderation_policy_async( components.GuardrailModerationPolicyConfigTypedDict, ], name: str, - workspace_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -7466,6 +7465,7 @@ async def update_moderation_policy_async( member_ids: Optional[Iterable[str]] = None, opted_out_api_key_hashes: Optional[Iterable[str]] = None, opted_out_member_ids: Optional[Iterable[str]] = None, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -7478,7 +7478,6 @@ async def update_moderation_policy_async( :param id: Policy ID :param config: :param name: Policy name - :param workspace_id: Workspace the policy belongs to :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. @@ -7491,6 +7490,7 @@ async def update_moderation_policy_async( :param member_ids: Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments. :param opted_out_api_key_hashes: API key hashes :param opted_out_member_ids: Organization member user IDs + :param workspace_id: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other. :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 diff --git a/src/openrouter/guardrails.py b/src/openrouter/guardrails.py index af6640372..1e2bebdcc 100644 --- a/src/openrouter/guardrails.py +++ b/src/openrouter/guardrails.py @@ -3802,6 +3802,7 @@ def list_key_assignments( x_open_router_categories: Optional[str] = None, offset: OptionalNullable[int] = 0, limit: Optional[int] = 50, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3820,6 +3821,7 @@ def list_key_assignments( :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) + :param workspace_id: Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. :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 @@ -3841,6 +3843,7 @@ def list_key_assignments( x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, + workspace_id=workspace_id, ) req = self._build_request( @@ -3915,6 +3918,7 @@ def next_func() -> Optional[operations.ListKeyAssignmentsResponse]: x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -3975,6 +3979,7 @@ async def list_key_assignments_async( x_open_router_categories: Optional[str] = None, offset: OptionalNullable[int] = 0, limit: Optional[int] = 50, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3993,6 +3998,7 @@ async def list_key_assignments_async( :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) + :param workspace_id: Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. :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 @@ -4014,6 +4020,7 @@ async def list_key_assignments_async( x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, + workspace_id=workspace_id, ) req = self._build_request_async( @@ -4091,6 +4098,7 @@ async def empty_result(): x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -4151,6 +4159,7 @@ def list_member_assignments( x_open_router_categories: Optional[str] = None, offset: OptionalNullable[int] = 0, limit: Optional[int] = 50, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4169,6 +4178,7 @@ def list_member_assignments( :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) + :param workspace_id: Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. :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 @@ -4190,6 +4200,7 @@ def list_member_assignments( x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, + workspace_id=workspace_id, ) req = self._build_request( @@ -4264,6 +4275,7 @@ def next_func() -> Optional[operations.ListMemberAssignmentsResponse]: x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -4324,6 +4336,7 @@ async def list_member_assignments_async( x_open_router_categories: Optional[str] = None, offset: OptionalNullable[int] = 0, limit: Optional[int] = 50, + workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4342,6 +4355,7 @@ async def list_member_assignments_async( :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) + :param workspace_id: Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace. :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 @@ -4363,6 +4377,7 @@ async def list_member_assignments_async( x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, + workspace_id=workspace_id, ) req = self._build_request_async( @@ -4442,6 +4457,7 @@ async def empty_result(): x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + workspace_id=workspace_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, diff --git a/src/openrouter/operations/deletebudgetpolicy.py b/src/openrouter/operations/deletebudgetpolicy.py index 90fd1f9ef..a6925175c 100644 --- a/src/openrouter/operations/deletebudgetpolicy.py +++ b/src/openrouter/operations/deletebudgetpolicy.py @@ -81,8 +81,6 @@ def serialize_model(self, handler): class DeleteBudgetPolicyRequestTypedDict(TypedDict): id: str r"""Policy ID""" - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,6 +94,8 @@ class DeleteBudgetPolicyRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class DeleteBudgetPolicyRequest(BaseModel): @@ -104,11 +104,6 @@ class DeleteBudgetPolicyRequest(BaseModel): ] r"""Policy ID""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -137,10 +132,21 @@ class DeleteBudgetPolicyRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/deletemodelavailabilitypolicy.py b/src/openrouter/operations/deletemodelavailabilitypolicy.py index 3827862e2..9da2b2fdf 100644 --- a/src/openrouter/operations/deletemodelavailabilitypolicy.py +++ b/src/openrouter/operations/deletemodelavailabilitypolicy.py @@ -81,8 +81,6 @@ def serialize_model(self, handler): class DeleteModelAvailabilityPolicyRequestTypedDict(TypedDict): id: str r"""Policy ID""" - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,6 +94,8 @@ class DeleteModelAvailabilityPolicyRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class DeleteModelAvailabilityPolicyRequest(BaseModel): @@ -104,11 +104,6 @@ class DeleteModelAvailabilityPolicyRequest(BaseModel): ] r"""Policy ID""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -137,10 +132,21 @@ class DeleteModelAvailabilityPolicyRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/deletemoderationpolicy.py b/src/openrouter/operations/deletemoderationpolicy.py index 481cb406c..f391a8daf 100644 --- a/src/openrouter/operations/deletemoderationpolicy.py +++ b/src/openrouter/operations/deletemoderationpolicy.py @@ -81,8 +81,6 @@ def serialize_model(self, handler): class DeleteModerationPolicyRequestTypedDict(TypedDict): id: str r"""Policy ID""" - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,6 +94,8 @@ class DeleteModerationPolicyRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class DeleteModerationPolicyRequest(BaseModel): @@ -104,11 +104,6 @@ class DeleteModerationPolicyRequest(BaseModel): ] r"""Policy ID""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -137,10 +132,21 @@ class DeleteModerationPolicyRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/getapikeypolicyassignment.py b/src/openrouter/operations/getapikeypolicyassignment.py index 7b87d4d54..b4e7379c1 100644 --- a/src/openrouter/operations/getapikeypolicyassignment.py +++ b/src/openrouter/operations/getapikeypolicyassignment.py @@ -93,8 +93,6 @@ def serialize_model(self, handler): class GetAPIKeyPolicyAssignmentRequestTypedDict(TypedDict): hash: str r"""API key hash""" - workspace_id: str - r"""Workspace the policy belongs to""" policy_type: GetAPIKeyPolicyAssignmentPolicyType r"""Policy type the assignment is read or changed for""" http_referer: NotRequired[str] @@ -110,6 +108,8 @@ class GetAPIKeyPolicyAssignmentRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class GetAPIKeyPolicyAssignmentRequest(BaseModel): @@ -118,11 +118,6 @@ class GetAPIKeyPolicyAssignmentRequest(BaseModel): ] r"""API key hash""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - policy_type: Annotated[ GetAPIKeyPolicyAssignmentPolicyType, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -157,10 +152,21 @@ class GetAPIKeyPolicyAssignmentRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/getbudgetpolicy.py b/src/openrouter/operations/getbudgetpolicy.py index 5d830347d..832c1d73c 100644 --- a/src/openrouter/operations/getbudgetpolicy.py +++ b/src/openrouter/operations/getbudgetpolicy.py @@ -81,8 +81,6 @@ def serialize_model(self, handler): class GetBudgetPolicyRequestTypedDict(TypedDict): id: str r"""Policy ID""" - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,6 +94,8 @@ class GetBudgetPolicyRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class GetBudgetPolicyRequest(BaseModel): @@ -104,11 +104,6 @@ class GetBudgetPolicyRequest(BaseModel): ] r"""Policy ID""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -137,10 +132,21 @@ class GetBudgetPolicyRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/getmemberpolicyassignment.py b/src/openrouter/operations/getmemberpolicyassignment.py index c48504773..babf428c5 100644 --- a/src/openrouter/operations/getmemberpolicyassignment.py +++ b/src/openrouter/operations/getmemberpolicyassignment.py @@ -93,8 +93,6 @@ def serialize_model(self, handler): class GetMemberPolicyAssignmentRequestTypedDict(TypedDict): member_id: str r"""Organization member user ID""" - workspace_id: str - r"""Workspace the policy belongs to""" policy_type: GetMemberPolicyAssignmentPolicyType r"""Policy type the assignment is read or changed for""" http_referer: NotRequired[str] @@ -110,6 +108,8 @@ class GetMemberPolicyAssignmentRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class GetMemberPolicyAssignmentRequest(BaseModel): @@ -118,11 +118,6 @@ class GetMemberPolicyAssignmentRequest(BaseModel): ] r"""Organization member user ID""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - policy_type: Annotated[ GetMemberPolicyAssignmentPolicyType, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -157,10 +152,21 @@ class GetMemberPolicyAssignmentRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/getmodelavailabilitypolicy.py b/src/openrouter/operations/getmodelavailabilitypolicy.py index 5a3c822a8..607d128d5 100644 --- a/src/openrouter/operations/getmodelavailabilitypolicy.py +++ b/src/openrouter/operations/getmodelavailabilitypolicy.py @@ -81,8 +81,6 @@ def serialize_model(self, handler): class GetModelAvailabilityPolicyRequestTypedDict(TypedDict): id: str r"""Policy ID""" - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,6 +94,8 @@ class GetModelAvailabilityPolicyRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class GetModelAvailabilityPolicyRequest(BaseModel): @@ -104,11 +104,6 @@ class GetModelAvailabilityPolicyRequest(BaseModel): ] r"""Policy ID""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -137,10 +132,21 @@ class GetModelAvailabilityPolicyRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/getmoderationpolicy.py b/src/openrouter/operations/getmoderationpolicy.py index 9e1e83005..39face005 100644 --- a/src/openrouter/operations/getmoderationpolicy.py +++ b/src/openrouter/operations/getmoderationpolicy.py @@ -81,8 +81,6 @@ def serialize_model(self, handler): class GetModerationPolicyRequestTypedDict(TypedDict): id: str r"""Policy ID""" - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,6 +94,8 @@ class GetModerationPolicyRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class GetModerationPolicyRequest(BaseModel): @@ -104,11 +104,6 @@ class GetModerationPolicyRequest(BaseModel): ] r"""Policy ID""" - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -137,10 +132,21 @@ class GetModerationPolicyRequest(BaseModel): """ + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "workspace_id", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/operations/listbudgetpolicies.py b/src/openrouter/operations/listbudgetpolicies.py index cb0680de6..40c8b5cfe 100644 --- a/src/openrouter/operations/listbudgetpolicies.py +++ b/src/openrouter/operations/listbudgetpolicies.py @@ -77,8 +77,6 @@ def serialize_model(self, handler): class ListBudgetPoliciesRequestTypedDict(TypedDict): - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,14 +94,11 @@ class ListBudgetPoliciesRequestTypedDict(TypedDict): r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" limit: NotRequired[int] r"""Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class ListBudgetPoliciesRequest(BaseModel): - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -144,6 +139,12 @@ class ListBudgetPoliciesRequest(BaseModel): ] = None r"""Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned""" + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -153,6 +154,7 @@ def serialize_model(self, handler): "X-OpenRouter-Categories", "offset", "limit", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/operations/listkeyassignments.py b/src/openrouter/operations/listkeyassignments.py index 25352cf38..0a8634cb3 100644 --- a/src/openrouter/operations/listkeyassignments.py +++ b/src/openrouter/operations/listkeyassignments.py @@ -94,6 +94,8 @@ class ListKeyAssignmentsRequestTypedDict(TypedDict): r"""Number of records to skip for pagination""" limit: NotRequired[int] r"""Maximum number of records to return (max 100)""" + workspace_id: NotRequired[str] + r"""Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.""" class ListKeyAssignmentsRequest(BaseModel): @@ -137,6 +139,12 @@ class ListKeyAssignmentsRequest(BaseModel): ] = 50 r"""Maximum number of records to return (max 100)""" + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -146,6 +154,7 @@ def serialize_model(self, handler): "X-OpenRouter-Categories", "offset", "limit", + "workspace_id", ] ) nullable_fields = set(["offset"]) diff --git a/src/openrouter/operations/listmemberassignments.py b/src/openrouter/operations/listmemberassignments.py index 4ccc06b53..36ac3bea0 100644 --- a/src/openrouter/operations/listmemberassignments.py +++ b/src/openrouter/operations/listmemberassignments.py @@ -94,6 +94,8 @@ class ListMemberAssignmentsRequestTypedDict(TypedDict): r"""Number of records to skip for pagination""" limit: NotRequired[int] r"""Maximum number of records to return (max 100)""" + workspace_id: NotRequired[str] + r"""Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.""" class ListMemberAssignmentsRequest(BaseModel): @@ -137,6 +139,12 @@ class ListMemberAssignmentsRequest(BaseModel): ] = 50 r"""Maximum number of records to return (max 100)""" + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Only list assignments of guardrails in this workspace. When omitted, an organization management key lists every workspace and a workspace-scoped key lists its own workspace. A workspace-scoped key gets 403 for any other workspace.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -146,6 +154,7 @@ def serialize_model(self, handler): "X-OpenRouter-Categories", "offset", "limit", + "workspace_id", ] ) nullable_fields = set(["offset"]) diff --git a/src/openrouter/operations/listmodelavailabilitypolicies.py b/src/openrouter/operations/listmodelavailabilitypolicies.py index dac3be4a1..d92ff0720 100644 --- a/src/openrouter/operations/listmodelavailabilitypolicies.py +++ b/src/openrouter/operations/listmodelavailabilitypolicies.py @@ -77,8 +77,6 @@ def serialize_model(self, handler): class ListModelAvailabilityPoliciesRequestTypedDict(TypedDict): - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,14 +94,11 @@ class ListModelAvailabilityPoliciesRequestTypedDict(TypedDict): r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" limit: NotRequired[int] r"""Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class ListModelAvailabilityPoliciesRequest(BaseModel): - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -144,6 +139,12 @@ class ListModelAvailabilityPoliciesRequest(BaseModel): ] = None r"""Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned""" + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -153,6 +154,7 @@ def serialize_model(self, handler): "X-OpenRouter-Categories", "offset", "limit", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/operations/listmoderationpolicies.py b/src/openrouter/operations/listmoderationpolicies.py index d5419d4b5..2f128dd65 100644 --- a/src/openrouter/operations/listmoderationpolicies.py +++ b/src/openrouter/operations/listmoderationpolicies.py @@ -77,8 +77,6 @@ def serialize_model(self, handler): class ListModerationPoliciesRequestTypedDict(TypedDict): - workspace_id: str - r"""Workspace the policy belongs to""" 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. @@ -96,14 +94,11 @@ class ListModerationPoliciesRequestTypedDict(TypedDict): r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" limit: NotRequired[int] r"""Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned""" + workspace_id: NotRequired[str] + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" class ListModerationPoliciesRequest(BaseModel): - workspace_id: Annotated[ - str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) - ] - r"""Workspace the policy belongs to""" - http_referer: Annotated[ Optional[str], pydantic.Field(alias="HTTP-Referer"), @@ -144,6 +139,12 @@ class ListModerationPoliciesRequest(BaseModel): ] = None r"""Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned""" + workspace_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -153,6 +154,7 @@ def serialize_model(self, handler): "X-OpenRouter-Categories", "offset", "limit", + "workspace_id", ] ) serialized = handler(self) diff --git a/src/openrouter/operations/updatekeys.py b/src/openrouter/operations/updatekeys.py index e9ed9da08..b0d89392b 100644 --- a/src/openrouter/operations/updatekeys.py +++ b/src/openrouter/operations/updatekeys.py @@ -109,7 +109,7 @@ class UpdateKeysRequestBodyTypedDict(TypedDict): name: NotRequired[str] r"""New name for the API key""" workspace_id: NotRequired[str] - r"""Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op.""" + r"""Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key's current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op.""" class UpdateKeysRequestBody(BaseModel): @@ -129,7 +129,7 @@ class UpdateKeysRequestBody(BaseModel): r"""New name for the API key""" workspace_id: Optional[str] = None - r"""Move the API key to this workspace. The key keeps its value; guardrail selections move with it, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op.""" + r"""Move the API key to this workspace. The key keeps its value; guardrail selections move with it, except direct guardrail assignments owned by the key's current workspace, which are removed along with the selections derived from them, while other workspace-scoped settings (presets, BYOK keys, broadcast destinations, routing rules) do not. Sending the key's current workspace is a no-op.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/uv.lock b/uv.lock index a0c391a04..147b9ddec 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.157" +version = "1.3.158" source = { editable = "." } dependencies = [ { name = "httpcore" },