diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 35a27e1a0..04131ecf9 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: 0958a10a31711b816dc9cd02bd337f8a + docChecksum: f54f05853e0c2f9e54f89f7528be704c docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.120 - configChecksum: 9b868e697244b0dbed98fd7fba98ba84 + releaseVersion: 1.3.121 + configChecksum: a8b428833d276786fc60b7ff54dbf58f repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: e8826673-e29c-4471-a306-ed3ef483d323 - pristine_commit_hash: 18fb4ad13cbafb3c9ce582e43cc3572e788f2358 - pristine_tree_hash: 147076f8bc197cc5b303c3f7fd9abb4c510bf3b2 + generation_id: 79b9d473-7eb9-427d-9e2d-f47aaf2d2ae4 + pristine_commit_hash: 4d787251002764a57db6a0b56d9017e43393ef55 + pristine_tree_hash: 90059c5a47d4d2124c4946cd1475b782137e00e9 features: python: acceptHeaders: 3.0.0 @@ -2126,10 +2126,6 @@ trackedFiles: id: 87ed2a5e080d last_write_checksum: sha1:2865a40286913d1de566dd4fdc81eada6a3b4fb2 pristine_git_object: 968ecf2c8b7548e152ba542566bb4a98fe86ba25 - docs/components/chattemplateconfig.mdx: - id: a490307c04d4 - last_write_checksum: sha1:c29cd8eb95e16a79b9e03e13756fb9c69cc78fb8 - pristine_git_object: d957a1e60749ad7e405046ae8285bdd94e50484c docs/components/chattokenlogprob.mdx: id: 5d735052588d last_write_checksum: sha1:34f2d68dd4c2026c61015d6d0f72b8ae6b99f6c9 @@ -3022,14 +3018,6 @@ trackedFiles: id: eb9e41a380b4 last_write_checksum: sha1:77ac3ec3f6d08e4d5e5f69df64f5c9028a6191b3 pristine_git_object: 78c74a24e624245cbbfe2f989c4301442bbb5fee - docs/components/defaultreasoningeffort.mdx: - id: e8b4ecf280a2 - last_write_checksum: sha1:1fcce8c285c26796c281a721a4ca4dbc29c076d4 - pristine_git_object: 8516502b755835fc28aef01a0dd91f59baf3355a - docs/components/defaultreasoningreturnmechanism.mdx: - id: 000970fdbfca - last_write_checksum: sha1:888ec65c9be7bdf0466dbe6c41ce641a482fc7ef - pristine_git_object: 9a185dec3a67d5541183b8407ed2a009650cd951 docs/components/deferredbm25search.mdx: id: 28b5539be31d last_write_checksum: sha1:7f897adc605d54cbb0d10b2c4aac7b99b7fd7dd8 @@ -3202,30 +3190,6 @@ trackedFiles: id: 5e4fa96c840d last_write_checksum: sha1:4d2ccb7fc0d20c8a0b72db3a55a8228169891b6a pristine_git_object: 72c5b4fb8441c2a4337dc9906fa81b01bb92f126 - docs/components/endpointsummary.mdx: - id: 2f3c10fd6e19 - last_write_checksum: sha1:ac6557050023b639b210534098fc7cd137d07645 - pristine_git_object: 62ddd126155c8d33824814ba4e43be525f5f9d68 - docs/components/endpointtestprofile.mdx: - id: 644dac398ccc - last_write_checksum: sha1:c18d9c81f4ac012cd1d26a9f7e35be824cf24f38 - pristine_git_object: 3a4fdcc049749a4d231dea897bd5d6d4e5363dff - docs/components/endpointtestprofileinputmodality.mdx: - id: e77ab18d72be - last_write_checksum: sha1:ac959058a8e57361f8fc69fb4b9bb5a9b952922e - pristine_git_object: 0afb96682c4dbf94d5642e32874b8993a20f2789 - docs/components/endpointtestprofilemodel.mdx: - id: fdfc9f88344c - last_write_checksum: sha1:dafd5f49c1abbe0e37e7461632e566d980359d3a - pristine_git_object: fa1eb572652e94f9866f05942a7248190c262010 - docs/components/endpointtestprofileoutputmodality.mdx: - id: 05439d848368 - last_write_checksum: sha1:ea58cbd52bb11f2cb87d9252bf2d1ad0bc336d82 - pristine_git_object: 14d81efa3ffd01908c4e900fc254d415a138d5f0 - docs/components/endpointtestprofilereasoningconfig.mdx: - id: 9e765c2ac138 - last_write_checksum: sha1:68edc8357d41f8c66acf6797ae16e1b8082073a3 - pristine_git_object: b9983570ef9c4d25c1f4ae17cd69751759f6f62f docs/components/enumcapability.mdx: id: 33c7a0f315d5 last_write_checksum: sha1:393f904f9c8528ba5fbf2dc2b48b4a0042ef1c5f @@ -3622,26 +3586,6 @@ trackedFiles: id: 538c871219f3 last_write_checksum: sha1:52ed81e463594f421f6459f9d363b76cba584711 pristine_git_object: 4b6c1a197ad3fa4a117c0919bbaf30129f454fed - docs/components/features.mdx: - id: 3e20b309e0ed - last_write_checksum: sha1:d4ecf214f1551b608fa9f7d4393a524868540b95 - pristine_git_object: d179320eae5feab2da0a4e9525907972d705271a - docs/components/featuresdefaultreasoningeffort.mdx: - id: 2341c826ca51 - last_write_checksum: sha1:d8e820975fec28c0eceff7cd03afffb212f79d16 - pristine_git_object: d04709713abc43e004782d0a6abe9ec88c375420 - docs/components/featuresreasoningconfig.mdx: - id: a31e174c4b0d - last_write_checksum: sha1:ac971564c7526941f6428eba544995b7077a4a01 - pristine_git_object: 0d676710496a1f398dc2c80a4c52734e62a2da69 - docs/components/featuresreasoningreturnmechanism.mdx: - id: 3890f37425b9 - last_write_checksum: sha1:ccfa12748baf5492c219152399d0097278eeb56f - pristine_git_object: 067b63cc4270f4d387773e1b4b0e0dcbbed50815 - docs/components/featuressupportedreasoningeffort.mdx: - id: c11603c83791 - last_write_checksum: sha1:77014a714f09e3cb28fcf6c1c0ddffbe0916adec - pristine_git_object: c6f07dceb7d00aabc33174e8dc095d42851a4058 docs/components/fields.mdx: id: 8b32f4bd19c8 last_write_checksum: sha1:1918a386c69669321ebe08f399c98afb62996481 @@ -4558,10 +4502,6 @@ trackedFiles: id: 6eb7b26998d7 last_write_checksum: sha1:7c462ce0c9c933fe87c31f3021fc80b644b29b7e pristine_git_object: 9cb9bd87ba962a19e4c1d645adcfebc8d6b39ddb - docs/components/instructionrolesupport.mdx: - id: 9b4f56fee3ed - last_write_checksum: sha1:a62c7f70c0a00800eb2f1bb1558a6405ea46c8e8 - pristine_git_object: d12c96f800e0e444461f62c3526b0340276b58e6 docs/components/instructtype.mdx: id: 4e1ceba5a654 last_write_checksum: sha1:2efe0463c8d0ed63159bbcc8cb8c21743800b88e @@ -4638,10 +4578,6 @@ trackedFiles: id: e031cc3f462c last_write_checksum: sha1:2506bc8b4e80b7b71b9f59a8d84a0367cfd3a119 pristine_git_object: bfef4620305e6517f0de3179cc1b9359ca3e43d2 - docs/components/latencyms.mdx: - id: b1a318d88ee8 - last_write_checksum: sha1:01023174846bb5194525a160f9a134bc48527cbf - pristine_git_object: 8740fcc1c8ae3a6df5e64d8b31034757ea9d7954 docs/components/legacychatcontentvideo.mdx: id: fd222b8b9445 last_write_checksum: sha1:900e39e30b47e20e71edde59669225c91d36b1d6 @@ -6846,34 +6782,6 @@ trackedFiles: id: 75786e3aa079 last_write_checksum: sha1:9af190f60239a910768092d5ed8342ed7aed4ebd pristine_git_object: e4103b29b85cafaf653bf8f71bd8e12278a16fa8 - docs/components/providerendpoints.mdx: - id: e02d82a05aa1 - last_write_checksum: sha1:e9216dbe6f41cb464c37e68d83c50170c9aeba69 - pristine_git_object: 2fa98c5f53be2a61d95370f0baf6ce3b78f932d3 - docs/components/providerendpointsresponse.mdx: - id: b9170e0f033a - last_write_checksum: sha1:c3d67ac04e85f7c021139fda03a847eff80df147 - pristine_git_object: 93121830de181d0b5bebae9046d0e0f669173c78 - docs/components/providerendpointstats.mdx: - id: d9ad41b12dc7 - last_write_checksum: sha1:15a01243c05c488f364b4f80342a7119c001857e - pristine_git_object: 0d36b106cd8aaf47eac34200a16792ea49145ba6 - docs/components/providerendpointstatsavailable.mdx: - id: 4d0ef470fc34 - last_write_checksum: sha1:ca31a0866cc49e7d5a274d3ab91ad6104986c80f - pristine_git_object: f18332bc3438772601b65e00a8c7e33b1c44f291 - docs/components/providerendpointstatsavailablestatus.mdx: - id: faa7f2d8af20 - last_write_checksum: sha1:4a7e1aa339e785354adf2b559643008a98eede1a - pristine_git_object: 43d1f481abc6a1bd3a6ec2f010c1bcc29e777092 - docs/components/providerendpointstatsunavailable.mdx: - id: 4e311fd26b6a - last_write_checksum: sha1:45b61240d35d33db5680e9ee1d5a544712316f7f - pristine_git_object: d7b19cd60dac2269318f98dd8670c172e71abf6f - docs/components/providerendpointstatsunavailablestatus.mdx: - id: 6b684d38c0f8 - last_write_checksum: sha1:823f29dc6c81d49495a9a44041339efc6f32dd49 - pristine_git_object: 5f99ed2cfb6d52c1ae6cf31154938f01afdb63c6 docs/components/providerenum.mdx: id: 3065d8db71f9 last_write_checksum: sha1:8adf2339eb304261db4be5001a8e3cf7ea449e2f @@ -7086,10 +6994,6 @@ trackedFiles: id: bbff17cc0627 last_write_checksum: sha1:5a3d3051d45f770038d66c27cade83a2ec9d9ffe pristine_git_object: d288ff3c7f26ed6a639f3c790d7d2a5de4d1715e - docs/components/reasoningreturnmechanism.mdx: - id: a63583fd55c0 - last_write_checksum: sha1:fcda99ee5214fef3faea0df5d0e11af8fdda5cf0 - pristine_git_object: ab2b9418cf640b6ccaaf76fcbde629116a1ee090 docs/components/reasoningsummarypartaddedevent.mdx: id: f8185d70cec5 last_write_checksum: sha1:1a681d328e3f6bcdd8e90a2c3f5ad986eae9f9f9 @@ -7198,10 +7102,6 @@ trackedFiles: id: fd80c94f61ca last_write_checksum: sha1:9df63b87a79a3ccb889870640b0d658ea57436fe pristine_git_object: 01acc3f8d0a451cf6ca5d1c0da90995c79f8f727 - docs/components/requiredinputmodality.mdx: - id: cdc606386c72 - last_write_checksum: sha1:53027168359a2cdf03896b2e949877d3706f942f - pristine_git_object: 5255fbcda60a8ca801b55e34c595cd52ddedcce4 docs/components/rerank.mdx: id: b011fb4a30ac last_write_checksum: sha1:c04836cd04951c2d9dbd99636d2e04f21ff2e8e2 @@ -7878,10 +7778,6 @@ trackedFiles: id: f34dfb27d78f last_write_checksum: sha1:a979de72a67038af692d17cdb379b1d58e7ad0c8 pristine_git_object: 64a19c185569b50eb0a3363b472c1c28807493f2 - docs/components/supportedreasoningeffort.mdx: - id: 2964975e7365 - last_write_checksum: sha1:e54be5bfd39b030f1dcd34e5da860d541281778c - pristine_git_object: 1911d4dfd8d1a3deb83ff480a20f1c80dbb335b1 docs/components/supportedresolution.mdx: id: 4dab32379c4d last_write_checksum: sha1:0df389c4bfbe7f608751121a9d93b6ddb5838b87 @@ -7978,10 +7874,6 @@ trackedFiles: id: 9f8561d6342c last_write_checksum: sha1:6226a4ff5f99a852e34cd5053851a507cb3a9e7c pristine_git_object: 834297f4c2167ee22b57bd3cfb126b37662cd1ae - docs/components/throughputtokenspersecond.mdx: - id: 2683dd4e1edd - last_write_checksum: sha1:7fa7f62b6dcf1f6675a1390d2efe51e8f59a109c - pristine_git_object: f36915f615d2b2936206234df6645d3c0f68ddec docs/components/token.mdx: id: f22f9a37dc7e last_write_checksum: sha1:97ec547ce1db50eecd30b5a03fe51d6365f93d3d @@ -8648,20 +8540,32 @@ trackedFiles: pristine_git_object: 47158d146ef4e92c5f47cb737170922102bfec11 docs/components/videogenerationrequest.mdx: id: b92ddbd15ee4 - last_write_checksum: sha1:2cf37c03a43b98159af9c06a1b9487fc3c63bd7a - pristine_git_object: ebdc8142c9fcaef8ba5d04a276b9467220edf72c + last_write_checksum: sha1:35af7901a2943fbb46a544fa611f49593c375590 + pristine_git_object: b6bdecc241f733e900c1c90006545ef42214e081 docs/components/videogenerationrequestaspectratio.mdx: id: c14859c0d8c3 last_write_checksum: sha1:4ad4aae702af1cd2ddee7b443c35c9b3df6824e8 pristine_git_object: 67f56887bb4758559189e3e9e6123dff9a38df81 + docs/components/videogenerationrequestignore.mdx: + id: ac6278a72d93 + last_write_checksum: sha1:21dc880010c8cfc07b1c1a0e53e7b163b74b6300 + pristine_git_object: 1480df84e382b284a52b04d16c83284d9557a833 + docs/components/videogenerationrequestonly.mdx: + id: 7f5c169bd281 + last_write_checksum: sha1:d2c7c693fa5a4a463377678ffee340cb7b5672d7 + pristine_git_object: d8c6c0f20ce631b8daf4ba53a722b532f75b139f docs/components/videogenerationrequestoptions.mdx: id: 1d67160e7e7a last_write_checksum: sha1:5178bb73428dee91884ac13b67fa33a0903059e3 pristine_git_object: bd8ddff7424b260e2f9cef4327d86055992736c4 + docs/components/videogenerationrequestorder.mdx: + id: 4daf6f446396 + last_write_checksum: sha1:e991c58b11c19acbd8a2d0416564380cedb42b94 + pristine_git_object: 0ddf6c9ae48cd55530b5a44d162a00f6fcaaff8c docs/components/videogenerationrequestprovider.mdx: id: d6424dd5de9d - last_write_checksum: sha1:6b22c6a287de733a3d5f7b9bbf04ce4f57a5ef73 - pristine_git_object: 7fc69a9d5aa70e761b2f8ac699afc0f63aee6aed + last_write_checksum: sha1:6754ce63a0429bcee89afecc36d06834eeb41c1d + pristine_git_object: 88b30bc0ab636f98d5642a51ceed496d3f740385 docs/components/videogenerationrequestresolution.mdx: id: b4287dc60239 last_write_checksum: sha1:53e4bbc3b66ae6ef1aeabe2269192cbfc5126ce0 @@ -8690,10 +8594,6 @@ trackedFiles: id: d08b4554c5c0 last_write_checksum: sha1:526462332a3139b4627d3bbc31d8cac2318f6b77 pristine_git_object: d42e64e68478b608c940ff56a1592375c7145698 - docs/components/visibility.mdx: - id: 5404485c7f02 - last_write_checksum: sha1:1cc5b33225ea510d7835f4b94de8530c772d2c45 - pristine_git_object: 85c28caf1117c92d7b33e55cf586cd3617499e1a docs/components/watch.mdx: id: 30a963a3de2c last_write_checksum: sha1:c9d01625c52deaa2399d196211ae37b63892efd9 @@ -8830,10 +8730,6 @@ trackedFiles: id: 2df2844a96ee last_write_checksum: sha1:1a58eaab78f5cfb3fba15aeddad9405b5ca13fa9 pristine_git_object: e8a689098106c445424b89fe5baa348824f3a36c - docs/components/window.mdx: - id: a1f640547218 - last_write_checksum: sha1:fd7da90856fb04e5aa50ca27fb2e01f36769255b - pristine_git_object: 6b84147b4664884bdf50bf2111b909ebe5347188 docs/components/workspace.mdx: id: eea9c32d09c4 last_write_checksum: sha1:f8518fa23ec7a3b2936d113271ba96a1fa7988ec @@ -9896,12 +9792,8 @@ trackedFiles: pristine_git_object: 9753c9912c2ad7f86b33b0be0e8a5f0f44af0599 docs/operations/gettaskclassificationsrequest.mdx: id: b4c12a5cf637 - last_write_checksum: sha1:70bfc6cd6ed078e5ccc825fd7e09d1a55f1b29a9 - pristine_git_object: bf44a0d334444d5dc6a6bd576b490467d2bb55a1 - docs/operations/gettaskclassificationswindow.mdx: - id: 899a3f608d79 - last_write_checksum: sha1:32cd19993e8d843210c0f428573025d206ee9dec - pristine_git_object: e0e1a0f035c08b756c3b41d10ef746cc1491b52c + last_write_checksum: sha1:386d1f4891ed366d1940757578c4c072de7557da + pristine_git_object: a2c427446b998196800034334da0cca3569d4595 docs/operations/gettoolglobals.mdx: id: e88fdfb11e03 last_write_checksum: sha1:c1011d20ad4fc60d7d92d74f341bc2d0e0b0cc1c @@ -10314,18 +10206,6 @@ trackedFiles: id: b3d116a5ba89 last_write_checksum: sha1:48cbb6d60736f3be395ff2f9b556c72f496f731c pristine_git_object: 1e9f3514bd813c91e6466ccbbca087b73b61f43c - docs/operations/listproviderendpointsglobals.mdx: - id: 9db8a2a5b5a5 - last_write_checksum: sha1:a354db801641fc601ae0dfc6bd0f0c99d6e04904 - pristine_git_object: 65a8151ddba10caacab93f31e58611f184e29682 - docs/operations/listproviderendpointsrequest.mdx: - id: b581bfcccd9c - last_write_checksum: sha1:ebd69b59d5b14f8223fdcb3de956c32545b31248 - pristine_git_object: 3dbaa9207a80459137e21ea3c317a1808b2e41a7 - docs/operations/listproviderendpointswindow.mdx: - id: 6a60ef940291 - last_write_checksum: sha1:056bd05761db309ddb31d3457022b02e2e52ccd1 - pristine_git_object: 08fc9d1cf67ae6938a8ca1cb64902e21961da83b docs/operations/listprovidersdata.mdx: id: 79d7624ebbdc last_write_checksum: sha1:44933a10cf08c83fd60046b3c8e169f9518dd0e5 @@ -10474,10 +10354,6 @@ trackedFiles: id: 5465d93e546d last_write_checksum: sha1:cd7e1616f1f34e0f3af97ca00025ff41423024b1 pristine_git_object: 56531d3d28f5a9adf8321bcb95daf99e781b044e - docs/operations/perfworkload.mdx: - id: 6ae2e628bb2d - last_write_checksum: sha1:45691bad85d27084cc50bf77b64d98a0bc33b2be - pristine_git_object: 6a4dd0d44ae4466bae35baeff4ed86a103495a63 docs/operations/period.mdx: id: 038d66aa4fc1 last_write_checksum: sha1:f65e16f5901c128767ab047aaeb811430c2bce3e @@ -10754,6 +10630,10 @@ trackedFiles: id: 11e224cdab3c last_write_checksum: sha1:6166c87ba26da5ef5f754195074264bf466d85e1 pristine_git_object: bffe0e5d76aac876860b6e3be42a9ebecf40e871 + docs/operations/window.mdx: + id: cdb33aa5c15a + last_write_checksum: sha1:36234c180ece9d264d313db08936d040af86cb8f + pristine_git_object: 52168404b9b71ed5151ac09d81cb9e148f1a600f docs/operations/zdr.mdx: id: 198b78abdff6 last_write_checksum: sha1:8a61e4b23d0f7e8376b2227d6c87ca49a473f7d1 @@ -10788,8 +10668,8 @@ trackedFiles: pristine_git_object: 25f5f771869c49ec913d671a4013d63d50836aef docs/sdks/classifications/README.mdx: id: 4786130ef02a - last_write_checksum: sha1:d5399dbacefc9ed5840a08c4b44f2a14e19086c1 - pristine_git_object: aa324667aa6bd9d8cd8aeba1aa36908aa83b3bc9 + last_write_checksum: sha1:0ad874e3b59605580ef4d4647b4e0feece64ccc9 + pristine_git_object: c59bcbd8e4f545fe69d2fa385dd81fdb2521e216 docs/sdks/containers/README.mdx: id: cc963972ad75 last_write_checksum: sha1:7e1c6252aa61f2e03f1f07cb2494ca1439376eda @@ -10868,8 +10748,8 @@ trackedFiles: pristine_git_object: 800024b7fce0349bda2b87c5035a4a464304d330 docs/sdks/providers/README.mdx: id: 5ea9af111324 - last_write_checksum: sha1:c315861e9e1ebbebc076b4b65b78fa5e6d931d2f - pristine_git_object: 88e3620cf8a40748e4e369e4a39f769213cfef4a + last_write_checksum: sha1:782a6fe2f68c7e03c0496ce0e83cdc3f5a1512f0 + pristine_git_object: fbd074b61683886e7e7049e81e2f03cdfa2ef32a docs/sdks/rerank/README.mdx: id: 68cdfc7f7dca last_write_checksum: sha1:64d5fd71e3e39c6c24856438e89ef7c9264cf630 @@ -10904,8 +10784,8 @@ trackedFiles: pristine_git_object: 63da02745c8b365676c3a049a527dc6964b1480b docs/sdks/videogeneration/README.mdx: id: 9a8fa04c3872 - last_write_checksum: sha1:30ed7b9ca5b81dc78c655c832082cfcadc654af5 - pristine_git_object: 19ee9f039dddd28e56ee89981b98399f065366cc + last_write_checksum: sha1:4e6cb071ff96f55a226a685b29160a2d08e36472 + pristine_git_object: 8d19de6bd101c9076774c43620db0252eebffd51 docs/sdks/workspaces/README.mdx: id: 0c75d023ef6b last_write_checksum: sha1:308d7b7981ce09372279d81af532e52c7d3f56dc @@ -10916,8 +10796,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:629840b0b324d2f93eb70a09282c7ac9b0478507 - pristine_git_object: 84ee3e926c0ef1dd5ab0895bb8c0fa5f8dab8e86 + last_write_checksum: sha1:a48ca139cadbd0b53d869879b2c2e30de3a18cbe + pristine_git_object: 24870006d653ba939fb94275ebe7cd5772c74c3a scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10944,8 +10824,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:d3a49dfd86d4466470276eec760afe57ea499d99 - pristine_git_object: 1f79214623c560cc1a2841fa7f0496cdd8738ddf + last_write_checksum: sha1:34e51ebe932b294e0906dae4bc46af3af877fc0e + pristine_git_object: 990fcb2f1af42e75622045524fde4c61228871e5 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -10988,12 +10868,12 @@ trackedFiles: pristine_git_object: 43dbe7dff7ebfc3a17ea4ee9241441c8fb64a20f src/openrouter/classifications.py: id: 4f2efc24b95b - last_write_checksum: sha1:129503d413e09ee585de15d8410e22ee115a2f82 - pristine_git_object: 192786c7ca69fff87f3683fc28b4d71baf28fc3d + last_write_checksum: sha1:3ab6fcd9ef679cd2149ec8dfbb4a86109cd152ad + pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:da8eae506cefd3a50cb35d29cddc26db0219d568 - pristine_git_object: dbb7fcac680ddc56952faf5795f4c2ec2c6d41bb + last_write_checksum: sha1:09084e1a5a58e57bfe6cc87ce767ed02ad625a89 + pristine_git_object: fe54f56dd572f15449d43664debffe999a592e75 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -12330,14 +12210,6 @@ trackedFiles: id: e935c578fce8 last_write_checksum: sha1:8a9c8184852faf1e3ca9a478e48df41ccac6fc33 pristine_git_object: ed5f8af0c599b1e55bb1939bc1d2aff0aeef610d - src/openrouter/components/endpointsummary.py: - id: f762a212e4ed - last_write_checksum: sha1:98a2c65e548248fd98d0dfaeb33d76bbb9963f3e - pristine_git_object: 357f1615265dad9b3057bf2bee0ec0a9b7ac76ac - src/openrouter/components/endpointtestprofile.py: - id: 224d4a6faca6 - last_write_checksum: sha1:45bde022ea3f7c732c4a9a1fb58a1b61f8188328 - pristine_git_object: a16c2c6d4be847563619173eff68786181705fb5 src/openrouter/components/enumcapability.py: id: 1eddd72a17a5 last_write_checksum: sha1:09e366c414f84edb166eeb8e9091e278c15136d6 @@ -13698,26 +13570,6 @@ trackedFiles: id: e78ab231a530 last_write_checksum: sha1:f257e3ae2b6385cf758e891ba02601c435e92098 pristine_git_object: 170ae25c582bb8decd74e1c69bfa8353bd44e86d - src/openrouter/components/providerendpoints.py: - id: d9871b08b002 - last_write_checksum: sha1:2bc5601965cde0440494c2dfd89ea9f293952b8d - pristine_git_object: 25fce7b1e68836296a0b2fdc3715efe63ef02a06 - src/openrouter/components/providerendpointsresponse.py: - id: 56feef563a46 - last_write_checksum: sha1:a675012d64dc6751caefd15f70fcdde7dbe8639d - pristine_git_object: 9b271e719ee24e101be559bd5f46686804fb47bd - src/openrouter/components/providerendpointstats.py: - id: 098633322fbe - last_write_checksum: sha1:922d57bd38b1b754c090408582c61b94d3ce261b - pristine_git_object: f87170f0fc209c5213c588d120b4c2860fd3f7c2 - src/openrouter/components/providerendpointstatsavailable.py: - id: 432eda2b3706 - last_write_checksum: sha1:7f38384e61db24db132d79e67e92ec042e9b6445 - pristine_git_object: 67d24b1f922d2a7346ec93cc5ca3149f3cbc3133 - src/openrouter/components/providerendpointstatsunavailable.py: - id: eb0ec66203dd - last_write_checksum: sha1:5eb2a4e2528635e5eec9209a78dbc71ea31794ad - pristine_git_object: ab2fb6d551947da1920028d7ecf40c711b6ef5b8 src/openrouter/components/providername.py: id: fcc722fa2fce last_write_checksum: sha1:a1690b4504574c699c746530fc9fdbb1cc56c34b @@ -14464,8 +14316,8 @@ trackedFiles: pristine_git_object: c2f15eb53f14024dfd1e620c52a564bf4682854f src/openrouter/components/videogenerationrequest.py: id: 70e3c9ff288c - last_write_checksum: sha1:4b08caf596f7d9b474c3278b956425def293b85b - pristine_git_object: c3f8a1e992f384d8f864673c3c6e35d87813a32b + last_write_checksum: sha1:ee8762a092b920500475a0dd8949e33c6d615f53 + pristine_git_object: ef6e96c11e7d76a6bed8c09d5cd75179afa397d7 src/openrouter/components/videogenerationresponse.py: id: 541f1321b072 last_write_checksum: sha1:6ba68c4551af144f37be940f0222f434d156e275 @@ -14772,8 +14624,8 @@ trackedFiles: pristine_git_object: 4a35ede011d09dddab042e2c00413ce4f6be655e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:d5f6a1573d060a4e50c1914f2d04419dd2221234 - pristine_git_object: 2c9a7c31257dd3615eb0ed006c116489f934802f + last_write_checksum: sha1:3549a224597521d4f1d080a8d9acdfd6a9de3fa7 + pristine_git_object: 7319f555fe88b80496da7b646185e294f6d83d38 src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -15092,8 +14944,8 @@ trackedFiles: pristine_git_object: 7a5e3e1cf09fcd3ac3a50b8f5790a1d6f35e5381 src/openrouter/operations/gettaskclassifications.py: id: ba6156d68acf - last_write_checksum: sha1:91add813072ad0c7a70607f3ac2f288bb7d071f4 - pristine_git_object: 1679b8aaa3cee779e41e1e43775b6fa2562028d2 + last_write_checksum: sha1:c569572d21aa766ac542d5c535208e8b1caae503 + pristine_git_object: a8b610cad3ca3792798e40b31cada48b0ed3845b src/openrouter/operations/gettool.py: id: f0997d66f38e last_write_checksum: sha1:f3e11b59741e20041a219c423c1392fc69a2a7f1 @@ -15230,10 +15082,6 @@ trackedFiles: id: d8ad909a544b last_write_checksum: sha1:ec09211e03d24ca14b54ebeb6af172a2fd73d3a6 pristine_git_object: 1b76ac2414e607e8e7565745592764cf7322e9a0 - src/openrouter/operations/listproviderendpoints.py: - id: 7d231ba68731 - last_write_checksum: sha1:674a63d3423f5441384a777ccc88c42f2098dbb0 - pristine_git_object: e6b63273e623eb09df35fe24460decbdbdaf2e36 src/openrouter/operations/listproviders.py: id: cf6e2db15118 last_write_checksum: sha1:decee82d2b55738162cc47f02f56c592d53f9ee9 @@ -15368,8 +15216,8 @@ trackedFiles: pristine_git_object: 1a1d32977e3758252ed28048211567054d0a7001 src/openrouter/providers.py: id: debc4c48f149 - last_write_checksum: sha1:394f42d50232b743d83a84a6171a0220c6e043f3 - pristine_git_object: ac109190c866c2671ed707cbb761e5a830eeac8c + last_write_checksum: sha1:11dbc607825edee8dcc84b39ee8171e097c47acf + pristine_git_object: c1fd70812d86dcc34e9f111325c50b988fb4aa1f src/openrouter/py.typed: id: 89fd03eab092 last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 @@ -15504,8 +15352,8 @@ trackedFiles: pristine_git_object: 301f5a486f27e1dcfcb4c9029b47d6df7b683d95 src/openrouter/video_generation.py: id: d0a90c1b8efe - last_write_checksum: sha1:e5fc6c816742687bad4a0ae9a9d9232945f04815 - pristine_git_object: aeec4401e4a6aafc46fc574f06d9696a3b8170d3 + last_write_checksum: sha1:232e599b8972ca4aabf2ffdbb2af4bd880e48c0a + pristine_git_object: 80463dc184cef6adeabe8b97ab8abcf7caac1780 src/openrouter/workspaces.py: id: cd6c533b1802 last_write_checksum: sha1:68af669c94b28b0a42648c30e72ebf55802a5da6 @@ -20076,4 +19924,7 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.byok.list()`: \n * `request.provider` **Changed**\n * `response.data[].provider.enum(primalabs)` **Added**\n* `open_router.byok.create()`: \n * `request.provider.enum(primalabs)` **Added**\n * `response.data.provider.enum(primalabs)` **Added**\n* `open_router.byok.get()`: `response.data.provider.enum(primalabs)` **Added**\n* `open_router.byok.update()`: `response.data.provider.enum(primalabs)` **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.providers.list_provider_endpoints()`: **Removed** (Breaking ⚠️) + * `open_router.video_generation.generate()`: `request.provider` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8ee12675b..f8dff1b77 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.120 + version: 1.3.121 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 6e6de7150..1a34534ee 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -11781,20 +11781,6 @@ components: - 'model' - 'selected' type: 'object' - EndpointRef: - properties: - endpoint_id: - description: 'Endpoint ID' - example: '0198c3f1-7b9a-7c31-a2d4-5e6f7a8b9c0d' - type: 'string' - model_slug: - description: 'Public model slug' - example: 'z-ai/glm-5.3' - type: 'string' - required: - - 'endpoint_id' - - 'model_slug' - type: 'object' EndpointsMetadata: example: available: @@ -11824,346 +11810,6 @@ components: example: 0 type: 'integer' x-speakeasy-unknown-values: allow - EndpointSummary: - allOf: - - $ref: '#/components/schemas/EndpointRef' - - properties: - created_at: - description: 'When the endpoint was created' - example: '2026-08-20T00:00:00.000Z' - type: 'string' - model_permaslug: - description: 'Permanent model slug the endpoint is listed under' - example: 'z-ai/glm-5.3-20260101' - type: 'string' - provider_model_id: - description: 'The provider''s own model ID' - example: 'accounts/fireworks/models/glm-5p3' - type: - - 'string' - - 'null' - provider_name: - description: 'Provider name' - example: 'Fireworks' - type: 'string' - provider_region: - description: 'Serving region' - example: 'us' - type: - - 'string' - - 'null' - service_tier: - description: 'Service tier; null for the default tier' - example: 'priority' - type: - - 'string' - - 'null' - test_profile: - $ref: '#/components/schemas/EndpointTestProfile' - variant: - description: 'Endpoint variant' - example: 'standard' - type: 'string' - visibility: - description: 'Whether the endpoint is listed on OpenRouter' - enum: - - 'visible' - - 'hidden' - example: 'visible' - type: 'string' - x-speakeasy-unknown-values: allow - required: - - 'model_permaslug' - - 'provider_name' - - 'provider_model_id' - - 'variant' - - 'provider_region' - - 'service_tier' - - 'visibility' - - 'created_at' - - 'test_profile' - type: 'object' - EndpointTestProfile: - properties: - context_length: - description: 'Context length the endpoint serves: its override, else the model''s' - example: 128000 - type: - - 'integer' - - 'null' - default_reasoning_return_mechanism: - description: 'Reasoning return mechanism the endpoint uses when neither its features nor the model set one' - enum: - - 'content-string' - - 'reasoning-content' - - 'reasoning' - - 'none' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - effective_adapter_name: - description: 'Adapter the endpoint is served through: its provider override, else the provider''s; null when unresolved' - example: 'openai' - type: - - 'string' - - 'null' - endpoint_features: - additionalProperties: {} - description: 'Endpoint feature flags; null when unset or invalid' - type: - - 'object' - - 'null' - is_lab_trusted: - description: 'Whether the endpoint serves a closed lab model through the lab or an official partner' - type: 'boolean' - model: - properties: - features: - properties: - chat_template_config: - properties: - instruction_role_support: - description: 'How leading instruction (developer/system) messages are mapped before reaching a chat-completions provider. ''developer'' keeps the developer role, ''system'' downgrades developer to system, ''user-only'' downgrades both to a wrapped user message. Overridable per-endpoint.' - enum: - - 'developer' - - 'system' - - 'user-only' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - should_hoist_and_merge_system_messages: - description: 'Whether to hoist and merge system messages' - type: - - 'boolean' - - 'null' - supports_mid_session_system: - description: 'Whether the model accepts system/developer messages that appear after the first user/assistant turn. When false, mid-session instruction messages are downgraded to wrapped user messages. Overridable per-endpoint.' - type: - - 'boolean' - - 'null' - type: - - 'object' - - 'null' - reasoning_config: - properties: - default_reasoning_effort: - enum: - - 'max' - - 'xhigh' - - 'high' - - 'medium' - - 'low' - - 'minimal' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - default_reasoning_enabled: - description: 'Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this.' - type: - - 'boolean' - - 'null' - end_token: - type: - - 'string' - - 'null' - is_mandatory_reasoning: - type: - - 'boolean' - - 'null' - reasoning_return_mechanism: - description: 'Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.' - enum: - - 'content-string' - - 'reasoning-content' - - 'reasoning' - - 'none' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - start_token: - type: - - 'string' - - 'null' - supported_reasoning_efforts: - description: 'List of reasoning effort values the model accepts upstream' - items: - enum: - - 'max' - - 'xhigh' - - 'high' - - 'medium' - - 'low' - - 'minimal' - type: 'string' - x-speakeasy-unknown-values: allow - type: - - 'array' - - 'null' - supports_reasoning_effort: - description: 'Whether the model supports reasoning effort' - type: - - 'boolean' - - 'null' - supports_reasoning_max_tokens: - description: 'Whether the model supports reasoning max tokens' - type: - - 'boolean' - - 'null' - system_prompt: - type: - - 'string' - - 'null' - type: - - 'object' - - 'null' - required_input_modalities: - description: 'Input modalities every request to the model must include, e.g. ["video"] for video-to-video-only models. Requests missing a required modality are rejected before dispatch. A required text modality is satisfied by the prompt. Currently enforced on the video generation request path.' - items: - enum: - - 'text' - - 'image' - - 'audio' - - 'video' - type: 'string' - x-speakeasy-unknown-values: allow - type: - - 'array' - - 'null' - type: - - 'object' - - 'null' - input_modalities: - items: - enum: - - 'text' - - 'image' - - 'file' - - 'audio' - - 'video' - type: 'string' - x-speakeasy-unknown-values: allow - type: 'array' - output_modalities: - items: - enum: - - 'text' - - 'image' - - 'embeddings' - - 'audio' - - 'video' - - 'rerank' - - 'decisions' - - 'speech' - - 'transcription' - type: 'string' - x-speakeasy-unknown-values: allow - type: 'array' - reasoning_config: - properties: - default_reasoning_effort: - enum: - - 'max' - - 'xhigh' - - 'high' - - 'medium' - - 'low' - - 'minimal' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - default_reasoning_enabled: - description: 'Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this.' - type: - - 'boolean' - - 'null' - end_token: - type: - - 'string' - - 'null' - is_mandatory_reasoning: - type: - - 'boolean' - - 'null' - reasoning_return_mechanism: - description: 'Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.' - enum: - - 'content-string' - - 'reasoning-content' - - 'reasoning' - - 'none' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - start_token: - type: - - 'string' - - 'null' - supported_reasoning_efforts: - description: 'List of reasoning effort values the model accepts upstream' - items: - enum: - - 'max' - - 'xhigh' - - 'high' - - 'medium' - - 'low' - - 'minimal' - type: 'string' - x-speakeasy-unknown-values: allow - type: - - 'array' - - 'null' - supports_reasoning_effort: - description: 'Whether the model supports reasoning effort' - type: - - 'boolean' - - 'null' - supports_reasoning_max_tokens: - description: 'Whether the model supports reasoning max tokens' - type: - - 'boolean' - - 'null' - system_prompt: - type: - - 'string' - - 'null' - type: - - 'object' - - 'null' - slug: - description: 'Public model slug' - example: 'z-ai/glm-5.3' - type: 'string' - supports_reasoning: - type: 'boolean' - required: - - 'slug' - - 'input_modalities' - - 'output_modalities' - - 'supports_reasoning' - - 'reasoning_config' - - 'features' - type: 'object' - required: - - 'model' - - 'endpoint_features' - - 'default_reasoning_return_mechanism' - - 'is_lab_trusted' - - 'context_length' - - 'effective_adapter_name' - type: 'object' EnumCapability: description: 'A parameter that accepts one of a discrete set of string values.' example: @@ -28065,145 +27711,6 @@ components: example: 'user_only' type: 'string' x-speakeasy-unknown-values: allow - ProviderEndpoints: - properties: - endpoints: - items: - $ref: '#/components/schemas/EndpointSummary' - type: 'array' - stats: - $ref: '#/components/schemas/ProviderEndpointStats' - window: - description: 'Time window the provider-wide stats cover' - enum: - - '1hr' - - '1d' - - '1w' - - '1mo' - - '1y' - example: '1d' - type: 'string' - x-speakeasy-unknown-values: allow - required: - - 'window' - - 'endpoints' - - 'stats' - type: 'object' - ProviderEndpointsResponse: - properties: - data: - $ref: '#/components/schemas/ProviderEndpoints' - required: - - 'data' - type: 'object' - ProviderEndpointStats: - discriminator: - mapping: - available: '#/components/schemas/ProviderEndpointStatsAvailable' - unavailable: '#/components/schemas/ProviderEndpointStatsUnavailable' - propertyName: 'status' - oneOf: - - $ref: '#/components/schemas/ProviderEndpointStatsAvailable' - - $ref: '#/components/schemas/ProviderEndpointStatsUnavailable' - ProviderEndpointStatsAvailable: - properties: - endpoint_count: - description: 'Endpoints the stats cover' - example: 12 - type: 'integer' - error_rate_percent: - description: 'Errored share of requests that count toward uptime, 0-100' - example: 0.8 - format: 'double' - type: 'number' - latency_ms: - description: 'Request latency, milliseconds' - properties: - p50: - format: 'double' - type: - - 'number' - - 'null' - p90: - format: 'double' - type: - - 'number' - - 'null' - required: - - 'p50' - - 'p90' - type: 'object' - quality_percent: - description: 'Routing quality, 0-100' - format: 'double' - type: - - 'number' - - 'null' - rate_limited_percent: - description: 'Rate-limited share of routed requests, 0-100' - format: 'double' - type: - - 'number' - - 'null' - reliability_percent: - description: 'Routing reliability, 0-100' - format: 'double' - type: - - 'number' - - 'null' - requests: - description: 'Requests in the window' - example: 120000 - type: 'integer' - status: - enum: - - 'available' - type: 'string' - throughput_tokens_per_second: - description: 'Output tokens per second' - properties: - p50: - format: 'double' - type: - - 'number' - - 'null' - p90: - format: 'double' - type: - - 'number' - - 'null' - required: - - 'p50' - - 'p90' - type: 'object' - uptime_percent: - description: 'Successful share of requests that count toward uptime, 0-100' - example: 99.2 - format: 'double' - type: - - 'number' - - 'null' - required: - - 'status' - - 'endpoint_count' - - 'requests' - - 'uptime_percent' - - 'error_rate_percent' - - 'reliability_percent' - - 'quality_percent' - - 'rate_limited_percent' - - 'latency_ms' - - 'throughput_tokens_per_second' - type: 'object' - ProviderEndpointStatsUnavailable: - properties: - status: - enum: - - 'unavailable' - type: 'string' - required: - - 'status' - type: 'object' ProviderName: enum: - 'Modal' @@ -35733,8 +35240,32 @@ components: example: 'A serene mountain landscape at sunset' type: 'string' provider: - description: 'Provider-specific passthrough configuration' + description: 'Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration' properties: + ignore: + description: 'List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.' + example: + - 'openai' + - 'anthropic' + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: 'string' + type: + - 'array' + - 'null' + only: + description: 'List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.' + example: + - 'openai' + - 'anthropic' + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: 'string' + type: + - 'array' + - 'null' options: allOf: - $ref: '#/components/schemas/ProviderOptions' @@ -35742,6 +35273,18 @@ components: google-vertex: output_config: effort: 'low' + order: + description: 'An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.' + example: + - 'openai' + - 'anthropic' + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: 'string' + type: + - 'array' + - 'null' type: 'object' resolution: description: 'Resolution of the generated video' @@ -51945,129 +51488,6 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /providers/{provider_slug}/endpoints: - get: - description: 'Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access.' - operationId: 'listProviderEndpoints' - parameters: - - description: 'URL-friendly provider identifier (e.g. "openai", "fireworks")' - in: 'path' - name: 'provider_slug' - required: true - schema: - description: 'URL-friendly provider identifier (e.g. "openai", "fireworks")' - example: 'fireworks' - type: 'string' - - description: 'Time window the provider-wide stats cover' - in: 'query' - name: 'window' - required: false - schema: - default: '1mo' - description: 'Time window the provider-wide stats cover' - enum: - - '1hr' - - '1d' - - '1w' - - '1mo' - - '1y' - example: '1d' - type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve' - in: 'query' - name: 'perf_workload' - required: false - schema: - description: 'Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve' - enum: - - 'text_generation' - - 'image_generation' - - 'video_generation' - - 'embeddings' - - 'rerank' - - 'tts' - - 'stt' - - 'decisions' - - 'extractions' - - 'unknown' - example: 'text_generation' - type: 'string' - x-speakeasy-unknown-values: allow - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProviderEndpointsResponse' - description: 'The provider''s endpoints and provider-wide stats' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded' - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'List a provider''s endpoints with provider-wide stats' - tags: - - 'Providers' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" /rerank: post: description: 'Submits a rerank request to the rerank router' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index fc06225c0..3a62392ca 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:52436923d0a6723ff9b4fa9bf9302fbe04561046793ec97d59d0dc5941a3d6ef - sourceBlobDigest: sha256:5ce8c1c0436ba33eec92da10f762c92ab4a3e9d160a28bcf266c4e3e5f33ba5d + sourceRevisionDigest: sha256:6fccf3336b6ed3b0558baec72e6d7dfbd1c800b8226b6660b9be299f8a4dd5e2 + sourceBlobDigest: sha256:f2fd2fd60b2ecd6213174989327dfcc70b713044488b60a0b1bc3621897f224a tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:52436923d0a6723ff9b4fa9bf9302fbe04561046793ec97d59d0dc5941a3d6ef - sourceBlobDigest: sha256:5ce8c1c0436ba33eec92da10f762c92ab4a3e9d160a28bcf266c4e3e5f33ba5d + sourceRevisionDigest: sha256:6fccf3336b6ed3b0558baec72e6d7dfbd1c800b8226b6660b9be299f8a4dd5e2 + sourceBlobDigest: sha256:f2fd2fd60b2ecd6213174989327dfcc70b713044488b60a0b1bc3621897f224a codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:58f5a62e1535e7ffc644cdf4ac679438040334cc78fa660922f3c22cc1f3ba69 + codeSamplesRevisionDigest: sha256:3d99a3ca3c4717b2b835dc713624407d5dbf9277821691d9ec5806a4bae31f5b workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 5bc63cb95..4f1b06ece 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3969,4 +3969,14 @@ Based on: ### Generated - [python v1.3.120] . ### Releases -- [PyPI v1.3.120] https://pypi.org/project/openrouter/1.3.120 - . \ No newline at end of file +- [PyPI v1.3.120] https://pypi.org/project/openrouter/1.3.120 - . + +## 2026-11-04 21:58:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.121] . +### Releases +- [PyPI v1.3.121] https://pypi.org/project/openrouter/1.3.121 - . \ No newline at end of file diff --git a/docs/components/chattemplateconfig.mdx b/docs/components/chattemplateconfig.mdx deleted file mode 100644 index d957a1e60..000000000 --- a/docs/components/chattemplateconfig.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "ChatTemplateConfig" ---- - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `instruction_role_support` | [OptionalNullable[components.InstructionRoleSupport]](../components/instructionrolesupport.mdx) | ➖ | How leading instruction (developer/system) messages are mapped before reaching a chat-completions provider. 'developer' keeps the developer role, 'system' downgrades developer to system, 'user-only' downgrades both to a wrapped user message. Overridable per-endpoint. | -| `should_hoist_and_merge_system_messages` | *OptionalNullable[bool]* | ➖ | Whether to hoist and merge system messages | -| `supports_mid_session_system` | *OptionalNullable[bool]* | ➖ | Whether the model accepts system/developer messages that appear after the first user/assistant turn. When false, mid-session instruction messages are downgraded to wrapped user messages. Overridable per-endpoint. | \ No newline at end of file diff --git a/docs/components/defaultreasoningeffort.mdx b/docs/components/defaultreasoningeffort.mdx deleted file mode 100644 index 8516502b7..000000000 --- a/docs/components/defaultreasoningeffort.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "DefaultReasoningEffort" ---- - -## Example Usage - -```python -from openrouter.components import DefaultReasoningEffort - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: DefaultReasoningEffort = "max" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"max"` -- `"xhigh"` -- `"high"` -- `"medium"` -- `"low"` -- `"minimal"` diff --git a/docs/components/defaultreasoningreturnmechanism.mdx b/docs/components/defaultreasoningreturnmechanism.mdx deleted file mode 100644 index 9a185dec3..000000000 --- a/docs/components/defaultreasoningreturnmechanism.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "DefaultReasoningReturnMechanism" ---- - -Reasoning return mechanism the endpoint uses when neither its features nor the model set one - -## Example Usage - -```python -from openrouter.components import DefaultReasoningReturnMechanism - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: DefaultReasoningReturnMechanism = "content-string" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"content-string"` -- `"reasoning-content"` -- `"reasoning"` -- `"none"` diff --git a/docs/components/endpointsummary.mdx b/docs/components/endpointsummary.mdx deleted file mode 100644 index 62ddd1261..000000000 --- a/docs/components/endpointsummary.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "EndpointSummary" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `endpoint_id` | *str* | ✔️ | Endpoint ID | 0198c3f1-7b9a-7c31-a2d4-5e6f7a8b9c0d | -| `model_slug` | *str* | ✔️ | Public model slug | z-ai/glm-5.3 | -| `created_at` | *str* | ✔️ | When the endpoint was created | 2026-08-20T00:00:00.000Z | -| `model_permaslug` | *str* | ✔️ | Permanent model slug the endpoint is listed under | z-ai/glm-5.3-20260101 | -| `provider_model_id` | *Nullable[str]* | ✔️ | The provider's own model ID | accounts/fireworks/models/glm-5p3 | -| `provider_name` | *str* | ✔️ | Provider name | Fireworks | -| `provider_region` | *Nullable[str]* | ✔️ | Serving region | us | -| `service_tier` | *Nullable[str]* | ✔️ | Service tier; null for the default tier | priority | -| `test_profile` | [components.EndpointTestProfile](../components/endpointtestprofile.mdx) | ✔️ | N/A | | -| `variant` | *str* | ✔️ | Endpoint variant | standard | -| `visibility` | [components.Visibility](../components/visibility.mdx) | ✔️ | Whether the endpoint is listed on OpenRouter | visible | \ No newline at end of file diff --git a/docs/components/endpointtestprofile.mdx b/docs/components/endpointtestprofile.mdx deleted file mode 100644 index 3a4fdcc04..000000000 --- a/docs/components/endpointtestprofile.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "EndpointTestProfile" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `context_length` | *Nullable[int]* | ✔️ | Context length the endpoint serves: its override, else the model's | 128000 | -| `default_reasoning_return_mechanism` | [Nullable[components.DefaultReasoningReturnMechanism]](../components/defaultreasoningreturnmechanism.mdx) | ✔️ | Reasoning return mechanism the endpoint uses when neither its features nor the model set one | | -| `effective_adapter_name` | *Nullable[str]* | ✔️ | Adapter the endpoint is served through: its provider override, else the provider's; null when unresolved | openai | -| `endpoint_features` | Dict[str, *Any*] | ✔️ | Endpoint feature flags; null when unset or invalid | | -| `is_lab_trusted` | *bool* | ✔️ | Whether the endpoint serves a closed lab model through the lab or an official partner | | -| `model` | [components.EndpointTestProfileModel](../components/endpointtestprofilemodel.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/components/endpointtestprofileinputmodality.mdx b/docs/components/endpointtestprofileinputmodality.mdx deleted file mode 100644 index 0afb96682..000000000 --- a/docs/components/endpointtestprofileinputmodality.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "EndpointTestProfileInputModality" ---- - -## Example Usage - -```python -from openrouter.components import EndpointTestProfileInputModality - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: EndpointTestProfileInputModality = "text" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"text"` -- `"image"` -- `"file"` -- `"audio"` -- `"video"` diff --git a/docs/components/endpointtestprofilemodel.mdx b/docs/components/endpointtestprofilemodel.mdx deleted file mode 100644 index fa1eb5726..000000000 --- a/docs/components/endpointtestprofilemodel.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "EndpointTestProfileModel" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `features` | [Nullable[components.Features]](../components/features.mdx) | ✔️ | N/A | | -| `input_modalities` | List[[components.EndpointTestProfileInputModality](../components/endpointtestprofileinputmodality.mdx)] | ✔️ | N/A | | -| `output_modalities` | List[[components.EndpointTestProfileOutputModality](../components/endpointtestprofileoutputmodality.mdx)] | ✔️ | N/A | | -| `reasoning_config` | [Nullable[components.EndpointTestProfileReasoningConfig]](../components/endpointtestprofilereasoningconfig.mdx) | ✔️ | N/A | | -| `slug` | *str* | ✔️ | Public model slug | z-ai/glm-5.3 | -| `supports_reasoning` | *bool* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/components/endpointtestprofileoutputmodality.mdx b/docs/components/endpointtestprofileoutputmodality.mdx deleted file mode 100644 index 14d81efa3..000000000 --- a/docs/components/endpointtestprofileoutputmodality.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "EndpointTestProfileOutputModality" ---- - -## Example Usage - -```python -from openrouter.components import EndpointTestProfileOutputModality - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: EndpointTestProfileOutputModality = "text" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"text"` -- `"image"` -- `"embeddings"` -- `"audio"` -- `"video"` -- `"rerank"` -- `"decisions"` -- `"speech"` -- `"transcription"` diff --git a/docs/components/endpointtestprofilereasoningconfig.mdx b/docs/components/endpointtestprofilereasoningconfig.mdx deleted file mode 100644 index b9983570e..000000000 --- a/docs/components/endpointtestprofilereasoningconfig.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "EndpointTestProfileReasoningConfig" ---- - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `default_reasoning_effort` | [OptionalNullable[components.DefaultReasoningEffort]](../components/defaultreasoningeffort.mdx) | ➖ | N/A | -| `default_reasoning_enabled` | *OptionalNullable[bool]* | ➖ | Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this. | -| `end_token` | *OptionalNullable[str]* | ➖ | N/A | -| `is_mandatory_reasoning` | *OptionalNullable[bool]* | ➖ | N/A | -| `reasoning_return_mechanism` | [OptionalNullable[components.ReasoningReturnMechanism]](../components/reasoningreturnmechanism.mdx) | ➖ | Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features. | -| `start_token` | *OptionalNullable[str]* | ➖ | N/A | -| `supported_reasoning_efforts` | List[[components.SupportedReasoningEffort](../components/supportedreasoningeffort.mdx)] | ➖ | List of reasoning effort values the model accepts upstream | -| `supports_reasoning_effort` | *OptionalNullable[bool]* | ➖ | Whether the model supports reasoning effort | -| `supports_reasoning_max_tokens` | *OptionalNullable[bool]* | ➖ | Whether the model supports reasoning max tokens | -| `system_prompt` | *OptionalNullable[str]* | ➖ | N/A | \ No newline at end of file diff --git a/docs/components/features.mdx b/docs/components/features.mdx deleted file mode 100644 index d179320ea..000000000 --- a/docs/components/features.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Features" ---- - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `chat_template_config` | [OptionalNullable[components.ChatTemplateConfig]](../components/chattemplateconfig.mdx) | ➖ | N/A | -| `reasoning_config` | [OptionalNullable[components.FeaturesReasoningConfig]](../components/featuresreasoningconfig.mdx) | ➖ | N/A | -| `required_input_modalities` | List[[components.RequiredInputModality](../components/requiredinputmodality.mdx)] | ➖ | Input modalities every request to the model must include, e.g. ["video"] for video-to-video-only models. Requests missing a required modality are rejected before dispatch. A required text modality is satisfied by the prompt. Currently enforced on the video generation request path. | \ No newline at end of file diff --git a/docs/components/featuresdefaultreasoningeffort.mdx b/docs/components/featuresdefaultreasoningeffort.mdx deleted file mode 100644 index d04709713..000000000 --- a/docs/components/featuresdefaultreasoningeffort.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "FeaturesDefaultReasoningEffort" ---- - -## Example Usage - -```python -from openrouter.components import FeaturesDefaultReasoningEffort - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: FeaturesDefaultReasoningEffort = "max" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"max"` -- `"xhigh"` -- `"high"` -- `"medium"` -- `"low"` -- `"minimal"` diff --git a/docs/components/featuresreasoningconfig.mdx b/docs/components/featuresreasoningconfig.mdx deleted file mode 100644 index 0d6767104..000000000 --- a/docs/components/featuresreasoningconfig.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "FeaturesReasoningConfig" ---- - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `default_reasoning_effort` | [OptionalNullable[components.FeaturesDefaultReasoningEffort]](../components/featuresdefaultreasoningeffort.mdx) | ➖ | N/A | -| `default_reasoning_enabled` | *OptionalNullable[bool]* | ➖ | Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this. | -| `end_token` | *OptionalNullable[str]* | ➖ | N/A | -| `is_mandatory_reasoning` | *OptionalNullable[bool]* | ➖ | N/A | -| `reasoning_return_mechanism` | [OptionalNullable[components.FeaturesReasoningReturnMechanism]](../components/featuresreasoningreturnmechanism.mdx) | ➖ | Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features. | -| `start_token` | *OptionalNullable[str]* | ➖ | N/A | -| `supported_reasoning_efforts` | List[[components.FeaturesSupportedReasoningEffort](../components/featuressupportedreasoningeffort.mdx)] | ➖ | List of reasoning effort values the model accepts upstream | -| `supports_reasoning_effort` | *OptionalNullable[bool]* | ➖ | Whether the model supports reasoning effort | -| `supports_reasoning_max_tokens` | *OptionalNullable[bool]* | ➖ | Whether the model supports reasoning max tokens | -| `system_prompt` | *OptionalNullable[str]* | ➖ | N/A | \ No newline at end of file diff --git a/docs/components/featuresreasoningreturnmechanism.mdx b/docs/components/featuresreasoningreturnmechanism.mdx deleted file mode 100644 index 067b63cc4..000000000 --- a/docs/components/featuresreasoningreturnmechanism.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "FeaturesReasoningReturnMechanism" ---- - -Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features. - -## Example Usage - -```python -from openrouter.components import FeaturesReasoningReturnMechanism - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: FeaturesReasoningReturnMechanism = "content-string" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"content-string"` -- `"reasoning-content"` -- `"reasoning"` -- `"none"` diff --git a/docs/components/featuressupportedreasoningeffort.mdx b/docs/components/featuressupportedreasoningeffort.mdx deleted file mode 100644 index c6f07dceb..000000000 --- a/docs/components/featuressupportedreasoningeffort.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "FeaturesSupportedReasoningEffort" ---- - -## Example Usage - -```python -from openrouter.components import FeaturesSupportedReasoningEffort - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: FeaturesSupportedReasoningEffort = "max" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"max"` -- `"xhigh"` -- `"high"` -- `"medium"` -- `"low"` -- `"minimal"` diff --git a/docs/components/instructionrolesupport.mdx b/docs/components/instructionrolesupport.mdx deleted file mode 100644 index d12c96f80..000000000 --- a/docs/components/instructionrolesupport.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InstructionRoleSupport" ---- - -How leading instruction (developer/system) messages are mapped before reaching a chat-completions provider. 'developer' keeps the developer role, 'system' downgrades developer to system, 'user-only' downgrades both to a wrapped user message. Overridable per-endpoint. - -## Example Usage - -```python -from openrouter.components import InstructionRoleSupport - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: InstructionRoleSupport = "developer" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"developer"` -- `"system"` -- `"user-only"` diff --git a/docs/components/latencyms.mdx b/docs/components/latencyms.mdx deleted file mode 100644 index 8740fcc1c..000000000 --- a/docs/components/latencyms.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "LatencyMs" ---- - -Request latency, milliseconds - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `p50` | *Nullable[float]* | ✔️ | N/A | -| `p90` | *Nullable[float]* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/providerendpoints.mdx b/docs/components/providerendpoints.mdx deleted file mode 100644 index 2fa98c5f5..000000000 --- a/docs/components/providerendpoints.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "ProviderEndpoints" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `endpoints` | List[[components.EndpointSummary](../components/endpointsummary.mdx)] | ✔️ | N/A | | -| `stats` | [components.ProviderEndpointStats](../components/providerendpointstats.mdx) | ✔️ | N/A | | -| `window` | [components.Window](../components/window.mdx) | ✔️ | Time window the provider-wide stats cover | 1d | \ No newline at end of file diff --git a/docs/components/providerendpointsresponse.mdx b/docs/components/providerendpointsresponse.mdx deleted file mode 100644 index 93121830d..000000000 --- a/docs/components/providerendpointsresponse.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "ProviderEndpointsResponse" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `data` | [components.ProviderEndpoints](../components/providerendpoints.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/providerendpointstats.mdx b/docs/components/providerendpointstats.mdx deleted file mode 100644 index 0d36b106c..000000000 --- a/docs/components/providerendpointstats.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "ProviderEndpointStats" ---- - -## Supported Types - -### `components.ProviderEndpointStatsAvailable` - -```python -value: components.ProviderEndpointStatsAvailable = /* values here */ -``` - -### `components.ProviderEndpointStatsUnavailable` - -```python -value: components.ProviderEndpointStatsUnavailable = /* values here */ -``` - diff --git a/docs/components/providerendpointstatsavailable.mdx b/docs/components/providerendpointstatsavailable.mdx deleted file mode 100644 index f18332bc3..000000000 --- a/docs/components/providerendpointstatsavailable.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "ProviderEndpointStatsAvailable" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `endpoint_count` | *int* | ✔️ | Endpoints the stats cover | 12 | -| `error_rate_percent` | *float* | ✔️ | Errored share of requests that count toward uptime, 0-100 | 0.8 | -| `latency_ms` | [components.LatencyMs](../components/latencyms.mdx) | ✔️ | Request latency, milliseconds | | -| `quality_percent` | *Nullable[float]* | ✔️ | Routing quality, 0-100 | | -| `rate_limited_percent` | *Nullable[float]* | ✔️ | Rate-limited share of routed requests, 0-100 | | -| `reliability_percent` | *Nullable[float]* | ✔️ | Routing reliability, 0-100 | | -| `requests` | *int* | ✔️ | Requests in the window | 120000 | -| `status` | [components.ProviderEndpointStatsAvailableStatus](../components/providerendpointstatsavailablestatus.mdx) | ✔️ | N/A | | -| `throughput_tokens_per_second` | [components.ThroughputTokensPerSecond](../components/throughputtokenspersecond.mdx) | ✔️ | Output tokens per second | | -| `uptime_percent` | *Nullable[float]* | ✔️ | Successful share of requests that count toward uptime, 0-100 | 99.2 | \ No newline at end of file diff --git a/docs/components/providerendpointstatsavailablestatus.mdx b/docs/components/providerendpointstatsavailablestatus.mdx deleted file mode 100644 index 43d1f481a..000000000 --- a/docs/components/providerendpointstatsavailablestatus.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "ProviderEndpointStatsAvailableStatus" ---- - -## Example Usage - -```python -from openrouter.components import ProviderEndpointStatsAvailableStatus -value: ProviderEndpointStatsAvailableStatus = "available" -``` - - -## Values - -- `"available"` diff --git a/docs/components/providerendpointstatsunavailable.mdx b/docs/components/providerendpointstatsunavailable.mdx deleted file mode 100644 index d7b19cd60..000000000 --- a/docs/components/providerendpointstatsunavailable.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "ProviderEndpointStatsUnavailable" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `status` | [components.ProviderEndpointStatsUnavailableStatus](../components/providerendpointstatsunavailablestatus.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/providerendpointstatsunavailablestatus.mdx b/docs/components/providerendpointstatsunavailablestatus.mdx deleted file mode 100644 index 5f99ed2cf..000000000 --- a/docs/components/providerendpointstatsunavailablestatus.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "ProviderEndpointStatsUnavailableStatus" ---- - -## Example Usage - -```python -from openrouter.components import ProviderEndpointStatsUnavailableStatus -value: ProviderEndpointStatsUnavailableStatus = "unavailable" -``` - - -## Values - -- `"unavailable"` diff --git a/docs/components/reasoningreturnmechanism.mdx b/docs/components/reasoningreturnmechanism.mdx deleted file mode 100644 index ab2b9418c..000000000 --- a/docs/components/reasoningreturnmechanism.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "ReasoningReturnMechanism" ---- - -Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features. - -## Example Usage - -```python -from openrouter.components import ReasoningReturnMechanism - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: ReasoningReturnMechanism = "content-string" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"content-string"` -- `"reasoning-content"` -- `"reasoning"` -- `"none"` diff --git a/docs/components/requiredinputmodality.mdx b/docs/components/requiredinputmodality.mdx deleted file mode 100644 index 5255fbcda..000000000 --- a/docs/components/requiredinputmodality.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "RequiredInputModality" ---- - -## Example Usage - -```python -from openrouter.components import RequiredInputModality - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: RequiredInputModality = "text" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"text"` -- `"image"` -- `"audio"` -- `"video"` diff --git a/docs/components/supportedreasoningeffort.mdx b/docs/components/supportedreasoningeffort.mdx deleted file mode 100644 index 1911d4dfd..000000000 --- a/docs/components/supportedreasoningeffort.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "SupportedReasoningEffort" ---- - -## Example Usage - -```python -from openrouter.components import SupportedReasoningEffort - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: SupportedReasoningEffort = "max" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"max"` -- `"xhigh"` -- `"high"` -- `"medium"` -- `"low"` -- `"minimal"` diff --git a/docs/components/throughputtokenspersecond.mdx b/docs/components/throughputtokenspersecond.mdx deleted file mode 100644 index f36915f61..000000000 --- a/docs/components/throughputtokenspersecond.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "ThroughputTokensPerSecond" ---- - -Output tokens per second - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `p50` | *Nullable[float]* | ✔️ | N/A | -| `p90` | *Nullable[float]* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/videogenerationrequest.mdx b/docs/components/videogenerationrequest.mdx index ebdc8142c..b6bdecc24 100644 --- a/docs/components/videogenerationrequest.mdx +++ b/docs/components/videogenerationrequest.mdx @@ -16,7 +16,7 @@ title: "VideoGenerationRequest" | `model` | *str* | ✔️ | N/A | | | `previous_job_id` | *Optional[str]* | ➖ | ID of a completed video job to edit or extend, as returned by the submit response. The new job runs on the same model and endpoint that produced the previous one. Only models that support continuation accept this field. | gen-vid-1789493115-a1B2c3D4e5F6g7H8i9J0 | | `prompt` | *Optional[str]* | ➖ | Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models. | A serene mountain landscape at sunset | -| `provider` | [Optional[components.VideoGenerationRequestProvider]](../components/videogenerationrequestprovider.mdx) | ➖ | Provider-specific passthrough configuration | | +| `provider` | [Optional[components.VideoGenerationRequestProvider]](../components/videogenerationrequestprovider.mdx) | ➖ | Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration | | | `resolution` | [Optional[components.VideoGenerationRequestResolution]](../components/videogenerationrequestresolution.mdx) | ➖ | Resolution of the generated video | 720p | | `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | diff --git a/docs/components/videogenerationrequestignore.mdx b/docs/components/videogenerationrequestignore.mdx new file mode 100644 index 000000000..1480df84e --- /dev/null +++ b/docs/components/videogenerationrequestignore.mdx @@ -0,0 +1,18 @@ +--- +title: "VideoGenerationRequestIgnore" +--- + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/videogenerationrequestonly.mdx b/docs/components/videogenerationrequestonly.mdx new file mode 100644 index 000000000..d8c6c0f20 --- /dev/null +++ b/docs/components/videogenerationrequestonly.mdx @@ -0,0 +1,18 @@ +--- +title: "VideoGenerationRequestOnly" +--- + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/videogenerationrequestorder.mdx b/docs/components/videogenerationrequestorder.mdx new file mode 100644 index 000000000..0ddf6c9ae --- /dev/null +++ b/docs/components/videogenerationrequestorder.mdx @@ -0,0 +1,18 @@ +--- +title: "VideoGenerationRequestOrder" +--- + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/videogenerationrequestprovider.mdx b/docs/components/videogenerationrequestprovider.mdx index 7fc69a9d5..88b30bc0a 100644 --- a/docs/components/videogenerationrequestprovider.mdx +++ b/docs/components/videogenerationrequestprovider.mdx @@ -2,11 +2,14 @@ title: "VideoGenerationRequestProvider" --- -Provider-specific passthrough configuration +Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `options` | [Optional[components.VideoGenerationRequestOptions]](../components/videogenerationrequestoptions.mdx) | ➖ | N/A | \{
"google-vertex": \{
"output_config": \{
"effort": "low"
}
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ignore` | List[[components.VideoGenerationRequestIgnore](../components/videogenerationrequestignore.mdx)] | ➖ | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | [
"openai",
"anthropic"
] | +| `only` | List[[components.VideoGenerationRequestOnly](../components/videogenerationrequestonly.mdx)] | ➖ | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | [
"openai",
"anthropic"
] | +| `options` | [Optional[components.VideoGenerationRequestOptions]](../components/videogenerationrequestoptions.mdx) | ➖ | N/A | \{
"google-vertex": \{
"output_config": \{
"effort": "low"
}
}
} | +| `order` | List[[components.VideoGenerationRequestOrder](../components/videogenerationrequestorder.mdx)] | ➖ | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | [
"openai",
"anthropic"
] | \ No newline at end of file diff --git a/docs/components/visibility.mdx b/docs/components/visibility.mdx deleted file mode 100644 index 85c28caf1..000000000 --- a/docs/components/visibility.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "Visibility" ---- - -Whether the endpoint is listed on OpenRouter - -## Example Usage - -```python -from openrouter.components import Visibility - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: Visibility = "visible" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"visible"` -- `"hidden"` diff --git a/docs/components/window.mdx b/docs/components/window.mdx deleted file mode 100644 index 6b84147b4..000000000 --- a/docs/components/window.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Window" ---- - -Time window the provider-wide stats cover - -## Example Usage - -```python -from openrouter.components import Window - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: Window = "1hr" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"1hr"` -- `"1d"` -- `"1w"` -- `"1mo"` -- `"1y"` diff --git a/docs/operations/gettaskclassificationsrequest.mdx b/docs/operations/gettaskclassificationsrequest.mdx index bf44a0d33..a2c427446 100644 --- a/docs/operations/gettaskclassificationsrequest.mdx +++ b/docs/operations/gettaskclassificationsrequest.mdx @@ -9,4 +9,4 @@ title: "GetTaskClassificationsRequest" | `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.
| | -| `window` | [Optional[operations.GetTaskClassificationsWindow]](../operations/gettaskclassificationswindow.mdx) | ➖ | Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. | 7d | \ No newline at end of file +| `window` | [Optional[operations.Window]](../operations/window.mdx) | ➖ | Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. | 7d | \ No newline at end of file diff --git a/docs/operations/listproviderendpointsglobals.mdx b/docs/operations/listproviderendpointsglobals.mdx deleted file mode 100644 index 65a8151dd..000000000 --- a/docs/operations/listproviderendpointsglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "ListProviderEndpointsGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listproviderendpointsrequest.mdx b/docs/operations/listproviderendpointsrequest.mdx deleted file mode 100644 index 3dbaa9207..000000000 --- a/docs/operations/listproviderendpointsrequest.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "ListProviderEndpointsRequest" ---- - -## 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.
| | -| `provider_slug` | *str* | ✔️ | URL-friendly provider identifier (e.g. "openai", "fireworks") | fireworks | -| `window` | [Optional[operations.ListProviderEndpointsWindow]](../operations/listproviderendpointswindow.mdx) | ➖ | Time window the provider-wide stats cover | 1d | -| `perf_workload` | [Optional[operations.PerfWorkload]](../operations/perfworkload.mdx) | ➖ | Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve | text_generation | \ No newline at end of file diff --git a/docs/operations/listproviderendpointswindow.mdx b/docs/operations/listproviderendpointswindow.mdx deleted file mode 100644 index 08fc9d1cf..000000000 --- a/docs/operations/listproviderendpointswindow.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "ListProviderEndpointsWindow" ---- - -Time window the provider-wide stats cover - -## Example Usage - -```python -from openrouter.operations import ListProviderEndpointsWindow - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: ListProviderEndpointsWindow = "1hr" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"1hr"` -- `"1d"` -- `"1w"` -- `"1mo"` -- `"1y"` diff --git a/docs/operations/perfworkload.mdx b/docs/operations/perfworkload.mdx deleted file mode 100644 index 6a4dd0d44..000000000 --- a/docs/operations/perfworkload.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "PerfWorkload" ---- - -Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve - -## Example Usage - -```python -from openrouter.operations import PerfWorkload - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: PerfWorkload = "text_generation" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"text_generation"` -- `"image_generation"` -- `"video_generation"` -- `"embeddings"` -- `"rerank"` -- `"tts"` -- `"stt"` -- `"decisions"` -- `"extractions"` -- `"unknown"` diff --git a/docs/operations/gettaskclassificationswindow.mdx b/docs/operations/window.mdx similarity index 53% rename from docs/operations/gettaskclassificationswindow.mdx rename to docs/operations/window.mdx index e0e1a0f03..52168404b 100644 --- a/docs/operations/gettaskclassificationswindow.mdx +++ b/docs/operations/window.mdx @@ -1,5 +1,5 @@ --- -title: "GetTaskClassificationsWindow" +title: "Window" --- Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. @@ -7,8 +7,8 @@ Trailing time window for the classification data. Currently only `7d` (trailing ## Example Usage ```python -from openrouter.operations import GetTaskClassificationsWindow -value: GetTaskClassificationsWindow = "7d" +from openrouter.operations import Window +value: Window = "7d" ``` diff --git a/docs/sdks/classifications/README.mdx b/docs/sdks/classifications/README.mdx index aa324667a..c59bcbd8e 100644 --- a/docs/sdks/classifications/README.mdx +++ b/docs/sdks/classifications/README.mdx @@ -61,7 +61,7 @@ with OpenRouter( | `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.
| | -| `window` | [Optional[operations.GetTaskClassificationsWindow]](../../operations/gettaskclassificationswindow.mdx) | ➖ | Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. | 7d | +| `window` | [Optional[operations.Window]](../../operations/window.mdx) | ➖ | Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. | 7d | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/providers/README.mdx b/docs/sdks/providers/README.mdx index 88e3620cf..fbd074b61 100644 --- a/docs/sdks/providers/README.mdx +++ b/docs/sdks/providers/README.mdx @@ -10,7 +10,6 @@ Provider information endpoints ### Available Operations * [list](#list) - List all providers -* [list_provider_endpoints](#list_provider_endpoints) - List a provider's endpoints with provider-wide stats ## list @@ -55,57 +54,4 @@ with OpenRouter( | Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.InternalServerResponseError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## list_provider_endpoints - -Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access. - -### Example Usage - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.providers.list_provider_endpoints(provider_slug="fireworks", window="1d") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `provider_slug` | *str* | ✔️ | URL-friendly provider identifier (e.g. "openai", "fireworks") | fireworks | -| `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.
| | -| `window` | [Optional[operations.ListProviderEndpointsWindow]](../../operations/listproviderendpointswindow.mdx) | ➖ | Time window the provider-wide stats cover | 1d | -| `perf_workload` | [Optional[operations.PerfWorkload]](../../operations/perfworkload.mdx) | ➖ | Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve | text_generation | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.ProviderEndpointsResponse](../../components/providerendpointsresponse.mdx)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| errors.BadRequestResponseError | 400 | application/json | -| errors.UnauthorizedResponseError | 401 | application/json | -| errors.ForbiddenResponseError | 403 | application/json | -| errors.NotFoundResponseError | 404 | application/json | -| errors.TooManyRequestsResponseError | 429 | application/json | -| errors.InternalServerResponseError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/videogeneration/README.mdx b/docs/sdks/videogeneration/README.mdx index 19ee9f039..8d19de6bd 100644 --- a/docs/sdks/videogeneration/README.mdx +++ b/docs/sdks/videogeneration/README.mdx @@ -56,7 +56,7 @@ with OpenRouter( | `input_references` | List[[components.InputReference](../../components/inputreference.mdx)] | ➖ | Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (including BytePlus Seedance generation 2 and newer); other providers use image references and ignore the rest. | | | `previous_job_id` | *Optional[str]* | ➖ | ID of a completed video job to edit or extend, as returned by the submit response. The new job runs on the same model and endpoint that produced the previous one. Only models that support continuation accept this field. | gen-vid-1789493115-a1B2c3D4e5F6g7H8i9J0 | | `prompt` | *Optional[str]* | ➖ | Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models. | A serene mountain landscape at sunset | -| `provider` | [Optional[components.VideoGenerationRequestProvider]](../../components/videogenerationrequestprovider.mdx) | ➖ | Provider-specific passthrough configuration | | +| `provider` | [Optional[components.VideoGenerationRequestProvider]](../../components/videogenerationrequestprovider.mdx) | ➖ | Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration | | | `resolution` | [Optional[components.VideoGenerationRequestResolution]](../../components/videogenerationrequestresolution.mdx) | ➖ | Resolution of the generated video | 720p | | `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | diff --git a/pyproject.toml b/pyproject.toml index 84ee3e926..24870006d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.120" +version = "1.3.121" 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 1f7921462..990fcb2f1 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.120" +__version__: str = "1.3.121" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.120 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.121 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/classifications.py b/src/openrouter/classifications.py index 192786c7c..ad3d24795 100644 --- a/src/openrouter/classifications.py +++ b/src/openrouter/classifications.py @@ -18,7 +18,7 @@ def get_task_classifications( http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - window: Optional[operations.GetTaskClassificationsWindow] = "7d", + window: Optional[operations.Window] = "7d", retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -171,7 +171,7 @@ async def get_task_classifications_async( http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - window: Optional[operations.GetTaskClassificationsWindow] = "7d", + window: Optional[operations.Window] = "7d", retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index dbb7fcac6..fe54f56dd 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1815,32 +1815,6 @@ from .endpointinfo import EndpointInfo, EndpointInfoTypedDict from .endpointsmetadata import EndpointsMetadata, EndpointsMetadataTypedDict from .endpointstatus import EndpointStatus - from .endpointsummary import EndpointSummary, EndpointSummaryTypedDict, Visibility - from .endpointtestprofile import ( - ChatTemplateConfig, - ChatTemplateConfigTypedDict, - DefaultReasoningEffort, - DefaultReasoningReturnMechanism, - EndpointTestProfile, - EndpointTestProfileInputModality, - EndpointTestProfileModel, - EndpointTestProfileModelTypedDict, - EndpointTestProfileOutputModality, - EndpointTestProfileReasoningConfig, - EndpointTestProfileReasoningConfigTypedDict, - EndpointTestProfileTypedDict, - Features, - FeaturesDefaultReasoningEffort, - FeaturesReasoningConfig, - FeaturesReasoningConfigTypedDict, - FeaturesReasoningReturnMechanism, - FeaturesSupportedReasoningEffort, - FeaturesTypedDict, - InstructionRoleSupport, - ReasoningReturnMechanism, - RequiredInputModality, - SupportedReasoningEffort, - ) from .enumcapability import ( EnumCapability, EnumCapabilityType, @@ -3812,30 +3786,6 @@ PromptCacheOptionsTypedDict, ) from .promptinjectionscanscope import PromptInjectionScanScope - from .providerendpoints import ProviderEndpoints, ProviderEndpointsTypedDict, Window - from .providerendpointsresponse import ( - ProviderEndpointsResponse, - ProviderEndpointsResponseTypedDict, - ) - from .providerendpointstats import ( - ProviderEndpointStats, - ProviderEndpointStatsTypedDict, - UnknownProviderEndpointStats, - ) - from .providerendpointstatsavailable import ( - LatencyMs, - LatencyMsTypedDict, - ProviderEndpointStatsAvailable, - ProviderEndpointStatsAvailableStatus, - ProviderEndpointStatsAvailableTypedDict, - ThroughputTokensPerSecond, - ThroughputTokensPerSecondTypedDict, - ) - from .providerendpointstatsunavailable import ( - ProviderEndpointStatsUnavailable, - ProviderEndpointStatsUnavailableStatus, - ProviderEndpointStatsUnavailableTypedDict, - ) from .providername import ProviderName from .provideroptions import ProviderOptions, ProviderOptionsTypedDict from .provideroverloadedresponseerrordata import ( @@ -4643,8 +4593,14 @@ from .videogenerationrequest import ( VideoGenerationRequest, VideoGenerationRequestAspectRatio, + VideoGenerationRequestIgnore, + VideoGenerationRequestIgnoreTypedDict, + VideoGenerationRequestOnly, + VideoGenerationRequestOnlyTypedDict, VideoGenerationRequestOptions, VideoGenerationRequestOptionsTypedDict, + VideoGenerationRequestOrder, + VideoGenerationRequestOrderTypedDict, VideoGenerationRequestProvider, VideoGenerationRequestProviderTypedDict, VideoGenerationRequestResolution, @@ -5577,8 +5533,6 @@ "ChatSystemMessageContentTypedDict", "ChatSystemMessageRole", "ChatSystemMessageTypedDict", - "ChatTemplateConfig", - "ChatTemplateConfigTypedDict", "ChatTokenLogprob", "ChatTokenLogprobTopLogprob", "ChatTokenLogprobTopLogprobTypedDict", @@ -5944,8 +5898,6 @@ "DefaultEffort", "DefaultParameters", "DefaultParametersTypedDict", - "DefaultReasoningEffort", - "DefaultReasoningReturnMechanism", "DeferredBm25Search", "DeferredBm25SearchType", "DeferredBm25SearchTypedDict", @@ -6015,16 +5967,6 @@ "EndpointInfo", "EndpointInfoTypedDict", "EndpointStatus", - "EndpointSummary", - "EndpointSummaryTypedDict", - "EndpointTestProfile", - "EndpointTestProfileInputModality", - "EndpointTestProfileModel", - "EndpointTestProfileModelTypedDict", - "EndpointTestProfileOutputModality", - "EndpointTestProfileReasoningConfig", - "EndpointTestProfileReasoningConfigTypedDict", - "EndpointTestProfileTypedDict", "EndpointsMetadata", "EndpointsMetadataTypedDict", "EnumCapability", @@ -6185,13 +6127,6 @@ "FailedModelTypedDict", "FalseT", "FalseTTypedDict", - "Features", - "FeaturesDefaultReasoningEffort", - "FeaturesReasoningConfig", - "FeaturesReasoningConfigTypedDict", - "FeaturesReasoningReturnMechanism", - "FeaturesSupportedReasoningEffort", - "FeaturesTypedDict", "FieldT", "Fields", "FieldsTypedDict", @@ -6561,7 +6496,6 @@ "Installation", "InstallationTypedDict", "InstructType", - "InstructionRoleSupport", "InternalServerResponseErrorData", "InternalServerResponseErrorDataTypedDict", "Interval", @@ -6588,8 +6522,6 @@ "KeyBudgetTypedDict", "KeyTypedDict", "Kty", - "LatencyMs", - "LatencyMsTypedDict", "LegacyChatContentVideo", "LegacyChatContentVideoInput", "LegacyChatContentVideoInputProcessing", @@ -7449,18 +7381,6 @@ "PromptCacheOptionsTypedDict", "PromptInjectionScanScope", "Protocol", - "ProviderEndpointStats", - "ProviderEndpointStatsAvailable", - "ProviderEndpointStatsAvailableStatus", - "ProviderEndpointStatsAvailableTypedDict", - "ProviderEndpointStatsTypedDict", - "ProviderEndpointStatsUnavailable", - "ProviderEndpointStatsUnavailableStatus", - "ProviderEndpointStatsUnavailableTypedDict", - "ProviderEndpoints", - "ProviderEndpointsResponse", - "ProviderEndpointsResponseTypedDict", - "ProviderEndpointsTypedDict", "ProviderEnum", "ProviderName", "ProviderOptions", @@ -7543,7 +7463,6 @@ "ReasoningItemType", "ReasoningItemTypedDict", "ReasoningMode", - "ReasoningReturnMechanism", "ReasoningSummaryPartAddedEvent", "ReasoningSummaryPartAddedEventType", "ReasoningSummaryPartAddedEventTypedDict", @@ -7585,7 +7504,6 @@ "RequireApprovalTypedDict", "RequireApprovalUnion", "RequireApprovalUnionTypedDict", - "RequiredInputModality", "Rerank", "RerankTypedDict", "ResponseFormat", @@ -7861,7 +7779,6 @@ "SubmitGenerationFeedbackResponseTypedDict", "SupportedAspectRatio", "SupportedFrameImage", - "SupportedReasoningEffort", "SupportedResolution", "SupportedSize", "SwitchyardRouterPlugin", @@ -7905,8 +7822,6 @@ "ThinkingEnabledTypedDict", "ThinkingTypeDisabled", "ThinkingTypedDict", - "ThroughputTokensPerSecond", - "ThroughputTokensPerSecondTypedDict", "Token", "TokenExchangeRequest", "TokenExchangeRequestScope", @@ -8114,7 +8029,6 @@ "UnknownOutputMessageContent", "UnknownOutputMessageItemContent", "UnknownOutputWebSearchCallItemActionUnion", - "UnknownProviderEndpointStats", "UnknownReasoningDetail", "UnknownReasoningDetailUnion", "UnknownStreamEvents", @@ -8211,8 +8125,14 @@ "VideoGeneration", "VideoGenerationRequest", "VideoGenerationRequestAspectRatio", + "VideoGenerationRequestIgnore", + "VideoGenerationRequestIgnoreTypedDict", + "VideoGenerationRequestOnly", + "VideoGenerationRequestOnlyTypedDict", "VideoGenerationRequestOptions", "VideoGenerationRequestOptionsTypedDict", + "VideoGenerationRequestOrder", + "VideoGenerationRequestOrderTypedDict", "VideoGenerationRequestProvider", "VideoGenerationRequestProviderTypedDict", "VideoGenerationRequestResolution", @@ -8229,7 +8149,6 @@ "VideoModelsListResponseTypedDict", "VideoURL", "VideoURLTypedDict", - "Visibility", "Watch", "WebFetchEngineEnum", "WebFetchPlugin", @@ -8280,7 +8199,6 @@ "WebSearchUserLocationServerToolTypedDict", "WebSearchUserLocationType", "WebSearchUserLocationTypedDict", - "Window", "Workspace", "WorkspaceBudget", "WorkspaceBudgetInterval", @@ -9589,32 +9507,6 @@ "EndpointsMetadata": ".endpointsmetadata", "EndpointsMetadataTypedDict": ".endpointsmetadata", "EndpointStatus": ".endpointstatus", - "EndpointSummary": ".endpointsummary", - "EndpointSummaryTypedDict": ".endpointsummary", - "Visibility": ".endpointsummary", - "ChatTemplateConfig": ".endpointtestprofile", - "ChatTemplateConfigTypedDict": ".endpointtestprofile", - "DefaultReasoningEffort": ".endpointtestprofile", - "DefaultReasoningReturnMechanism": ".endpointtestprofile", - "EndpointTestProfile": ".endpointtestprofile", - "EndpointTestProfileInputModality": ".endpointtestprofile", - "EndpointTestProfileModel": ".endpointtestprofile", - "EndpointTestProfileModelTypedDict": ".endpointtestprofile", - "EndpointTestProfileOutputModality": ".endpointtestprofile", - "EndpointTestProfileReasoningConfig": ".endpointtestprofile", - "EndpointTestProfileReasoningConfigTypedDict": ".endpointtestprofile", - "EndpointTestProfileTypedDict": ".endpointtestprofile", - "Features": ".endpointtestprofile", - "FeaturesDefaultReasoningEffort": ".endpointtestprofile", - "FeaturesReasoningConfig": ".endpointtestprofile", - "FeaturesReasoningConfigTypedDict": ".endpointtestprofile", - "FeaturesReasoningReturnMechanism": ".endpointtestprofile", - "FeaturesSupportedReasoningEffort": ".endpointtestprofile", - "FeaturesTypedDict": ".endpointtestprofile", - "InstructionRoleSupport": ".endpointtestprofile", - "ReasoningReturnMechanism": ".endpointtestprofile", - "RequiredInputModality": ".endpointtestprofile", - "SupportedReasoningEffort": ".endpointtestprofile", "EnumCapability": ".enumcapability", "EnumCapabilityType": ".enumcapability", "EnumCapabilityTypedDict": ".enumcapability", @@ -11125,24 +11017,6 @@ "PromptCacheOptionsMode": ".promptcacheoptions", "PromptCacheOptionsTypedDict": ".promptcacheoptions", "PromptInjectionScanScope": ".promptinjectionscanscope", - "ProviderEndpoints": ".providerendpoints", - "ProviderEndpointsTypedDict": ".providerendpoints", - "Window": ".providerendpoints", - "ProviderEndpointsResponse": ".providerendpointsresponse", - "ProviderEndpointsResponseTypedDict": ".providerendpointsresponse", - "ProviderEndpointStats": ".providerendpointstats", - "ProviderEndpointStatsTypedDict": ".providerendpointstats", - "UnknownProviderEndpointStats": ".providerendpointstats", - "LatencyMs": ".providerendpointstatsavailable", - "LatencyMsTypedDict": ".providerendpointstatsavailable", - "ProviderEndpointStatsAvailable": ".providerendpointstatsavailable", - "ProviderEndpointStatsAvailableStatus": ".providerendpointstatsavailable", - "ProviderEndpointStatsAvailableTypedDict": ".providerendpointstatsavailable", - "ThroughputTokensPerSecond": ".providerendpointstatsavailable", - "ThroughputTokensPerSecondTypedDict": ".providerendpointstatsavailable", - "ProviderEndpointStatsUnavailable": ".providerendpointstatsunavailable", - "ProviderEndpointStatsUnavailableStatus": ".providerendpointstatsunavailable", - "ProviderEndpointStatsUnavailableTypedDict": ".providerendpointstatsunavailable", "ProviderName": ".providername", "ProviderOptions": ".provideroptions", "ProviderOptionsTypedDict": ".provideroptions", @@ -11742,8 +11616,14 @@ "VideoGenerationTypedDict": ".videogeneration", "VideoGenerationRequest": ".videogenerationrequest", "VideoGenerationRequestAspectRatio": ".videogenerationrequest", + "VideoGenerationRequestIgnore": ".videogenerationrequest", + "VideoGenerationRequestIgnoreTypedDict": ".videogenerationrequest", + "VideoGenerationRequestOnly": ".videogenerationrequest", + "VideoGenerationRequestOnlyTypedDict": ".videogenerationrequest", "VideoGenerationRequestOptions": ".videogenerationrequest", "VideoGenerationRequestOptionsTypedDict": ".videogenerationrequest", + "VideoGenerationRequestOrder": ".videogenerationrequest", + "VideoGenerationRequestOrderTypedDict": ".videogenerationrequest", "VideoGenerationRequestProvider": ".videogenerationrequest", "VideoGenerationRequestProviderTypedDict": ".videogenerationrequest", "VideoGenerationRequestResolution": ".videogenerationrequest", diff --git a/src/openrouter/components/endpointsummary.py b/src/openrouter/components/endpointsummary.py deleted file mode 100644 index 357f16152..000000000 --- a/src/openrouter/components/endpointsummary.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .endpointtestprofile import EndpointTestProfile, EndpointTestProfileTypedDict -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr -from pydantic import model_serializer -from typing import Literal, Union -from typing_extensions import TypedDict - - -Visibility = Union[ - Literal[ - "visible", - "hidden", - ], - UnrecognizedStr, -] -r"""Whether the endpoint is listed on OpenRouter""" - - -class EndpointSummaryTypedDict(TypedDict): - endpoint_id: str - r"""Endpoint ID""" - model_slug: str - r"""Public model slug""" - created_at: str - r"""When the endpoint was created""" - model_permaslug: str - r"""Permanent model slug the endpoint is listed under""" - provider_model_id: Nullable[str] - r"""The provider's own model ID""" - provider_name: str - r"""Provider name""" - provider_region: Nullable[str] - r"""Serving region""" - service_tier: Nullable[str] - r"""Service tier; null for the default tier""" - test_profile: EndpointTestProfileTypedDict - variant: str - r"""Endpoint variant""" - visibility: Visibility - r"""Whether the endpoint is listed on OpenRouter""" - - -class EndpointSummary(BaseModel): - endpoint_id: str - r"""Endpoint ID""" - - model_slug: str - r"""Public model slug""" - - created_at: str - r"""When the endpoint was created""" - - model_permaslug: str - r"""Permanent model slug the endpoint is listed under""" - - provider_model_id: Nullable[str] - r"""The provider's own model ID""" - - provider_name: str - r"""Provider name""" - - provider_region: Nullable[str] - r"""Serving region""" - - service_tier: Nullable[str] - r"""Service tier; null for the default tier""" - - test_profile: EndpointTestProfile - - variant: str - r"""Endpoint variant""" - - visibility: Visibility - r"""Whether the endpoint is listed on OpenRouter""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/endpointtestprofile.py b/src/openrouter/components/endpointtestprofile.py deleted file mode 100644 index a16c2c6d4..000000000 --- a/src/openrouter/components/endpointtestprofile.py +++ /dev/null @@ -1,540 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, - UnrecognizedStr, -) -from pydantic import model_serializer -from typing import Any, Dict, List, Literal, Union -from typing_extensions import NotRequired, TypedDict - - -DefaultReasoningReturnMechanism = Union[ - Literal[ - "content-string", - "reasoning-content", - "reasoning", - "none", - ], - UnrecognizedStr, -] -r"""Reasoning return mechanism the endpoint uses when neither its features nor the model set one""" - - -InstructionRoleSupport = Union[ - Literal[ - "developer", - "system", - "user-only", - ], - UnrecognizedStr, -] -r"""How leading instruction (developer/system) messages are mapped before reaching a chat-completions provider. 'developer' keeps the developer role, 'system' downgrades developer to system, 'user-only' downgrades both to a wrapped user message. Overridable per-endpoint.""" - - -class ChatTemplateConfigTypedDict(TypedDict): - instruction_role_support: NotRequired[Nullable[InstructionRoleSupport]] - r"""How leading instruction (developer/system) messages are mapped before reaching a chat-completions provider. 'developer' keeps the developer role, 'system' downgrades developer to system, 'user-only' downgrades both to a wrapped user message. Overridable per-endpoint.""" - should_hoist_and_merge_system_messages: NotRequired[Nullable[bool]] - r"""Whether to hoist and merge system messages""" - supports_mid_session_system: NotRequired[Nullable[bool]] - r"""Whether the model accepts system/developer messages that appear after the first user/assistant turn. When false, mid-session instruction messages are downgraded to wrapped user messages. Overridable per-endpoint.""" - - -class ChatTemplateConfig(BaseModel): - instruction_role_support: OptionalNullable[InstructionRoleSupport] = UNSET - r"""How leading instruction (developer/system) messages are mapped before reaching a chat-completions provider. 'developer' keeps the developer role, 'system' downgrades developer to system, 'user-only' downgrades both to a wrapped user message. Overridable per-endpoint.""" - - should_hoist_and_merge_system_messages: OptionalNullable[bool] = UNSET - r"""Whether to hoist and merge system messages""" - - supports_mid_session_system: OptionalNullable[bool] = UNSET - r"""Whether the model accepts system/developer messages that appear after the first user/assistant turn. When false, mid-session instruction messages are downgraded to wrapped user messages. Overridable per-endpoint.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "instruction_role_support", - "should_hoist_and_merge_system_messages", - "supports_mid_session_system", - ] - ) - nullable_fields = set( - [ - "instruction_role_support", - "should_hoist_and_merge_system_messages", - "supports_mid_session_system", - ] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m - - -FeaturesDefaultReasoningEffort = Union[ - Literal[ - "max", - "xhigh", - "high", - "medium", - "low", - "minimal", - ], - UnrecognizedStr, -] - - -FeaturesReasoningReturnMechanism = Union[ - Literal[ - "content-string", - "reasoning-content", - "reasoning", - "none", - ], - UnrecognizedStr, -] -r"""Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.""" - - -FeaturesSupportedReasoningEffort = Union[ - Literal[ - "max", - "xhigh", - "high", - "medium", - "low", - "minimal", - ], - UnrecognizedStr, -] - - -class FeaturesReasoningConfigTypedDict(TypedDict): - default_reasoning_effort: NotRequired[Nullable[FeaturesDefaultReasoningEffort]] - default_reasoning_enabled: NotRequired[Nullable[bool]] - r"""Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this.""" - end_token: NotRequired[Nullable[str]] - is_mandatory_reasoning: NotRequired[Nullable[bool]] - reasoning_return_mechanism: NotRequired[Nullable[FeaturesReasoningReturnMechanism]] - r"""Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.""" - start_token: NotRequired[Nullable[str]] - supported_reasoning_efforts: NotRequired[ - Nullable[List[FeaturesSupportedReasoningEffort]] - ] - r"""List of reasoning effort values the model accepts upstream""" - supports_reasoning_effort: NotRequired[Nullable[bool]] - r"""Whether the model supports reasoning effort""" - supports_reasoning_max_tokens: NotRequired[Nullable[bool]] - r"""Whether the model supports reasoning max tokens""" - system_prompt: NotRequired[Nullable[str]] - - -class FeaturesReasoningConfig(BaseModel): - default_reasoning_effort: OptionalNullable[FeaturesDefaultReasoningEffort] = UNSET - - default_reasoning_enabled: OptionalNullable[bool] = UNSET - r"""Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this.""" - - end_token: OptionalNullable[str] = UNSET - - is_mandatory_reasoning: OptionalNullable[bool] = UNSET - - reasoning_return_mechanism: OptionalNullable[FeaturesReasoningReturnMechanism] = ( - UNSET - ) - r"""Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.""" - - start_token: OptionalNullable[str] = UNSET - - supported_reasoning_efforts: OptionalNullable[ - List[FeaturesSupportedReasoningEffort] - ] = UNSET - r"""List of reasoning effort values the model accepts upstream""" - - supports_reasoning_effort: OptionalNullable[bool] = UNSET - r"""Whether the model supports reasoning effort""" - - supports_reasoning_max_tokens: OptionalNullable[bool] = UNSET - r"""Whether the model supports reasoning max tokens""" - - system_prompt: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "default_reasoning_effort", - "default_reasoning_enabled", - "end_token", - "is_mandatory_reasoning", - "reasoning_return_mechanism", - "start_token", - "supported_reasoning_efforts", - "supports_reasoning_effort", - "supports_reasoning_max_tokens", - "system_prompt", - ] - ) - nullable_fields = set( - [ - "default_reasoning_effort", - "default_reasoning_enabled", - "end_token", - "is_mandatory_reasoning", - "reasoning_return_mechanism", - "start_token", - "supported_reasoning_efforts", - "supports_reasoning_effort", - "supports_reasoning_max_tokens", - "system_prompt", - ] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m - - -RequiredInputModality = Union[ - Literal[ - "text", - "image", - "audio", - "video", - ], - UnrecognizedStr, -] - - -class FeaturesTypedDict(TypedDict): - chat_template_config: NotRequired[Nullable[ChatTemplateConfigTypedDict]] - reasoning_config: NotRequired[Nullable[FeaturesReasoningConfigTypedDict]] - required_input_modalities: NotRequired[Nullable[List[RequiredInputModality]]] - r"""Input modalities every request to the model must include, e.g. [\"video\"] for video-to-video-only models. Requests missing a required modality are rejected before dispatch. A required text modality is satisfied by the prompt. Currently enforced on the video generation request path.""" - - -class Features(BaseModel): - chat_template_config: OptionalNullable[ChatTemplateConfig] = UNSET - - reasoning_config: OptionalNullable[FeaturesReasoningConfig] = UNSET - - required_input_modalities: OptionalNullable[List[RequiredInputModality]] = UNSET - r"""Input modalities every request to the model must include, e.g. [\"video\"] for video-to-video-only models. Requests missing a required modality are rejected before dispatch. A required text modality is satisfied by the prompt. Currently enforced on the video generation request path.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["chat_template_config", "reasoning_config", "required_input_modalities"] - ) - nullable_fields = set( - ["chat_template_config", "reasoning_config", "required_input_modalities"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m - - -EndpointTestProfileInputModality = Union[ - Literal[ - "text", - "image", - "file", - "audio", - "video", - ], - UnrecognizedStr, -] - - -EndpointTestProfileOutputModality = Union[ - Literal[ - "text", - "image", - "embeddings", - "audio", - "video", - "rerank", - "decisions", - "speech", - "transcription", - ], - UnrecognizedStr, -] - - -DefaultReasoningEffort = Union[ - Literal[ - "max", - "xhigh", - "high", - "medium", - "low", - "minimal", - ], - UnrecognizedStr, -] - - -ReasoningReturnMechanism = Union[ - Literal[ - "content-string", - "reasoning-content", - "reasoning", - "none", - ], - UnrecognizedStr, -] -r"""Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.""" - - -SupportedReasoningEffort = Union[ - Literal[ - "max", - "xhigh", - "high", - "medium", - "low", - "minimal", - ], - UnrecognizedStr, -] - - -class EndpointTestProfileReasoningConfigTypedDict(TypedDict): - default_reasoning_effort: NotRequired[Nullable[DefaultReasoningEffort]] - default_reasoning_enabled: NotRequired[Nullable[bool]] - r"""Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this.""" - end_token: NotRequired[Nullable[str]] - is_mandatory_reasoning: NotRequired[Nullable[bool]] - reasoning_return_mechanism: NotRequired[Nullable[ReasoningReturnMechanism]] - r"""Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.""" - start_token: NotRequired[Nullable[str]] - supported_reasoning_efforts: NotRequired[Nullable[List[SupportedReasoningEffort]]] - r"""List of reasoning effort values the model accepts upstream""" - supports_reasoning_effort: NotRequired[Nullable[bool]] - r"""Whether the model supports reasoning effort""" - supports_reasoning_max_tokens: NotRequired[Nullable[bool]] - r"""Whether the model supports reasoning max tokens""" - system_prompt: NotRequired[Nullable[str]] - - -class EndpointTestProfileReasoningConfig(BaseModel): - default_reasoning_effort: OptionalNullable[DefaultReasoningEffort] = UNSET - - default_reasoning_enabled: OptionalNullable[bool] = UNSET - r"""Default reasoning enabled state for the model. When true, reasoning is enabled by default; when false, disabled by default. User-specified values always override this.""" - - end_token: OptionalNullable[str] = UNSET - - is_mandatory_reasoning: OptionalNullable[bool] = UNSET - - reasoning_return_mechanism: OptionalNullable[ReasoningReturnMechanism] = UNSET - r"""Default mechanism for returning reasoning tokens. Can be overridden per-endpoint via endpoint features.""" - - start_token: OptionalNullable[str] = UNSET - - supported_reasoning_efforts: OptionalNullable[List[SupportedReasoningEffort]] = ( - UNSET - ) - r"""List of reasoning effort values the model accepts upstream""" - - supports_reasoning_effort: OptionalNullable[bool] = UNSET - r"""Whether the model supports reasoning effort""" - - supports_reasoning_max_tokens: OptionalNullable[bool] = UNSET - r"""Whether the model supports reasoning max tokens""" - - system_prompt: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "default_reasoning_effort", - "default_reasoning_enabled", - "end_token", - "is_mandatory_reasoning", - "reasoning_return_mechanism", - "start_token", - "supported_reasoning_efforts", - "supports_reasoning_effort", - "supports_reasoning_max_tokens", - "system_prompt", - ] - ) - nullable_fields = set( - [ - "default_reasoning_effort", - "default_reasoning_enabled", - "end_token", - "is_mandatory_reasoning", - "reasoning_return_mechanism", - "start_token", - "supported_reasoning_efforts", - "supports_reasoning_effort", - "supports_reasoning_max_tokens", - "system_prompt", - ] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m - - -class EndpointTestProfileModelTypedDict(TypedDict): - features: Nullable[FeaturesTypedDict] - input_modalities: List[EndpointTestProfileInputModality] - output_modalities: List[EndpointTestProfileOutputModality] - reasoning_config: Nullable[EndpointTestProfileReasoningConfigTypedDict] - slug: str - r"""Public model slug""" - supports_reasoning: bool - - -class EndpointTestProfileModel(BaseModel): - features: Nullable[Features] - - input_modalities: List[EndpointTestProfileInputModality] - - output_modalities: List[EndpointTestProfileOutputModality] - - reasoning_config: Nullable[EndpointTestProfileReasoningConfig] - - slug: str - r"""Public model slug""" - - supports_reasoning: bool - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m - - -class EndpointTestProfileTypedDict(TypedDict): - context_length: Nullable[int] - r"""Context length the endpoint serves: its override, else the model's""" - default_reasoning_return_mechanism: Nullable[DefaultReasoningReturnMechanism] - r"""Reasoning return mechanism the endpoint uses when neither its features nor the model set one""" - effective_adapter_name: Nullable[str] - r"""Adapter the endpoint is served through: its provider override, else the provider's; null when unresolved""" - endpoint_features: Nullable[Dict[str, Any]] - r"""Endpoint feature flags; null when unset or invalid""" - is_lab_trusted: bool - r"""Whether the endpoint serves a closed lab model through the lab or an official partner""" - model: EndpointTestProfileModelTypedDict - - -class EndpointTestProfile(BaseModel): - context_length: Nullable[int] - r"""Context length the endpoint serves: its override, else the model's""" - - default_reasoning_return_mechanism: Nullable[DefaultReasoningReturnMechanism] - r"""Reasoning return mechanism the endpoint uses when neither its features nor the model set one""" - - effective_adapter_name: Nullable[str] - r"""Adapter the endpoint is served through: its provider override, else the provider's; null when unresolved""" - - endpoint_features: Nullable[Dict[str, Any]] - r"""Endpoint feature flags; null when unset or invalid""" - - is_lab_trusted: bool - r"""Whether the endpoint serves a closed lab model through the lab or an official partner""" - - model: EndpointTestProfileModel - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/providerendpoints.py b/src/openrouter/components/providerendpoints.py deleted file mode 100644 index 25fce7b1e..000000000 --- a/src/openrouter/components/providerendpoints.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .endpointsummary import EndpointSummary, EndpointSummaryTypedDict -from .providerendpointstats import ProviderEndpointStats, ProviderEndpointStatsTypedDict -from openrouter.types import BaseModel, UnrecognizedStr -from typing import List, Literal, Union -from typing_extensions import TypedDict - - -Window = Union[ - Literal[ - "1hr", - "1d", - "1w", - "1mo", - "1y", - ], - UnrecognizedStr, -] -r"""Time window the provider-wide stats cover""" - - -class ProviderEndpointsTypedDict(TypedDict): - endpoints: List[EndpointSummaryTypedDict] - stats: ProviderEndpointStatsTypedDict - window: Window - r"""Time window the provider-wide stats cover""" - - -class ProviderEndpoints(BaseModel): - endpoints: List[EndpointSummary] - - stats: ProviderEndpointStats - - window: Window - r"""Time window the provider-wide stats cover""" diff --git a/src/openrouter/components/providerendpointsresponse.py b/src/openrouter/components/providerendpointsresponse.py deleted file mode 100644 index 9b271e719..000000000 --- a/src/openrouter/components/providerendpointsresponse.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .providerendpoints import ProviderEndpoints, ProviderEndpointsTypedDict -from openrouter.types import BaseModel -from typing_extensions import TypedDict - - -class ProviderEndpointsResponseTypedDict(TypedDict): - data: ProviderEndpointsTypedDict - - -class ProviderEndpointsResponse(BaseModel): - data: ProviderEndpoints diff --git a/src/openrouter/components/providerendpointstats.py b/src/openrouter/components/providerendpointstats.py deleted file mode 100644 index f87170f0f..000000000 --- a/src/openrouter/components/providerendpointstats.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .providerendpointstatsavailable import ( - ProviderEndpointStatsAvailable, - ProviderEndpointStatsAvailableTypedDict, -) -from .providerendpointstatsunavailable import ( - ProviderEndpointStatsUnavailable, - ProviderEndpointStatsUnavailableTypedDict, -) -from functools import partial -from openrouter.types import BaseModel -from openrouter.utils.unions import parse_open_union -from pydantic import ConfigDict -from pydantic.functional_validators import BeforeValidator -from typing import Any, Literal, Union -from typing_extensions import Annotated, TypeAliasType - - -ProviderEndpointStatsTypedDict = TypeAliasType( - "ProviderEndpointStatsTypedDict", - Union[ - ProviderEndpointStatsUnavailableTypedDict, - ProviderEndpointStatsAvailableTypedDict, - ], -) - - -class UnknownProviderEndpointStats(BaseModel): - r"""A ProviderEndpointStats variant the SDK doesn't recognize. Preserves the raw payload.""" - - status: Literal["UNKNOWN"] = "UNKNOWN" - raw: Any - is_unknown: Literal[True] = True - - model_config = ConfigDict(frozen=True) - - -_PROVIDER_ENDPOINT_STATS_VARIANTS: dict[str, Any] = { - "available": ProviderEndpointStatsAvailable, - "unavailable": ProviderEndpointStatsUnavailable, -} - - -ProviderEndpointStats = Annotated[ - Union[ - ProviderEndpointStatsAvailable, - ProviderEndpointStatsUnavailable, - UnknownProviderEndpointStats, - ], - BeforeValidator( - partial( - parse_open_union, - disc_key="status", - variants=_PROVIDER_ENDPOINT_STATS_VARIANTS, - unknown_cls=UnknownProviderEndpointStats, - union_name="ProviderEndpointStats", - ) - ), -] diff --git a/src/openrouter/components/providerendpointstatsavailable.py b/src/openrouter/components/providerendpointstatsavailable.py deleted file mode 100644 index 67d24b1f9..000000000 --- a/src/openrouter/components/providerendpointstatsavailable.py +++ /dev/null @@ -1,135 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal -from typing_extensions import TypedDict - - -class LatencyMsTypedDict(TypedDict): - r"""Request latency, milliseconds""" - - p50: Nullable[float] - p90: Nullable[float] - - -class LatencyMs(BaseModel): - r"""Request latency, milliseconds""" - - p50: Nullable[float] - - p90: Nullable[float] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m - - -ProviderEndpointStatsAvailableStatus = Literal["available",] - - -class ThroughputTokensPerSecondTypedDict(TypedDict): - r"""Output tokens per second""" - - p50: Nullable[float] - p90: Nullable[float] - - -class ThroughputTokensPerSecond(BaseModel): - r"""Output tokens per second""" - - p50: Nullable[float] - - p90: Nullable[float] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m - - -class ProviderEndpointStatsAvailableTypedDict(TypedDict): - endpoint_count: int - r"""Endpoints the stats cover""" - error_rate_percent: float - r"""Errored share of requests that count toward uptime, 0-100""" - latency_ms: LatencyMsTypedDict - r"""Request latency, milliseconds""" - quality_percent: Nullable[float] - r"""Routing quality, 0-100""" - rate_limited_percent: Nullable[float] - r"""Rate-limited share of routed requests, 0-100""" - reliability_percent: Nullable[float] - r"""Routing reliability, 0-100""" - requests: int - r"""Requests in the window""" - status: ProviderEndpointStatsAvailableStatus - throughput_tokens_per_second: ThroughputTokensPerSecondTypedDict - r"""Output tokens per second""" - uptime_percent: Nullable[float] - r"""Successful share of requests that count toward uptime, 0-100""" - - -class ProviderEndpointStatsAvailable(BaseModel): - endpoint_count: int - r"""Endpoints the stats cover""" - - error_rate_percent: float - r"""Errored share of requests that count toward uptime, 0-100""" - - latency_ms: LatencyMs - r"""Request latency, milliseconds""" - - quality_percent: Nullable[float] - r"""Routing quality, 0-100""" - - rate_limited_percent: Nullable[float] - r"""Rate-limited share of routed requests, 0-100""" - - reliability_percent: Nullable[float] - r"""Routing reliability, 0-100""" - - requests: int - r"""Requests in the window""" - - status: ProviderEndpointStatsAvailableStatus - - throughput_tokens_per_second: ThroughputTokensPerSecond - r"""Output tokens per second""" - - uptime_percent: Nullable[float] - r"""Successful share of requests that count toward uptime, 0-100""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/providerendpointstatsunavailable.py b/src/openrouter/components/providerendpointstatsunavailable.py deleted file mode 100644 index ab2fb6d55..000000000 --- a/src/openrouter/components/providerendpointstatsunavailable.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict - - -ProviderEndpointStatsUnavailableStatus = Literal["unavailable",] - - -class ProviderEndpointStatsUnavailableTypedDict(TypedDict): - status: ProviderEndpointStatsUnavailableStatus - - -class ProviderEndpointStatsUnavailable(BaseModel): - status: ProviderEndpointStatsUnavailableStatus diff --git a/src/openrouter/components/videogenerationrequest.py b/src/openrouter/components/videogenerationrequest.py index c3f8a1e99..ef6e96c11 100644 --- a/src/openrouter/components/videogenerationrequest.py +++ b/src/openrouter/components/videogenerationrequest.py @@ -3,12 +3,20 @@ from __future__ import annotations from .frameimage import FrameImage, FrameImageTypedDict from .inputreference import InputReference, InputReferenceTypedDict +from .providername import ProviderName from .traceconfig import TraceConfig, TraceConfigTypedDict -from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) import pydantic from pydantic import model_serializer from typing import Any, Dict, List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict VideoGenerationRequestAspectRatio = Union[ @@ -28,6 +36,26 @@ r"""Aspect ratio of the generated video""" +VideoGenerationRequestIgnoreTypedDict = TypeAliasType( + "VideoGenerationRequestIgnoreTypedDict", Union[ProviderName, str] +) + + +VideoGenerationRequestIgnore = TypeAliasType( + "VideoGenerationRequestIgnore", Union[ProviderName, str] +) + + +VideoGenerationRequestOnlyTypedDict = TypeAliasType( + "VideoGenerationRequestOnlyTypedDict", Union[ProviderName, str] +) + + +VideoGenerationRequestOnly = TypeAliasType( + "VideoGenerationRequestOnly", Union[ProviderName, str] +) + + class VideoGenerationRequestOptionsTypedDict(TypedDict): r"""Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" @@ -728,29 +756,63 @@ def serialize_model(self, handler): return m +VideoGenerationRequestOrderTypedDict = TypeAliasType( + "VideoGenerationRequestOrderTypedDict", Union[ProviderName, str] +) + + +VideoGenerationRequestOrder = TypeAliasType( + "VideoGenerationRequestOrder", Union[ProviderName, str] +) + + class VideoGenerationRequestProviderTypedDict(TypedDict): - r"""Provider-specific passthrough configuration""" + r"""Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration""" + ignore: NotRequired[Nullable[List[VideoGenerationRequestIgnoreTypedDict]]] + r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" + only: NotRequired[Nullable[List[VideoGenerationRequestOnlyTypedDict]]] + r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" options: NotRequired[VideoGenerationRequestOptionsTypedDict] + order: NotRequired[Nullable[List[VideoGenerationRequestOrderTypedDict]]] + r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" class VideoGenerationRequestProvider(BaseModel): - r"""Provider-specific passthrough configuration""" + r"""Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration""" + + ignore: OptionalNullable[List[VideoGenerationRequestIgnore]] = UNSET + r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" + + only: OptionalNullable[List[VideoGenerationRequestOnly]] = UNSET + r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" options: Optional[VideoGenerationRequestOptions] = None + order: OptionalNullable[List[VideoGenerationRequestOrder]] = UNSET + r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["options"]) + optional_fields = set(["ignore", "only", "options", "order"]) + nullable_fields = set(["ignore", "only", "order"]) serialized = handler(self) m = {} for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): m[k] = val return m @@ -793,7 +855,7 @@ class VideoGenerationRequestTypedDict(TypedDict): prompt: NotRequired[str] r"""Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models.""" provider: NotRequired[VideoGenerationRequestProviderTypedDict] - r"""Provider-specific passthrough configuration""" + r"""Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration""" resolution: NotRequired[VideoGenerationRequestResolution] r"""Resolution of the generated video""" seed: NotRequired[int] @@ -841,7 +903,7 @@ class VideoGenerationRequest(BaseModel): r"""Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models.""" provider: Optional[VideoGenerationRequestProvider] = None - r"""Provider-specific passthrough configuration""" + r"""Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration""" resolution: Optional[VideoGenerationRequestResolution] = None r"""Resolution of the generated video""" diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 2c9a7c312..7319f555f 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -635,7 +635,7 @@ GetTaskClassificationsGlobalsTypedDict, GetTaskClassificationsRequest, GetTaskClassificationsRequestTypedDict, - GetTaskClassificationsWindow, + Window, ) from .gettool import ( GetToolGlobals, @@ -901,14 +901,6 @@ ListPrivateProvidersResponse, ListPrivateProvidersResponseTypedDict, ) - from .listproviderendpoints import ( - ListProviderEndpointsGlobals, - ListProviderEndpointsGlobalsTypedDict, - ListProviderEndpointsRequest, - ListProviderEndpointsRequestTypedDict, - ListProviderEndpointsWindow, - PerfWorkload, - ) from .listproviders import ( Datacenter, Headquarters, @@ -1580,7 +1572,6 @@ "GetTaskClassificationsGlobalsTypedDict", "GetTaskClassificationsRequest", "GetTaskClassificationsRequestTypedDict", - "GetTaskClassificationsWindow", "GetToolGlobals", "GetToolGlobalsTypedDict", "GetToolRequest", @@ -1782,11 +1773,6 @@ "ListPrivateProvidersRequestTypedDict", "ListPrivateProvidersResponse", "ListPrivateProvidersResponseTypedDict", - "ListProviderEndpointsGlobals", - "ListProviderEndpointsGlobalsTypedDict", - "ListProviderEndpointsRequest", - "ListProviderEndpointsRequestTypedDict", - "ListProviderEndpointsWindow", "ListProvidersData", "ListProvidersDataTypedDict", "ListProvidersGlobals", @@ -1856,7 +1842,6 @@ "Order", "OrderBy", "OrderByTypedDict", - "PerfWorkload", "Period", "PromoteContainerFileGlobals", "PromoteContainerFileGlobalsTypedDict", @@ -1980,6 +1965,7 @@ "ValidatePrivateEndpointGlobalsTypedDict", "ValidatePrivateEndpointRequest", "ValidatePrivateEndpointRequestTypedDict", + "Window", "Zdr", ] @@ -2455,7 +2441,7 @@ "GetTaskClassificationsGlobalsTypedDict": ".gettaskclassifications", "GetTaskClassificationsRequest": ".gettaskclassifications", "GetTaskClassificationsRequestTypedDict": ".gettaskclassifications", - "GetTaskClassificationsWindow": ".gettaskclassifications", + "Window": ".gettaskclassifications", "GetToolGlobals": ".gettool", "GetToolGlobalsTypedDict": ".gettool", "GetToolRequest": ".gettool", @@ -2652,12 +2638,6 @@ "ListPrivateProvidersRequestTypedDict": ".listprivateproviders", "ListPrivateProvidersResponse": ".listprivateproviders", "ListPrivateProvidersResponseTypedDict": ".listprivateproviders", - "ListProviderEndpointsGlobals": ".listproviderendpoints", - "ListProviderEndpointsGlobalsTypedDict": ".listproviderendpoints", - "ListProviderEndpointsRequest": ".listproviderendpoints", - "ListProviderEndpointsRequestTypedDict": ".listproviderendpoints", - "ListProviderEndpointsWindow": ".listproviderendpoints", - "PerfWorkload": ".listproviderendpoints", "Datacenter": ".listproviders", "Headquarters": ".listproviders", "ListProvidersData": ".listproviders", diff --git a/src/openrouter/operations/gettaskclassifications.py b/src/openrouter/operations/gettaskclassifications.py index 1679b8aaa..a8b610cad 100644 --- a/src/openrouter/operations/gettaskclassifications.py +++ b/src/openrouter/operations/gettaskclassifications.py @@ -73,7 +73,7 @@ def serialize_model(self, handler): return m -GetTaskClassificationsWindow = Literal["7d",] +Window = Literal["7d",] r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.""" @@ -91,7 +91,7 @@ class GetTaskClassificationsRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ - window: NotRequired[GetTaskClassificationsWindow] + window: NotRequired[Window] r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.""" @@ -125,7 +125,7 @@ class GetTaskClassificationsRequest(BaseModel): """ window: Annotated[ - Optional[GetTaskClassificationsWindow], + Optional[Window], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = "7d" r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.""" diff --git a/src/openrouter/operations/listproviderendpoints.py b/src/openrouter/operations/listproviderendpoints.py deleted file mode 100644 index e6b63273e..000000000 --- a/src/openrouter/operations/listproviderendpoints.py +++ /dev/null @@ -1,202 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - QueryParamMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ListProviderEndpointsGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class ListProviderEndpointsGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -ListProviderEndpointsWindow = Union[ - Literal[ - "1hr", - "1d", - "1w", - "1mo", - "1y", - ], - UnrecognizedStr, -] -r"""Time window the provider-wide stats cover""" - - -PerfWorkload = Union[ - Literal[ - "text_generation", - "image_generation", - "video_generation", - "embeddings", - "rerank", - "tts", - "stt", - "decisions", - "extractions", - "unknown", - ], - UnrecognizedStr, -] -r"""Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve""" - - -class ListProviderEndpointsRequestTypedDict(TypedDict): - provider_slug: str - r"""URL-friendly provider identifier (e.g. \"openai\", \"fireworks\")""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - window: NotRequired[ListProviderEndpointsWindow] - r"""Time window the provider-wide stats cover""" - perf_workload: NotRequired[PerfWorkload] - r"""Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve""" - - -class ListProviderEndpointsRequest(BaseModel): - provider_slug: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""URL-friendly provider identifier (e.g. \"openai\", \"fireworks\")""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - window: Annotated[ - Optional[ListProviderEndpointsWindow], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = "1mo" - r"""Time window the provider-wide stats cover""" - - perf_workload: Annotated[ - Optional[PerfWorkload], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - r"""Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "HTTP-Referer", - "X-OpenRouter-Title", - "X-OpenRouter-Categories", - "window", - "perf_workload", - ] - ) - 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/providers.py b/src/openrouter/providers.py index ac109190c..c1fd70812 100644 --- a/src/openrouter/providers.py +++ b/src/openrouter/providers.py @@ -237,305 +237,3 @@ async def list_async( ) raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def list_provider_endpoints( - self, - *, - provider_slug: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - window: Optional[operations.ListProviderEndpointsWindow] = "1mo", - perf_workload: Optional[operations.PerfWorkload] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ProviderEndpointsResponse: - r"""List a provider's endpoints with provider-wide stats - - Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access. - - :param provider_slug: URL-friendly provider identifier (e.g. \"openai\", \"fireworks\") - :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param window: Time window the provider-wide stats cover - :param perf_workload: Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.ListProviderEndpointsRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - provider_slug=provider_slug, - window=window, - perf_workload=perf_workload, - ) - - req = self._build_request( - method="GET", - path="/providers/{provider_slug}/endpoints", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.ListProviderEndpointsGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listProviderEndpoints", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Providers"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - components.ProviderEndpointsResponse, http_res - ) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response( - errors.ForbiddenResponseErrorData, http_res - ) - raise errors.ForbiddenResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.TooManyRequestsResponseErrorData, http_res - ) - raise errors.TooManyRequestsResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def list_provider_endpoints_async( - self, - *, - provider_slug: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - window: Optional[operations.ListProviderEndpointsWindow] = "1mo", - perf_workload: Optional[operations.PerfWorkload] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ProviderEndpointsResponse: - r"""List a provider's endpoints with provider-wide stats - - Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access. - - :param provider_slug: URL-friendly provider identifier (e.g. \"openai\", \"fireworks\") - :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param window: Time window the provider-wide stats cover - :param perf_workload: Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.ListProviderEndpointsRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - provider_slug=provider_slug, - window=window, - perf_workload=perf_workload, - ) - - req = self._build_request_async( - method="GET", - path="/providers/{provider_slug}/endpoints", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.ListProviderEndpointsGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listProviderEndpoints", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Providers"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - components.ProviderEndpointsResponse, http_res - ) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response( - errors.ForbiddenResponseErrorData, http_res - ) - raise errors.ForbiddenResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.TooManyRequestsResponseErrorData, http_res - ) - raise errors.TooManyRequestsResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/video_generation.py b/src/openrouter/video_generation.py index aeec4401e..80463dc18 100644 --- a/src/openrouter/video_generation.py +++ b/src/openrouter/video_generation.py @@ -80,7 +80,7 @@ def generate( :param input_references: Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (including BytePlus Seedance generation 2 and newer); other providers use image references and ignore the rest. :param previous_job_id: ID of a completed video job to edit or extend, as returned by the submit response. The new job runs on the same model and endpoint that produced the previous one. Only models that support continuation accept this field. :param prompt: Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration :param resolution: Resolution of the generated video :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. @@ -326,7 +326,7 @@ async def generate_async( :param input_references: Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (including BytePlus Seedance generation 2 and newer); other providers use image references and ignore the rest. :param previous_job_id: ID of a completed video job to edit or extend, as returned by the submit response. The new job runs on the same model and endpoint that produced the previous one. Only models that support continuation accept this field. :param prompt: Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration :param resolution: Resolution of the generated video :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. diff --git a/uv.lock b/uv.lock index e5674114d..7c4afeae8 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.120" +version = "1.3.121" source = { editable = "." } dependencies = [ { name = "httpcore" },