diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 52eceb3..ee17f57 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: 1b3480b82990a39f968571a292695e01 + docChecksum: d92ce8758dacb7f04efe84b124109740 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 0.11.3 - configChecksum: 9580963049895d84eccfc135025854cb + releaseVersion: 0.11.33 + configChecksum: a00384aafb8d1896bec819892b242863 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 00a7dc9a-a2f7-46bb-898f-e804c87aa438 - pristine_commit_hash: 22206487f7eccf058be8483fb016c65abc71aef9 - pristine_tree_hash: c724440db515750df210411562157b40257083ef + generation_id: a281389d-a736-44f4-8c73-9e55b23e68ec + pristine_commit_hash: 101d9557403c55e49b699ce862a5954379816549 + pristine_tree_hash: d069b8a3a0b13c8fa7b2e3ed9aef8c3f70884916 features: python: acceptHeaders: 3.0.0 @@ -108,6 +108,30 @@ trackedFiles: id: 5886155bc810 last_write_checksum: sha1:64acd6c3d2db5593d8359474c4e2e31e4db62453 pristine_git_object: 6edb98e874664ab4349034ca3d0c5874f761fe9a + docs/components/additionaltoolsitem.mdx: + id: 8658d14827df + last_write_checksum: sha1:e97ba3bc67c191d689dba7fe6ab66871a1cecf3c + pristine_git_object: 34d2291edf704988089189629166217cc45ab2b0 + docs/components/additionaltoolsitemrole.mdx: + id: b3d0b645d28d + last_write_checksum: sha1:a8df9099d85af44ca7547bba92435a4d93523dd3 + pristine_git_object: 2e7f805c00b56bbd6872d986beb5fa76cb0a6c28 + docs/components/additionaltoolsitemtool.mdx: + id: 075b8c61fc35 + last_write_checksum: sha1:e038792f2a5d489bc1994d81d6df101d376c53e8 + pristine_git_object: 9dcea23673cc79bb60efaf0b84299aa4b916e3ca + docs/components/additionaltoolsitemtoolfunction.mdx: + id: b8c1e4fcad3b + last_write_checksum: sha1:fd16181ea1f609dfcb8cc4bdc566011d2041faee + pristine_git_object: d78714317e328d9131e563de7807db0761bb3da1 + docs/components/additionaltoolsitemtoolunion.mdx: + id: b3e8598b1887 + last_write_checksum: sha1:9337d3a54afac90f430e4c7fd9ecaed326f5995a + pristine_git_object: 31c685297062f6ac8d8a61943c4430500af47744 + docs/components/additionaltoolsitemtypefunction.mdx: + id: bf179b4008af + last_write_checksum: sha1:c0d4fee7d39fbd3d08c44bbe0e7b929350c5d7e8 + pristine_git_object: 00ce08abaaf149eb1713cc084e87a8b1efc8df81 docs/components/advisornestedtool.mdx: id: 71464b7dde39 last_write_checksum: sha1:85f6613d57b23cb14b06e5bd9ee717dd7a0076cb @@ -132,6 +156,30 @@ trackedFiles: id: 037d49b1a02c last_write_checksum: sha1:1ef65dad1b6f74dad67829f8b67d65da6144922b pristine_git_object: 95bf97c81f4b519b1abf0b8ef96d5344140ac182 + docs/components/agent.mdx: + id: a9ece83c3330 + last_write_checksum: sha1:6aa5ec348e98fe755fa241b09b94e9316f130a5a + pristine_git_object: d0300461c7036764ce02b5ad12748485406a018f + docs/components/agentmessageitem.mdx: + id: 207b0f2bd32f + last_write_checksum: sha1:11acb80bcbb86196a5fa991843bce2ffa8ce1f88 + pristine_git_object: f50b6f364c0b9deddd755f43d68af8f032bc8298 + docs/components/agentmessageitemcontentinputimage.mdx: + id: a491c3154b29 + last_write_checksum: sha1:ae00600fdb044ef6055b821ea9e1c6ed1984059e + pristine_git_object: 67e9a2411f1fb7ed3dd9d20900ea39cca3c90536 + docs/components/agentmessageitemcontentunion.mdx: + id: 1059ca11299e + last_write_checksum: sha1:772f5e3f8bd01d99bddc12160bf5e3b448bbf8a6 + pristine_git_object: 0ffa1e9e09f27fe2e3fa668316ee29271a6ce46c + docs/components/agentmessageitemdetail.mdx: + id: fe0d57b4e1d7 + last_write_checksum: sha1:3c38eb440eb62672a2543017bb57d2f9277ddbbc + pristine_git_object: 1e49ee6a692735eeaab980d66640a8212fb24152 + docs/components/agentmessageitemtypeinputimage.mdx: + id: d16eed88b27f + last_write_checksum: sha1:f1b71145d88842c0b61651b24f1b7245ece6620d + pristine_git_object: 4acb9c2305ede0ba0e6596e3c2b8d261ff24e12d docs/components/allowedtools.mdx: id: bc9b06183311 last_write_checksum: sha1:9b19ddb249037404d76b5c8f7cd8b40e20cf598d @@ -186,8 +234,8 @@ trackedFiles: pristine_git_object: 44deb61a813fde8473d34e0a14ccaef643467e0d docs/components/anthropiccachecontroldirective.mdx: id: 5671704f9917 - last_write_checksum: sha1:03d0b8bed7d5dd448141a09c4515594bcc7ef3f2 - pristine_git_object: 5f755985a972da22e96483e3807cb2029ba18989 + last_write_checksum: sha1:a31ffcd83295557f5a070d96873408214676a2ea + pristine_git_object: 12b753fe8b98723cd210a3dac91402a026b1dfac docs/components/anthropiccachecontroldirectivetype.mdx: id: f5d844d35b58 last_write_checksum: sha1:9e513498c44431258e61e8fb25537d8f6c5d4f7d @@ -196,6 +244,10 @@ trackedFiles: id: f047a00a8826 last_write_checksum: sha1:7731c7cecebc8d0ea5d779a811809d4d570ed7c1 pristine_git_object: bd3e799f85c07638dff4daf50d361bc718c47b0f + docs/components/anthropiccachecreation.mdx: + id: 76d410a5e73e + last_write_checksum: sha1:3b9e3d49c378acbdada5129434dc5e469ff0137f + pristine_git_object: c9562a64e41c396aee705ef025650900df0b43e4 docs/components/anthropiccitationcharlocationparam.mdx: id: c40e539e0fb1 last_write_checksum: sha1:bf7cb3fdf2b38b00e4b026e7c0304d9e308cbb75 @@ -220,22 +272,22 @@ trackedFiles: id: 600fbeec8753 last_write_checksum: sha1:dcc72105e3f4c5f50ff39092ad82dc511d65e73b pristine_git_object: ebe0335b3a26503e24ffa142fb1c3907c5e23600 - docs/components/anthropiccitationsearchresultlocation.mdx: - id: 40f569d8ec6e - last_write_checksum: sha1:503cabd5f211da0e9681f802b63e6a242069e3eb - pristine_git_object: 4766fcaadfbff64d65a1b3fbffd3ae95cf8fe435 - docs/components/anthropiccitationsearchresultlocationtype.mdx: - id: 100166b3a8b6 - last_write_checksum: sha1:deed2eb89dc2d1c20b084e4e4c0a2c74b4f84b7c - pristine_git_object: 096cc0d6ce515592417e620b1340aa3b4ea02638 - docs/components/anthropiccitationwebsearchresultlocation.mdx: - id: 95ef98e8c423 - last_write_checksum: sha1:033b55c4b6e7cf6161a5d059d89ba0cd506d0d0d - pristine_git_object: b03268fdff9d48c3e99696ec02c0636c5d23871b - docs/components/anthropiccitationwebsearchresultlocationtype.mdx: - id: 1d41c18eef52 - last_write_checksum: sha1:a18a6f783fc84d86afb56b21cf08ca9d74297b0a - pristine_git_object: 9cb6d29da30e11fd653a9bb5a06c6f7592ea56c8 + docs/components/anthropiccitationsearchresultlocationparam.mdx: + id: 9ae72ccb3e72 + last_write_checksum: sha1:32fca32b7cee91aa9a77edfc5cd8fea9225c0863 + pristine_git_object: 8d0c9d2ac994806fc2d2e0c4de4aec4e4a058852 + docs/components/anthropiccitationsearchresultlocationparamtype.mdx: + id: aaf65427c659 + last_write_checksum: sha1:1c244ccc9dc3e9786157f7b79f0eae68b02a2895 + pristine_git_object: 36ba3e46039d4a40008345c0939a33f95bb36b8e + docs/components/anthropiccitationwebsearchresultlocationparam.mdx: + id: e8b10b5b40f7 + last_write_checksum: sha1:3078918f99892b68eae36856265f870675ef7604 + pristine_git_object: 9b59d45b7e4a9f43588692a661c71214ff316a30 + docs/components/anthropiccitationwebsearchresultlocationparamtype.mdx: + id: 584f4fda6d05 + last_write_checksum: sha1:5529e2c7a6402f204c3dcf7ed18522aefaeb73f4 + pristine_git_object: 4bc0197a7fdc78781b645d2c8f4b32bb0b71b571 docs/components/anthropiccompactionusageiteration.mdx: id: 9bcca00fbe93 last_write_checksum: sha1:7d79a2bda26c860d3da4882bf4c8b4e044d2ed56 @@ -246,8 +298,8 @@ trackedFiles: pristine_git_object: 2b04c2483fceacf8300bb872ea0eed600970d160 docs/components/anthropicdocumentblockparam.mdx: id: ece98dcf04f6 - last_write_checksum: sha1:5a05c624a5a134bedac12d687f51621448627daf - pristine_git_object: 5a24251490513dca5c64fa3f8b29c80eafdcd331 + last_write_checksum: sha1:42f908ffe281fd4272a24d7eb874f76fbee47da9 + pristine_git_object: 1ed7b7cd83e412bdc9945f00a875bc681e0c96ee docs/components/anthropicdocumentblockparamcitations.mdx: id: 474518ae0167 last_write_checksum: sha1:798372e77425fd7127a318c75247ce44e6f1dbfd @@ -274,8 +326,8 @@ trackedFiles: pristine_git_object: c86bc52963eca6a9de705f418c56d17a4bf8ebc6 docs/components/anthropicimageblockparam.mdx: id: a85ff43edd3a - last_write_checksum: sha1:b2324840f7be26004674f2a59f5d66122b75437a - pristine_git_object: 2d95dd47a3b3f4551cd4a148f4936057a40587f5 + last_write_checksum: sha1:32a650d11a80f74059407954fa86eba2247fdf03 + pristine_git_object: 9be25eff134f6283b95213ba56fa2ee21c493a39 docs/components/anthropicimageblockparamsource.mdx: id: 82f05c79d5cb last_write_checksum: sha1:0939a26da32a1d150a58d6988b9ef8bbd49bacf4 @@ -330,8 +382,8 @@ trackedFiles: pristine_git_object: a538343b4f3fca39a44d3f208e702c482978c4f8 docs/components/anthropicsearchresultblockparam.mdx: id: 5c62b24b2c58 - last_write_checksum: sha1:a8acf36f4eb32d7d01a906f889f9c76e36786f24 - pristine_git_object: 517785e7ab5c58a8e41292572d2d581a0a0e3df7 + last_write_checksum: sha1:b6f01f3da19d4a430e66f5c47e90f31aa3fb0e29 + pristine_git_object: 89ae1afd55149a2e641d5330189fd5213aa7f05b docs/components/anthropicsearchresultblockparamcitations.mdx: id: e6a0db284ce9 last_write_checksum: sha1:20a8315824e11129d12d4d5c441e9fde3691a1f5 @@ -346,8 +398,8 @@ trackedFiles: pristine_git_object: 6f1e9ce880a0c3173ce7af4d14c8508b686b8ebc docs/components/anthropictextblockparam.mdx: id: bded5d409e91 - last_write_checksum: sha1:5c8b4dafc14fafa615c888b9cd207bac55ebb585 - pristine_git_object: 6d00495d81a02e202e2ae1346439d734a75df8f0 + last_write_checksum: sha1:ab2ebb14dd5e54bbadf4db4aa919d1b380b844b5 + pristine_git_object: 502d15e612cfe8df8b28ba89855683eee5f0ce4b docs/components/anthropictextblockparamtype.mdx: id: 7f03a13234b7 last_write_checksum: sha1:12c7718c5c0da4561914ed95dd6853873568bd05 @@ -610,8 +662,8 @@ trackedFiles: pristine_git_object: 633bd16e1abe0e3894c12f551761ad1a9da37d5e docs/components/basereasoningconfig.mdx: id: 3c6f03de40b1 - last_write_checksum: sha1:3273f4dc1e6af65f58aa87e4b97bdab579f65f8a - pristine_git_object: 628251998a3571d2b89225ac5a707f372c5ec143 + last_write_checksum: sha1:036514fae32cb43664cd47805eeb2f848a340547 + pristine_git_object: 6f900a92fdf544de9b1531b7c2865fa9564cbeb1 docs/components/bashservertool.mdx: id: 664dbaf53aa3 last_write_checksum: sha1:0b276c752d22836d67b31aab477b4ebba24c17c1 @@ -702,16 +754,20 @@ trackedFiles: pristine_git_object: 151dd8398dc818ff4d26d6859d25efd202d03917 docs/components/byokproviderslug.mdx: id: 6ea70819f6d8 - last_write_checksum: sha1:5116cfa7ed1f8270dfc9d277d3cc0ee02b147c44 - pristine_git_object: 439563d0fe5440c4f0127337f39ddc403f63ae06 + last_write_checksum: sha1:e98e972e8efd96c2f0f9f3a71f6146021b11dd6e + pristine_git_object: 7f17d7c4d338ac9aed696e2cb2449882be52dac4 docs/components/caching.mdx: id: edc8a0f8f37f - last_write_checksum: sha1:b4e6619f389c1440555ec567fbdcddbc9976e63e - pristine_git_object: d9c719912c5e82aa2bf9b02c54fb03c8d448ef83 + last_write_checksum: sha1:cce3835ca76b640b591de1307422aa4e391cde69 + pristine_git_object: 0d7013f54bed0390239fa49074a48d5b21711a28 docs/components/capabilitydescriptor.mdx: id: 34ac0e581d79 last_write_checksum: sha1:62ee9ccab6cec4572383cef654997ab4106d4676 pristine_git_object: ace8f22b972273bdee620a9981abcb0cc46d994e + docs/components/category.mdx: + id: c952e528e6a0 + last_write_checksum: sha1:8c57eac99923f3c4d343cd6dc3727c58d405c33c + pristine_git_object: e67ca2a02783050e89bed3f53bf59d2e8c805478 docs/components/chatassistantimages.mdx: id: ffb19be9dace last_write_checksum: sha1:cbcf9e1fb04e660786ad38a273b852cf84504f9f @@ -754,8 +810,8 @@ trackedFiles: pristine_git_object: fdb10076d12248abeacfae19a1bd647d4a838eaa docs/components/chatcontentcachecontrol.mdx: id: 215e2356f770 - last_write_checksum: sha1:cf9c5e64dcedcccbab8d79499bea7bf76e86b1b9 - pristine_git_object: 250fd47f76c936c2e979b55caa6d4fb17b4a26ef + last_write_checksum: sha1:96bb8d2d2c51fc1b5208120f84ca175ddcd0346a + pristine_git_object: 6f1d2f8e0e284e16eeff1f0dbd03166260f3ac94 docs/components/chatcontentcachecontroltype.mdx: id: 93c1e9a9146e last_write_checksum: sha1:febb0b8575ef8fc009f71312d8fed2b596cf6d28 @@ -790,8 +846,8 @@ trackedFiles: pristine_git_object: 92c9c5c2ce23807bac9756e55803057921c34f24 docs/components/chatcontenttext.mdx: id: a2436d6c5c1c - last_write_checksum: sha1:dfda97beb6d5cdb859b9207798e34ed7ed4691f8 - pristine_git_object: a59dafe92bfb650c89244eaa89f00690fd8282d3 + last_write_checksum: sha1:bf50de67c2c4b71ef14a92a53507b1c28fa1cc5b + pristine_git_object: b31006bd9cd42c1afa9f936eb085af94ae786f4d docs/components/chatcontenttexttype.mdx: id: eb29ddb48a88 last_write_checksum: sha1:154a7cb1f0dcdc0ff60b5fcfe1ce5e86e08bb72f @@ -836,6 +892,14 @@ trackedFiles: id: 8afc3b0c53f8 last_write_checksum: sha1:f86f220ce930d1a671b8c702bdea25dcefabfa94 pristine_git_object: 9b479f4efdecfa74ed55207183a0bce5d4d38f5b + docs/components/chatformatjsonobjectconfig.mdx: + id: 6e196fe09ae2 + last_write_checksum: sha1:3db48171b63121e740354c543989c4249f6ab23d + pristine_git_object: 5dae96c7348d2ff09b872408a35afd3bd546c0f1 + docs/components/chatformatjsonobjectconfigtype.mdx: + id: f4db08f0130b + last_write_checksum: sha1:13be1ecccc74426b6db1ed68b26bbc922e836022 + pristine_git_object: 617987c42d412b2814a55a00c73cc435469559c7 docs/components/chatformatjsonschemaconfig.mdx: id: fddf166f727d last_write_checksum: sha1:454f73f794c83adb2b86edc7bc9cba8b322405de @@ -862,12 +926,12 @@ trackedFiles: pristine_git_object: f5cbc93e1277fe0ed97bb520e331a58837e91ab4 docs/components/chatfunctiontool.mdx: id: 13433a4eb5b0 - last_write_checksum: sha1:d3b6abd613e7866de1fb7074e9e794543c8a940f - pristine_git_object: 41b4523f970c7a81f2512587ef8dd3a8db150f89 + last_write_checksum: sha1:7d68426d966a73f8b924fac73976317a47826f8c + pristine_git_object: bc9f2fa0780e97e0d13a2c10af27a5f3e666c0f5 docs/components/chatfunctiontoolfunction.mdx: id: b9f813a5b0c9 - last_write_checksum: sha1:1daf25e4f31b7013fcbcd43f86678ce1548c8423 - pristine_git_object: 7619eec425176b875101f822b806ff98a5d991c9 + last_write_checksum: sha1:649b1fe5d94d5613d6e902d5d96762be33e648eb + pristine_git_object: a6cf73c17fd5cf6752d09f7eb25a13fb8d9d4a02 docs/components/chatfunctiontoolfunctionfunction.mdx: id: 59c7a37a65c9 last_write_checksum: sha1:671313b618e2e45e37f94494b8bd88822aa4220a @@ -902,8 +966,8 @@ trackedFiles: pristine_git_object: 220be03bd674a257c2064c0455104959b3974a35 docs/components/chatrequest.mdx: id: 055812be14d8 - last_write_checksum: sha1:77fcd137afe54399a3eba5f08cf6e0ffda8cc242 - pristine_git_object: 1cc4f0f490833b0defa14840b69ea02f90820770 + last_write_checksum: sha1:8803f814796b25653c13db7cd2e167720d615499 + pristine_git_object: e831058c3a681c3f9e8896137e06d82d3c416a5a docs/components/chatrequesteffort.mdx: id: 703c73252ebd last_write_checksum: sha1:243510f188071a3f317dc06a07fbcfcedd3cf821 @@ -1058,8 +1122,8 @@ trackedFiles: pristine_git_object: 48386287b072381a9b59de6ae804b0ffbbab221a docs/components/chatusage.mdx: id: d7c2bc8b3eb2 - last_write_checksum: sha1:7f8bf402accabcc12f92b52bf6101cac3ef0363e - pristine_git_object: a45747f57783767d91fe66f212525f7578d7345c + last_write_checksum: sha1:94539927996d770b9629c64bde6d8188976eec1d + pristine_git_object: a32fff446094a26dfa62cdfcd02b5bc3c1293a72 docs/components/chatusagecompletiontokensdetails.mdx: id: 0274e721a9d9 last_write_checksum: sha1:77e7b8ae3c4456f4284f4fbd0093d00fdefd06c9 @@ -1090,16 +1154,16 @@ trackedFiles: pristine_git_object: 6056c49814eafac5ca7ce25eb0da8413a358c8be docs/components/citation.mdx: id: 9a5f3d4dc85e - last_write_checksum: sha1:e87496dfef2b1f10bc75744fb01cd8c56dc36e1a - pristine_git_object: 9e503681992fded303416915b21d3e23d1296dca + last_write_checksum: sha1:caaf7b5e9d578c27e3347b6a74151450df7b979b + pristine_git_object: 262286806c125e7b4e306e43f29f964459157382 docs/components/cleartoolinputs.mdx: id: 4e474b90f4b7 last_write_checksum: sha1:2574803d7adf914b3f90850fbaea1af2cf6eaed5 pristine_git_object: d5682fcb62d709606d7e073a9447621cc6da7a68 docs/components/code.mdx: id: 1cc125f1dfa9 - last_write_checksum: sha1:4a06fc3c63211ff7ac30cd5012663f58d077d3ec - pristine_git_object: dc6776c36813b18fba2613f5cfaf147acb229a90 + last_write_checksum: sha1:322ba712be712d52ddd41577792f1d4ec2012c9c + pristine_git_object: 7605a858caea23ecb7afe6bcc306d659abc245c6 docs/components/codeinterpreterservertool.mdx: id: d828abe3a52a last_write_checksum: sha1:8eafcbabe4084b286d34a7b2e7db0f99ad547727 @@ -1118,8 +1182,8 @@ trackedFiles: pristine_git_object: 8a2adc33e4a201f48cc802d12dd0154dfa674aa9 docs/components/compactionitem.mdx: id: 26c52557072b - last_write_checksum: sha1:5d5e9a7ece815c6cc9aea6cb3b484e8d3a7e0321 - pristine_git_object: 7fb1a632309091019e4f2622225c07f926e42b1b + last_write_checksum: sha1:f8c0deb4eb10c507ec77d2be7669a96bb81c2a1b + pristine_git_object: 52161ac34082b508dbc5da7e8ec8a380ab813c99 docs/components/compactionitemtype.mdx: id: 688981b39855 last_write_checksum: sha1:70bb56c5e1b6352f709a63c98103e99c379fc86c @@ -1178,8 +1242,12 @@ trackedFiles: pristine_git_object: 9a8e9eaadebb36e2836d73c4ed1867c5f1e564e7 docs/components/contentcompaction.mdx: id: 1923f9db3cff - last_write_checksum: sha1:59526732df9d4b5a69f3a79d1210493dff8d8898 - pristine_git_object: 39acf3a7dc4de67d2eb07a4e21e33e6cfdd2091f + last_write_checksum: sha1:db0ae20faae38b060e586c80655b79849bb4e18b + pristine_git_object: 87f9c8d7936595373ebeae59a265705db8df2721 + docs/components/contentencryptedcontent.mdx: + id: 0dc55809c394 + last_write_checksum: sha1:97675b67fb3cdb6c892bbe01d2cd9e6bab5e4dec + pristine_git_object: f6d3a51c9fa32b15dd589583fd07b835f76f0ecc docs/components/contentfilteraction.mdx: id: 11728ebb9679 last_write_checksum: sha1:c2e70a8136e1af5a9a0e2abd930e5cd3bdb880a1 @@ -1286,8 +1354,8 @@ trackedFiles: pristine_git_object: f9c4eeefa07fcc73839934dd6b3d403fe7539da3 docs/components/contentservertooluse.mdx: id: 7b676db3a465 - last_write_checksum: sha1:65f0643d0a7af0e2ef8b4f2dc9a336b5a34b135c - pristine_git_object: 527a1c1ae4e8df68528db2404024b67348ab4b6c + last_write_checksum: sha1:b49ee690460e4de02996066b31e91bb1f4eb8400 + pristine_git_object: 86c112ede3a14c30546d1fb00f6526a5f854ced0 docs/components/contentthinking.mdx: id: c23024acf25a last_write_checksum: sha1:f3a989b8eb7a38f2705324263796f49a7e1722b6 @@ -1298,20 +1366,28 @@ trackedFiles: pristine_git_object: f07b01d7d44cc717b67e5648283c659fc02c72fa docs/components/contenttoolresult.mdx: id: a9a083b8900f - last_write_checksum: sha1:1a0bb46e6c27779f1f88da7eb87d0ae04acd62af - pristine_git_object: 4abde669843735aeb36b10c6a5992f8d6509cd40 + last_write_checksum: sha1:72b603d3efa32360cf6e8b6c718dd46718b0e98b + pristine_git_object: f83588a9c24d3172b8f8fd131cdc5aea073d0088 docs/components/contenttooluse.mdx: id: ad7fb52d642b - last_write_checksum: sha1:47f463246904b67a444c6072b1d927c1c6c223de - pristine_git_object: e29dae101a0e629b6cfa1473fc22d732e646ef55 + last_write_checksum: sha1:96dda7c7f895597f5f60c57b69936f77e14fc8ff + pristine_git_object: 7149ea56376799b7d485254b63acdda00e9713a4 docs/components/contentwebsearchtoolresult.mdx: id: d2401cf2f6b9 - last_write_checksum: sha1:b24e06b9ba722674a7fc4116eba838657914f166 - pristine_git_object: a2664d14e56d9f5ada405cee06d7f745e1a5a47b + last_write_checksum: sha1:d7ecfe7df3b1e89151edb59cd1525aab997b28b6 + pristine_git_object: 9a9180dcba1e86c7a26c5396f39bc4dafe160e96 docs/components/contentwebsearchtoolresulterror.mdx: id: e53d83e87e2b last_write_checksum: sha1:22dd4ec3f699feb7d8f22abff79623b427292e35 pristine_git_object: c944724a99b7f7d4a9b5de4dc478f1e15643e20a + docs/components/contextcompactionitem.mdx: + id: 4e12480f54d6 + last_write_checksum: sha1:b3491d872cda856a3c9e338cf9121af0e68f1be0 + pristine_git_object: 4410f499ce362b79b38a3ea450e03913cfafc984 + docs/components/contextcompactionitemtype.mdx: + id: 393257938ed7 + last_write_checksum: sha1:28b03a5e14d3ab558cd6379fa25a4481e05e3016 + pristine_git_object: a8256a82a3cc87a83ac240f2bd3971b29af436cf docs/components/contextcompressionengine.mdx: id: 684ea7e73a30 last_write_checksum: sha1:b093510814e6d7a1911104a6a5911e789b689759 @@ -1346,16 +1422,16 @@ trackedFiles: pristine_git_object: 67494d04412539e0cb0b406ef4e4cce61b3a6c87 docs/components/createguardrailrequest.mdx: id: c1a768f054c0 - last_write_checksum: sha1:8e8d8f957c48303ea3eb1955c182b26e8c2d5729 - pristine_git_object: f26042f6c6a5c769f5c13030df4f9e48a8077e6b + last_write_checksum: sha1:4be348500854ec5c2cb903ad498730b1893de714 + pristine_git_object: 1c7c87df72d92253b110e550066407bcd057ef87 docs/components/createguardrailresponse.mdx: id: 1477eebdf505 - last_write_checksum: sha1:5b260347acddb3d10bcb9283673646950b4b3c6b - pristine_git_object: e876cac85124ae1a612a2611c11e7039a7eed07a + last_write_checksum: sha1:15a74cf2abd149416117cc525e6fad918d536afc + pristine_git_object: b7e89dc116e820a8748af87b83e66f2706ec5599 docs/components/createobservabilitydestinationrequest.mdx: id: 8d942a601a6e - last_write_checksum: sha1:8bed1fb299e0fb1961ee90a07274a0803c977958 - pristine_git_object: a3435fe0c498da2ef18fe16d0afab27b813d3595 + last_write_checksum: sha1:968666d16e4c3b3249f7e533829d510c5c043179 + pristine_git_object: 065e043f3ea11140659cba056f490b634d435e62 docs/components/createobservabilitydestinationrequesttype.mdx: id: 0cb269425077 last_write_checksum: sha1:f8608dbed4fcc4407be03f34d5a5ab50c5cd085e @@ -1934,8 +2010,8 @@ trackedFiles: pristine_git_object: 3c29bc4bd3bdf7037b9c3aa894180b8e4cae6098 docs/components/fusionservertoolconfig.mdx: id: 87976811b0c3 - last_write_checksum: sha1:dc0f4c3cd6409193662d17304c0dfc2eb28f6efb - pristine_git_object: 68527081664f78ec050036db30091158a08bd5b6 + last_write_checksum: sha1:267106d40b0f8e9a7601945753f7934b34084183 + pristine_git_object: 1247ee7797392ca5e7778a47b42932a97cc16203 docs/components/fusionservertoolconfigeffort.mdx: id: f5ce0fbc94aa last_write_checksum: sha1:4ce09a069b4eeae41ac1531027cf97dc4139927f @@ -1986,8 +2062,8 @@ trackedFiles: pristine_git_object: 5730056ada30b50ff129f1da9e021fe69310d5b7 docs/components/getguardrailresponse.mdx: id: a5ffd4aa91ea - last_write_checksum: sha1:511fa1f74b06e6f9c8b39ec95dbd976d31daa3fe - pristine_git_object: 7a49600a95781a703124f690ab3440201b3613fe + last_write_checksum: sha1:f1f2143e99650fb602f8c5a14c953b9e0b4ebecd + pristine_git_object: 0b5936faf7249661e98170af74382cfcd8b7b69c docs/components/getobservabilitydestinationresponse.mdx: id: fc89b94d297e last_write_checksum: sha1:43e6002bcb78df9ee766e6d97c08a6b238f8cae5 @@ -2004,22 +2080,14 @@ trackedFiles: id: c8d0c4683019 last_write_checksum: sha1:d659e4cebde3a9a14eca14c4a95f1e9e53e46f06 pristine_git_object: bb16c1fd514e8e4d4f98dfbebd3a29bcdf8ee192 - docs/components/group.mdx: - id: 7a304030a713 - last_write_checksum: sha1:e7ac1a81dba9420ef0ca16b53648812273505a3b - pristine_git_object: 34495da0d0429ae52773d520030bb2b0807bc206 docs/components/guardrail.mdx: id: 91791d4c83b6 - last_write_checksum: sha1:071ca3eb0a6f158e4107d7f337c3f7a8e6ac95f8 - pristine_git_object: dc72fbb152e23a7e3903e9aa6479e68baf10f556 + last_write_checksum: sha1:d10ad674399ad65710d1dd4d4d20fc87d2317e14 + pristine_git_object: 7d6c170b4990eb92cc3e252c1ffa82836a4875c5 docs/components/guardrailinterval.mdx: id: ccedea0ab250 last_write_checksum: sha1:08342a9cceb4f7a5dc0b574a429d46af9d9a13f4 pristine_git_object: 9e0a058e6a19b68f470eb0938670dff51b47f4b5 - docs/components/ignore.mdx: - id: 2714aa9d51d7 - last_write_checksum: sha1:fd8114687442350261ba507cd41d1f0ebb067928 - pristine_git_object: 8ba131528ef679ebd2880be85b7732ad5a078174 docs/components/imageconfig.mdx: id: 455a9f530ea8 last_write_checksum: sha1:3ec5e8ac11e823479e41115da31aae29d2a1cbd3 @@ -2062,16 +2130,40 @@ trackedFiles: pristine_git_object: 8eb6786a519936cce87262623156a61e2f645c38 docs/components/imagegencompletedevent.mdx: id: 2b1b82b2ff79 - last_write_checksum: sha1:3d4e28577da1d6ee353a8f3bdacbc45e8a1c043a - pristine_git_object: 90ddd67dae34e0fed8c622edf27638d47709f3f7 + last_write_checksum: sha1:2e4d746322e73bf36923a7f14ff6888207b660d6 + pristine_git_object: 247d9e47e9583ec3778ca94cc3fadee3a4034376 docs/components/imagegencompletedeventtype.mdx: id: dd9998bc9093 last_write_checksum: sha1:a7d7c52d0a7c5128a40fd9f1524e8b6f372a9061 pristine_git_object: df5a9a53d2ea20bb548913c902b0bffdf2dc5d15 + docs/components/imagegenerationproviderpreferences.mdx: + id: 96067cea4257 + last_write_checksum: sha1:63f1caa2d78a1e1d32c1222e8275155417e7e87f + pristine_git_object: b98f786f64edd693499cd395774d60fca698aa85 + docs/components/imagegenerationproviderpreferencesignore.mdx: + id: 0c7b1553ce53 + last_write_checksum: sha1:6d55c341ed1a68b8656b8b4564794941881b3487 + pristine_git_object: 5f20d5e467c508d7814a43897a4ae35e907b0740 + docs/components/imagegenerationproviderpreferencesonly.mdx: + id: c8343461ec27 + last_write_checksum: sha1:8e2ed740ce1cf64959b7732c12bf664f5cc4a8f3 + pristine_git_object: 11f1471c8b6c04f52af89d74d6dec2e9d12c2d82 + docs/components/imagegenerationproviderpreferencesoptions.mdx: + id: 32d5c4b3e06b + last_write_checksum: sha1:7a1718d0eb96dd90a668c528534a68e2e0e4d58c + pristine_git_object: 9f867b4a7ee4c98de70e50a64801bd2e4803e810 + docs/components/imagegenerationproviderpreferencesorder.mdx: + id: 0547877073f3 + last_write_checksum: sha1:3e890c691097373cc9a2d7e47c3594f56b57809c + pristine_git_object: 3125f8b2ec3ee98a992c7397978917d47e1043cd + docs/components/imagegenerationproviderpreferencessort.mdx: + id: ce43ddb42deb + last_write_checksum: sha1:acd4609eea738b06a6252ee2ea0a4621eeaad2bd + pristine_git_object: 7696bf5f4a2c4a1f05e148513b70fe96b2f948a8 docs/components/imagegenerationrequest.mdx: id: b093cb0f5e81 - last_write_checksum: sha1:68096752052ef76c094d2e49782962a0facad4d8 - pristine_git_object: 1d6369db6d2d6de74df8a6d7366ba627a5389a70 + last_write_checksum: sha1:1bccab895149605ba994e84b202c1f7b50c6ccb2 + pristine_git_object: 36805ca3350396bfded85776a3fe88e268ca0a35 docs/components/imagegenerationrequestaspectratio.mdx: id: bda89377f32d last_write_checksum: sha1:9cc231ee222c01ce471ecff3804a9e5acb8a054f @@ -2080,18 +2172,10 @@ trackedFiles: id: cab3c6c6dfc6 last_write_checksum: sha1:ea6f2fa5f8f63600e2d1a67a784e6a93cf295975 pristine_git_object: 8501680bcfebabb3af52b518c01f732d18282120 - docs/components/imagegenerationrequestoptions.mdx: - id: 2245ece0aaf8 - last_write_checksum: sha1:ef565300c4aaaacf991f0ecabb2dade678494423 - pristine_git_object: 26f3f1ecd8f4865034e81ce1eca81552d90d70b8 docs/components/imagegenerationrequestoutputformat.mdx: id: 380f12bf77bd last_write_checksum: sha1:afb479dc34118828e988888a8f49e7a5a50a45ab pristine_git_object: 4901416246fb4e34fc9227d3dc0bbbc08aa717e2 - docs/components/imagegenerationrequestprovider.mdx: - id: 8b592ddbab98 - last_write_checksum: sha1:c67183fc76f6e46530829fc5b85b8c164a4c2557 - pristine_git_object: 51188d0f86b2208ae9dc3d797ce3595961162602 docs/components/imagegenerationrequestquality.mdx: id: 7699c7fce91f last_write_checksum: sha1:e0c8abee1332b182aeb1228b9c7a7f4cec83e99b @@ -2106,12 +2190,12 @@ trackedFiles: pristine_git_object: b6e0e2c0dadc42fd0fbfaeb9b81f12efb62ff051 docs/components/imagegenerationresponsedata.mdx: id: 1afc55d56268 - last_write_checksum: sha1:04d65c9889436bc57b88dc1e9e98765f86d9da29 - pristine_git_object: 78ec1e139b813231ed78ecf7f337cb277180b7a8 + last_write_checksum: sha1:7960f5fce39a388da2aaf3a39a38d5c27f17da10 + pristine_git_object: e36ed8937fc9401d2741d97cc03ff5c0ffc3bd52 docs/components/imagegenerationservertool.mdx: id: "299013078656" - last_write_checksum: sha1:663ae715382f7f22890ea81a43ddb3cd0c07cf6b - pristine_git_object: c290753ad894940926de78e89ec89f19f71b7370 + last_write_checksum: sha1:e0bcf01506046b995743f16aa0bffbe10f65846e + pristine_git_object: c620407af23e39d21aa1e4a372fc2584cdb7a072 docs/components/imagegenerationservertoolbackground.mdx: id: d42f0c89a96f last_write_checksum: sha1:1e06585c90c3fd1fbe38bbf24d2c382cfe5f0738 @@ -2150,8 +2234,8 @@ trackedFiles: pristine_git_object: cabf0cccfa7d7bee9faa823d66650bc395220966 docs/components/imagegenerationusage.mdx: id: 0f8faafc5148 - last_write_checksum: sha1:be2ebcd80f3299ec6e38bf8c580ac5e28ba67d85 - pristine_git_object: be9fe8ffa3ea8829bf61cbbdcfd5f1a17aad439d + last_write_checksum: sha1:7662a98019e0fb829b124d14f938ee07f5ef5519 + pristine_git_object: cb01cf31c16ba5f1caea0be6b376e83ee0d82b59 docs/components/imagegenerationusagecompletiontokensdetails.mdx: id: 71ecb25e164d last_write_checksum: sha1:f0843acffd7d7540b07bb384f299557e7309950d @@ -2180,10 +2264,26 @@ trackedFiles: id: 4aebc0906c32 last_write_checksum: sha1:cc721e8cb94394423b023926244b51f981a1840e pristine_git_object: dc1d52997ba58bd62e44c145f3f954ff619d95b9 + docs/components/imagegentextchunkevent.mdx: + id: 90061f61e915 + last_write_checksum: sha1:737477edb091fd149324f9126be49b3e25c8d456 + pristine_git_object: 9c2837aabc4b5ee6f947ae9bca1412d756f261f9 + docs/components/imagegentextchunkeventphase.mdx: + id: d0833d90ca7f + last_write_checksum: sha1:31d0056d886bb9c4b74a04debc2e29e63f2ccd60 + pristine_git_object: b9333b18b1926cb5ba5c8d781e82c57a5ade4a75 + docs/components/imagegentextchunkeventtype.mdx: + id: 352d5a931932 + last_write_checksum: sha1:6d49bb73e36c227f1db9a865435ec47fc3076986 + pristine_git_object: fffb82a794389680343b9317dd08062214edf303 + docs/components/imageinputmodality.mdx: + id: dff1855cdca0 + last_write_checksum: sha1:20c35ad045c3933c34f357aab4e9dcde89e20f6d + pristine_git_object: 9062baf545e585b575fbe567868f05451aa5bbb5 docs/components/imagemodelarchitecture.mdx: id: 605b7d0df8cd - last_write_checksum: sha1:4d1003bc766ebe55e79e172c1f959ccb3b945487 - pristine_git_object: 6842d9d695c103dc85f93fa899cb2646c5c2d62a + last_write_checksum: sha1:eb762ec64e5e384c2a3e136fd1dfb9f07ce48d71 + pristine_git_object: 860b66299facaf33aa7f5d2ceac6e4657815a905 docs/components/imagemodelendpointsresponse.mdx: id: 831c40b45635 last_write_checksum: sha1:fd1f51f3157ff364b9c61def7734a5321eb66400 @@ -2210,8 +2310,8 @@ trackedFiles: pristine_git_object: 8aad6cc3403b2d0874a7b591248988f3089d33ad docs/components/imagestreamingresponsedata.mdx: id: 4376edf71a13 - last_write_checksum: sha1:5e6ed13b281270c672168c506b36d7e3b16789cf - pristine_git_object: 104002712c11896019f0ef05708333ce6631d4d1 + last_write_checksum: sha1:b782a29aa28c0b85e153a67f919d6080eec96b9d + pristine_git_object: 290f4510d7e41e612aefc61cefa9560a432b0ae1 docs/components/incompletedetails.mdx: id: d83c063d7285 last_write_checksum: sha1:b24c3be63176609c48ae9b19582c520ba1683ce7 @@ -2394,20 +2494,20 @@ trackedFiles: pristine_git_object: 33aee92c61bf7ab9beded4e193f50a2c08462378 docs/components/inputsunion1.mdx: id: c216609d21ce - last_write_checksum: sha1:ccfecdbd5ad7a2719b2372c54e9eac1075b1f108 - pristine_git_object: 9d37626f96de3c19d39e4901d041ef41b01bdc98 + last_write_checksum: sha1:38d513739703efb245bb9c09606aacc35651ad92 + pristine_git_object: 2e56403330ecae1d43fd2e4d23976dfe5330c38d docs/components/inputtext.mdx: id: c8a97322a50a - last_write_checksum: sha1:5462885a683c2ca29551281c9fcf3ad1bceb0634 - pristine_git_object: 5ebcb8365d9d55c2032d5d4739ceeb30831d1ebb + last_write_checksum: sha1:6f92abbb193a5d21cc129df4c5804b3f9161322d + pristine_git_object: 5908413083a34d8bdd34ed916610dc5eee0d6564 docs/components/inputtexttype.mdx: id: 91f958925357 last_write_checksum: sha1:42a8d9a6d3506e02f6024592691292b7ac255075 pristine_git_object: 18baf9c9090c0696427dfebf69ed7e12a8fd77af docs/components/inputtokensdetails.mdx: id: 1b569c720e5c - last_write_checksum: sha1:f6b5b4912a20dfea2515994f9656374d3fc56676 - pristine_git_object: c58b1d023f8ebca70e803c0128b0ade367b4ae35 + last_write_checksum: sha1:c77b55a6ef458ebd7c03cb877aa9ce3d6eec3114 + pristine_git_object: daa531b4e153c105de1905f44bfce078f755f3fb docs/components/inputunion.mdx: id: 94f68c6e9582 last_write_checksum: sha1:85c3b78897569c4572f3fc43f6b1143c293b452d @@ -2458,8 +2558,12 @@ trackedFiles: pristine_git_object: 3c18ed0fb80fbc8cfd45667af06cdecde6a907d5 docs/components/legacychatcontentvideo.mdx: id: fd222b8b9445 - last_write_checksum: sha1:c77f3069be68b3a8fe5757bf31626d73606de778 - pristine_git_object: f1d4b3d542cadec3caabd2fbb99f8769221e37ee + last_write_checksum: sha1:d6819bc122734d7dbe9abf060ae31bac61361633 + pristine_git_object: 74b480b1c49cda64a8d30cf84e91c18d4f4fa32e + docs/components/legacychatcontentvideoinput.mdx: + id: ca6bd671604d + last_write_checksum: sha1:027a30a7edefff19d85cb0065c5c1521280418bc + pristine_git_object: d79ac0622f1c74b02e6f5ce1667c52b8244ff049 docs/components/legacychatcontentvideotype.mdx: id: 6ed2500f1a33 last_write_checksum: sha1:191077107def4be932273d87f6e81a2b3aefc412 @@ -2472,6 +2576,10 @@ trackedFiles: id: 192fa7358f3b last_write_checksum: sha1:c82facbab1f9b4f53e06a6e3986b886f2a9b9b00 pristine_git_object: 3bb4205e59ddb7d332e8d900afd2ee5aaa120dc0 + docs/components/links.mdx: + id: 70a0fc77c7ab + last_write_checksum: sha1:67b732d632e9dee1437f8de51c8160568a3a5ac5 + pristine_git_object: 6debf47da9bcab18bf9b0387b70decb269dead18 docs/components/listbyokkeysresponse.mdx: id: be41921e1cce last_write_checksum: sha1:cc039aaf6927478fd3d3db9eb6a1f84c51e9caa4 @@ -2662,8 +2770,8 @@ trackedFiles: pristine_git_object: cff8f3938a8bd5699d1111a6b1a926518d868da5 docs/components/messagesrequest.mdx: id: 762dd6b894c8 - last_write_checksum: sha1:8e06b3369eb4dee0ab5fee504e444cb5be1f2f3c - pristine_git_object: 2b25d420887ade7549b1848592fb24ed622b54f1 + last_write_checksum: sha1:a2837f5f14f370453c77fd6962dea4fa9fa43999 + pristine_git_object: 89b9780ced7cfd41a0f2b0296232df38e71b84ee docs/components/messagesrequestmetadata.mdx: id: facdcaeb2576 last_write_checksum: sha1:42bf112bc4f6d259c589906fd5f67c5342ab4c2d @@ -2678,8 +2786,16 @@ trackedFiles: pristine_git_object: e6fae8228c3d685d6cfe815e3c24fa53fd642ff7 docs/components/messagesrequesttoolunion.mdx: id: cb1be4df3cf7 - last_write_checksum: sha1:f3afd12d5ecb4ceb5a4209dd03594abb8dcd626a - pristine_git_object: b24e866b9c3842956daae6c28351e0643c29fc49 + last_write_checksum: sha1:bf5c4e8ff92e9f7620dad799ef238f74d15a4102 + pristine_git_object: f5868bf92de456cf395b9bd769323ca35d3225a8 + docs/components/messagessearchmodelsservertool.mdx: + id: 1f9f5edef4fe + last_write_checksum: sha1:5d3026e9fc2eda9ed7c5e8a08aff7f09514d666e + pristine_git_object: e13f74e2abe12371b8dd6d13c85402c17650dc3c + docs/components/messagessearchmodelsservertooltype.mdx: + id: ecbd7f7f2e44 + last_write_checksum: sha1:b0dc13c5cf05011f6496565a4553eb52b9d09481 + pristine_git_object: 52ce907478e961eb90e709fca118e6d0631883d2 docs/components/metadatalevel.mdx: id: f564e5e9a7d3 last_write_checksum: sha1:e51f09243a346926c426f53b07865f5ed145511d @@ -2706,20 +2822,12 @@ trackedFiles: pristine_git_object: e8757cbafebf799b6f162a2b9d7a2aff95c67e4d docs/components/modelarchitecture.mdx: id: fe77e4816f6a - last_write_checksum: sha1:dcf6b88330ab80e643cb7e9b962489a85783002b - pristine_git_object: 3035c9bac4573c0b1a70f9b463ba1a0ce8cf36e2 - docs/components/modelarchitectureinstructtype.mdx: - id: 4064f8606ef4 - last_write_checksum: sha1:172862da64039b2e61ed05b24fbc4c0e219ef9b5 - pristine_git_object: c8d02132963a140b2d71c982b09bec0eed30d042 + last_write_checksum: sha1:ee0aa33ad4b453bc1a0de9aacb2d62b09fc19522 + pristine_git_object: d46fef4698df66a63c1a0e7dc7ac1793df265835 docs/components/modelbenchmarks.mdx: id: a56406a8820b last_write_checksum: sha1:556248629a58731cd01f96ad5972f9d09c00e8af pristine_git_object: f9d4890de1167d8a1fbef33478ab3de57b5396ab - docs/components/modelenum.mdx: - id: 354b0a829212 - last_write_checksum: sha1:52c95ff24eb1c1f0a797e99f1915a218f9f22758 - pristine_git_object: 815fb46e5e07168841ed484059450e5e9cdf3a49 docs/components/modelgroup.mdx: id: 8f246164d34c last_write_checksum: sha1:2954097c66c1dd56fa0440a501630275a6cfebea @@ -2746,8 +2854,8 @@ trackedFiles: pristine_git_object: 9e1b9145d0352d47192a8427975702517923ef66 docs/components/modelslistresponse.mdx: id: 1880eae9f45e - last_write_checksum: sha1:660d60c5fb6e99883437e7e30da3586cbf35b57e - pristine_git_object: 140ec11b65ad7ee9bd3b3fd7933d21a49af3561e + last_write_checksum: sha1:37dc51e0d818c3561d0b7094cf6ab9e2cf44167d + pristine_git_object: ac531b92ce061a5062aa91aeac7ce68242c35fcf docs/components/moderation.mdx: id: d145b88b8b67 last_write_checksum: sha1:ed7cedc44d3043ef40007d3135774d168b30683d @@ -2848,14 +2956,22 @@ trackedFiles: id: 2b5b371b62ed last_write_checksum: sha1:eb15fe342436bb49fe24b4884c5989564149716f pristine_git_object: 3fcbba14f1e9d35a5b5f2aac22d4b4827a6ae149 + docs/components/observabilityfilterrulegroup.mdx: + id: 950cb2bcab56 + last_write_checksum: sha1:2d6488e843daf1826887e21964b08f7e22bea201 + pristine_git_object: 95aa7cfb8f9cf3bad8079923919c5ead01936d21 + docs/components/observabilityfilterrulegroupvalue.mdx: + id: 7394ec319945 + last_write_checksum: sha1:d35837b1d253d1d55e5d61923b4f47bb04eedc0f + pristine_git_object: af2effd1a0616aa1b534f4c3ecda08c6cce9333d docs/components/observabilityfilterrulesconfig.mdx: id: 7693db9b58d8 - last_write_checksum: sha1:e0ebf1b44bd0174e38fafee60ed17eca07c1606c - pristine_git_object: 46330428534ffced625fbd3b3a3b2da5f1a156d1 - docs/components/observabilityfilterrulesconfigvalue.mdx: - id: 7c5b26ae20b1 - last_write_checksum: sha1:f8558110d2cff9d5e3ac036fc7befacb12eaf105 - pristine_git_object: 6b335f615687720e4590e73578de2d4e9096b8b2 + last_write_checksum: sha1:83de5980ee1a40def4b464b77aeaf6aec2d83253 + pristine_git_object: 8393404427dfcb3512809c80e749961b758ab7eb + docs/components/observabilityfilterrulesconfignullable.mdx: + id: 8565a4dcf81d + last_write_checksum: sha1:0cbe6562ce8d9a3c26c0135acfb270f9ab32be72 + pristine_git_object: 842fa8f78a38e50486069046e7c2aef07997c600 docs/components/observabilitygrafanadestination.mdx: id: 933526705b96 last_write_checksum: sha1:75f67fe00561d8a7f163554ccec092903698df55 @@ -3012,10 +3128,6 @@ trackedFiles: id: 35262d81b0a1 last_write_checksum: sha1:53220ed66cf059d9f06df81b7f5bb0f2d87f5283 pristine_git_object: bf3c27b8d2da352bd80bb18179159839e69b9b0a - docs/components/only.mdx: - id: cee5f91a1c3b - last_write_checksum: sha1:abccbc4844ea73ff3641b1aa2a98bdfaebf8d216 - pristine_git_object: cc284e22005d61c156fac73624aee6ead3c1e9eb docs/components/openairesponsecustomtoolcall.mdx: id: 090c07768006 last_write_checksum: sha1:34b7e423654fb097e3420b2fa3ef010f15821796 @@ -3220,10 +3332,6 @@ trackedFiles: id: f88a0ae3ee7d last_write_checksum: sha1:196dfc00e44fa232c6e4f0f496f265a163ffe66b pristine_git_object: b4df5fb4757522576e8452d88f22499cee204278 - docs/components/order.mdx: - id: ae1a6aab00d6 - last_write_checksum: sha1:efc73cd83c8f4e0095ba6901df6dc95349b822a2 - pristine_git_object: edc1ffcd263a4fffa0d4d5b7da1e2c0315a61cb8 docs/components/outcome.mdx: id: dc555505ef36 last_write_checksum: sha1:5e99185f9d49f3f404ca4e54ef84d0cdbf31546c @@ -3658,8 +3766,8 @@ trackedFiles: pristine_git_object: eef5a5c4a33f4a956032328641888fc336a5a55d docs/components/paretorouterplugin.mdx: id: 92e7a1e63fd0 - last_write_checksum: sha1:0d27d564e181cecd6570c92ce027afd447518536 - pristine_git_object: c7ff4bd17a8c4fa61b9a02abad2257ce6c931dc6 + last_write_checksum: sha1:493693e42545592735e9103c9c0a343911a3ac55 + pristine_git_object: 072b9b7e8859caae7e50577a4ed7a2efff48a3b8 docs/components/paretorouterpluginid.mdx: id: 1142f2f64cc8 last_write_checksum: sha1:6e5b2bd86e73db92a9b4b93f014acb57cc61e1ae @@ -3776,38 +3884,78 @@ trackedFiles: id: 35ac43fbcda0 last_write_checksum: sha1:ac447a848769901eb347e8d4ab81494a79d4101f pristine_git_object: 414a5204c691ee0766f05498ff467eeaddebcb6c + docs/components/pricesource.mdx: + id: 815a5cfaf906 + last_write_checksum: sha1:7a7ed23b3c6a5feb64f8428c7e62eab575883a7f + pristine_git_object: 3d340325d192b54a5d039336cce2bd35d12445ac docs/components/pricing.mdx: id: 6816d700f8b1 - last_write_checksum: sha1:ac5c56af4e56eb98da5686e33a224950dfbb8207 - pristine_git_object: 78ac34b5053103dc4261c2fbeb9833f97ef109db + last_write_checksum: sha1:4b1943b79c3f1b054236d4e35f843b91108decd0 + pristine_git_object: e60ec6cfd7c0882a02067bfbe246e5cf6d5208c0 + docs/components/pricingoverride.mdx: + id: 74675f38c1c6 + last_write_checksum: sha1:ca4bf606df26dd9e2b636d7d9e9f0fd183b21145 + pristine_git_object: 5fb1b765b2b0e46d40042f341bbcc91aa0d92762 + docs/components/promptcachebreakpoint.mdx: + id: c135956dc623 + last_write_checksum: sha1:6df345ea99da1fdcae22895faa2ee36339ba7332 + pristine_git_object: 313ab84d0db5d181f8dea91208a4b5127f43477b + docs/components/promptcachebreakpointmode.mdx: + id: 05abe4e54869 + last_write_checksum: sha1:f7ca9f8ff280c1fa750609f4aa13b0706d1dd7cd + pristine_git_object: 37263b53e0db06966ac692cd11558cd68c515637 + docs/components/promptcacheoptions.mdx: + id: 84100012ff84 + last_write_checksum: sha1:fee66864b36bed40090f8e330a390f12b8847dec + pristine_git_object: a9b20d3f963b738ae414738b0b96d42ab8f9ab13 + docs/components/promptcacheoptionsmode.mdx: + id: fbdb2c936b50 + last_write_checksum: sha1:9ad96fb9d26840c0088b7013ef9cba7a7d0431c9 + pristine_git_object: b9df1b4b846931011deabad7c556720ec383ce45 docs/components/promptinjectionscanscope.mdx: id: 27b252a0e798 last_write_checksum: sha1:a8947423372ce9b2edee232b8da4aa0afe5c6619 pristine_git_object: 1d91d32cd0bf4b64699bbbf05a7e95ab835b10cf docs/components/providername.mdx: id: aa3a4904b228 - last_write_checksum: sha1:0ed72fc077d1a2641c8013c782fa7797282337e8 - pristine_git_object: f7cde44d7ed6638b63f3f5c3921096cd368c1b1e + last_write_checksum: sha1:a877ebb29f41cef89404095a42cf667aed632f38 + pristine_git_object: c92f453d6c77a3f5b35a7bd1923fb29fc7d53f1c docs/components/provideroptions.mdx: id: 2697807524fe - last_write_checksum: sha1:e1d6db7e6b3ed82bc19a6ece557566273f9a4b93 - pristine_git_object: b15b96fc074273c0d83e59b9b69c64ce8dfb48d8 + last_write_checksum: sha1:6bdc68db4bd0da411e6f1a0a96415cbdde5bf545 + pristine_git_object: 5ea7d4f6f82b00d4ef8b895ca7109fa523aa185f docs/components/provideroverloadedresponseerrordata.mdx: id: dc500cd14889 last_write_checksum: sha1:6c1d551db4083f1d0bc429baa1ce472d2c085331 pristine_git_object: 05bcfceecf3e74def73684391a76fa68829271a3 docs/components/providerpreferences.mdx: id: adbdfaa46438 - last_write_checksum: sha1:d0f7b534fbaed359e2f2abd736bd669367371462 - pristine_git_object: 750d3a21ada3133dba71217f0444c2064b2ff081 + last_write_checksum: sha1:26ef79be79d733e12a89acc7687ccbd87ebc2f2e + pristine_git_object: a312c6f654c101959c3f182c268556c01e578a40 + docs/components/providerpreferencesignore.mdx: + id: e0455b31c87b + last_write_checksum: sha1:823f56c785a5c80949105fc0f4297a5b0ff2c2b2 + pristine_git_object: 77ecc57935ce0edf477099eac9550490515be515 + docs/components/providerpreferencesonly.mdx: + id: a72941ff2735 + last_write_checksum: sha1:614acb6d266ffd00b1f4f0b7fb4ab6cee551bc96 + pristine_git_object: a6e0692f2fe4e5f87d3816797118dd19f0ebd480 + docs/components/providerpreferencesorder.mdx: + id: a1fce55fe271 + last_write_checksum: sha1:ccbc5120235aa6a8c3aefe791a49bf1539bde74f + pristine_git_object: b9fce30d460f0ed187b5c81225d41c8f4217d1e8 + docs/components/providerpreferencessort.mdx: + id: 64d54fd9ff0b + last_write_checksum: sha1:4eb43e63950c0481fae29816afe807226bdda4ea + pristine_git_object: 72d68077694236233f2bde5d65959b550210a20d docs/components/providerresponse.mdx: id: 36e1a24f90b6 - last_write_checksum: sha1:8cc7665df40a74a5df41e654e7824b6cdd8a2155 - pristine_git_object: 65abb901a8ffeeafa89279f5e15d885cbaa297ec + last_write_checksum: sha1:512adc6bd7e7854ce01d5e5c46ce76b26a1b1174 + pristine_git_object: dd376f0952fa0517dd83b06ed7afc2c856123dbc docs/components/providerresponseprovidername.mdx: id: 2fc17b61e546 - last_write_checksum: sha1:3c9ef87051135f7aa37e89b7b952aed3b8e2c13a - pristine_git_object: 85c97ab96bd1c209a131187986528ea636e81256 + last_write_checksum: sha1:15f7576d4384757dd568dd7bc29b8e7814286a0a + pristine_git_object: aa00e25e5e9ba7697e00a6cdecbb905b109a8518 docs/components/providersort.mdx: id: d73fa13eeb95 last_write_checksum: sha1:b7e9e6842741e3433d705bd576f2ac5383f00134 @@ -3826,8 +3974,8 @@ trackedFiles: pristine_git_object: 4498d08fd82f26a210eeed2b9659e6a0b321f9ef docs/components/publicpricing.mdx: id: 61fb18b7ff94 - last_write_checksum: sha1:41c3b03c9eb4883d41e128e1b2d549ddb608c317 - pristine_git_object: 0d8f6cf2cca158ec93dd8afdc29c0cb377053fbd + last_write_checksum: sha1:e241420249fcbd1bf515b0f5e84934de0b207948 + pristine_git_object: 894ca95c033795d50895fec5b8a6a18cd4a459c3 docs/components/quantization.mdx: id: 9d062e4ee362 last_write_checksum: sha1:4cb3588933fe1ca8592669f8ec1bef1cf0986e28 @@ -3870,8 +4018,12 @@ trackedFiles: pristine_git_object: 99c4a374a4dacb8e64c8a1cf5efb815fb177e22d docs/components/reasoningconfig.mdx: id: e5500b541923 - last_write_checksum: sha1:0356f9e98a2ae7ec83b1c352994ced8cddeaaf79 - pristine_git_object: 819b0830608d88a227d9457f4189d7b1112c39d4 + last_write_checksum: sha1:b83b9e28c2808197ddfe72729f5f2795b5df3b33 + pristine_git_object: d087355d2333bdff545bcfcb351aca98dbd8a4ab + docs/components/reasoningcontext.mdx: + id: 8187c67b9cf1 + last_write_checksum: sha1:b24b2ff096dbdf64839e0842812a043a95f2f9a8 + pristine_git_object: fa199a5442e9a1af6f58a63fc04bc597e1e660d0 docs/components/reasoningdeltaevent.mdx: id: 2ec3838c029f last_write_checksum: sha1:15dccf12992148893efb3325d86be310d339fda5 @@ -3888,6 +4040,14 @@ trackedFiles: id: 7dea8887a486 last_write_checksum: sha1:92808e57ae938c7cfaf7d5ab1dcc2e411d887108 pristine_git_object: 3779ebb04af32b9188d75c4c910752f6ef31ccc6 + docs/components/reasoningdetailservertoolcall.mdx: + id: 095a5cb44df4 + last_write_checksum: sha1:ef83973b82b8630fcb3f195c4bed67e1ea9a0994 + pristine_git_object: 78f316a13caa1cbc4b95082c1273f83cdfdb88b6 + docs/components/reasoningdetailservertoolcalltype.mdx: + id: 703597bf09db + last_write_checksum: sha1:a4415cefe09b6e1944d239999be6622a057ef865 + pristine_git_object: cb6b4d6476d46b8715441055056e000b56448b3d docs/components/reasoningdetailsummary.mdx: id: 264cd49526bd last_write_checksum: sha1:73d7efd548b4a457454ebf381f159797ddc91970 @@ -3906,8 +4066,8 @@ trackedFiles: pristine_git_object: 4b94f542433728f6cf9adce6be943b7be90dbd41 docs/components/reasoningdetailunion.mdx: id: b79bc447eaff - last_write_checksum: sha1:93c29cce21e4ba625b7299ecc8891d1b1fa7ef87 - pristine_git_object: 49ac02bee627aed7cc041917d432dd368463827a + last_write_checksum: sha1:b2451dd8ad86ad3ef3ba6cea0fd18bea1c488bcd + pristine_git_object: 19039845eae5a92b79a1e53f4797cd69996fec0a docs/components/reasoningdoneevent.mdx: id: 3183f11559d0 last_write_checksum: sha1:b2ab6eac3b93629f1643c518dca3e7274d4b17c9 @@ -3948,6 +4108,10 @@ trackedFiles: id: e8641738e2de last_write_checksum: sha1:3e48a910c91face268f4856b29513a839387908b pristine_git_object: ce469f036c494a9b65a2f9c6cba2a00d84ea27be + docs/components/reasoningmode.mdx: + id: bbff17cc0627 + last_write_checksum: sha1:5a3d3051d45f770038d66c27cade83a2ec9d9ffe + pristine_git_object: d288ff3c7f26ed6a639f3c790d7d2a5de4d1715e docs/components/reasoningsummarypartaddedevent.mdx: id: f8185d70cec5 last_write_checksum: sha1:ea2de8082c5aa7e86313a4e22caf7f800d76988a @@ -4050,12 +4214,8 @@ trackedFiles: pristine_git_object: f12a0a04d9dc4430ca6180c8507360d9bc7494cd docs/components/responseformat.mdx: id: 9b8deacad550 - last_write_checksum: sha1:2ca93510828412e375f9903be2c92bcefbacd177 - pristine_git_object: 29709effcd49176f32b4b99f9a37ed1309231549 - docs/components/responseformatenum.mdx: - id: 60f6138df415 - last_write_checksum: sha1:b3d58b45db884f8b051be834701ee3166bfb13cc - pristine_git_object: 0b7c4b07a2162050d564e6947d060d1b22241817 + last_write_checksum: sha1:fab329e55c5d5be71c187de6a2ca592d7c1c3e68 + pristine_git_object: 4715eaef06706262e09a0108dab8c9fc2ef94f62 docs/components/responsehealingplugin.mdx: id: 5bf9b8008e95 last_write_checksum: sha1:1aa7dc7146a93a215d275571233ee63902a6e155 @@ -4086,8 +4246,8 @@ trackedFiles: pristine_git_object: 996cffee821435729436d7f29bce4333f4900382 docs/components/responsesrequest.mdx: id: 0dbcef40a4b1 - last_write_checksum: sha1:6349c1560ef2f55875ce6d926e42117d1b069cee - pristine_git_object: eb2f6540a39471b65545174c8f5658303868f00f + last_write_checksum: sha1:51003cb482d6de367ebe0c4e2691bf41be8d384c + pristine_git_object: 3090f61cfb772d83d2ac230fb571ef3e048e423e docs/components/responsesrequestplugin.mdx: id: 4d550c41c85f last_write_checksum: sha1:ab9d1e6c062cd51fc976da6ccf393e9974171f7b @@ -4102,8 +4262,8 @@ trackedFiles: pristine_git_object: 5f6cc606242e0f8343c7bef1d54e640fef620a80 docs/components/responsesrequesttoolunion.mdx: id: 96bafa5d19b1 - last_write_checksum: sha1:ea0dca57eedbc520f2a5097b8e0adc1b1f831be2 - pristine_git_object: bfec11b6f951665f3b0467a8e8f98e7f224a9350 + last_write_checksum: sha1:94c59f53bc6d9c13148eb65e73e8850d5714e6b1 + pristine_git_object: b06f8e77235ad31695cf106e56768f83c7432001 docs/components/responsesrequesttype.mdx: id: b2720876d384 last_write_checksum: sha1:9ed21e9f3c79e3936a4f6bc9df24eea499cc1e56 @@ -4112,6 +4272,10 @@ trackedFiles: id: 5eefe41f1850 last_write_checksum: sha1:06ac8357212098a2e461592ff4cd29ef9e7e1fe1 pristine_git_object: a9e4e2a7461ba24eedfd00740bf4522607e64a04 + docs/components/routedservicetier.mdx: + id: 1ecc7cdd925e + last_write_checksum: sha1:538e8fc60dab1d88f2b735682161cc8ab6101d5d + pristine_git_object: 0c826312b0c506004b51e7dbcaceb82639046687 docs/components/routerattempt.mdx: id: 372598a145ed last_write_checksum: sha1:51d8aee604f0093ea6df2df0fd73f02241190f70 @@ -4126,8 +4290,8 @@ trackedFiles: pristine_git_object: 02852267fa52361a11f7732afe1e7818105196f0 docs/components/rule.mdx: id: 652b4ec56a02 - last_write_checksum: sha1:9e98bfe08cdbc0e13635a26c52a1d11003041b78 - pristine_git_object: d585c3be57a8c3843d6712c747983fbcdb692d17 + last_write_checksum: sha1:689f48837abf4c42c787a7a531e751d32d1e3c67 + pristine_git_object: 14a9f713694cfd61d45b800a23294d906482bca5 docs/components/searchcontextsizeenum.mdx: id: b6b9a99acb5f last_write_checksum: sha1:177016c42a56a7a8dcd40caa7e9105ca7a6ea1cc @@ -4136,6 +4300,14 @@ trackedFiles: id: afffad2845a2 last_write_checksum: sha1:4c205a6c239561b5813ec9202abeeef9e4e41331 pristine_git_object: fb2f7f7c53004cfee264fe37346b88af5cf7d61c + docs/components/searchmodelsservertoolopenrouter.mdx: + id: 7fecfe80e04e + last_write_checksum: sha1:7de51c7d40b22c850b6c49ca7a3e989fd7da71aa + pristine_git_object: e72c5e1cd8e90695cea2f97cc7909d6d7099ef2d + docs/components/searchmodelsservertoolopenroutertype.mdx: + id: a9a0e137d51e + last_write_checksum: sha1:b13d77690c90a53b9957b099560f88729956f701 + pristine_git_object: e57b04828acdf4f7cf9fa30409a47947f7e7f25e docs/components/searchqualitylevel.mdx: id: 0cbced049b6f last_write_checksum: sha1:106b7467c7ab738c7ce04ab44d83a91388dc0808 @@ -4150,8 +4322,8 @@ trackedFiles: pristine_git_object: a90fbbefe76853f92638f4ae7ad63cf67951efc4 docs/components/servertoolusedetails.mdx: id: 5a7d75562dec - last_write_checksum: sha1:28d1fa7491c62f6fc5592fc8092afa9cfaa0b4f5 - pristine_git_object: a9f0d64b5351c9d5f5839b29c8c8c9c79a2d0c3a + last_write_checksum: sha1:c2a156aba0f34118e3c681561f817d8deb4a06ac + pristine_git_object: de0d677d4f188af0688f78b8c8a25ae07ca3a093 docs/components/serviceunavailableresponseerrordata.mdx: id: 72f01d77e774 last_write_checksum: sha1:7b53cfdd92a87ef0b70e0b5f7d2031e73bcbe033 @@ -4220,14 +4392,6 @@ trackedFiles: id: b35cae5eacec last_write_checksum: sha1:6865169ff4445d70d63c674092812b47236f213f pristine_git_object: 1c0dd3c44cfce8b531e7d89e3db6b2787f060984 - docs/components/size.mdx: - id: 21d53f42f1b5 - last_write_checksum: sha1:543c159668e36a35b0d6f2357e4b9cfda44ce2f4 - pristine_git_object: 707abe9890dce5df4f29843cb2b05cff5d9f280c - docs/components/sort.mdx: - id: 2423f4a05690 - last_write_checksum: sha1:3443886b2481e8685a1c390530dfd7b763d9f237 - pristine_git_object: b12340f49cd6973329dc305d88b7190bcb5c163b docs/components/sourcecontent.mdx: id: d211413b56ad last_write_checksum: sha1:e9ec235c28760da429e35fea006321e7a697e5c4 @@ -4238,12 +4402,16 @@ trackedFiles: pristine_git_object: 5d617cac37f7b364f4dd0640246e97c34351d824 docs/components/speechrequest.mdx: id: 06e81b0433f6 - last_write_checksum: sha1:0c8b9aae49356145aa960740cd88e620b511ec6c - pristine_git_object: e984d1fcbbc242679fbd51f142bd9de711833a50 + last_write_checksum: sha1:76fa6d5d3d316f4c7b205f656b4cebe4c15c8bea + pristine_git_object: de4caacffca57c3d03275206dd4288335fe6c532 docs/components/speechrequestprovider.mdx: id: 4f78ed0394c4 last_write_checksum: sha1:99d94c6b01dbd3e875c213584f97c7dca545a6a9 pristine_git_object: 3a95d19f4a88dbd0c96cec7cf53d9264927a3c0d + docs/components/speechrequestresponseformat.mdx: + id: bd09f77a4a90 + last_write_checksum: sha1:1b87242f33c6d22a08dd085d0ef41335ec2e9b0c + pristine_git_object: 9af8a5aa6a7c26f353f552d369b87debb045b7cd docs/components/speed.mdx: id: 4fd1f2823924 last_write_checksum: sha1:c6815d115b55b9409052f9d1d1d16bb1d7197763 @@ -4362,20 +4530,36 @@ trackedFiles: pristine_git_object: 70a2660b7c0bc35aed96124e1faa3852b3117054 docs/components/sttrequest.mdx: id: 6a5e33cf6dbe - last_write_checksum: sha1:6fefcb5b5dd513388709f62acee929cde6bfb8ee - pristine_git_object: 198ca47de64cf983930c58cc618d3ef8c15d74a8 + last_write_checksum: sha1:63f215311d23a63a59b65d2bc8d642005379730e + pristine_git_object: e81d9df15323bda23bdc67ac0703ca24e5a84175 docs/components/sttrequestprovider.mdx: id: d8b1bac8e745 last_write_checksum: sha1:e15551eddbe4c1f7c4515fa556d4873075512eea pristine_git_object: 5eebff082dc885ed94ec0e6ceed8446c2ca104ae + docs/components/sttrequestresponseformat.mdx: + id: ab58b1666609 + last_write_checksum: sha1:f0cbf9b5b35d8ef8c049a3b84c47f6c43778a00a + pristine_git_object: d016021a79783dfa11b1110edc231f49f45df4d0 docs/components/sttresponse.mdx: id: a421f69065a0 - last_write_checksum: sha1:3bf5f6d14c6e2586808ee5a0db3cd911af03ff7c - pristine_git_object: 9a61014568868a1f08581e5b7580feddaf379f8c + last_write_checksum: sha1:438935b5dcb2fb9cf44c74fff733133937286bff + pristine_git_object: 5868e50f86df62aae9952c94f98ebb33570efff1 + docs/components/sttsegment.mdx: + id: 7264ea9cdd57 + last_write_checksum: sha1:8a4996d6a483fdeee0899f6656ed6e5d69a4e159 + pristine_git_object: d0bcd9afe39262dd4297adb6fc618e984e1c209f + docs/components/stttimestampgranularity.mdx: + id: 2a365c57c3a1 + last_write_checksum: sha1:5932b36c214d97201f0cce0d0787203fed2baf4e + pristine_git_object: 3505a518e362a11e06a3c098eb31de2718ee1c04 docs/components/sttusage.mdx: id: 11bce3b257f6 last_write_checksum: sha1:a777bc390f180c1163612213633f2150a9566313 pristine_git_object: f0b56839c067ce29024888f689d379ed83f86ff4 + docs/components/sttword.mdx: + id: 665227ec6052 + last_write_checksum: sha1:e39fb80f3b8d02747142ab15631e4788810c366f + pristine_git_object: 994522a52060add3b501680d2be27546ded1dfe2 docs/components/subagentnestedtool.mdx: id: 12547a9efd5f last_write_checksum: sha1:9141ce608f42d2c53e89f0e8e108252227a7366f @@ -4400,6 +4584,18 @@ trackedFiles: id: 36a519fbf209 last_write_checksum: sha1:14f4bf5f550f0dfddb8bd950e000ed431a5470e9 pristine_git_object: a93cd73684c2a51b27f8a1e13a09f980a676567e + docs/components/submitgenerationfeedbackrequest.mdx: + id: fba2401919b4 + last_write_checksum: sha1:0c574d3011a3b5c9183697be0484a019188b5ec0 + pristine_git_object: 9e56152e2335fe11da9245816c8d1e97cd86948f + docs/components/submitgenerationfeedbackresponse.mdx: + id: 965ad9f0e7d8 + last_write_checksum: sha1:7451bf17e40384dd0c719af06afd429f305da84d + pristine_git_object: ba546e044aa0cacbde96b10562c4526a03cc0408 + docs/components/submitgenerationfeedbackresponsedata.mdx: + id: 3dc9b2ef8c55 + last_write_checksum: sha1:3bd23a1fe786aa76836d0990d51213c9ddd8fc36 + pristine_git_object: 2b6ccfe5787d34259f7c5c89e9852d32afd6aef4 docs/components/supportedaspectratio.mdx: id: 236a2016da06 last_write_checksum: sha1:638d1fbeb7e634fd924c4c1c92a0cc69f5291635 @@ -4494,12 +4690,12 @@ trackedFiles: pristine_git_object: 54a7627079b16a50865cf6f2224abe36870c95fa docs/components/tooladvisor20260301.mdx: id: df2858dddd07 - last_write_checksum: sha1:94a6e30c4bc7ff7771b99d3f09c87604423b2847 - pristine_git_object: ee1f63bc170b35e5fb8da3390818160a2b4b93c6 + last_write_checksum: sha1:2dd846c19c5dabfeba4fe838ca60bd495c31e689 + pristine_git_object: a00186b54ba47296aed2eb1098928f3b4a565ceb docs/components/toolbash20250124.mdx: id: acc36fba0c55 - last_write_checksum: sha1:b0e3ad180f48dba955ae20481ae6ef55ace6b18f - pristine_git_object: d9f17ef27ea42b2251c85ffdd230af45f7293c75 + last_write_checksum: sha1:b899d22b5559c09fcaa14c5cd3ff18f914ad34d2 + pristine_git_object: d3a3ea6cfbc5118b9adad9c1a8e543e02fd2870f docs/components/toolcallstatus.mdx: id: e79e5ffbe798 last_write_checksum: sha1:338789050d562f0ac596d6a94783307e27a634b2 @@ -4538,12 +4734,12 @@ trackedFiles: pristine_git_object: 6817216b64de42e834ab68a072287701e621daa8 docs/components/toolcustom.mdx: id: b3ea2dbc7af5 - last_write_checksum: sha1:dd0734eb86cbbba753632268613a2f2ebc8e8f78 - pristine_git_object: 57073f649edd84b26f2395c46aef55c86e31ed4c + last_write_checksum: sha1:f0fdef1bc45a22946f6026d202499b63ff241711 + pristine_git_object: ce9be3cd6fbb03e8d15866baefa9f38c1398a91c docs/components/tooltexteditor20250124.mdx: id: 58d2a6f35f9f - last_write_checksum: sha1:bbc36d5c8d48b8971fed82553489759ca2379c0d - pristine_git_object: 0fe06a930a6a67a5a007185f892422f232389d3a + last_write_checksum: sha1:c785aecfc38109c995d4d2f825de0f145d3f626a + pristine_git_object: a7f1a2731ba8ab1deea97b51e63372e70e3afa0e docs/components/tooltypecustom.mdx: id: ac3c7f5f5fa6 last_write_checksum: sha1:bfbecb3b4e70cb8a4aa0379246f4ffbaae71b341 @@ -4554,12 +4750,12 @@ trackedFiles: pristine_git_object: 48e6f8afc2a41ccac4be220dd5d5d475a4d36b71 docs/components/toolwebsearch20250305.mdx: id: e583eb0b3bd1 - last_write_checksum: sha1:59297ba6e78d528a5a6cc0bcbefd1301c21af308 - pristine_git_object: 33510135de4236e72077c4acb6c8a8c65fe5f647 + last_write_checksum: sha1:a750dd139f327bf53d4cde02e6b897afa274475b + pristine_git_object: 36a096412525a09d1903488c804648047782b8be docs/components/toolwebsearch20260209.mdx: id: dfc99c1c297c - last_write_checksum: sha1:e3adde8067e2e5e5504165e7b8ebf1ca743d8352 - pristine_git_object: a70393e56b803a455f0ea3e82d9270ee84fed5fe + last_write_checksum: sha1:8237527944c9d8670c8c323ce8bec709602d8322 + pristine_git_object: 062b3155e1ffd04dae559ccc126ff8b922616aee docs/components/toomanyrequestsresponseerrordata.mdx: id: 282b92f982c7 last_write_checksum: sha1:976995e37e897805df9f3f50c0aae39e41447822 @@ -4596,10 +4792,18 @@ trackedFiles: id: ed021c787cd5 last_write_checksum: sha1:bb6b3619ca5b6877ddd66dda0a2cb799c989ad33 pristine_git_object: 01eae6d76ebf42187c1dcbeaa43288f5df94e8cb + docs/components/typeadditionaltools.mdx: + id: e9b8d6c3c36b + last_write_checksum: sha1:6b4730663782a2052103e741b926d4943319b269 + pristine_git_object: fd61616ce5a2764c026d48863bb671a79be3e824 docs/components/typeadvisor20260301.mdx: id: 6b8fbaf1abe6 last_write_checksum: sha1:a8d7df683cc00996868f4a8f16d43f5171f9786c pristine_git_object: 92220371000c3ec2476ecbeaccc4f095d25a997e + docs/components/typeagentmessage.mdx: + id: 806319bb3eee + last_write_checksum: sha1:486521730ba37bb9393665797e1f1cc775766874 + pristine_git_object: b03f1ab2115442904e357d6aee81e6656a6b6f15 docs/components/typeany.mdx: id: b3bd6b0de96e last_write_checksum: sha1:7d4c65b6740216e057d36ea498509249d9c97354 @@ -4640,6 +4844,10 @@ trackedFiles: id: 2107f66972cb last_write_checksum: sha1:47c1d819d31519b3d19a87f3389786d5c23206d4 pristine_git_object: 52ed7b166a48116cbd5a6f950a50f3f180c62a84 + docs/components/typeencryptedcontent.mdx: + id: 7e29de8a1874 + last_write_checksum: sha1:19b66fd2808ce791e8ec41203dd91bf1eeb9a996 + pristine_git_object: 62d36e211de192914adac3fd60dc58b52956f57a docs/components/typeexec.mdx: id: bdffae9225e9 last_write_checksum: sha1:adcee4778c3a095280c7e3541c1bfec21eba0139 @@ -4798,16 +5006,16 @@ trackedFiles: pristine_git_object: 335feb18256a83af9c732525307d1432a718f3a1 docs/components/updateguardrailrequest.mdx: id: 450912b18db6 - last_write_checksum: sha1:7f4d97114ddca06c474d4a47ea585d6119d7ec89 - pristine_git_object: 6127914dd10312a4fc00e387c9af8d2d2f1a7150 + last_write_checksum: sha1:fe895becd42233f628907590d8cde52a7a0c2499 + pristine_git_object: be349dd72e39c127967315f3914d3f7fc6c6b71f docs/components/updateguardrailresponse.mdx: id: e00dc0a0c6e0 - last_write_checksum: sha1:528476cf3a4f15900eb0f4d293498450f0b5079a - pristine_git_object: 9c95861831e9f31f54efd7d48d8f48eece10e369 + last_write_checksum: sha1:9fa2b237c77138fad34fce39a922eeafb11964a8 + pristine_git_object: 7fd2bcafeabc1be627f99a868c06c6f597d04856 docs/components/updateobservabilitydestinationrequest.mdx: id: b54091567003 - last_write_checksum: sha1:a49d260a3c096efeeda18b7f204ed6336c25aed4 - pristine_git_object: 1a6d04101d79b08a5993638272a569695d6151c2 + last_write_checksum: sha1:9ba0d6c18b145237efd307d621834669669838f8 + pristine_git_object: f13384238a27b4d58710d33648c8ac8de766635a docs/components/updateobservabilitydestinationresponse.mdx: id: be9661c3676e last_write_checksum: sha1:c8fde493ab2c8285b0a800795e6106f2dbf3a63f @@ -4838,8 +5046,8 @@ trackedFiles: pristine_git_object: c5fe94ebc3791026c16a9636c7d6077773297e19 docs/components/usage.mdx: id: d84b29a6ea8c - last_write_checksum: sha1:e9adc633c75f1e77e76fe32545662cc27c6304fc - pristine_git_object: c400fc42927885901a17ce82529b39c2cdadce6e + last_write_checksum: sha1:b279f416f251c361dd705a2960b17e23c63aa508 + pristine_git_object: 2b203365a2a132a20be296a0acf7ba080780f44b docs/components/usagecostdetails.mdx: id: 95d8a52fead9 last_write_checksum: sha1:d8b2597a2921b79c43fd30173a8c395cd60584b2 @@ -4866,8 +5074,8 @@ trackedFiles: pristine_git_object: 67f56887bb4758559189e3e9e6123dff9a38df81 docs/components/videogenerationrequestoptions.mdx: id: 1d67160e7e7a - last_write_checksum: sha1:8f1c4b3b0a67cce0aad25ef560ca635a929f8784 - pristine_git_object: f3d6474edb250bfaecbdb3a1fa9c930e9587a46b + last_write_checksum: sha1:a4b9f3a57e8de8bec0a4aca1ebc6ec8063936a02 + pristine_git_object: 3f914db0284663a0d01c68c3156090cfada7e8ca docs/components/videogenerationrequestprovider.mdx: id: d6424dd5de9d last_write_checksum: sha1:72aa46a3335220b579db56574ea179d150dbe2b6 @@ -5164,6 +5372,22 @@ trackedFiles: id: db4a10e02011 last_write_checksum: sha1:07a2b233999d732b3559f431337d40cbfb8acb18 pristine_git_object: de22a4c7b44e291012ca85daacc77bde58afbfa4 + docs/operations/classifierdimensions.mdx: + id: 5e48dede0ae4 + last_write_checksum: sha1:9aea7af347af4565daaebcfced2f96f8957dfd1a + pristine_git_object: f7cf34faf7a89ceaeb2c20f9fd37f76e102defba + docs/operations/classifierfilters.mdx: + id: bf2b4d539ad0 + last_write_checksum: sha1:882166611599b6921a6ec342986fe18bf78cf524 + pristine_git_object: db4dbe946e875ad7189725a020f7ea2631a8adf3 + docs/operations/classifierfiltersfilter.mdx: + id: 4c60b258249e + last_write_checksum: sha1:98efc2e7262b521d268dd591b08cb90a3406fabc + pristine_git_object: f09e983a0daa403ee6d2cfca1604906f44a42ee2 + docs/operations/classifierfiltersvalue.mdx: + id: 0701a4bb73c4 + last_write_checksum: sha1:077df057506e544243ecc2e6ab055cadee049035 + pristine_git_object: 47e7dc4e537b1c7392c04f36a7c6c8f45847ee29 docs/operations/content.mdx: id: 6f64feb2d798 last_write_checksum: sha1:329d9719c9e25478666963df7b79710aa626d988 @@ -5176,22 +5400,38 @@ trackedFiles: id: 537b5f749941 last_write_checksum: sha1:49c12ecbb5dfd1da81be814c3e70baa9c249d432 pristine_git_object: 08e418f7bcf3cf8142171de78bedd0243bda6854 - docs/operations/costdetails.mdx: - id: a5015273e58c - last_write_checksum: sha1:90a330bfa37e208bcee6615af2ee7535c4416a26 - pristine_git_object: 753493b8d505e9317dcaca6fc897da7e30e91d0c + docs/operations/contextbucket.mdx: + id: 2ab0b419379e + last_write_checksum: sha1:f3bcb4a33fc0d7d868762b459a838d1fdca99d28 + pristine_git_object: d24616128ffb2e8a3f1fc639235d8210dbeea107 docs/operations/createaudiospeechglobals.mdx: id: 9b19782b0fc7 last_write_checksum: sha1:620e2236612f7cdf7dc23e0f975671e979d7e4f5 pristine_git_object: 78fe3a35c7c813e4554c8b8d3e403f4902a17c32 docs/operations/createaudiospeechrequest.mdx: id: 097a81eed964 - last_write_checksum: sha1:1a773adccf87e107b0648cc0034e97613378f47f - pristine_git_object: 176fe2508bf060b22bf9f2c8c8fd158a96fef19e + last_write_checksum: sha1:ed83c321078683a0cffabd503750b31a30927c72 + pristine_git_object: a9aaac38a7f70c589c212a1ed00d95196d285117 docs/operations/createaudiotranscriptionsglobals.mdx: id: 3a50c3fec9de last_write_checksum: sha1:df0aebe1971befd5930236620a6ea94dbec73898 pristine_git_object: 2427dcaa5a305401e2e863eaaa6a99bb53183c51 + docs/operations/createaudiotranscriptionsmultipartfile.mdx: + id: 7a553e03f3a1 + last_write_checksum: sha1:47da0d067b733b676fdd0ed535620d7a5b4b5ee6 + pristine_git_object: 3fa3d99a9db518b810a86f06448b3a2f32b37f0a + docs/operations/createaudiotranscriptionsmultipartglobals.mdx: + id: 6f8d9ab67625 + last_write_checksum: sha1:2de6739adb69660e9b1e85090bcc8fbd73ea822d + pristine_git_object: 40d3f1222273b0f940344f051d1184c551ff3002 + docs/operations/createaudiotranscriptionsmultipartrequest.mdx: + id: 31e7948635e6 + last_write_checksum: sha1:00af643224e329cb890449f62f4ee6d350b30db1 + pristine_git_object: b5031668ec1156a4157609e4812b7a3937b802a2 + docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx: + id: 0550cc56c73a + last_write_checksum: sha1:c15b1a62c475511e194d9a5b7b2ed240e369a4d1 + pristine_git_object: 3054ebe9dc2b1c40dbac7a5b387a57a89c468bdc docs/operations/createaudiotranscriptionsrequest.mdx: id: 68a813383936 last_write_checksum: sha1:a3ad7e4691917927539d6c614788da7f4d6b4892 @@ -5254,16 +5494,16 @@ trackedFiles: pristine_git_object: 4efeda7aa813ebf97131645e6af8e49853731100 docs/operations/createembeddingsusage.mdx: id: 4f9205ca2bb9 - last_write_checksum: sha1:cda993a456ed0e22740a2d6d657dd499199e742a - pristine_git_object: 1050293af3353abc1dba846e61f3d6980cc126f8 + last_write_checksum: sha1:8156e256387b12cc08a5a92f9e9332ec2b35a2af + pristine_git_object: 1218cf960cbc2285120cb399596e0bc73b44aa9f docs/operations/createguardrailglobals.mdx: id: ce6e792df15c last_write_checksum: sha1:6542508eed5dbd74bf6812b8cc0cc9cfd3157d06 pristine_git_object: 89d6df049a07dd0c7fb980daeee97309cc3ce74a docs/operations/createguardrailrequest.mdx: id: 3d30aa9a4ec7 - last_write_checksum: sha1:0440e47100b0ce6309e6ea0d16b7e4e9be50ac59 - pristine_git_object: 906c993096e226923d9aac19bf0bb82ffd35936a + last_write_checksum: sha1:aa4af15191dde1fc6b51d7139be1ef3e35fabd28 + pristine_git_object: 645bf9a23e67ec35700da73403da763ceabcd34c docs/operations/createimagesglobals.mdx: id: 3eca6cb49159 last_write_checksum: sha1:9ac3837e42882bcb0edab9d0d801c0893d53d3e5 @@ -5512,10 +5752,6 @@ trackedFiles: id: 64162c7ece40 last_write_checksum: sha1:ab0c02f32ff39de1f3da9604432708878cc932c6 pristine_git_object: 2642f99d77ceb5007b1b863028d73c07e48dac67 - docs/operations/file.mdx: - id: 262d5e5a2457 - last_write_checksum: sha1:bb735203bac5677c946bf404bf1e516635d39efd - pristine_git_object: 0c3c666ca80b93b693bd9b4798d8f511738bf269 docs/operations/filter_.mdx: id: 79b9c7c02d3b last_write_checksum: sha1:210f8d87b466cf10785abbd4cb2f9eb2c3e8576e @@ -5662,12 +5898,16 @@ trackedFiles: pristine_git_object: e6beafcf11154033e2951ae58103041a2af946b9 docs/operations/getmodelsrequest.mdx: id: b2627beb1959 - last_write_checksum: sha1:d945628c6bc1fdad3b7732e0fbcefc241bd373c6 - pristine_git_object: 272e1449f6b0895e9311ba2f03c05edbf17dc225 + last_write_checksum: sha1:416ad223f0e50e03f76f5da03ca4c3d97754201a + pristine_git_object: 532a1ab9bd3372f778cf6406d9ac686305006228 + docs/operations/getmodelsresponse.mdx: + id: acfd4707ddde + last_write_checksum: sha1:0c0fb343b7965a76cc790355b7f43d1f52f13e89 + pristine_git_object: c7353f31e48c90e3abd225386f409e211bf043de docs/operations/getmodelssort.mdx: id: 3cfd33e60661 - last_write_checksum: sha1:0cc94491120ca9b9a92ac5d6181a51131d78b94c - pristine_git_object: 9a5681eb1112bdb27c7c6677b74a17ff2fb0a574 + last_write_checksum: sha1:6d75758523f8665ff617fe5d4e54385ad785c7ef + pristine_git_object: 537a70d3eb590cda229847689553607b46a3a5f7 docs/operations/getobservabilitydestinationglobals.mdx: id: d7ba84a5b9dc last_write_checksum: sha1:281603c38cce8aea9f289fc0d49a455b56196e2e @@ -5692,14 +5932,18 @@ trackedFiles: id: 970105a3a642 last_write_checksum: sha1:001bb931da274741dca567c87c4149c11c5e67d1 pristine_git_object: c7cf40110dc4a82e2d4abdd06e98d9a28637a016 + docs/operations/getrankingsdailycategory.mdx: + id: 37dbd531ea7d + last_write_checksum: sha1:3c4ffc04da2558c3357a8759ba9984ea15b58db4 + pristine_git_object: a81ff4b55f28b6a1456eee9665809305a68e7ee1 docs/operations/getrankingsdailyglobals.mdx: id: 0f9fa155d24e last_write_checksum: sha1:b3f58d600e4791419b37f4a8ec65869d59424f41 pristine_git_object: 4bc1a2bf9e75dc1eaca4e1531a49dfbbea0dfb72 docs/operations/getrankingsdailyrequest.mdx: id: a83322d91eea - last_write_checksum: sha1:ee987639475df96010b6a2732ecf9c7b4cfd2472 - pristine_git_object: 1788b942b41cb5afa8bebb28c0387c2cc0381d50 + last_write_checksum: sha1:fd05c4e755a6ba4f6b41bb37856169ad1b14d927 + pristine_git_object: 04784a9f4a05fa7d473b532d4e881a6d45a64a10 docs/operations/gettaskclassificationsglobals.mdx: id: 14d0010b40f8 last_write_checksum: sha1:6c967e8855540035a6f70fa895ceea0c9caf1cdd @@ -5756,6 +6000,10 @@ trackedFiles: id: fa09ca81a05c last_write_checksum: sha1:6126fc355e98574f157b9b485ac850a0ec6f2a5e pristine_git_object: 2394952123e253a775bb81426d6ee2d49911e97b + docs/operations/languagetype.mdx: + id: fe52912b0ea7 + last_write_checksum: sha1:85897c7620d5c3725f610a496f4ceb485b9f5063 + pristine_git_object: 0d94d66d51eee4f9fc8d18fb42a32c91fb9c89ec docs/operations/listbyokkeysglobals.mdx: id: b77dfe46caab last_write_checksum: sha1:203cef2704a0493a98ae74994baf54dd7789b998 @@ -5778,8 +6026,12 @@ trackedFiles: pristine_git_object: fad77722bdedf3aa5902e0216dadbbbbb2331c66 docs/operations/listembeddingsmodelsrequest.mdx: id: 280530b63070 - last_write_checksum: sha1:aa92c46789315ceae419561330e80127280e9559 - pristine_git_object: 76c365bf04a9c5fc1f461b0eda0d59d0122b22fa + last_write_checksum: sha1:f409c6a09dd308ffe3145b09b1115293c5c80862 + pristine_git_object: 7e491482186d8bd3a8b13797e591fc7128b5966d + docs/operations/listembeddingsmodelsresponse.mdx: + id: d07053bd83fc + last_write_checksum: sha1:a80671cd7e9e2247b38a0c3f0c9fa1daf0080600 + pristine_git_object: 053af0a817f0ae9077ec70ccd12e4e6581bf8e91 docs/operations/listendpointsglobals.mdx: id: 12c08333c32c last_write_checksum: sha1:72d0a3a54e8fc8cdfa2812fa929c08669dec9779 @@ -5862,8 +6114,8 @@ trackedFiles: pristine_git_object: 285cb55ce46435b741ac96d7f980a609067d432d docs/operations/listguardrailsresponse.mdx: id: b96388a22ab2 - last_write_checksum: sha1:0996fb66661b831820683fa58ca3c0819783aa1d - pristine_git_object: 519808b7794ecf8c5951991a0857cb27106fc130 + last_write_checksum: sha1:d2b73aa9c8f8f99290b92c0c891595ea01fab031 + pristine_git_object: 48f98d5e32fbde3b9fe06d53f93588e6bc351fdf docs/operations/listimagemodelendpointsglobals.mdx: id: ac044b2c8762 last_write_checksum: sha1:b8b8e4ba63cd49b7eb1b58f0d01c0c43d6cd6a43 @@ -5918,8 +6170,12 @@ trackedFiles: pristine_git_object: f0a800135df0c6e4799128a4fbc901c576c8c6ce docs/operations/listmodelsuserrequest.mdx: id: 01537864056e - last_write_checksum: sha1:6a40c5348b33b01ac4dd2d5daac02fb237efc459 - pristine_git_object: 3b65b53fd19e841061b65013fe3adaedebaa5b68 + last_write_checksum: sha1:45aab507978152748484ff6d2eb394570514f08c + pristine_git_object: ca39aeabcd71a18c6e29542ef9cde33fe6b77b33 + docs/operations/listmodelsuserresponse.mdx: + id: 34f7a1648ceb + last_write_checksum: sha1:bf1ee4a9b2ad707ff1c39ea8680e72e5d0c27b9a + pristine_git_object: 380f686c12cbcd07de087be55b5a3f2b8f9eeec5 docs/operations/listmodelsusersecurity.mdx: id: fa5ad15aebfd last_write_checksum: sha1:daa5aafeecb31a35e7cb1bbedc70b722f6a675a5 @@ -6060,6 +6316,10 @@ trackedFiles: id: 43ac1599200a last_write_checksum: sha1:cfb8efa24bc87017aff709963270c9b414bc3483 pristine_git_object: a1b3a3e10a8fc5042c341319692cb2a643cdd9fe + docs/operations/modality.mdx: + id: b6e20b489278 + last_write_checksum: sha1:7914d5e12a4b5a623f277722ae09e1e27d7d6a08 + pristine_git_object: 63f8e9856e57d9736628dcd45b24b6c5646f4a35 docs/operations/object.mdx: id: 6fa1fcf5620b last_write_checksum: sha1:3727111f1223b76f5a9f21c89fba6c59ea31d428 @@ -6080,14 +6340,18 @@ trackedFiles: id: 5465d93e546d last_write_checksum: sha1:5f10a8fd8a9a7b55fc023e33bc9250f4d801af35 pristine_git_object: 91c6769e0026aa486c3fb4a6672c3691b2a997aa + docs/operations/period.mdx: + id: 038d66aa4fc1 + last_write_checksum: sha1:f65e16f5901c128767ab047aaeb811430c2bce3e + pristine_git_object: a1fdee3160b2294a66e05f59cfd17382364c129c docs/operations/prompttokensdetails.mdx: id: 346b38e82e1c last_write_checksum: sha1:ece0f5c30ccaef159981265b3ac57381289e86b3 pristine_git_object: 0f0b54e43577a8a835cd971f82e48c3921e3d88e docs/operations/provider.mdx: id: c75b3bbeeaa0 - last_write_checksum: sha1:c55d7af5c40483430e2debde39643c564ea19838 - pristine_git_object: 1b6b620243fb2472e1bfe2acc7bbb646b8a82a79 + last_write_checksum: sha1:3bab335278373e2867fe23084f7b67225ca7efa9 + pristine_git_object: 8ea30eb555013ee1bdd172bd4f086166acab4e79 docs/operations/queryanalyticsdata1.mdx: id: 0e41beea77d0 last_write_checksum: sha1:f9a349b4fee07f786180e94b45f92002bfae0e56 @@ -6106,8 +6370,8 @@ trackedFiles: pristine_git_object: 5b3c7c98d8cee9aa77138996c3d9af3e2bd3127a docs/operations/queryanalyticsrequestbody.mdx: id: 1b8d33b6ac1b - last_write_checksum: sha1:bd5e4998875dd2b73f5b04749ae013f108119a50 - pristine_git_object: 79876b7e840eb330cecb69b748c1dc80bbb7d14e + last_write_checksum: sha1:b100dcb3db6adf543fddf53977874d3d793c99b4 + pristine_git_object: ceec61fa2f3ad3a903475827003f6b4bbfd771c8 docs/operations/queryanalyticsresponse.mdx: id: 26c4b637ce33 last_write_checksum: sha1:3f778b3125815a89ceae9aaa735ffc846fef3de8 @@ -6120,6 +6384,10 @@ trackedFiles: id: bff19f8bb679 last_write_checksum: sha1:1a743e8a62051c433127a609e131187a74e2a240 pristine_git_object: 051bb4d1cdb3bdbcd87b29419a4a408f10bb1555 + docs/operations/responseformat.mdx: + id: 363fb8a0ddd6 + last_write_checksum: sha1:ce7d9ba61f903de7446102d09d412e5813d77f1b + pristine_git_object: b7f772318bb3da788acb989aba6067371db53634 docs/operations/result.mdx: id: b68db2e6b7af last_write_checksum: sha1:3ca42544567f285e78aa012de25ac52b5d082314 @@ -6148,6 +6416,14 @@ trackedFiles: id: b3291e6c44b9 last_write_checksum: sha1:2594ecd2302b9515e5997f4fbaaebba4a9a0615c pristine_git_object: af1d9e961714b356ae1a7cd86d64ff636215bae8 + docs/operations/submitgenerationfeedbackglobals.mdx: + id: cdef4c621cb3 + last_write_checksum: sha1:dc4e93ccccf8e97b25a5a64428a8bf8c679037bd + pristine_git_object: bbd731b6fa9990b637d7dad9fd5614619c83d0d9 + docs/operations/submitgenerationfeedbackrequest.mdx: + id: f159f51b36f7 + last_write_checksum: sha1:1d16f944195d66950cba4bfc2f96255286cf33c0 + pristine_git_object: 18f5cc3e2fe30014037f8f68d5513a4981d513b9 docs/operations/tasktype.mdx: id: d3da8106d2d1 last_write_checksum: sha1:06aede3448490e1fb77b5c1b758238a11ce1dceb @@ -6156,6 +6432,10 @@ trackedFiles: id: 03a218211f06 last_write_checksum: sha1:3cdcfbfcdb71dcc17a0c3b4cd5704eac3718fa0f pristine_git_object: dc194bad92caf2afd0759830559be89a8bafe5a4 + docs/operations/timestampgranularities.mdx: + id: 6694d3af2ace + last_write_checksum: sha1:bc7319f009e4133e65cf476c1763b11fb6622ff9 + pristine_git_object: c783ad06042f710374b4702b3b63030a32e52180 docs/operations/typeimageurl.mdx: id: 66578c3ea6a5 last_write_checksum: sha1:e3275995c5351075e0c4082a161891cf710b8fdc @@ -6220,6 +6500,10 @@ trackedFiles: id: f2e782002c04 last_write_checksum: sha1:f04d312af9e3ccc5ce53deb68cb6ade27c300dec pristine_git_object: 086cdf63dfdacf09da11a66301f90245ac7cbb0b + docs/operations/uploadfilefile.mdx: + id: fd906268ce4a + last_write_checksum: sha1:31e686522b460fe22dff0c71c996d34b56947c70 + pristine_git_object: f07c77ddfac359392f50d0b9c2f1919bcb043bc4 docs/operations/uploadfileglobals.mdx: id: ec9ebdf283f8 last_write_checksum: sha1:50f87018f87e3b469cd1f8a0795fc186faa0daa4 @@ -6230,8 +6514,8 @@ trackedFiles: pristine_git_object: 70188129763ff300a0f3faa45134f7299c9bdf39 docs/operations/uploadfilerequestbody.mdx: id: fde4cc558d95 - last_write_checksum: sha1:74a28c6834102e4511000ad118bb2892aa0d11cc - pristine_git_object: 4a9975fed03ab1d97c880283bedde17ce90906f9 + last_write_checksum: sha1:84cd9ecf7c776cba269dbc3c6b970b906bd0030d + pristine_git_object: e91f2d3752b54fa3fe8fd469c1e452aa99f5f6b8 docs/operations/upsertworkspacebudgetglobals.mdx: id: 08d7f90d9b03 last_write_checksum: sha1:3fff3f45d7170916f5c4d12557a97cd9693bbac4 @@ -6252,6 +6536,10 @@ trackedFiles: id: ebf32fddf22e last_write_checksum: sha1:18f440dbfdcb2498771fe53a98b054d4d76f283c pristine_git_object: f72dd54a6f1db3e758a924691b07ec17f38bc01e + docs/operations/valueclassifierfilters.mdx: + id: 258cd046e559 + last_write_checksum: sha1:013f0a03f199fa6d2b2a256acd8af403fdd51c5a + pristine_git_object: 9280541b880980bbf528c00ea7c3eb3cc7b4f54c docs/operations/valuetype.mdx: id: 29a8210305d2 last_write_checksum: sha1:5ea5c9a100089970356c552e3d9792c6657d0143 @@ -6278,16 +6566,16 @@ trackedFiles: pristine_git_object: 072d78b5b5aedcdc34724557e76cc0fa03994fba docs/sdks/betaanalytics/README.mdx: id: 239279ebf01b - last_write_checksum: sha1:721b90a76008fa9876ce046a84a7b54bae0dcef8 - pristine_git_object: 716e4631b3b48e11081ed70ca5acc5826b8a6383 + last_write_checksum: sha1:5a76d28d77f68efe34ebbcb72850e6a87c74d3b1 + pristine_git_object: 6e4b06ff97f02da5d31d78f478094db32dfdaa6f docs/sdks/byok/README.mdx: id: 17792f3b180d - last_write_checksum: sha1:18692d1b1454837b1592113fe1aaba1b1d37a805 - pristine_git_object: f1da2da04de257540172ce771ed1b665f0da9010 + last_write_checksum: sha1:17ebad0d042bd205530b527caf71c33d248ac5c7 + pristine_git_object: 513bb72efe9f74672b1b60d6b45dc0aca282ddf6 docs/sdks/chat/README.mdx: id: 1dd859c23fe1 - last_write_checksum: sha1:b6c104dc6b0c3461a2264a95d886f860e7277780 - pristine_git_object: 390ca7cf2ff70cf7a4273cd1c8c13cb58eb32971 + last_write_checksum: sha1:afeaa6d1195ec68d845aa76038b47498826d48a3 + pristine_git_object: 70aca7d4ce8dd7f8356abc4d836e8bdc236e090f docs/sdks/classifications/README.mdx: id: 4786130ef02a last_write_checksum: sha1:87ea3518b4147ae7833b01da7be92d41a4b49df7 @@ -6298,52 +6586,52 @@ trackedFiles: pristine_git_object: 414ae2830c58add7ad904cc9ffc5b46ed65058df docs/sdks/datasets/README.mdx: id: 15e5ab0183de - last_write_checksum: sha1:91e92cf17fa0a3a1729a8777bad701e69aeed404 - pristine_git_object: 9cdcae1f6c83a4b1918d00c221f619978967f490 + last_write_checksum: sha1:f716eecbda6e252e092fd559e4c68778b551d5c8 + pristine_git_object: ef43241cee60a329848e01772031d3f97e0f0d30 docs/sdks/embeddings/README.mdx: id: cd71581df291 - last_write_checksum: sha1:627e1efaacb2a29cb97e9d184ead987d95008bed - pristine_git_object: bf8b8c511bb6de4fcb0f24060788581aa51ef1a7 + last_write_checksum: sha1:6327ec4cf4aa480bbbf6eea9c8b54713e46a7db1 + pristine_git_object: 0ec380e6de0a439e80527b502d78d90963d8671b docs/sdks/endpoints/README.mdx: id: 62dfac9f7b71 last_write_checksum: sha1:05fc24509aa174b336fbe7d1a95faf7beca9bca3 pristine_git_object: 741c77c1982e1f7fc1c2352ce5199c921f9ee82f docs/sdks/files/README.mdx: id: 1a0c257e330c - last_write_checksum: sha1:475d99ba1b2bb8b2826cb43cc729753fbfc0acf8 - pristine_git_object: 5327882a8d7463846af3285afa1bd38432cec275 + last_write_checksum: sha1:e21cb3c8c0e1c48ca7bc6799e764f45790578d3d + pristine_git_object: 8ed39ab511e8430389a8cb92bed10b088a586006 docs/sdks/generations/README.mdx: id: a754fecc8514 - last_write_checksum: sha1:e4276fe2f85be0fbafaf573fe58d17b7236d0652 - pristine_git_object: b29ea120367f5944c6a71e31f6c3d5e07ab4b798 + last_write_checksum: sha1:b5f8035c676b5eb050472ed9697b64718aed8f17 + pristine_git_object: f262b34982a18293f5ae22bfbbf385010bfcdc9c docs/sdks/guardrails/README.mdx: id: a0cd4218b8fa - last_write_checksum: sha1:b6543c22a38aca53d7bfbc8d41ed482965fc3b3c - pristine_git_object: d164a1da79b0838bd68f0a6560a0317eb86e0226 + last_write_checksum: sha1:a559f40ebf9b9f04680cc87be4aebfef34bbb6dd + pristine_git_object: db67983c1b2386a3ed60fb23a1610faca0785d69 docs/sdks/images/README.mdx: id: 534a6c102c4f - last_write_checksum: sha1:cdebfe56dd55af4bf9248c8a61366d1a6c6b894b - pristine_git_object: cb61de85f54743e18a3e9ff2a861ffc510af713f + last_write_checksum: sha1:1c0a9c704bdd9090f5a0a74f4d9ae0c4360707bb + pristine_git_object: 4b3508543942b711f2d74df5436748e1815619e2 docs/sdks/models/README.mdx: id: 58f1ca464e0b - last_write_checksum: sha1:13cd9e4631b4e19a7db5ad93ce63d66358ffb935 - pristine_git_object: cc84c8d7382e6cee53ceb625344dadeefbb48b5d + last_write_checksum: sha1:90e4f262bc449464226d1d83c731709e3352bbb1 + pristine_git_object: dd4b54253703029cfcc99203de65731b350e49b7 docs/sdks/oauth/README.mdx: id: 42b5079343d2 last_write_checksum: sha1:60ecae1338bc4487fbb050b6044ddc08dd7d1685 pristine_git_object: c8f7dfd9fd46b60a5814250f8cb2de313166e2c3 docs/sdks/observability/README.mdx: id: 75811527e651 - last_write_checksum: sha1:83e566a1ab2ca84c1139d44060b3740a9a543e1d - pristine_git_object: 869bf82e6c2a769a2017220c38e6a6ef1fd270fd + last_write_checksum: sha1:e0d3c0963d72b6c982ec2164d3b38ed7f42ccfc5 + pristine_git_object: fb37fc078d177af746a8d20d989cddd4ab24aa8f docs/sdks/organization/README.mdx: id: f41b85542db0 - last_write_checksum: sha1:05a25a46b97551c8b92fbe3ec2eb736a562ca8bf - pristine_git_object: 6e199abaeb2f5269a885637d65bb176fd235a61c + last_write_checksum: sha1:7bb8e127781511bb01ce8b610084674f56e1ca00 + pristine_git_object: 32a291cb837977e7cdd475c664e5d475660b2ba3 docs/sdks/presets/README.mdx: id: eeb505928d52 - last_write_checksum: sha1:6f71a463dd8d32e2a002e86c3ff37a44350b54af - pristine_git_object: 5e8523f49f3809d1a9f0af88342148d40cf8bb4d + last_write_checksum: sha1:77d23418817e3a4e1d7135bdbd21a61812c960ee + pristine_git_object: 82e78fb13dc1c886ea37068b24ad1e5c786b6052 docs/sdks/providers/README.mdx: id: 5ea9af111324 last_write_checksum: sha1:570b55655ee7602d3807c3218e450741f634eed6 @@ -6354,32 +6642,32 @@ trackedFiles: pristine_git_object: cd1b341b1b7c0284b9ba9b102bd8020e0d7ce707 docs/sdks/responses/README.mdx: id: abab319e080e - last_write_checksum: sha1:c93ea3f5b1bedad1e7ac32b47a28dc3fc1bc8bae - pristine_git_object: 03281f8cf709ebb9a81700ade4cf9bc0db665eb6 + last_write_checksum: sha1:2dbf6b499e85a4605d79d756e043f7bfbc633087 + pristine_git_object: 708c8a1312812b7d552b5e970f0fb8c27f61b4df docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 - last_write_checksum: sha1:7647525772ccfd7b3b3653eaca748e0e785941b0 - pristine_git_object: a5097c97cbefb52415e2c830b7869525e994a9da + last_write_checksum: sha1:a8e68ac2b0bb8640e01d962177b42ab47b24898b + pristine_git_object: 003f85994a515547fe80dcc316ccc19d81c5322d docs/sdks/tts/README.mdx: id: cd1132543884 - last_write_checksum: sha1:8930237642313a1db6fdce5f7ea2b0680dc7c5ac - pristine_git_object: ece7fa92f85b1d8f702ecf2855f7267120d4efac + last_write_checksum: sha1:748da68a8d8e057dabb7af4297b5d8adf737f8b0 + pristine_git_object: f02ae88383dec340e4cd0f20d82363155bc08852 docs/sdks/videogeneration/README.mdx: id: 9a8fa04c3872 last_write_checksum: sha1:7d3c54cf2daa98e25df18bc27cc4ca30b2b1f03f pristine_git_object: 429ca7dad6a66516aec6bb1e674af1e09dc42dd5 docs/sdks/workspaces/README.mdx: id: 0c75d023ef6b - last_write_checksum: sha1:29a4f4699004ed16b9c980463a649576b30fe035 - pristine_git_object: 37f2346cb81f6c7712df90b676b5084808b609b5 + last_write_checksum: sha1:177cf8e7c0b14f92eadee9e7fbd1282ed6c8f679 + pristine_git_object: 0c43dff087b5657ea22168564472c35b7e81d63d py.typed: id: 258c3ed47ae4 last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:77dc4bb23124c68a4514773255a6be898795a345 - pristine_git_object: 0ee40fce00c555f4ae902fe221bccbc7bc2cf960 + last_write_checksum: sha1:f0f7e932c7bd4c925e46f46b6bf97f892541ee99 + pristine_git_object: 9fb79642304d03a5d47fdbc05c84a5c3da09836a scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -6406,8 +6694,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:07a6785b54ea278e7f66f25b16dc131011c8fbd6 - pristine_git_object: c2263273c453c720d864cf483e26066fd7edb1e2 + last_write_checksum: sha1:cac07fa2f6da0149e7c082a302589905dd9fcf73 + pristine_git_object: 22f63c25f6137a2f8e6b2e6b583305780919a837 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841 @@ -6430,24 +6718,24 @@ trackedFiles: pristine_git_object: 9c02cc64163adf027507af763e7b612d3b704adb src/openrouter/beta_analytics.py: id: 81988b170188 - last_write_checksum: sha1:91cc3d033be8ad49f3d2a67e9dd1ead470c4016f - pristine_git_object: bcf5829eba6df16f8984b756a46c8836b799dc98 + last_write_checksum: sha1:517ca1b0d4b94343e7728f156230e653f43c4641 + pristine_git_object: 1b01f0c081ffc8a42fa56d335f95ec3121e4b5e6 src/openrouter/byok.py: id: bec352462ae1 - last_write_checksum: sha1:14ffff34cdb97e81dd5ef9d7ba0f105b09b7ba48 - pristine_git_object: fcbfd1acaba89492d5ca7a58aa1126073d5cd5d7 + last_write_checksum: sha1:d812981f845cfc7313a86be8eecca156969ca0a0 + pristine_git_object: 08b177b0b39e7f3581f1a5da13e245c3daddf9d5 src/openrouter/chat.py: id: 723fdce15c1d - last_write_checksum: sha1:79e9c02b4a16cae3c202b5ae0bfd6cd1d0d6f89b - pristine_git_object: ab93b1be035fe591f6c8fac84b57ecad89ff5b1a + last_write_checksum: sha1:2afda128e7af2900cfeeaf79cc5a52122da8c3a2 + pristine_git_object: f14c3b5188d6dfdefcc28aa685daa24276ae2990 src/openrouter/classifications.py: id: 4f2efc24b95b last_write_checksum: sha1:3ab6fcd9ef679cd2149ec8dfbb4a86109cd152ad pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:08af0c2202383ec06d9bc58553df3ceb68272edd - pristine_git_object: 192d30802850b8d05e199dade47c0e86deb3c689 + last_write_checksum: sha1:94b5ed66b643a74f91ce1c3ec98744e1146f729e + pristine_git_object: c2d2d47304bce289181c2cba8ddc3ab3f947e3b8 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -6460,6 +6748,10 @@ trackedFiles: id: 0bd8d79c3144 last_write_checksum: sha1:db8e3247cf9eb2c235d32949d36f7ae95870e8ed pristine_git_object: 1138e6f6bc025546a86877749ce83aca4c46499a + src/openrouter/components/additionaltoolsitem.py: + id: 2761ab789f41 + last_write_checksum: sha1:955f9a0246407a1e72933c4861b9e343698f4141 + pristine_git_object: 6f2202805056318932d7426b061c24d082cacb53 src/openrouter/components/advisornestedtool.py: id: 768fcc6bad2b last_write_checksum: sha1:9c4303eb7fbefd1d7200cd588e7ab7e55db791e8 @@ -6476,6 +6768,10 @@ trackedFiles: id: 683887bb9db3 last_write_checksum: sha1:3a801b02cc92e02a00f0e26f377fb93a6893641a pristine_git_object: d92e19f8e9bec36933cd3e5d7ccc1690f14b168f + src/openrouter/components/agentmessageitem.py: + id: 6dbe0c8e2c79 + last_write_checksum: sha1:cdc92eac94cf3a35a412c95f894345c7a362afeb + pristine_git_object: 612d33983cd731ce83f33949fb2e9ab05b89f43b src/openrouter/components/annotationaddedevent.py: id: dc032c9ad744 last_write_checksum: sha1:8e5d49d2b57114df7f4559b611d40769e65f9f78 @@ -6498,12 +6794,16 @@ trackedFiles: pristine_git_object: 870c2e75705a43762b7aa2797e5b0cde4fe40d87 src/openrouter/components/anthropiccachecontroldirective.py: id: ffa72802cd82 - last_write_checksum: sha1:c73ec323b8d1e650f51d91f00b824804e4b9f6c3 - pristine_git_object: a9292b2d0dc104b016f7bc2600275d87fbd9ecac + last_write_checksum: sha1:2c92e5081aa549627b961c97cfe0ba8d672a567c + pristine_git_object: 05b36d10c1f772110394071a9c90b1d9c31bf2c2 src/openrouter/components/anthropiccachecontrolttl.py: id: 2ec3e3546afe last_write_checksum: sha1:338e193bd6929eb6ed69da9bdb4e608e5db6121b pristine_git_object: 05a105c6e4f6c9037f953e4620576a8494645865 + src/openrouter/components/anthropiccachecreation.py: + id: 10d4a3bde2d9 + last_write_checksum: sha1:5e3b33cda7e69aeb2e683374815796ca76ee2368 + pristine_git_object: b08b10ce6b317954ebf7f12d09157d5cc4a19f26 src/openrouter/components/anthropiccitationcharlocationparam.py: id: 6f6f0732b22f last_write_checksum: sha1:f06cdcdd405abb4222450f027fd38f29b05efbec @@ -6516,30 +6816,30 @@ trackedFiles: id: "8776686778e3" last_write_checksum: sha1:9a7144f078d7b404bf3d90eac0d3a16a24ba3bba pristine_git_object: cbe0a66bb0fd32915d5f1379990f0b55b1be34e8 - src/openrouter/components/anthropiccitationsearchresultlocation.py: - id: 3bed26599605 - last_write_checksum: sha1:2dd310e399d7957ff933cd7163b7ca9f9fc348f4 - pristine_git_object: 8a90ed4f254de659efca56a8ad691dcca505bf1b - src/openrouter/components/anthropiccitationwebsearchresultlocation.py: - id: 1a120a6f2e0a - last_write_checksum: sha1:e4841838144a600bbc556aed274ecdd56aa2b51e - pristine_git_object: 4d061c61a4c7c6cee32194f7fe3ab9bebf00ec6f + src/openrouter/components/anthropiccitationsearchresultlocationparam.py: + id: 6610f6ef1f41 + last_write_checksum: sha1:8300415c29d0e1ea74e01f9a60e807ab5faec7d2 + pristine_git_object: 77b17e50979925c45c350782a3642dbc0496586d + src/openrouter/components/anthropiccitationwebsearchresultlocationparam.py: + id: e3b53306ee2f + last_write_checksum: sha1:ce75e5feff4dbaa43e8633d1c6c5492bff8a457b + pristine_git_object: 9be8376389ace420687450d12a94075c59902b18 src/openrouter/components/anthropiccompactionusageiteration.py: id: fdfc1ef0420f last_write_checksum: sha1:67b10e83d2fc7777319f6c51d4e5cc7539b9eccc pristine_git_object: 50ad24f32ec87623c006381c477c46f44d84c753 src/openrouter/components/anthropicdocumentblockparam.py: id: 2c3093530540 - last_write_checksum: sha1:904f1546a7a69df231395f33cb5b1b71ae0c2611 - pristine_git_object: 686764bb6991204328c5017ab636e3d38a4f2f09 + last_write_checksum: sha1:43f9b964f383ea77663e47c9a1e1cd76b7457d2c + pristine_git_object: be2d48fefcffa05ca80bfa647f77fafe60872a7d src/openrouter/components/anthropicfiledocumentsource.py: id: d824b52285d7 last_write_checksum: sha1:5d3c89e2d60df0116aed28d9a2274cf61536af41 pristine_git_object: 06ab054ee7227cb2186c19c108145d8e19646044 src/openrouter/components/anthropicimageblockparam.py: id: 71cab07562d1 - last_write_checksum: sha1:7077151d8ef411a85bc3cdafb17ae7969c8bf7cb - pristine_git_object: 979d0464c4ef00aba59e1431a2bbd3568c411246 + last_write_checksum: sha1:fbdb3a017bc51cb2848933aca87023159951a2aa + pristine_git_object: 7b5effbbab60e15e1daa06ad703f445d3dde96b6 src/openrouter/components/anthropicimagemimetype.py: id: 2434bf06fc4f last_write_checksum: sha1:2016e4ef5d678a2af645d50cb02e022c3918d494 @@ -6566,16 +6866,16 @@ trackedFiles: pristine_git_object: d16f6dc9a2449185ef45731cbcd0a78c266745ef src/openrouter/components/anthropicsearchresultblockparam.py: id: bccb7c6b3128 - last_write_checksum: sha1:aa8fcc04743f07cf8a72b3cbfaae212524101700 - pristine_git_object: 5925732967541b0d598ac249f372e5b18f975b0d + last_write_checksum: sha1:8d073fef507a39b53421384ff9a5914fd9438493 + pristine_git_object: 14967a292ebe05517a28c98b1e241bd2fd03a572 src/openrouter/components/anthropicspeed.py: id: 7e39c29f3d89 last_write_checksum: sha1:19e37bf7ec082d89258f44674405811cc8a010ad pristine_git_object: 4f9c2bc739541b12c381e3d6265184af879cc1ff src/openrouter/components/anthropictextblockparam.py: id: f387daeeb940 - last_write_checksum: sha1:f58942e9bb462aa291affec04500e112495a9acf - pristine_git_object: ed10fdcf8fdb3fcc18a59ea6cbaa1035bb987a5f + last_write_checksum: sha1:d07d4bef39b0f763604a58604da6aa4cb7979590 + pristine_git_object: 31a1df2ee27149c8862fb8709f4898ef0535360f src/openrouter/components/anthropicthinkingdisplay.py: id: 5d63f1a15f67 last_write_checksum: sha1:388d60bbe78d3b848744564f91b31142d7bfc7e3 @@ -6694,12 +6994,12 @@ trackedFiles: pristine_git_object: c59b958cb34640b4cc6329be5154480e4116929f src/openrouter/components/baseinputs_union.py: id: d85e19ff642b - last_write_checksum: sha1:0d8178381a828cc9db2f7b7eb36e0b657f0e1d52 - pristine_git_object: 56b48e741547abaae734d07a4022808fb082f899 + last_write_checksum: sha1:ef1fd31c14b1d9ee88ce2a927e4d68c199d5dce0 + pristine_git_object: f662ef47202e2685b0342486507c31ef27341c8d src/openrouter/components/basereasoningconfig.py: id: 8bd09a7e873a - last_write_checksum: sha1:1519371cc541bdec60a88b183b45717cd60d93c2 - pristine_git_object: 35d8ea7747973582b749e258443a1450e74a589b + last_write_checksum: sha1:db86178d4a8ebbd0279ba6107b9ae8a6eafa1c44 + pristine_git_object: c70517b14d7851590774b1a21cd813827a875e5e src/openrouter/components/bashservertool.py: id: 1c5881bea648 last_write_checksum: sha1:fd74247241c7371ff595e3b5e8fb1cac31f66ddc @@ -6774,8 +7074,8 @@ trackedFiles: pristine_git_object: 47ef267b5e0f7b615b0cd66018728e3f47440a66 src/openrouter/components/byokproviderslug.py: id: 6738a8516caf - last_write_checksum: sha1:2b105bacb46fd7150af7f079241fab2ba6700322 - pristine_git_object: 38050fde0204f069cb2568fafc91338a7051c92f + last_write_checksum: sha1:1d5f63d7206873cd787c0f8783edb1668c110a6b + pristine_git_object: 3eeec994403b5be04396cb2a9130051b96b7ff69 src/openrouter/components/capabilitydescriptor.py: id: 368790a86f10 last_write_checksum: sha1:a167551924ee82b4b5876a0ab698a45fe8c87a95 @@ -6802,8 +7102,8 @@ trackedFiles: pristine_git_object: b937a2df121366183d40d9f124c9f1bf21b798db src/openrouter/components/chatcontentcachecontrol.py: id: fa34483583b7 - last_write_checksum: sha1:e34eec1c61fdbf41456cb25b3704f4f26c7590ac - pristine_git_object: e23d40503368f1c30d2bd3335b9196fea2094c51 + last_write_checksum: sha1:b8a998d3dc83c8edd1a35c25846f59d01ff2649c + pristine_git_object: d60c7b13de35893537d9c6867c1e51a888dcc72d src/openrouter/components/chatcontentfile.py: id: 2a747b8033b8 last_write_checksum: sha1:1203efad65c0e72e18fa600bd8ebbc72a82340fa @@ -6818,8 +7118,8 @@ trackedFiles: pristine_git_object: 61415b0c78602a7fabc4bf7f62ac869bacf38195 src/openrouter/components/chatcontenttext.py: id: 5301d8af31e7 - last_write_checksum: sha1:8c30921c5e1530becb0f646866787aa3d1deab13 - pristine_git_object: 86d0a046b85b9caba7f628344d55febb71936ca9 + last_write_checksum: sha1:f4abea5885878b3c6aaacac28829fae85a7c25ce + pristine_git_object: 45f9d3e9873702cbffb4cd7078fff4fffe2b81d2 src/openrouter/components/chatcontentvideo.py: id: 42859cb5a9f4 last_write_checksum: sha1:f60354c6602613f3f8628ca29330a6037fcf20e9 @@ -6844,6 +7144,10 @@ trackedFiles: id: a852009cc661 last_write_checksum: sha1:0b53b9be3fc3c703dd69f537bd4e2d74bb3794b3 pristine_git_object: 9ec411f0b6d050166527d9ad38b892763113781b + src/openrouter/components/chatformatjsonobjectconfig.py: + id: c6434d0938fa + last_write_checksum: sha1:27544a9a1fcb7531c2e2ff93b63e361a6b6db815 + pristine_git_object: 450c8f6b441ce00d6a164f236ec19ce32a2d5abe src/openrouter/components/chatformatjsonschemaconfig.py: id: ab345e635f28 last_write_checksum: sha1:cf6c6e7bf8101361b2351f978e21bf3f8d61c375 @@ -6858,8 +7162,8 @@ trackedFiles: pristine_git_object: 7a6140f2b8afb0cde9b031322a4284c9cbce7e33 src/openrouter/components/chatfunctiontool.py: id: 1fcf92f8a7da - last_write_checksum: sha1:f5a4e444028732635ae55ff627f8f3e4f2d5695b - pristine_git_object: b62a155adffc32102f97f4160386c212b943c875 + last_write_checksum: sha1:bd0f773ec2135cbfdffb56db092587410c7e5daf + pristine_git_object: 69f8f1c4be7afa41b812c012d3cf1b0906efcf1b src/openrouter/components/chatjsonschemaconfig.py: id: d2278e414fab last_write_checksum: sha1:73791c8aa5f3dec4a25903dcc9c61118fc88a4f3 @@ -6878,8 +7182,8 @@ trackedFiles: pristine_git_object: 8bbde153b53887e426989fd5b0486b6dc1122810 src/openrouter/components/chatrequest.py: id: 5e39eaefa9cf - last_write_checksum: sha1:795fe5c66c8e44878d3769d1068d5591bd0a7a40 - pristine_git_object: 3ab5ba1d64a4f1cb214ff2428a6cfa31054d8774 + last_write_checksum: sha1:2b4baaf4c3bf6d32c3514edfaab04ded9b71b001 + pristine_git_object: 4c79a21cfcf76239f27b251c35a5600839703c3a src/openrouter/components/chatresult.py: id: 9062fe2935fe last_write_checksum: sha1:2ff1963c54e7e79500115c8549c8d395f4e336d1 @@ -6942,8 +7246,8 @@ trackedFiles: pristine_git_object: 2ccba8386486b7a730816a9829b01754935a2e96 src/openrouter/components/chatusage.py: id: f224a054bf45 - last_write_checksum: sha1:3cdcb6cbf944509ef966f90f7d6e3af967323277 - pristine_git_object: 1410ca9d1ed4032acb4a59569be77cea2fb4432b + last_write_checksum: sha1:ea708aa417bad1c480ef113ec9c4491f1cdfcf44 + pristine_git_object: 4fd2be35dd11a5c81fcc575f766ae23cbdc4e78e src/openrouter/components/chatusermessage.py: id: 7777191e729a last_write_checksum: sha1:6e9d3d1a827832b947bbb688a8f78f43aaaa9f81 @@ -6962,8 +7266,8 @@ trackedFiles: pristine_git_object: ea86f79f7e10d7584621fb804ac56e7bb79578ba src/openrouter/components/compactionitem.py: id: f1535c3a68c3 - last_write_checksum: sha1:c344678bd27fea9bae0da60dae93aff484483a20 - pristine_git_object: 0c6d74912168fc04a0d756e9fac3b914e0ca6106 + last_write_checksum: sha1:877b1856696c67229c1f0bc9c39e98d79c11120f + pristine_git_object: fd2fa67f5ed2630c005e33123ec291065ee5b6ff src/openrouter/components/compoundfilter.py: id: 0cab72c7a3bc last_write_checksum: sha1:7bc0251dcf6c06f0fd00c9cadee2fa6a1e88ea82 @@ -7040,6 +7344,10 @@ trackedFiles: id: 2dbef15bd5df last_write_checksum: sha1:34ee6609ef4171a4d54b52e41b781970edcf8fa8 pristine_git_object: 50bdff02f1430696b08d5bb5dc38ba67704dad61 + src/openrouter/components/contextcompactionitem.py: + id: 0212b34610c0 + last_write_checksum: sha1:e4f65d722d166d4818afffe5a4d2e2756b810dba + pristine_git_object: 591e51c49354f87abbaaa20e6b7d9bdb10a2be69 src/openrouter/components/contextcompressionengine.py: id: a3965275d07f last_write_checksum: sha1:8aeacab427a9277db44ef731fd7a38a58752a64f @@ -7062,16 +7370,16 @@ trackedFiles: pristine_git_object: fcfd9d646f216fdbb715cbbaefa4382d75750b79 src/openrouter/components/createguardrailrequest.py: id: 34d69149fb33 - last_write_checksum: sha1:4138e0c0ec26c3ec904a49846f9ed70f65227a0e - pristine_git_object: fb9dae6f51b5cd214cc05653f92014e87bc029ab + last_write_checksum: sha1:de39a253f2045f0185536b24c8a4983b9f96fb74 + pristine_git_object: 83ee2b358b34064762f7560d3c3c9fded954f8d4 src/openrouter/components/createguardrailresponse.py: id: b4e1bdf1de5b last_write_checksum: sha1:ae20a5e7425510c240e5697d847b1cae65940bd6 pristine_git_object: d6c4a4dc73222668daddc2a1788d314ff30e8fe6 src/openrouter/components/createobservabilitydestinationrequest.py: id: 58587fb98a32 - last_write_checksum: sha1:b8a96311602687e9280550674d0d840f2916ad06 - pristine_git_object: b7bf9755acc084c2f17f3787dc5b70e354b0efe4 + last_write_checksum: sha1:a69652cab8079b002fdcdfd8a3de2d5da4ed2677 + pristine_git_object: 6cd46b4fb85e986a1b54f89e5983a3a0d53b837e src/openrouter/components/createobservabilitydestinationresponse.py: id: 9a8561661e52 last_write_checksum: sha1:730054c12ad209d5f83b88825c946fd6f322e6e9 @@ -7150,8 +7458,8 @@ trackedFiles: pristine_git_object: 708dfac62530c5fcd29f6bb0be113dc34fd24718 src/openrouter/components/easyinputmessage.py: id: 72619a312585 - last_write_checksum: sha1:6fe16f2a35b373420e6b5289132da3557a3daaca - pristine_git_object: acc023a14c9edefd377c7d213fa928fd046ec999 + last_write_checksum: sha1:d239d7043ffc81d1fa3ec0779f6170f3d494a8f6 + pristine_git_object: 814efc2c2b79781d126d77e0d7fda85dcae7608f src/openrouter/components/edgenetworktimeoutresponseerrordata.py: id: dc53aae5b171 last_write_checksum: sha1:cfbbb83051f349bedda3d81a81ef2d3aea2916d6 @@ -7302,8 +7610,8 @@ trackedFiles: pristine_git_object: 0015e263bbb2d817af89780610cc8f25ff852e73 src/openrouter/components/fusionservertoolconfig.py: id: 0d1d229c531f - last_write_checksum: sha1:c5575780c1be8d9c66c13298d00a93ff004d386a - pristine_git_object: 5803dc6d2b2c74d2b7270233aef9d90524dd8d53 + last_write_checksum: sha1:ee754be65e6d2a35ed3f1f3985a0c3600116a6d0 + pristine_git_object: f7377d2de6c4e6129e8c7f9916200a06ae862afa src/openrouter/components/fusionsource.py: id: ce20a4a9f32f last_write_checksum: sha1:2141dd1dd9396035bf8070878c9ec945331514c8 @@ -7346,8 +7654,8 @@ trackedFiles: pristine_git_object: acda534cb0ced2a391479b720434cf0f57f46276 src/openrouter/components/guardrail.py: id: 67ee78dd06e6 - last_write_checksum: sha1:d3c96a79c8f1b033378f4c2f21fd74c172457185 - pristine_git_object: b087dc33e958e24a59a4e04584d9af3d6538a990 + last_write_checksum: sha1:911c0b3d65f34d1bad1b55d963fc8d6394c6e25b + pristine_git_object: 7839f84e779127c3c97764efbf7434816245f5a6 src/openrouter/components/guardrailinterval.py: id: 01687fc135ab last_write_checksum: sha1:430f886f371b85777346de663202d62708cd84cf @@ -7378,20 +7686,24 @@ trackedFiles: pristine_git_object: 5f17d77c25a82ad2bf7b1211d05ee665b6fee35a src/openrouter/components/imagegencompletedevent.py: id: 7a791a02cb5b - last_write_checksum: sha1:bd73865dd7ffd0ff9ec34b2edd484e4f0a3bde61 - pristine_git_object: ca3f68a4504570acfdc9c095ccdecfbb636c30f1 + last_write_checksum: sha1:497f9be381527fd1ee961450a2364a898dba875b + pristine_git_object: 6b9a8990973466285f9b49b366bbc5fc1ae42e41 + src/openrouter/components/imagegenerationproviderpreferences.py: + id: 100a82a54e2d + last_write_checksum: sha1:b62a5853eb29e4ade80bceb5a1d8d160b8791bcf + pristine_git_object: f31f0c06f6bdf464baa6bf50047be8901521bbdb src/openrouter/components/imagegenerationrequest.py: id: f8291a7be9a0 - last_write_checksum: sha1:5332c2cd26dbb93e94c927f20babe1d060388242 - pristine_git_object: 5d2a7e6371e56cfadd302a67a10d00deef0373cc + last_write_checksum: sha1:48a9640c0b9f48833d5514c7671bfa4b76aac776 + pristine_git_object: 9f5f9caf2d762e3db6affdd2aa20612978821dee src/openrouter/components/imagegenerationresponse.py: id: 53354cd0cbfc - last_write_checksum: sha1:8c42a25c58b589aad6031d2c1734eabcf1a1b143 - pristine_git_object: 7eddf64ed888d59494938f38e2b9035e7ba2b38e + last_write_checksum: sha1:53f1cde7b8bfe4f9e786a76f6e57b0a1f76aced2 + pristine_git_object: 687008d328b39a67390cdf0ab3eb8f6179ae6f7c src/openrouter/components/imagegenerationservertool.py: id: 9c95bc975f2e - last_write_checksum: sha1:f87c338c9b54030623f7f3e32f08a064e411f76c - pristine_git_object: 6e4cf9a3bd6eb13429a87a31c22864f56567e889 + last_write_checksum: sha1:808635f6a028797cd87918e3a3353d6c3bf00226 + pristine_git_object: bdf825ff7cbb8efb1a6aca6baebb724f877c6108 src/openrouter/components/imagegenerationservertool_openrouter.py: id: b7499cf15b3a last_write_checksum: sha1:37b4e32b48943100d6a3c894c514a9785e08c797 @@ -7410,8 +7722,8 @@ trackedFiles: pristine_git_object: eb59bfd0d4b89dde72504f8aa57533c689474ced src/openrouter/components/imagegenerationusage.py: id: f51151e8dbfa - last_write_checksum: sha1:810fd7e3dd1808d3c846fa4791ce3ba728dc32d6 - pristine_git_object: 83ae9b1bc1e7624550cf432b440c20ebe6eb16f5 + last_write_checksum: sha1:7f3f93e29e3b5018e8bf218dc167665794cf1d65 + pristine_git_object: 089d12ed821830575a14bf6b279a750f9737c1a4 src/openrouter/components/imagegenpartialimageevent.py: id: f88cea0c67fc last_write_checksum: sha1:2ee76cbb50b60ebe624bdfe0769a7bbdce047cd0 @@ -7420,10 +7732,18 @@ trackedFiles: id: 15c890eb8a08 last_write_checksum: sha1:29a04e6dc39f00f7784cc9228348a3b6f129b416 pristine_git_object: 80006d6d186baf7838a40a93839cdea5375256f2 + src/openrouter/components/imagegentextchunkevent.py: + id: 5cfc6caf763d + last_write_checksum: sha1:79c33282493bf247e4f761e878cc8242b0992c2c + pristine_git_object: d433ceae961e91fee4732913cfae463775322981 + src/openrouter/components/imageinputmodality.py: + id: c2336ff63555 + last_write_checksum: sha1:391a5fb69d5e9ce8b4bcdaef4d1280bce944a439 + pristine_git_object: bfe11c62d66b9ba64627867934d9796ea1bf96e8 src/openrouter/components/imagemodelarchitecture.py: id: 5f3e50733fe9 - last_write_checksum: sha1:cc9bee6400f1b7b65ff1c86c5d6bcd5eeab03209 - pristine_git_object: 01f0cb5e15bc03592cca4d25a3d67ebb990dd433 + last_write_checksum: sha1:9400a6354c6b217939bb87dbca39c5c2bf5956a1 + pristine_git_object: 0a870e4b18be6630023ab7a3b32ea9fd90821e62 src/openrouter/components/imagemodelendpointsresponse.py: id: f3d538d38ec2 last_write_checksum: sha1:e10cae58b2bb98ab1a0df6fc162f402ac1561d3c @@ -7446,8 +7766,8 @@ trackedFiles: pristine_git_object: 4e4c1cb067ac9184362a7284906f13c442cc152b src/openrouter/components/imagestreamingresponse.py: id: 7de5604ae99c - last_write_checksum: sha1:9148415c3a30065e7b1c373818a4d2ae4fc73ace - pristine_git_object: 877d1986f2a7e941f17532061468b5115a7b0d7f + last_write_checksum: sha1:b27e74509fefd10a10fc5e1a75ea8c1efcaa713f + pristine_git_object: d8a39f6587ab7b80f097dda43b908d406539a905 src/openrouter/components/incompletedetails.py: id: 1984e5246b23 last_write_checksum: sha1:573c1e6509ff2a9e1224725ec74e69f1c720eb09 @@ -7466,8 +7786,8 @@ trackedFiles: pristine_git_object: 0e7edf2ba9a0c7cfa1e395b240ab55ada9bbd436 src/openrouter/components/inputmessageitem.py: id: 6c5260d62714 - last_write_checksum: sha1:98b5f65b95e9b984ed78a2555e58b33ded517f41 - pristine_git_object: 654f64256a1cc0fdcdcf60c22e0bdc99256fba5a + last_write_checksum: sha1:b3d5ab531388f83247f204f15b9bba082f8aa035 + pristine_git_object: e6332882b51e720126426ccdede1a60f2e90819f src/openrouter/components/inputmodality.py: id: ffa999fb401a last_write_checksum: sha1:da607c1deed71fcc11d880b7cebe92471e2ec5d4 @@ -7478,12 +7798,12 @@ trackedFiles: pristine_git_object: a3d84a96f4553a320f5eee5d63f6bc5c244ab446 src/openrouter/components/inputs_union.py: id: 17d6239cb6a7 - last_write_checksum: sha1:289d1c1eb23075d285491f8fab2bf4d8dc941c4b - pristine_git_object: 1371934ab909d77965b050958080277ca8988f09 + last_write_checksum: sha1:8f82753fd340ed60d3314a63e913500c3281d686 + pristine_git_object: 39681f4c16af7831a14dcccf7447e742c8a2b43b src/openrouter/components/inputtext.py: id: a995ae96be99 - last_write_checksum: sha1:0e30dbfa1813d3e69e0ccd2511f50080cce0fb6e - pristine_git_object: 088b7564b2d7a76d0a1aef448050975fbc18663c + last_write_checksum: sha1:2da9ff645acc96772701908830151c5a707ed021 + pristine_git_object: 81a4151b3b1cdb6eb262a9ede28217b6c0afd1df src/openrouter/components/inputvideo.py: id: d262affd6f7e last_write_checksum: sha1:60c1792ab1f440ae67b5b451fd4d195e02783161 @@ -7506,8 +7826,12 @@ trackedFiles: pristine_git_object: d334197ca0822a32f5f98a7548b254a37ee7d110 src/openrouter/components/legacy_chatcontentvideo.py: id: b06bf8b4b644 - last_write_checksum: sha1:13c50b1957251e4819fc8ac6545c64cfe940bc8f - pristine_git_object: b5dd4d1a0d29169acd66c3b92b04dd9cf5291f79 + last_write_checksum: sha1:59cab32b6634299755ba92b46c90ee4495e6e86a + pristine_git_object: 38a7bf71a9b45b3f38d0aaad567a97996f80401e + src/openrouter/components/legacy_chatcontentvideoinput.py: + id: 27b3187afed4 + last_write_checksum: sha1:b9acaad63d544772ae34ba29a6eec2248b0181ac + pristine_git_object: 0fe43c16758210b0b304f3f31cc88ba2df5e46a0 src/openrouter/components/legacy_websearchservertool.py: id: 8b28b05b8756 last_write_checksum: sha1:bff7d5ebd6a54d3a598aaaeccefd18a04bb9b489 @@ -7598,16 +7922,20 @@ trackedFiles: pristine_git_object: 05b041967edf0ab2d8458f9f0fc3577f0a55fcfc src/openrouter/components/messagesmessageparam.py: id: ed8bbab6720d - last_write_checksum: sha1:4e5fb461702f78194596d7de570c7da25f05249e - pristine_git_object: 8a9738b371fb0ed0cd30d0bb7cc237fc7168eb92 + last_write_checksum: sha1:479cfffaf1013b89e92bb78ee7d5c5ad6646a1ca + pristine_git_object: e556cb06f6cf993616dd14191c43d6eca82edd7d src/openrouter/components/messagesoutputconfig.py: id: 54d1e297f740 last_write_checksum: sha1:01e41c73a07af6167f6934394f6e1f419f7ab878 pristine_git_object: 9b033dd8570e1d71ddb61a63a4b320d3003bd3ef src/openrouter/components/messagesrequest.py: id: 72b1f339024d - last_write_checksum: sha1:ea318958da35e90201812d01dfb04608212533b3 - pristine_git_object: e87ddbde100b658e3d6378cca6b123c8e162b3a9 + last_write_checksum: sha1:31b9b9af3f04cb27796a56329b3ad8629c8ae33a + pristine_git_object: b4d8f657ed28a53d7cdd1dd963694631070d1e40 + src/openrouter/components/messagessearchmodelsservertool.py: + id: 53d755edb120 + last_write_checksum: sha1:389786fc22ba4bb47b0a086b7aa321f2f04fe943 + pristine_git_object: d101995fd27b0bccbac266805caba629039c5f93 src/openrouter/components/metadatalevel.py: id: 0eede47eef62 last_write_checksum: sha1:b4e7e6fc4e9016b65008e9ebbfcc6f018fe89ced @@ -7618,8 +7946,8 @@ trackedFiles: pristine_git_object: a76656cf0dfc106b6c1a80dac3b53d0114aa68b6 src/openrouter/components/modelarchitecture.py: id: b37ac27e512b - last_write_checksum: sha1:4cb5ae4ebd310085d58966528958f7183f2ca9f0 - pristine_git_object: 1fb1dbcc44f43ac47d0f3c8af94298235461399f + last_write_checksum: sha1:d0b370e5a88cb723c8836ba4c5f4bf9c000ff82d + pristine_git_object: b1fb080a8142fe434784811e7c1cd51fce87c0b4 src/openrouter/components/modelbenchmarks.py: id: efd0b01b6775 last_write_checksum: sha1:71dd3f1be37b6ea21345316025cb106488a9a4c9 @@ -7646,8 +7974,8 @@ trackedFiles: pristine_git_object: 8d68ee4aa093ba2754a65f28e46a23a1848fd99b src/openrouter/components/modelslistresponse.py: id: c2d4bb2cac89 - last_write_checksum: sha1:54bc618bea7ddcaa4e49082d601065c634fb2ea1 - pristine_git_object: 8497c58e5956b9344427e0147063b01ab86c7001 + last_write_checksum: sha1:54461c815f518a71ba9f9b5a00ffad57c2d62c20 + pristine_git_object: a1cd85a3ba7fbb5c4b28936c5a3d0a70ca87aa38 src/openrouter/components/moderationplugin.py: id: d99bd9d505d3 last_write_checksum: sha1:58ff3e6829b973b3db5ed7dda3fa11558ded04b2 @@ -7680,10 +8008,18 @@ trackedFiles: id: f02862444a3d last_write_checksum: sha1:182ba82fb2aee3f33a975ce8eb2ef978bc0b46d2 pristine_git_object: b7a1d2f385159ff27bde884ad290db7878ccdfb1 + src/openrouter/components/observabilityfilterrulegroup.py: + id: f1fcf7b3732d + last_write_checksum: sha1:752f7a5db8f00c94443cc70f1c8cd1217c83e0b9 + pristine_git_object: 576d6a303f41aec506ccc7eb44c254ae5fb3064d src/openrouter/components/observabilityfilterrulesconfig.py: id: 98476c1c326b - last_write_checksum: sha1:2f0154d62e8ae85dfced48bfbc4d5430bddabc18 - pristine_git_object: 76f042e250255d33d9ed6626f1dd0be51f2fb4f3 + last_write_checksum: sha1:2ce6d9001db7a4fec752c3bb8898574be738ddef + pristine_git_object: 6f5536a507863e73dc5bdbd52b9faebf75f35b64 + src/openrouter/components/observabilityfilterrulesconfignullable.py: + id: 4e3d140792cb + last_write_checksum: sha1:6cb7c481dfe78fb6948e85c167ee3c93904ddf57 + pristine_git_object: 80ac61fe6a5044a15f9508a12a746b01085a558d src/openrouter/components/observabilitygrafanadestination.py: id: 36c8f26bcf6f last_write_checksum: sha1:d7fc978dd9c663490f1a7a8c12b07097d7985688 @@ -7754,8 +8090,8 @@ trackedFiles: pristine_git_object: af8258c63d88899948741f0597c89203e461fea1 src/openrouter/components/openairesponseinputmessageitem.py: id: 90c7fe9366e7 - last_write_checksum: sha1:629ebc3b56ae4570554eef76220d9394d189ac0d - pristine_git_object: 3dedde3ce07be821316ef8b9eda0999071d5946b + last_write_checksum: sha1:36c63c2364d5bdb82ab06b91a9cb0c19121d9b69 + pristine_git_object: d96f09596b5e0d88b4de5e5df6315022bb6a65b0 src/openrouter/components/openairesponsesannotation.py: id: 092d7d770eb3 last_write_checksum: sha1:7fed7001721d065ceb1644217e397d7c76ee7203 @@ -7942,8 +8278,8 @@ trackedFiles: pristine_git_object: 9aaebc4cb7eefdce97f37e89d6d719e524d148e5 src/openrouter/components/paretorouterplugin.py: id: b239c8e11899 - last_write_checksum: sha1:683d7762d520e3b9d08a3e976bc3bfd3ceca931f - pristine_git_object: f010e7df96d242b4b636a3112416a28b7a5845ac + last_write_checksum: sha1:b40a6f823553cd1602d0ccc3d163c19b2b4dbb8a + pristine_git_object: 68114efa832af6afe4dc86cb3e7daa2a2517620b src/openrouter/components/payloadtoolargeresponseerrordata.py: id: 5209b3a61cc9 last_write_checksum: sha1:41c9cfe04f098a0f8c3971e6dfe490c27e783413 @@ -8020,30 +8356,42 @@ trackedFiles: id: 40414eada27a last_write_checksum: sha1:0e241830bf9014e8ea814465c573711d8a7caa2c pristine_git_object: 90bdb267893360608210843a5da0d5d68e80d41e + src/openrouter/components/pricingoverride.py: + id: 8984e4cc7422 + last_write_checksum: sha1:0f72b9806164907aacce785f2d0c79a3e9374ac9 + pristine_git_object: a7c4599ac6ab794f54968f12cd6b15c3137a5159 + src/openrouter/components/promptcachebreakpoint.py: + id: f1e589a13300 + last_write_checksum: sha1:ea0f5d81093058c261edd1937b4c7148989a203a + pristine_git_object: 13fbce26b5254ca66ebecfbbc8701d2002483399 + src/openrouter/components/promptcacheoptions.py: + id: 5c39fe555e03 + last_write_checksum: sha1:77647b94fd80f6cfcae368bff4c87cbaf903a98e + pristine_git_object: 9d3586245623788e9accd1fe5ff883de89dc4bbe src/openrouter/components/promptinjectionscanscope.py: id: e78ab231a530 last_write_checksum: sha1:f257e3ae2b6385cf758e891ba02601c435e92098 pristine_git_object: 170ae25c582bb8decd74e1c69bfa8353bd44e86d src/openrouter/components/providername.py: id: fcc722fa2fce - last_write_checksum: sha1:b6d26b4ce3e92121a80cb351962e89593951962d - pristine_git_object: 009c1401a29123f18887b48c03f9c2a8b11ca2b5 + last_write_checksum: sha1:7bb29aa3b55fa6df3b056320b0556206f738e78d + pristine_git_object: 86245cd85f2de0a7344ffd555024b62d61a81db4 src/openrouter/components/provideroptions.py: id: 73dde6c8f359 - last_write_checksum: sha1:ddde99f94118559796f316a1f05de70060f3bee1 - pristine_git_object: d84b93dea4982ead0bd8a069cb0801a8e02447c0 + last_write_checksum: sha1:ca9d736d42f2c82fa375b0018b986c2376a32281 + pristine_git_object: f465173ff34bc40ef17fa475db7bde136124e8d8 src/openrouter/components/provideroverloadedresponseerrordata.py: id: 5b693682570e last_write_checksum: sha1:1ebc4527736f1e174ab37c84bea8a169fda9f8b8 pristine_git_object: c85a381a5f596fcbc2e3e599a65e8d03d62fabcd src/openrouter/components/providerpreferences.py: id: cdd58c8d664d - last_write_checksum: sha1:381d12826558a405f980ca338413e472296c12a2 - pristine_git_object: abbb3cb3d7d8946aabdbd5e6b07b2e45954f6948 + last_write_checksum: sha1:93405c39357e66bfe8cb60010622a884122b9197 + pristine_git_object: 2d44eabbe3200d884a5e01589732570d3a3ab7e1 src/openrouter/components/providerresponse.py: id: ad3887be54c5 - last_write_checksum: sha1:98ca4edc575c9c99ba342a4a490268308a0ac4e8 - pristine_git_object: 757907b8bdc224a0b94835fcec085a9f85172d45 + last_write_checksum: sha1:dbf09bc4d653c93702c3d25fc08df40027f1a296 + pristine_git_object: 9ef2d5d15f59ee0a3086a59e86aedcd978a731ad src/openrouter/components/providersort.py: id: 348e382bf494 last_write_checksum: sha1:57551507f95cd2e16ef995e1c13f859fd0726152 @@ -8054,12 +8402,12 @@ trackedFiles: pristine_git_object: 1798ae9dd8c2e4b629bb99cc5c643827895e8231 src/openrouter/components/publicendpoint.py: id: 848aa2ef9129 - last_write_checksum: sha1:d8788cb95c89974e6339ecaccc6202dfae871225 - pristine_git_object: 270a46db728bbf80ab3c89fde25d71c61f93434e + last_write_checksum: sha1:cfd3d1e8d5c62bbd494bd35e92d4d574103a189a + pristine_git_object: f91d6ae5aa526c51cf218eaaed2cb77514737ae8 src/openrouter/components/publicpricing.py: id: 96d115d83cc5 - last_write_checksum: sha1:41f834b27573c1f621c99883d27e231a1384c846 - pristine_git_object: fc3f2cdb028345dbeda1c0a6a1493647286f1cc9 + last_write_checksum: sha1:fd8c320ac83b282eaf2405045329b55076d4311a + pristine_git_object: 34b9d18bf50bcce3c150fffff684f41e8e79a2bd src/openrouter/components/quantization.py: id: bde317b3d703 last_write_checksum: sha1:96b042899bfb818f20d282be76ad37fc948a599d @@ -8082,8 +8430,12 @@ trackedFiles: pristine_git_object: 9adc8e68c6993b0490e8d14e1d2c0f15694dde97 src/openrouter/components/reasoningconfig.py: id: 754fc31a7b69 - last_write_checksum: sha1:49e4159a5318afffc7be6061d809c91c6fe26924 - pristine_git_object: 7e37f18a825c059606ec701dd94dbdcd3343f2c3 + last_write_checksum: sha1:03e4e2ec1a964e9d549604a6883001cd241c3b62 + pristine_git_object: fc8b0fb192b13cc1bd9700df1ee91bab73f446c2 + src/openrouter/components/reasoningcontext.py: + id: 39d2491701d9 + last_write_checksum: sha1:91e931a7ef777351be84e50d342fe635b0e1d8be + pristine_git_object: 79fc4af70b05b0bb716ccd1ba43ec1e7443ec41a src/openrouter/components/reasoningdeltaevent.py: id: 6de06228d1f6 last_write_checksum: sha1:efff164cfffbf6b89ab270ac4912243649149457 @@ -8092,6 +8444,10 @@ trackedFiles: id: ae7d7526c9b5 last_write_checksum: sha1:df579e34f32d49b348ae1fc8e74904ac4edb03a3 pristine_git_object: 0ba2daa8d62116e1122638e2c703e89428cd742d + src/openrouter/components/reasoningdetailservertoolcall.py: + id: f95da47c231d + last_write_checksum: sha1:5196ad2ea5f8b463bb8e9e98adc54f8faa63a07e + pristine_git_object: 4487eb0e24600c0affed1a29ea5380328c56fd0f src/openrouter/components/reasoningdetailsummary.py: id: 53bda5c72dc5 last_write_checksum: sha1:db665a5b9c7ca3be181719df3c81f07ce3c127ea @@ -8102,8 +8458,8 @@ trackedFiles: pristine_git_object: 49b08a205274f8aad7af7c5c910a7dbc73c12588 src/openrouter/components/reasoningdetailunion.py: id: 3326e0b80cdb - last_write_checksum: sha1:ba9766e0906ce06081ef33e5889ca7c0af870e13 - pristine_git_object: 78e5924ea5aff2f91111acd8348907ff37c738e9 + last_write_checksum: sha1:0a582331054241874c2bb83991b6596c84358e43 + pristine_git_object: 17b2534207bf2a898937bbcf3ee56fd58020cb41 src/openrouter/components/reasoningdoneevent.py: id: 5d7fc847e949 last_write_checksum: sha1:456aa0d5bc1ca2e46d2dd494d3d0f78d77ca23bf @@ -8120,6 +8476,10 @@ trackedFiles: id: 4345f446ad97 last_write_checksum: sha1:609a0510506f8dc70ca9cba07040b82ebdc9ec9f pristine_git_object: 40ee3f6c1a1e249d988950ebe49d1ad6f8c05dc1 + src/openrouter/components/reasoningmode.py: + id: 874f05fcf99c + last_write_checksum: sha1:0613ad16798a2678bb9fe0c55a20a13bf51373b1 + pristine_git_object: b0b5cbdbb34a9f84c8facd1bd213d3a877a4132d src/openrouter/components/reasoningsummarypartaddedevent.py: id: 006a060524d6 last_write_checksum: sha1:acd510a13e5cc8df7dcca38040af2be0a37a689b @@ -8174,12 +8534,12 @@ trackedFiles: pristine_git_object: 900bf08ec940565a8cbf55712a437775db00ca46 src/openrouter/components/responseserrorfield.py: id: 565a88fd70a1 - last_write_checksum: sha1:2547f2be40063fd0c897edd541c38485ddbd598f - pristine_git_object: 1c7f8a0ef6bc011cd6196c4a4c77a94b1cbb6b73 + last_write_checksum: sha1:98c70c30d80e112b471776feb4dd3c0cee5b26f3 + pristine_git_object: f38c8edcb616d9e7cbd0f724fbb9d9f5aae014f9 src/openrouter/components/responsesrequest.py: id: 8c850080ec5d - last_write_checksum: sha1:101e67249f64b2d28693f05935aa964a94109467 - pristine_git_object: 53cacf214278aeecf2d9219374316ebde6c1c726 + last_write_checksum: sha1:52b22af092ebe8d61503b02aaaa806737ecd295f + pristine_git_object: 92873ed0edafcd63a858b859da883c1431f15e56 src/openrouter/components/responsesstreamingresponse.py: id: 142379f3bd90 last_write_checksum: sha1:a48d6f3610f5d15248ef4d25a0d88a0a4a1a9db7 @@ -8200,6 +8560,10 @@ trackedFiles: id: c246413c0bd7 last_write_checksum: sha1:863a664a9f17def86180b0407c8233c263acfae7 pristine_git_object: 7faa97b80bfc0d362fd89c255adb708a4f7afc05 + src/openrouter/components/searchmodelsservertool_openrouter.py: + id: 126d609eda44 + last_write_checksum: sha1:4459710e2e9299ccee45ebccc2ab6a4ad03057a3 + pristine_git_object: 158d0a1a8dcd06be171fea886635c69d2c140e63 src/openrouter/components/searchmodelsservertoolconfig.py: id: 6a1174213084 last_write_checksum: sha1:4e4cfb2275ef0d6410f9557ab6a8f28ac8e9ab16 @@ -8212,6 +8576,10 @@ trackedFiles: id: ae2ca334218a last_write_checksum: sha1:4f739c60ede675286c18e898f4cc9505480897a4 pristine_git_object: fce3d0742de43f714ec40da747e6dcf7ff5e4075 + src/openrouter/components/servertoolusedetails.py: + id: b681965db7f8 + last_write_checksum: sha1:071f2fee04f80ccff9139c7909b4e3ed331fdb0c + pristine_git_object: 16ca66ee3f2402e06b9395a78be7def7da172e79 src/openrouter/components/serviceunavailableresponseerrordata.py: id: 606d51d201e8 last_write_checksum: sha1:275a171422155df8447f1b250f0a8af61d266b68 @@ -8250,8 +8618,8 @@ trackedFiles: pristine_git_object: 418953ba7366a6015934bf8795178d79adb03b89 src/openrouter/components/speechrequest.py: id: 2a9400167112 - last_write_checksum: sha1:110111aca3452c99b2c8ae365956737d935ae5ba - pristine_git_object: cb7e1b2a4626b9424b4c4c564a084d1ad2f15b3d + last_write_checksum: sha1:c91c94e2cf165ea7fd12b8001094c537c8858c9c + pristine_git_object: f903339eaa5c31fa00f7aad4150d61dea0737dad src/openrouter/components/stopservertoolswhencondition.py: id: 2deeda4209ac last_write_checksum: sha1:581e0ee62776d42bf598b9f68b998faabfecd3ce @@ -8318,16 +8686,28 @@ trackedFiles: pristine_git_object: 76c4b466e22e57b34098b587e95cb358089dd87c src/openrouter/components/sttrequest.py: id: 5fb1d469e16e - last_write_checksum: sha1:04621e286373ed7b188a3c171f83c93cb89c67f1 - pristine_git_object: d5497b98e6de245a4839b80079bf673be05d70ae + last_write_checksum: sha1:2944becda4acc11da95aff5cfb967544b8b15d0a + pristine_git_object: ce7ba259743cba658a3e23c2ea212d0fcaf34ebf src/openrouter/components/sttresponse.py: id: 2dc8eb8daaca - last_write_checksum: sha1:31cb20245662006e6459e662152c80e97778d77f - pristine_git_object: 19ff065a62373dfe9e0c97842d4ee173a175f5b6 + last_write_checksum: sha1:36aff8c075a27f036d34f3970031a26aad99f804 + pristine_git_object: 61daeb24ef51df79db5fa62329f8d15d81d729d9 + src/openrouter/components/sttsegment.py: + id: f3439539736c + last_write_checksum: sha1:be08482dc37814ed812250622b4ecb346b31787a + pristine_git_object: 471a0806203bea27421e0681e4b48cda9ce23220 + src/openrouter/components/stttimestampgranularity.py: + id: d6f8b068026d + last_write_checksum: sha1:9d1aff48024b9ab1446a05784f9aeb33aebdcee4 + pristine_git_object: 30edd2ffd22cad78e4950c8751b8de3314909250 src/openrouter/components/sttusage.py: id: abe8329af787 last_write_checksum: sha1:4b7b79be71c2d1e392aef738a37d2d75f0bb29c4 pristine_git_object: 1feb5db4da1422d55744c5a4bb10eabda6c50c4f + src/openrouter/components/sttword.py: + id: b46ff7c5fa20 + last_write_checksum: sha1:69fc17c2b943ace9486b782f7250579ba8d454b0 + pristine_git_object: 020dd01249eb982b0e94f0c19748badf5287a31a src/openrouter/components/subagentnestedtool.py: id: 911a465973a0 last_write_checksum: sha1:beb2209144b032e109c4afe33f440728423d7594 @@ -8344,6 +8724,14 @@ trackedFiles: id: a8425c790cb6 last_write_checksum: sha1:f434a1ff30f069c379b1809edd62b0435998156a pristine_git_object: eb9f276769106934801d88ce9d2c5c5c67fe1bc2 + src/openrouter/components/submitgenerationfeedbackrequest.py: + id: ae68ea802a9c + last_write_checksum: sha1:3d0fb9415d218dfbe5b978791c95bc0f28abb131 + pristine_git_object: c73cccc81298593ce3f4acbf2b25f02956528d8f + src/openrouter/components/submitgenerationfeedbackresponse.py: + id: 1e1463bcfd03 + last_write_checksum: sha1:d7ba55af6eca473c91a3cd09a73068bb8a75ad22 + pristine_git_object: 139b0fc5a600fee17eafff1d36df72754c90b2fe src/openrouter/components/taskclassificationitem.py: id: 86d4bab5ebf3 last_write_checksum: sha1:16176fda0ccd16b0be59bb5c4b74db78eae02f36 @@ -8434,16 +8822,16 @@ trackedFiles: pristine_git_object: a3664695c9722c531f7694851da76e51c2efe4fb src/openrouter/components/updateguardrailrequest.py: id: 6a557cd822a0 - last_write_checksum: sha1:cbdb7d942739143b727a64ad5330116c96aa6402 - pristine_git_object: d80389ace4e8b02227c7b1fab4496789761a26dd + last_write_checksum: sha1:b5377f5f986039b0ff74b9f5d1b8a45247b6c4b1 + pristine_git_object: 22e9f13f221efafeb7c2828e22c63cdc30cd86c4 src/openrouter/components/updateguardrailresponse.py: id: 7b068d26ce31 last_write_checksum: sha1:2b63cbb90747f07f775d9a22e80f74c67221fea8 pristine_git_object: df833960211cc7ed2a2a42fddbeafda0092e1c0c src/openrouter/components/updateobservabilitydestinationrequest.py: id: d7a39fe04386 - last_write_checksum: sha1:3a4279ca4f9680d2a4c41464b04ace5971a125ad - pristine_git_object: a344284f904d781583b0f493839fe11930b5afc1 + last_write_checksum: sha1:9eb493e5c3c8567235b70ec7a603ebdffcb544ea + pristine_git_object: e0d3f99ca9cafe61ac6b011cc2e54348d46115e5 src/openrouter/components/updateobservabilitydestinationresponse.py: id: 187c51d2b3a4 last_write_checksum: sha1:cadc62b37feddb4281e471d15627a9a1bef32cb1 @@ -8470,12 +8858,12 @@ trackedFiles: pristine_git_object: a0491cc8fd3bd9986146cb1176e27d5b9c9beb60 src/openrouter/components/usage.py: id: 965ca6748bf6 - last_write_checksum: sha1:859ca57d253deee9ccf672095bbe59b52df571d3 - pristine_git_object: 62c5e14fb1646a51b213ce3b5f822d0dc75ad979 + last_write_checksum: sha1:ffc3d82f236daff144c71e0c48c201b428d3201a + pristine_git_object: 09f7248804ba12bfbef924b934f57c34974d965b src/openrouter/components/videogenerationrequest.py: id: 70e3c9ff288c - last_write_checksum: sha1:bb81c3a4684e20898148e1415980457732da28d2 - pristine_git_object: 1f383a973b0d3f20605db372c24c9e9204c95d85 + last_write_checksum: sha1:7c3519d6e8a9d46821215c6a6e0bf060dbfb526c + pristine_git_object: d6ea46838880939edb6b3764a95b5c9ca58291a3 src/openrouter/components/videogenerationresponse.py: id: 541f1321b072 last_write_checksum: sha1:18c3aa7845f63a9614286b1a27b6098eae1c4951 @@ -8590,12 +8978,12 @@ trackedFiles: pristine_git_object: 791cdeba11d6c5e9e9381760fd8cd8ca86233b22 src/openrouter/datasets.py: id: 2378f80d1d6a - last_write_checksum: sha1:a2941625198705ff1585bb7e8ae7ba5c110d43e9 - pristine_git_object: 04200589b12afe8bf67a158b99c7b9c11e4dab5c + last_write_checksum: sha1:bcbf0eef58b4f26fc01ddd28c568fc361ccf8919 + pristine_git_object: 3d9437c8ce1bdc83d3703c4374cf10b1bcae5d71 src/openrouter/embeddings.py: id: 0374ace39067 - last_write_checksum: sha1:bdfaf3f9ffa1e337c0cc62b5a956a53c7863f24d - pristine_git_object: 9f0b5ce3612b8e56070f8cc69e890aaeb98491a9 + last_write_checksum: sha1:6a967c8d367aabf21aae51b4c098e02f3909bf5a + pristine_git_object: 906426aac514d79539160aae83cb6dbd4e128eac src/openrouter/endpoints.py: id: 465bbf2b7939 last_write_checksum: sha1:0c4ec93f6309edfb7f009679c04f59fa2a62232c @@ -8682,24 +9070,24 @@ trackedFiles: pristine_git_object: d858f3b578b189d20b89d0dfc1a6b829ff5897ff src/openrouter/files.py: id: 7baf7ee1f5b3 - last_write_checksum: sha1:0835637e39ff5f43fd04f2b428c861c87d1963be - pristine_git_object: 0c46d08795e4f68a47d310d5636e004fd9088208 + last_write_checksum: sha1:d06e5c382e420e3ffb5892e08088844e69f7a8d7 + pristine_git_object: 1c20e7d6a4837053dac23f3d7985ef6910217589 src/openrouter/generations.py: id: 70e1c21042bc - last_write_checksum: sha1:c513500d0aecefad46e4e791094672dd8a31e6f2 - pristine_git_object: cecdd21a8e07352f8fa8d44e9018e01dfd918a99 + last_write_checksum: sha1:00b190db603c57571f77ccfe5d5612a3f42c62a0 + pristine_git_object: f6dbf5440466ba6b1d92442cad1b91e2b3587c52 src/openrouter/guardrails.py: id: 705839f34e66 - last_write_checksum: sha1:e525be9e5746b7b1cb6d170ac74cce37f010004a - pristine_git_object: 4add1c7f1f5608569227ae476d820fa412e33745 + last_write_checksum: sha1:45c6fa317d2c33c9fc5c3b59ef6b0e2979ccc16a + pristine_git_object: b9fa12541a1210e1ba7b50c75ef9acf3c9ab0cbd src/openrouter/httpclient.py: id: e9311185443d last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 pristine_git_object: 89560b566073785535643e694c112bedbd3db13d src/openrouter/images.py: id: c4d7adf63ae0 - last_write_checksum: sha1:00ec5394bd5507e972b99d119ce27e8b3a0d47b4 - pristine_git_object: ebdec2dfff7323a1abe95b3143396cc0a91deb6d + last_write_checksum: sha1:277721bb6c89aabdc3fd5b8bbb73b9dc6e98d2f9 + pristine_git_object: 8a3080f7b51f197bb357e5e264b173d230b1f293 src/openrouter/models/__init__.py: id: ed73b93abb3f last_write_checksum: sha1:932a790ae66ccd7d7022b39c659bcf72a664ebea @@ -8714,20 +9102,20 @@ trackedFiles: pristine_git_object: 5b741456655ff48919d17ffd552a6410f0587966 src/openrouter/models_.py: id: 4e1ae1fe5b98 - last_write_checksum: sha1:3c9aa7ec25ebd7cf7eb43a4d31cab845658fd484 - pristine_git_object: 02dd1c2072829766214cfdbcb9a3eb098f282e33 + last_write_checksum: sha1:92ace67311606c8bb05b1e264f394e58e2f3a73d + pristine_git_object: 1a85e99763d0764e5d200911200e4710e454b538 src/openrouter/oauth.py: id: 1948ce27255b last_write_checksum: sha1:8d6ba30594d5674164f045d6655914b801268f72 pristine_git_object: d6a938412d5c82be874e958ba4a3043bd46284d3 src/openrouter/observability.py: id: 6a17f32d3f33 - last_write_checksum: sha1:760a86891fad356e60d36c619e02d7c710f10d70 - pristine_git_object: a1dea9b45650cc42a6f60447c032fa46b102839a + last_write_checksum: sha1:4c9eabfefd55cb2cfe1e3813a567296e99e988aa + pristine_git_object: 67318c78e377567e897be1f572a1e3cbdac0366b src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:58c06e81675a137ec84b13517f78cf1020874f2d - pristine_git_object: fc51690a99a6041a78762af05e43da30f15875da + last_write_checksum: sha1:e56a2031fc05ced63f1e1c769fc3407b290890a8 + pristine_git_object: 95999d265d654c5c2adab6aaf93bab0e75376e3d src/openrouter/operations/bulkaddworkspacemembers.py: id: e0ed56117619 last_write_checksum: sha1:5c44eb0d40fdece3ac084615f6c6082be4cf1d5a @@ -8760,6 +9148,10 @@ trackedFiles: id: 53f76e1550e4 last_write_checksum: sha1:80072ad426adddceec1d13756ba0c239cbad7014 pristine_git_object: 4e8414f223370bff1e4f060919f36f70da6ec40c + src/openrouter/operations/createaudiotranscriptions_multipart.py: + id: da07d463225a + last_write_checksum: sha1:a267131b5e9d8803f51431bbbc96a29484e97f0b + pristine_git_object: ff5459ee49af5fabed9c5e9a68979b923a7c4e9b src/openrouter/operations/createauthkeyscode.py: id: 4253a437de22 last_write_checksum: sha1:874492b64266fcdc5a7f3cd988d71326b7796a5c @@ -8770,8 +9162,8 @@ trackedFiles: pristine_git_object: d96c756e911994eaf6ef695a059f7575d69ff63c src/openrouter/operations/createembeddings.py: id: fe1160a960e9 - last_write_checksum: sha1:b268603b5bade55ac49a04e3ce217858ab3174b9 - pristine_git_object: 699e98674ffe69fea3bd1b8df9383cd558884c19 + last_write_checksum: sha1:a0b0b0755594b7a11b6662d9b8685fd3174d64e0 + pristine_git_object: a7fed8ead2d7dbf97fe0107a4f63318b7e610048 src/openrouter/operations/createguardrail.py: id: 52ed4b2f5903 last_write_checksum: sha1:d4351fdd66f1fa2bedcfc9a974c7f4ff6c68a6bc @@ -8898,8 +9290,8 @@ trackedFiles: pristine_git_object: d5a47b01285b12f05d46240e253a934be63f0a00 src/openrouter/operations/getmodels.py: id: 5bd5dfcb0125 - last_write_checksum: sha1:6d13fdf573bd5a4ff65484e3358d36d5f5e17a7d - pristine_git_object: af887b941b69db369b1623fd2a19abeef6ef967d + last_write_checksum: sha1:f736c36217ac4f17ba5405dabcc33ee54223a256 + pristine_git_object: de855463c99bc9ea9e94fc78093d289c6dc0d20a src/openrouter/operations/getobservabilitydestination.py: id: 15b49f22aca9 last_write_checksum: sha1:351b050b646c9e2dbffaf27633cbd38b30047169 @@ -8914,8 +9306,8 @@ trackedFiles: pristine_git_object: cbcc9abe2ab38d7e7bd3cbc79acfda4da6b630e0 src/openrouter/operations/getrankingsdaily.py: id: 61dd0325de08 - last_write_checksum: sha1:a5953f86dfb31e77024412d02cc56b7a485fdb76 - pristine_git_object: efa494faf3208ec621c97b156196a27b1c61b018 + last_write_checksum: sha1:352d2aeaebf68140c78343f31cc8ba344dc3d9ae + pristine_git_object: fb9267c75f1e40b75ad22f313c3c1028f026f657 src/openrouter/operations/gettaskclassifications.py: id: ba6156d68acf last_write_checksum: sha1:c569572d21aa766ac542d5c535208e8b1caae503 @@ -8938,12 +9330,12 @@ trackedFiles: pristine_git_object: cc90375e9aac23107e57e18e6adecc38f544e185 src/openrouter/operations/listbyokkeys.py: id: b6dd42b3e05f - last_write_checksum: sha1:ca0276ecb273e8b62e43937369d7b059ad73d9f1 - pristine_git_object: 2ec07724128bf2fb6152e84694f31b4234279e82 + last_write_checksum: sha1:9cce3860543e50cf242e3fdcabb6017b13198523 + pristine_git_object: c7d75c7caaaf9db51a4d1d63ae59e848e14cf4bc src/openrouter/operations/listembeddingsmodels.py: id: bf749a1f23d6 - last_write_checksum: sha1:19ed80a098e6e1b43bedfcccb11b4c8d8794541c - pristine_git_object: a019232d0cfcaccbca305f9d9aefccd0a5023df9 + last_write_checksum: sha1:0af7e243f6b7ea8dcb9c3e506c0e9382372e8397 + pristine_git_object: 016f0b9bc08b60b51e61f5b6acc44697ef5f1c27 src/openrouter/operations/listendpoints.py: id: 62b7a5f21dec last_write_checksum: sha1:1aa9ca7cc8e0376cc77fe81403e2664ecbd1abb2 @@ -8962,16 +9354,16 @@ trackedFiles: pristine_git_object: d57feee9926b76b03d1ec5ed8655cde8310b8192 src/openrouter/operations/listguardrailkeyassignments.py: id: ee9d33f4de6b - last_write_checksum: sha1:6837feb62ec5d172f6588933821232ad73fa08f2 - pristine_git_object: e7a2c31fb2451fbbc836d1356d156db8e9a7a933 + last_write_checksum: sha1:82c4cb0cd9d16cd761b7c0db8fa66165e1bb6f11 + pristine_git_object: 90f267220ceab68f8965a64b5d008a891da9f0d3 src/openrouter/operations/listguardrailmemberassignments.py: id: e36e679b02ec - last_write_checksum: sha1:de031b827a456c84a7d92790fca5ddd06780aa7a - pristine_git_object: 84076b7480837071db3d745f0fee690bd7809a01 + last_write_checksum: sha1:c281ab2ced63404c7786dd0828363708d60ae081 + pristine_git_object: 4ff57806d2d433412d45aef06b033f0c2a3502ff src/openrouter/operations/listguardrails.py: id: c99a9e7be93c - last_write_checksum: sha1:c908e642caa02b7904355cc6dba6f2c4d9a83d1f - pristine_git_object: 461e691429a7daea86a57f6d08df1bf4e9f78833 + last_write_checksum: sha1:758db0ed0413ea4a9ec15ac0e6942fd4f56cc863 + pristine_git_object: 1e36035bdc2da8a195f335d0dca4f0bf6f6858de src/openrouter/operations/listimagemodelendpoints.py: id: 40fd868ead3f last_write_checksum: sha1:2f4ba55f45f8fe4b5ce56cb6781fa8db455f8927 @@ -8982,36 +9374,36 @@ trackedFiles: pristine_git_object: 01655ae02036acf433ec5f54fd1d9323a55f0684 src/openrouter/operations/listkeyassignments.py: id: e26c11d1bd3c - last_write_checksum: sha1:bade55d5aaef4f6d9437c24f0bcb39b645af05ae - pristine_git_object: 2aee3fc4636c77ba4fcf5884a4000a1a04ee58a8 + last_write_checksum: sha1:045dffabc8207001234c5426e8fec665749597ff + pristine_git_object: f9ccb3da2d18137bfd9cadf6b53448a5bd8c3efe src/openrouter/operations/listmemberassignments.py: id: a993b5549126 - last_write_checksum: sha1:f0aab0c649c589a7d76cdaa9bbe4f0529ade66de - pristine_git_object: f8e0b658a596aaab401ff4feb3fa633f56f831f2 + last_write_checksum: sha1:00abec2beffb8b43a17c9d053fd582f4802a80b2 + pristine_git_object: 60c04beaf9ddb069d8b6e9b689e158bac1cc7d8f src/openrouter/operations/listmodelscount.py: id: d588d81b71c2 last_write_checksum: sha1:359fe33759ae50d8180ab793a32b42045a28e3af pristine_git_object: 797af26e7d4985305600eb79b3ede8e78379d13a src/openrouter/operations/listmodelsuser.py: id: 16eb5946cf60 - last_write_checksum: sha1:f77768589018acd0395e98b9a313933872834d84 - pristine_git_object: 6070772eb28a5452620eb4ebebfa2bc5c2310a4f + last_write_checksum: sha1:ac09a491143da6a59b3b84ce74fcc51f19222b0c + pristine_git_object: d2a24e430af7ad8357c453a1a91dad76635501df src/openrouter/operations/listobservabilitydestinations.py: id: 40d2ffa975ee - last_write_checksum: sha1:3f7de2adcba23902d0abc08728d82bb138fa93d1 - pristine_git_object: 465e357cbbb90b0d1be4f7e223332bc14e5deb71 + last_write_checksum: sha1:e49fcd9ded0009ac0699ad63f8ddbfbb2dc92aab + pristine_git_object: 818784f85b0d94fb4731a492ed05297720b5add2 src/openrouter/operations/listorganizationmembers.py: id: d40a3e0e2b38 - last_write_checksum: sha1:d36b77a9962c1808572789f535a04acb51e64685 - pristine_git_object: 15662f480a26a6b35a299d2845556ac4b8bbddf1 + last_write_checksum: sha1:9501a8781176d34c507edb9b160f8e1dca1b190d + pristine_git_object: 06825eead8265472d4abaa1395328215e9dca760 src/openrouter/operations/listpresets.py: id: ecdc7097aab7 - last_write_checksum: sha1:5f23af709ff305b4a1ddb26fd972a080a9c5d134 - pristine_git_object: bf21a246c75309e027a8ee69eb19f610a26af61a + last_write_checksum: sha1:a20921ac7ad2f66fe43a8e09ff14aefeafdbffd3 + pristine_git_object: 23c66e8419b295bb092f2ba1dbf59f5cb30572f8 src/openrouter/operations/listpresetversions.py: id: 697cf707300b - last_write_checksum: sha1:47eabd5ac45fe37bc05f0c57faea512fcb6b1c05 - pristine_git_object: 36052fb3de83cfafd1c021ac8ebfa56110eb55af + last_write_checksum: sha1:5059f0a2b2af9247f2d0f9c84a1338570d671465 + pristine_git_object: 1224fee0a75a1bb356e4bb53459fd1d2a0db3e72 src/openrouter/operations/listproviders.py: id: cf6e2db15118 last_write_checksum: sha1:decee82d2b55738162cc47f02f56c592d53f9ee9 @@ -9030,20 +9422,24 @@ trackedFiles: pristine_git_object: a65454da5ec6727d99312d56c64324edd8615685 src/openrouter/operations/listworkspacemembers.py: id: 9886d508d283 - last_write_checksum: sha1:c83463410e0899b9f5b686e2155f69340c7acff7 - pristine_git_object: 9a8706fcb1a1761c4e636dba74866e239e8d51a3 + last_write_checksum: sha1:dac90a6e7a00d60bff8440f8a012b2a88cf5fc82 + pristine_git_object: ff41be4a17d8b57a01aa9c2273b7db6099f589fd src/openrouter/operations/listworkspaces.py: id: fe94c6f61835 - last_write_checksum: sha1:2458a0c8d4834fa046496a68620b66c5ba55d927 - pristine_git_object: a242ff323f23dfadad254b76440114e66db4e744 + last_write_checksum: sha1:7f5d1903b71a84b51230492ea725f42ee1c413e5 + pristine_git_object: 59f628e9ebbd9da59c4e76aa1c8a080e4f6bd063 src/openrouter/operations/queryanalytics.py: id: d76c63ff66f6 - last_write_checksum: sha1:7866c71f371c0dbf9e1cda9be336bbf1d0e30ac5 - pristine_git_object: 705a3eaf0ce3e1b7cc9af6f96dbbed4fe0f67f50 + last_write_checksum: sha1:b184adfb9d438f443c1fd6c4e749aff3188e9496 + pristine_git_object: 23f2f9398884b3ab38b7e3ade20cafee40dc97f3 src/openrouter/operations/sendchatcompletionrequest.py: id: d9fee71bb577 last_write_checksum: sha1:0cba4011b8e305270ac30f88cb7ab59b6aefe619 pristine_git_object: b065e38c8d449348c4d133004653607e4194da6e + src/openrouter/operations/submitgenerationfeedback.py: + id: a1f4458f5e75 + last_write_checksum: sha1:634750972ca2bf7d76b1530f19f0d5401a44c3d8 + pristine_git_object: 878e3ec2224f81c003c35efa326d2ba53ee595c0 src/openrouter/operations/updatebyokkey.py: id: 486f4ea60120 last_write_checksum: sha1:a170382e38c66128bddbe8ea18c034d1350910da @@ -9066,20 +9462,20 @@ trackedFiles: pristine_git_object: 4441056786e1495816e8dc057a29795e86380ab1 src/openrouter/operations/uploadfile.py: id: f9dc565da045 - last_write_checksum: sha1:d73fad089275b4d32a718e63baf48926899f6bca - pristine_git_object: 29a37b944dfd1855409f064503e348ce50d13cf0 + last_write_checksum: sha1:fba1a6cb4299c240b32bae8628b5e583e914182a + pristine_git_object: fa8f9261c002709027180b7db501f3c6face90ea src/openrouter/operations/upsertworkspacebudget.py: id: 67d4a2962257 last_write_checksum: sha1:e251aa9f18cef5e265ef4d65cfbda42af411d2a3 pristine_git_object: 228942b37d54273e752786186a49bd1b4ed4a787 src/openrouter/organization.py: id: 6f4c63c416e8 - last_write_checksum: sha1:b60a04c6f8482981e03f69fb357c8c183a187225 - pristine_git_object: d24bfa86c4b67290033a18eced04435a3fc3d69f + last_write_checksum: sha1:d12e64ae4b677c154ff5a2cb964d34ddd848a323 + pristine_git_object: 31c74edd544c4ab7d4c5153a6d2888623ca66aed src/openrouter/presets.py: id: bd0c40379dcd - last_write_checksum: sha1:ff4882369524258936055676e9516ebeb68959d5 - pristine_git_object: 83085f60d38d0cb0b5540b8dd1cc1dfb7dc613ee + last_write_checksum: sha1:3b194964b25c57db796921e561898ae7073b6cbf + pristine_git_object: 832689477bac35ba16b604b330fdb3720e90a3a4 src/openrouter/providers.py: id: debc4c48f149 last_write_checksum: sha1:11dbc607825edee8dcc84b39ee8171e097c47acf @@ -9094,8 +9490,8 @@ trackedFiles: pristine_git_object: 76378ffba1806e0ca66fc873db1a568be0becebb src/openrouter/responses.py: id: f2108fb635e1 - last_write_checksum: sha1:9d6782aa347b58754a77cacbd85c3fec63febbac - pristine_git_object: 28b31f4ca269976764c47bd9a27f4d942e08f1d4 + last_write_checksum: sha1:cea59e9d4f9ff5a5c61bc69ab696f6a82d77c137 + pristine_git_object: 74419ce01c4c30820bb1e6103d2542b59d062d7a src/openrouter/sdk.py: id: ee9846c4c9c5 last_write_checksum: sha1:2247537eca7f88a8f36e53fe011904b98569ad52 @@ -9106,12 +9502,12 @@ trackedFiles: pristine_git_object: 26433165a0b1c25d7bd3115b9b129b18f2dc9387 src/openrouter/stt.py: id: fc0c2f669423 - last_write_checksum: sha1:da4bb584de8f5e54ae6d9b6a5d07c3bc6cf41558 - pristine_git_object: a5f03a72b9dd5ad769366fb71c07c57d7510fc56 + last_write_checksum: sha1:22247925e3c44234947eadbd409603292d4f9efe + pristine_git_object: 4bcc6d0314a17f48bc9735e2720e5b0b5f4bca22 src/openrouter/tts.py: id: 5055d4b95f1d - last_write_checksum: sha1:727a19a0df768153cbe2d8351394a2e254f680ea - pristine_git_object: 68ae54d07c464e69738c16bebf77d06d0d7f2141 + last_write_checksum: sha1:1561bf5c436e6912dfde6bfec7516aa85e24db9c + pristine_git_object: 5ccc4b9bad1c3db1c901d7df2d7f8d7e2d12df57 src/openrouter/types/__init__.py: id: 5eab536205b7 last_write_checksum: sha1:f9ad14217f832e74f594285960125add50324be9 @@ -9206,8 +9602,8 @@ trackedFiles: pristine_git_object: 4a82cde858211c0f5a01b08980cee0e9e3d0f52c src/openrouter/workspaces.py: id: cd6c533b1802 - last_write_checksum: sha1:cde38a8140d790751ffd6bb013a4c702c112aa6f - pristine_git_object: f3cf390c8f027710aaf32e794fa5229f0447b991 + last_write_checksum: sha1:3c465ee2641e0d0b42b28de96788f0b38e825f75 + pristine_git_object: 0e31f05047b6c176effc21f3540fcffc9a2cb6b5 examples: createResponses: speakeasy-default-create-responses: @@ -9364,9 +9760,13 @@ examples: application/json: {"error": {"code": 529, "message": "Provider returned error"}} listEmbeddingsModels: speakeasy-default-list-embeddings-models: + parameters: + query: + offset: 0 + limit: 500 responses: "200": - application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}]} + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}], "links": {"next": "/api/v1/models?offset=500&limit=500"}, "total_count": 150} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": @@ -9406,18 +9806,26 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} getModels: speakeasy-default-get-models: + parameters: + query: + offset: 0 + limit: 500 responses: "200": - application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}]} + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}], "links": {"next": "/api/v1/models?offset=500&limit=500"}, "total_count": 150} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} listModelsUser: speakeasy-default-list-models-user: + parameters: + query: + offset: 0 + limit: 500 responses: "200": - application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}]} + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}], "links": {"next": "/api/v1/models?offset=500&limit=500"}, "total_count": 150} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -9542,6 +9950,10 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} listGuardrails: speakeasy-default-list-guardrails: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production Guardrail", "workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"}], "total_count": 1} @@ -9612,6 +10024,10 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} listKeyAssignments: speakeasy-default-list-key-assignments: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "id": "550e8400-e29b-41d4-a716-446655440000", "key_hash": "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", "key_label": "prod-key", "key_name": "Production Key"}], "total_count": 1} @@ -9621,6 +10037,10 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} listMemberAssignments: speakeasy-default-list-member-assignments: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "id": "550e8400-e29b-41d4-a716-446655440000", "organization_id": "org_xyz789", "user_id": "user_abc123"}], "total_count": 1} @@ -9633,6 +10053,9 @@ examples: parameters: path: id: "550e8400-e29b-41d4-a716-446655440000" + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "id": "550e8400-e29b-41d4-a716-446655440000", "key_hash": "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", "key_label": "prod-key", "key_name": "Production Key"}], "total_count": 1} @@ -9665,6 +10088,9 @@ examples: parameters: path: id: "550e8400-e29b-41d4-a716-446655440000" + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "id": "550e8400-e29b-41d4-a716-446655440000", "organization_id": "org_xyz789", "user_id": "user_abc123"}], "total_count": 1} @@ -9760,6 +10186,10 @@ examples: application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} listOrganizationMembers: speakeasy-default-list-organization-members: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"email": "jane.doe@example.com", "first_name": "Jane", "id": "user_2dHFtVWx2n56w6HkM0000000000", "last_name": "Doe", "role": "org:member"}], "total_count": 25} @@ -9891,7 +10321,7 @@ examples: createAudioSpeech: speakeasy-default-create-audio-speech: requestBody: - application/json: {"input": "Hello world", "model": "elevenlabs/eleven-turbo-v2", "response_format": "pcm", "voice": "alloy"} + application/json: {"input": "Hello world", "model": "mistralai/voxtral-mini-tts-2603", "response_format": "pcm", "voice": "en_paul_neutral"} responses: "200": audio/*: "" @@ -9942,8 +10372,38 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + speakeasy-default-create-audio-transcriptions-multipart: + requestBody: + multipart/form-data: {"file": "x-file: example.file", "model": "Escalade"} + responses: + "200": + application/json: {"text": "Hello, this is a test of OpenAI speech-to-text transcription."} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "402": + application/json: {"error": {"code": 402, "message": "Insufficient credits. Add more using https://openrouter.ai/credits"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "524": + application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} + "529": + application/json: {"error": {"code": 529, "message": "Provider returned error"}} listBYOKKeys: speakeasy-default-list-BYOK-keys: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_fallback": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}], "total_count": 1} @@ -10069,6 +10529,10 @@ examples: application/json: {"error": {"code": 529, "message": "Provider returned error"}} listObservabilityDestinations: speakeasy-default-list-observability-destinations: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"api_key_hashes": null, "config": {"baseUrl": "https://us.cloud.langfuse.com", "publicKey": "pk-l...EfGh", "secretKey": "sk-l...AbCd"}, "created_at": "2025-08-24T10:30:00Z", "enabled": true, "filter_rules": null, "id": "99999999-aaaa-bbbb-cccc-dddddddddddd", "name": "Production Langfuse", "privacy_mode": false, "sampling_rate": 1, "type": "langfuse", "updated_at": "2025-08-24T15:45:00Z", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}], "total_count": 1} @@ -10143,6 +10607,10 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} listPresets: speakeasy-default-list-presets: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"created_at": "2026-04-20T10:00:00Z", "creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000", "description": null, "designated_version_id": "550e8400-e29b-41d4-a716-446655440000", "id": "650e8400-e29b-41d4-a716-446655440001", "name": "my-preset", "slug": "my-preset", "status": "active", "status_updated_at": null, "updated_at": "2026-04-20T10:00:00Z", "workspace_id": "750e8400-e29b-41d4-a716-446655440002"}], "total_count": 1} @@ -10239,6 +10707,9 @@ examples: parameters: path: slug: "my-preset" + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"config": {"model": "openai/gpt-4o", "temperature": 0.7}, "created_at": "2026-04-20T10:00:00Z", "creator_id": "user_2dHFtVWx2n56w6HkM0000000000", "id": "550e8400-e29b-41d4-a716-446655440000", "preset_id": "650e8400-e29b-41d4-a716-446655440001", "system_prompt": "You are a helpful assistant.", "updated_at": "2026-04-20T10:00:00Z", "version": 1}], "total_count": 1} @@ -10269,6 +10740,10 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} listWorkspaces: speakeasy-default-list-workspaces: + parameters: + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}], "total_count": 1} @@ -10615,6 +11090,8 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} listImageModels: speakeasy-default-list-image-models: responses: @@ -10640,6 +11117,9 @@ examples: parameters: path: id: "production" + query: + offset: 0 + limit: 50 responses: "200": application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "id": "660e8400-e29b-41d4-a716-446655440000", "role": "member", "user_id": "user_abc123", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}], "total_count": 1} @@ -10651,5 +11131,22 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + submitGenerationFeedback: + speakeasy-default-submit-generation-feedback: + requestBody: + application/json: {"category": "incorrect_response", "generation_id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG"} + responses: + "200": + application/json: {"data": {"success": true}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[].union(OutputFilesServerToolItem)` **Added**\n * `response` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[].union(OutputFilesServerToolItem)` **Added**\n" +releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(sail_research)` **Added**\n* `open_router.tts.create_speech()`: \n * `request.provider.options.sail_research` **Added**\n* `open_router.stt.create_transcription()`: \n * `request.provider.options.sail_research` **Added**\n* `open_router.byok.list()`: \n * `request.provider` **Changed**\n * `response.data[].provider.enum(sail_research)` **Added**\n* `open_router.byok.create()`: \n * `request.provider.enum(sail_research)` **Added**\n * `response.data.provider.enum(sail_research)` **Added**\n* `open_router.byok.get()`: `response.data.provider.enum(sail_research)` **Added**\n* `open_router.byok.update()`: `response.data.provider.enum(sail_research)` **Added**\n* `open_router.chat.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(sail_research)` **Added**\n* `open_router.embeddings.generate()`: \n * `request.provider.ignore[].union(ProviderName).enum(sail_research)` **Added**\n* `open_router.endpoints.list_zdr_endpoints()`: `response.data[].provider_name.enum(sail_research)` **Added**\n* `open_router.endpoints.list()`: `response.data.endpoints[].provider_name.enum(sail_research)` **Added**\n* `open_router.generations.get_generation()`: `response.data.provider_responses[].provider_name.enum(sail_research)` **Added**\n* `open_router.images.generate()`: `request.provider` **Changed**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.provider.ignore[].union(ProviderName).enum(sail_research)` **Added**\n* `open_router.presets.create_presets_messages()`: \n * `request.provider.ignore[].union(ProviderName).enum(sail_research)` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.provider.ignore[].union(ProviderName).enum(sail_research)` **Added**\n* `open_router.rerank.rerank()`: \n * `request.provider.ignore[].union(ProviderName).enum(sail_research)` **Added**\n* `open_router.video_generation.generate()`: \n * `request.provider.options.sail_research` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c997d33..f416d0b 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 0.11.3 + version: 0.11.33 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 11afda5..de6797b 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -127,6 +127,102 @@ components: required: - data type: object + AdditionalToolsItem: + description: Additional tools made available to the model at this point in the input + example: + role: developer + tools: + - name: get_weather + parameters: + properties: + location: + type: string + type: object + type: function + type: additional_tools + properties: + id: + nullable: true + type: string + role: + enum: + - unknown + - user + - assistant + - system + - critic + - discriminator + - developer + - tool + type: string + tools: + items: + anyOf: + - allOf: + - $ref: '#/components/schemas/FunctionTool' + - properties: {} + type: object + description: Function tool definition + example: + description: Get the current weather in a location + name: get_weather + parameters: + properties: + location: + description: The city and state + type: string + unit: + enum: + - celsius + - fahrenheit + type: string + required: + - location + type: object + type: function + - $ref: '#/components/schemas/Preview_WebSearchServerTool' + - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool' + - $ref: '#/components/schemas/Legacy_WebSearchServerTool' + - $ref: '#/components/schemas/WebSearchServerTool' + - $ref: '#/components/schemas/FileSearchServerTool' + - $ref: '#/components/schemas/ComputerUseServerTool' + - $ref: '#/components/schemas/CodeInterpreterServerTool' + - $ref: '#/components/schemas/McpServerTool' + - $ref: '#/components/schemas/ImageGenerationServerTool' + - $ref: '#/components/schemas/CodexLocalShellTool' + - $ref: '#/components/schemas/ShellServerTool' + - $ref: '#/components/schemas/ApplyPatchServerTool' + - $ref: '#/components/schemas/CustomTool' + - $ref: '#/components/schemas/AdvisorServerTool_OpenRouter' + - $ref: '#/components/schemas/SubagentServerTool_OpenRouter' + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/FilesServerTool' + - $ref: '#/components/schemas/FusionServerTool_OpenRouter' + - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' + - $ref: '#/components/schemas/SearchModelsServerTool_OpenRouter' + - $ref: '#/components/schemas/WebFetchServerTool' + - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter' + - $ref: '#/components/schemas/ApplyPatchServerTool_OpenRouter' + - $ref: '#/components/schemas/BashServerTool' + - $ref: '#/components/schemas/ShellServerTool_OpenRouter' + - additionalProperties: + nullable: true + properties: + type: + type: string + required: + - type + type: object + type: array + type: + enum: + - additional_tools + type: string + required: + - type + - role + - tools + type: object AdvisorNestedTool: additionalProperties: nullable: true @@ -263,6 +359,72 @@ components: $ref: '#/components/schemas/AdvisorNestedTool' type: array type: object + AgentMessageItem: + additionalProperties: + nullable: true + description: A message routed between agents in a multi-agent session + example: + author: /root/worker + content: + - text: Task complete. + type: input_text + recipient: /root + type: agent_message + properties: + agent: + additionalProperties: + nullable: true + nullable: true + properties: + agent_name: + type: string + required: + - agent_name + type: object + author: + type: string + content: + items: + oneOf: + - $ref: '#/components/schemas/InputText' + - allOf: + - $ref: '#/components/schemas/InputImage' + - properties: {} + type: object + description: Image input content item + example: + detail: auto + image_url: https://example.com/image.jpg + type: input_image + - additionalProperties: + nullable: true + properties: + encrypted_content: + type: string + type: + enum: + - encrypted_content + type: string + required: + - type + - encrypted_content + type: object + type: array + id: + nullable: true + type: string + recipient: + type: string + type: + enum: + - agent_message + type: string + required: + - type + - author + - recipient + - content + type: object AnnotationAddedEvent: allOf: - $ref: '#/components/schemas/BaseAnnotationAddedEvent' @@ -503,7 +665,9 @@ components: AnthropicCacheControlDirective: description: >- Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints - to the last cacheable block in the request. Currently supported for Anthropic Claude models. + to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache + breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter + converts them to the provider's native format. example: type: ephemeral properties: @@ -803,6 +967,42 @@ components: - start_block_index - end_block_index type: object + AnthropicCitationSearchResultLocationParam: + example: + cited_text: Example cited text + end_block_index: 1 + search_result_index: 0 + source: example_source + start_block_index: 0 + title: Example Result + type: search_result_location + properties: + cited_text: + type: string + end_block_index: + type: integer + search_result_index: + type: integer + source: + type: string + start_block_index: + type: integer + title: + nullable: true + type: string + type: + enum: + - search_result_location + type: string + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + type: object AnthropicCitationWebSearchResultLocation: example: cited_text: Example cited text @@ -831,6 +1031,34 @@ components: - title - url type: object + AnthropicCitationWebSearchResultLocationParam: + example: + cited_text: Example cited text + encrypted_index: enc_idx_0 + title: Example Page + type: web_search_result_location + url: https://example.com + properties: + cited_text: + type: string + encrypted_index: + type: string + title: + nullable: true + type: string + type: + enum: + - web_search_result_location + type: string + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + type: object AnthropicCodeExecution20250825Caller: example: tool_id: toolu_01abc @@ -1445,15 +1673,15 @@ components: char_location: '#/components/schemas/AnthropicCitationCharLocationParam' content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocationParam' page_location: '#/components/schemas/AnthropicCitationPageLocationParam' - search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation' - web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation' + search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocationParam' + web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocationParam' propertyName: type oneOf: - $ref: '#/components/schemas/AnthropicCitationCharLocationParam' - $ref: '#/components/schemas/AnthropicCitationPageLocationParam' - $ref: '#/components/schemas/AnthropicCitationContentBlockLocationParam' - - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation' - - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation' + - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocationParam' + - $ref: '#/components/schemas/AnthropicCitationSearchResultLocationParam' nullable: true type: array text: @@ -3099,8 +3327,12 @@ components: summary: auto nullable: true properties: + context: + $ref: '#/components/schemas/ReasoningContext' effort: $ref: '#/components/schemas/ReasoningEffort' + mode: + $ref: '#/components/schemas/ReasoningMode' summary: $ref: '#/components/schemas/ReasoningSummaryVerbosity' type: object @@ -4001,6 +4233,7 @@ components: - crusoe - darkbloom - decart + - deepgram - deepinfra - deepseek - dekallm @@ -4024,6 +4257,7 @@ components: - liquid - mancer - mara + - meta - minimax - mistral - modelrun @@ -4047,7 +4281,8 @@ components: - recraft - reka - relace - - sakana-ai + - sail-research + - sakana - sambanova - seed - siliconflow @@ -4227,7 +4462,9 @@ components: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - properties: {} type: object - description: Cache control for the content part + description: >- + Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style + `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request. example: ttl: 5m type: ephemeral @@ -4323,6 +4560,8 @@ components: properties: cache_control: $ref: '#/components/schemas/ChatContentCacheControl' + prompt_cache_breakpoint: + $ref: '#/components/schemas/PromptCacheBreakpoint' text: type: string type: @@ -4428,6 +4667,18 @@ components: - type - grammar type: object + ChatFormatJsonObjectConfig: + description: JSON object response format + example: + type: json_object + properties: + type: + enum: + - json_object + type: string + required: + - type + type: object ChatFormatJsonSchemaConfig: description: JSON Schema response format for structured outputs example: @@ -4537,6 +4788,7 @@ components: - $ref: '#/components/schemas/BashServerTool' - $ref: '#/components/schemas/DatetimeServerTool' - $ref: '#/components/schemas/FilesServerTool' + - $ref: '#/components/schemas/FusionServerTool_OpenRouter' - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - $ref: '#/components/schemas/ChatSearchModelsServerTool' - $ref: '#/components/schemas/SubagentServerTool_OpenRouter' @@ -4803,6 +5055,11 @@ components: format: double nullable: true type: number + prompt_cache_key: + nullable: true + type: string + prompt_cache_options: + $ref: '#/components/schemas/PromptCacheOptions' provider: $ref: '#/components/schemas/ProviderPreferences' reasoning: @@ -4857,7 +5114,7 @@ components: discriminator: mapping: grammar: '#/components/schemas/ChatFormatGrammarConfig' - json_object: '#/components/schemas/FormatJsonObjectConfig' + json_object: '#/components/schemas/ChatFormatJsonObjectConfig' json_schema: '#/components/schemas/ChatFormatJsonSchemaConfig' python: '#/components/schemas/ChatFormatPythonConfig' text: '#/components/schemas/ChatFormatTextConfig' @@ -4866,7 +5123,7 @@ components: type: json_object oneOf: - $ref: '#/components/schemas/ChatFormatTextConfig' - - $ref: '#/components/schemas/FormatJsonObjectConfig' + - $ref: '#/components/schemas/ChatFormatJsonObjectConfig' - $ref: '#/components/schemas/ChatFormatJsonSchemaConfig' - $ref: '#/components/schemas/ChatFormatGrammarConfig' - $ref: '#/components/schemas/ChatFormatPythonConfig' @@ -5545,27 +5802,7 @@ components: type: integer type: object server_tool_use_details: - description: Usage for server-side tool execution (e.g., web search) - nullable: true - properties: - tool_calls_executed: - description: Number of OpenRouter server tool calls that executed and produced a result - nullable: true - type: integer - tool_calls_requested: - description: >- - Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. - Provider-native tools (e.g. native web search) are not counted here. - nullable: true - type: integer - web_search_requests: - description: >- - Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search - is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. - Do not sum the two. - nullable: true - type: integer - type: object + $ref: '#/components/schemas/ServerToolUseDetails' total_tokens: description: Total number of tokens type: integer @@ -5773,6 +6010,8 @@ components: - type type: object CompactionItem: + additionalProperties: + nullable: true description: A context compaction marker with encrypted summary example: encrypted_content: enc_abc123... @@ -6220,6 +6459,27 @@ components: - type - video_url type: object + ContextCompactionItem: + additionalProperties: + nullable: true + description: A context compaction marker with an optional encrypted summary + example: + encrypted_content: enc_abc123... + type: context_compaction + properties: + encrypted_content: + nullable: true + type: string + id: + nullable: true + type: string + type: + enum: + - context_compaction + type: string + required: + - type + type: object ContextCompressionEngine: description: The compression engine to use. Defaults to "middle-out". enum: @@ -6395,6 +6655,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false ignored_models: null ignored_providers: null limit_usd: 50 @@ -6453,9 +6714,9 @@ components: enforce_zdr: deprecated: true description: >- - Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other - instead. When provided, its value is copied into any of those per-provider fields that are not explicitly - specified on the request. + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and + enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are + not explicitly specified on the request. example: false nullable: true type: boolean @@ -6476,8 +6737,13 @@ components: type: boolean enforce_zdr_other: description: >- - Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back - to enforce_zdr when not provided. + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls + back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_xai: + description: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. example: false nullable: true type: boolean @@ -6541,6 +6807,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -6591,7 +6858,7 @@ components: example: true type: boolean filter_rules: - $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + $ref: '#/components/schemas/ObservabilityFilterRulesConfigNullable' name: description: Human-readable name for the destination. example: Production Langfuse @@ -8357,7 +8624,8 @@ components: description: >- Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their - token allowance before producing visible text. When omitted, the provider's default applies. + token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to + 50000. example: 16384 type: integer max_tool_calls: @@ -8881,6 +9149,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -9063,6 +9332,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -9126,9 +9396,9 @@ components: enforce_zdr: deprecated: true description: >- - Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other - instead. When provided, its value is copied into any of those per-provider fields that are not explicitly - specified on the request. + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and + enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are + not explicitly specified on the request. example: false nullable: true type: boolean @@ -9149,8 +9419,13 @@ components: type: boolean enforce_zdr_other: description: >- - Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back - to enforce_zdr when not provided. + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls + back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_xai: + description: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. example: false nullable: true type: boolean @@ -9361,9 +9636,9 @@ components: type: integer media_type: description: >- - Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for - non-raster outputs such as SVG (`image/svg+xml`). - example: image/svg+xml + Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be + omitted if the format could not be determined. + example: image/png type: string type: description: The event type @@ -9377,6 +9652,80 @@ components: - b64_json - created type: object + ImageGenerationProviderPreferences: + description: Provider routing preferences and provider-specific passthrough configuration. + example: + allow_fallbacks: false + only: + - google-ai-studio + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the + next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + nullable: true + type: boolean + 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 + nullable: true + type: array + 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 + nullable: true + type: array + options: + allOf: + - $ref: '#/components/schemas/ProviderOptions' + - example: + black-forest-labs: + guidance: 3 + steps: 40 + 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 + nullable: true + type: array + sort: + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is + performed. + example: price + type: object ImageGenerationRequest: description: Image generation request input example: @@ -9453,16 +9802,7 @@ components: minLength: 1 type: string provider: - description: Provider-specific passthrough configuration - properties: - options: - allOf: - - $ref: '#/components/schemas/ProviderOptions' - - example: - black-forest-labs: - guidance: 3 - steps: 40 - type: object + $ref: '#/components/schemas/ImageGenerationProviderPreferences' quality: description: Rendering quality. Providers without a quality knob ignore this. enum: @@ -9489,9 +9829,9 @@ components: size: description: >- Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels - ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with - resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting - size + resolution/aspect_ratio is rejected. + ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent + to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a + mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. example: 2K type: string stream: @@ -9529,9 +9869,9 @@ components: type: string media_type: description: >- - Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). - Present for non-raster outputs such as SVG (`image/svg+xml`). - example: image/svg+xml + Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. + May be omitted if the format could not be determined. + example: image/png type: string required: - b64_json @@ -9570,9 +9910,6 @@ components: type: string type: object model: - enum: - - gpt-image-1 - - gpt-image-1-mini type: string moderation: enum: @@ -9597,11 +9934,6 @@ components: - auto type: string size: - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto type: string type: enum: @@ -9666,6 +9998,8 @@ components: prompt_tokens: 0 total_tokens: 4175 properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' completion_tokens: description: The tokens generated type: integer @@ -9827,6 +10161,44 @@ components: - type - error type: object + ImageGenTextChunkEvent: + description: Emitted when a text chunk becomes available during streaming generation of text-based formats (e.g. SVG) + example: + phase: content + text: + type: image_generation.text_chunk + properties: + phase: + description: >- + The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are + intermediate provider phases. + enum: + - content + - reasoning + - draft + type: string + text: + description: A text fragment of the image being generated (e.g. partial SVG markup) + type: string + type: + description: The event type + enum: + - image_generation.text_chunk + type: string + required: + - type + - text + - phase + type: object + ImageInputModality: + enum: + - text + - image + - file + - audio + - video + example: text + type: string ImageModelArchitecture: example: input_modalities: @@ -9838,7 +10210,7 @@ components: input_modalities: description: Supported input modalities items: - $ref: '#/components/schemas/InputModality' + $ref: '#/components/schemas/ImageInputModality' type: array output_modalities: description: Supported output modalities @@ -10030,6 +10402,7 @@ components: data: anyOf: - $ref: '#/components/schemas/ImageGenPartialImageEvent' + - $ref: '#/components/schemas/ImageGenTextChunkEvent' - $ref: '#/components/schemas/ImageGenCompletedEvent' - $ref: '#/components/schemas/ImageGenStreamErrorEvent' required: @@ -10362,7 +10735,10 @@ components: - $ref: '#/components/schemas/CustomToolCallItem' - $ref: '#/components/schemas/CustomToolCallOutputItem' - $ref: '#/components/schemas/CompactionItem' + - $ref: '#/components/schemas/ContextCompactionItem' - $ref: '#/components/schemas/ItemReferenceItem' + - $ref: '#/components/schemas/AdditionalToolsItem' + - $ref: '#/components/schemas/AgentMessageItem' type: array description: Input for a response request - can be a string or array of items example: @@ -10374,6 +10750,8 @@ components: text: Hello, how can I help you? type: input_text properties: + prompt_cache_breakpoint: + $ref: '#/components/schemas/PromptCacheBreakpoint' text: type: string type: @@ -10548,11 +10926,22 @@ components: - input_video type: string video_url: - $ref: '#/components/schemas/ChatContentVideoInput' + $ref: '#/components/schemas/Legacy_ChatContentVideoInput' required: - type - video_url type: object + Legacy_ChatContentVideoInput: + description: Video input object + example: + url: https://example.com/video.mp4 + properties: + url: + description: 'URL of the video (data: URLs supported)' + type: string + required: + - url + type: object Legacy_WebSearchServerTool: description: Web search tool configuration example: @@ -10749,6 +11138,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -11558,6 +11948,8 @@ components: type: string usage: properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' cache_creation_input_tokens: nullable: true type: integer @@ -12350,7 +12742,7 @@ components: - $ref: '#/components/schemas/BashServerTool' - $ref: '#/components/schemas/DatetimeServerTool' - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - - $ref: '#/components/schemas/ChatSearchModelsServerTool' + - $ref: '#/components/schemas/MessagesSearchModelsServerTool' - $ref: '#/components/schemas/WebFetchServerTool' - $ref: '#/components/schemas/OpenRouterWebSearchServerTool' - additionalProperties: @@ -12460,6 +12852,22 @@ components: output_tokens: 15 server_tool_use: null service_tier: standard + MessagesSearchModelsServerTool: + description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter' + example: + parameters: + max_results: 5 + type: openrouter:experimental__search_models + properties: + parameters: + $ref: '#/components/schemas/SearchModelsServerToolConfig' + type: + enum: + - openrouter:experimental__search_models + type: string + required: + - type + type: object MessagesStartEvent: description: Event sent at the start of a streaming message example: @@ -12546,6 +12954,7 @@ components: - Crusoe - Darkbloom - Decart + - Deepgram - DeepInfra - DeepSeek - DekaLLM @@ -12591,6 +13000,7 @@ components: - Recraft - Reka - Relace + - Sail Research - Sakana AI - SambaNova - Seed @@ -12880,34 +13290,7 @@ components: $ref: '#/components/schemas/InputModality' type: array instruct_type: - description: Instruction format type - enum: - - none - - airoboros - - alpaca - - alpaca-modif - - chatml - - claude - - code-llama - - gemma - - llama2 - - llama3 - - mistral - - nemotron - - neural - - openchat - - phi3 - - rwkv - - vicuna - - zephyr - - deepseek-r1 - - deepseek-v3.1 - - qwq - - qwen3 - - null - example: chatml - nullable: true - type: string + $ref: '#/components/schemas/InstructType' modality: description: Primary modality of the model example: text->text @@ -13116,7 +13499,7 @@ components: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -13135,11 +13518,31 @@ components: context_length: 8192 is_moderated: true max_completion_tokens: 4096 + links: + next: /api/v1/models?offset=500&limit=500 + total_count: 150 properties: data: $ref: '#/components/schemas/ModelsListResponseData' + links: + description: Pagination links + properties: + next: + description: URL for the next page of results, or null if this is the last page + example: /api/v1/models?offset=500&limit=500 + nullable: true + type: string + required: + - next + type: object + total_count: + description: Total number of models matching the query + example: 150 + type: integer required: - data + - total_count + - links type: object ModelsListResponseData: description: List of available models @@ -13161,7 +13564,7 @@ components: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -13732,6 +14135,66 @@ components: - $ref: '#/components/schemas/ObservabilitySnowflakeDestination' - $ref: '#/components/schemas/ObservabilityWeaveDestination' - $ref: '#/components/schemas/ObservabilityWebhookDestination' + ObservabilityFilterRuleGroup: + example: + logic: and + rules: + - field: model + operator: equals + value: openai/gpt-4o + properties: + logic: + default: and + enum: + - and + - or + type: string + rules: + items: + properties: + field: + enum: + - model + - provider + - session_id + - user_id + - api_key_name + - finish_reason + - input + - output + - total_cost + - total_tokens + - prompt_tokens + - completion_tokens + type: string + operator: + enum: + - equals + - not_equals + - contains + - not_contains + - regex + - starts_with + - ends_with + - gt + - lt + - gte + - lte + - exists + - not_exists + type: string + value: + anyOf: + - type: string + - type: number + required: + - field + - operator + type: object + type: array + required: + - rules + type: object ObservabilityFilterRulesConfig: description: Optional structured filter rules controlling which events are forwarded. example: null @@ -13742,59 +14205,22 @@ components: type: boolean groups: items: - properties: - logic: - default: and - enum: - - and - - or - type: string - rules: - items: - properties: - field: - enum: - - model - - provider - - session_id - - user_id - - api_key_name - - finish_reason - - input - - output - - total_cost - - total_tokens - - prompt_tokens - - completion_tokens - type: string - operator: - enum: - - equals - - not_equals - - contains - - not_contains - - regex - - starts_with - - ends_with - - gt - - lt - - gte - - lte - - exists - - not_exists - type: string - value: - anyOf: - - type: string - - type: number - required: - - field - - operator - type: object - type: array - required: - - rules - type: object + $ref: '#/components/schemas/ObservabilityFilterRuleGroup' + type: array + required: + - groups + type: object + ObservabilityFilterRulesConfigNullable: + description: Optional structured filter rules controlling which events are forwarded. + example: null + nullable: true + properties: + enabled: + default: true + type: boolean + groups: + items: + $ref: '#/components/schemas/ObservabilityFilterRuleGroup' type: array required: - groups @@ -15561,6 +15987,9 @@ components: type: integer input_tokens_details: properties: + cache_write_tokens: + nullable: true + type: integer cached_tokens: type: integer required: @@ -17442,6 +17871,7 @@ components: enabled: true id: pareto-router min_coding_score: 0.8 + price_source: prompt properties: enabled: description: Set to false to disable the pareto-router plugin for this request. Defaults to true. @@ -17452,14 +17882,23 @@ components: type: string min_coding_score: description: >- - Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding - models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, - medium, high). Omit to use the router default tier. + Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding + models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to + default to the highest tier (equivalent to >= 0.66). example: 0.8 format: double maximum: 1 minimum: 0 type: number + price_source: + description: >- + Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). + "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for + models without traffic data. Defaults to "prompt". + enum: + - prompt + - weighted_avg + type: string required: - id type: object @@ -17967,6 +18406,90 @@ components: required: - type type: object + PricingOverride: + description: >- + A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. + min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later + entries win per price key; price keys absent from an entry inherit the base price. + example: + completion: '0.00002' + min_prompt_tokens: 200000 + prompt: '0.000005' + properties: + audio: + description: Overridden price in USD per audio input token + type: string + completion: + description: Overridden price in USD per token for completion (output) generation + type: string + input_audio_cache: + description: Overridden price in USD per cached audio input token + type: string + input_cache_read: + description: Overridden price in USD per cached input token (read) + type: string + input_cache_write: + description: Overridden price in USD per cache-write token + type: string + input_cache_write_1h: + description: Overridden price in USD per 1-hour cache-write token + type: string + min_prompt_tokens: + description: >- + Condition: the entry applies when the total prompt tokens of a request are strictly greater than this + threshold + format: double + type: number + prompt: + description: Overridden price in USD per token for prompt (input) processing + type: string + utc_end: + description: 'Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)' + format: double + type: number + utc_start: + description: >- + Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = + 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), + which may wrap past midnight (utc_start > utc_end). + format: double + type: number + type: object + PromptCacheBreakpoint: + description: >- + Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block + carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on + providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. + example: + mode: explicit + nullable: true + properties: + mode: + enum: + - explicit + type: string + required: + - mode + type: object + PromptCacheOptions: + description: >- + Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks + marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + example: + mode: explicit + ttl: 30m + nullable: true + properties: + mode: + enum: + - explicit + type: string + ttl: + nullable: true + type: string + required: + - mode + type: object PromptInjectionScanScope: description: >- Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults @@ -17978,6 +18501,7 @@ components: type: string ProviderName: enum: + - Meta - AkashML - AI21 - AionLabs @@ -18004,6 +18528,7 @@ components: - Crusoe - Darkbloom - Decart + - Deepgram - DeepInfra - DeepSeek - DekaLLM @@ -18049,6 +18574,7 @@ components: - Recraft - Reka - Relace + - Sail Research - Sakana AI - SambaNova - Seed @@ -18203,6 +18729,10 @@ components: additionalProperties: nullable: true type: object + deepgram: + additionalProperties: + nullable: true + type: object deepinfra: additionalProperties: nullable: true @@ -18467,7 +18997,11 @@ components: additionalProperties: nullable: true type: object - sakana-ai: + sail-research: + additionalProperties: + nullable: true + type: object + sakana: additionalProperties: nullable: true type: object @@ -18823,6 +19357,7 @@ components: - Crusoe - Darkbloom - Decart + - Deepgram - DeepInfra - DeepSeek - DekaLLM @@ -18868,6 +19403,7 @@ components: - Recraft - Reka - Relace + - Sail Research - Sakana AI - SambaNova - Seed @@ -18890,6 +19426,15 @@ components: - FakeProvider example: OpenAI type: string + routed_service_tier: + description: >- + The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is + determined by the provider response and may differ. + enum: + - flex + - priority + example: priority + type: string status: description: HTTP status code from the provider example: 200 @@ -19036,6 +19581,16 @@ components: internal_reasoning: description: Price in USD per internal reasoning token type: string + overrides: + description: >- + Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies + when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match + the request; among applicable entries, later entries win per key; price keys absent from an entry + inherit the base price. The top-level pricing keys always reflect the price that applies under default + conditions. + items: + $ref: '#/components/schemas/PricingOverride' + type: array prompt: description: Price in USD per token for prompt (input) processing type: string @@ -19160,6 +19715,15 @@ components: internal_reasoning: description: Price in USD per internal reasoning token type: string + overrides: + description: >- + Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when + all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the + request; among applicable entries, later entries win per key; price keys absent from an entry inherit the + base price. The top-level pricing keys always reflect the price that applies under default conditions. + items: + $ref: '#/components/schemas/PricingOverride' + type: array prompt: description: Price in USD per token for prompt (input) processing type: string @@ -19314,6 +19878,19 @@ components: example: enabled: true summary: auto + ReasoningContext: + description: >- + Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); + `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn + only. Only supported by OpenAI GPT-5.6 and newer. + enum: + - auto + - all_turns + - current_turn + - null + example: all_turns + nullable: true + type: string ReasoningDeltaEvent: allOf: - $ref: '#/components/schemas/BaseReasoningDeltaEvent' @@ -19350,6 +19927,43 @@ components: - type - data type: object + ReasoningDetailServerToolCall: + description: >- + Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior + tool call can be rehydrated into a later turn of the same conversation. + example: + arguments: '{"prompt":"Compare carbon tax proposals"}' + result: '{"status":"ok","models":["openai/gpt-4o"]}' + tool_call_id: call_abc123 + tool_name: openrouter:fusion + type: reasoning.server_tool_call + properties: + arguments: + type: string + format: + $ref: '#/components/schemas/ReasoningFormat' + id: + nullable: true + type: string + index: + type: integer + result: + type: string + tool_call_id: + nullable: true + type: string + tool_name: + type: string + type: + enum: + - reasoning.server_tool_call + type: string + required: + - type + - tool_name + - arguments + - result + type: object ReasoningDetailSummary: description: Reasoning detail summary schema example: @@ -19405,6 +20019,7 @@ components: discriminator: mapping: reasoning.encrypted: '#/components/schemas/ReasoningDetailEncrypted' + reasoning.server_tool_call: '#/components/schemas/ReasoningDetailServerToolCall' reasoning.summary: '#/components/schemas/ReasoningDetailSummary' reasoning.text: '#/components/schemas/ReasoningDetailText' propertyName: type @@ -19415,6 +20030,7 @@ components: - $ref: '#/components/schemas/ReasoningDetailSummary' - $ref: '#/components/schemas/ReasoningDetailEncrypted' - $ref: '#/components/schemas/ReasoningDetailText' + - $ref: '#/components/schemas/ReasoningDetailServerToolCall' ReasoningDoneEvent: allOf: - $ref: '#/components/schemas/BaseReasoningDoneEvent' @@ -19475,6 +20091,17 @@ components: - text: Step by step analysis type: summary_text type: reasoning + ReasoningMode: + description: >- + Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, + billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. + enum: + - standard + - pro + - null + example: standard + nullable: true + type: string ReasoningSummaryPartAddedEvent: allOf: - $ref: '#/components/schemas/BaseReasoningSummaryPartAddedEvent' @@ -19760,6 +20387,7 @@ components: - empty_image_file - failed_to_download_image - image_file_not_found + - bio_policy type: string message: type: string @@ -19873,6 +20501,8 @@ components: prompt_cache_key: nullable: true type: string + prompt_cache_options: + $ref: '#/components/schemas/PromptCacheOptions' provider: $ref: '#/components/schemas/ProviderPreferences' reasoning: @@ -19962,7 +20592,7 @@ components: - $ref: '#/components/schemas/FilesServerTool' - $ref: '#/components/schemas/FusionServerTool_OpenRouter' - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - - $ref: '#/components/schemas/ChatSearchModelsServerTool' + - $ref: '#/components/schemas/SearchModelsServerTool_OpenRouter' - $ref: '#/components/schemas/WebFetchServerTool' - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter' - $ref: '#/components/schemas/ApplyPatchServerTool_OpenRouter' @@ -20060,6 +20690,22 @@ components: - high example: medium type: string + SearchModelsServerTool_OpenRouter: + description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter' + example: + parameters: + max_results: 5 + type: openrouter:experimental__search_models + properties: + parameters: + $ref: '#/components/schemas/SearchModelsServerToolConfig' + type: + enum: + - openrouter:experimental__search_models + type: string + required: + - type + type: object SearchModelsServerToolConfig: description: Configuration for the openrouter:experimental__search_models server tool example: @@ -20084,6 +20730,32 @@ components: - high example: medium type: string + ServerToolUseDetails: + description: Usage for server-side tool execution (e.g., web search) + example: + tool_calls_executed: 2 + tool_calls_requested: 2 + web_search_requests: 2 + nullable: true + properties: + tool_calls_executed: + description: Number of OpenRouter server tool calls that executed and produced a result. + nullable: true + type: integer + tool_calls_requested: + description: >- + Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. + Provider-native tools (e.g. native web search) are not counted here. + nullable: true + type: integer + web_search_requests: + description: >- + Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is + also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not + sum the two. + nullable: true + type: integer + type: object ServiceTier: enum: - auto @@ -20312,10 +20984,10 @@ components: description: Text-to-speech request input example: input: Hello world - model: elevenlabs/eleven-turbo-v2 + model: mistralai/voxtral-mini-tts-2603 response_format: pcm speed: 1 - voice: alloy + voice: en_paul_neutral properties: input: description: Text to synthesize @@ -20323,7 +20995,7 @@ components: type: string model: description: TTS model identifier - example: elevenlabs/eleven-turbo-v2 + example: mistralai/voxtral-mini-tts-2603 type: string provider: description: Provider-specific passthrough configuration @@ -20348,7 +21020,7 @@ components: type: number voice: description: Voice identifier (provider-specific). - example: alloy + example: en_paul_neutral type: string required: - model @@ -20804,11 +21476,30 @@ components: options: $ref: '#/components/schemas/ProviderOptions' type: object + response_format: + description: >- + Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, + duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + enum: + - json + - verbose_json + example: json + type: string temperature: description: Sampling temperature for transcription example: 0 format: double type: number + timestamp_granularities: + description: >- + Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level + timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless + response_format is "verbose_json". + example: + - segment + items: + $ref: '#/components/schemas/STTTimestampGranularity' + type: array required: - model - input_audio @@ -20824,6 +21515,24 @@ components: seconds: 9.2 total_tokens: 113 properties: + duration: + description: Duration of the input audio in seconds, present when response_format is verbose_json + example: 9.2 + format: double + type: number + language: + description: Detected or forced language, present when response_format is verbose_json + example: english + type: string + segments: + description: Timestamped transcript segments, present when response_format is verbose_json + items: + $ref: '#/components/schemas/STTSegment' + type: array + task: + description: The task performed, present when response_format is verbose_json + example: transcribe + type: string text: description: The transcribed text example: >- @@ -20832,9 +21541,87 @@ components: type: string usage: $ref: '#/components/schemas/STTUsage' + words: + description: Timestamped words, present when the provider returns word-level timestamps + items: + $ref: '#/components/schemas/STTWord' + type: array required: - text type: object + STTSegment: + description: A timestamped transcript segment, returned when response_format is verbose_json + example: + avg_logprob: -0.28 + compression_ratio: 1.13 + end: 3.2 + id: 0 + no_speech_prob: 0.01 + seek: 0 + start: 0 + temperature: 0 + text: Hello there. + tokens: + - 50364 + - 2425 + - 456 + properties: + avg_logprob: + description: Average log probability of the segment + format: double + type: number + compression_ratio: + description: Compression ratio of the segment + format: double + type: number + end: + description: Segment end time in seconds + example: 3.2 + format: double + type: number + id: + description: Segment index within the transcript + example: 0 + type: integer + no_speech_prob: + description: Probability the segment contains no speech + format: double + type: number + seek: + description: Seek offset of the segment + example: 0 + type: integer + start: + description: Segment start time in seconds + example: 0 + format: double + type: number + temperature: + description: Temperature used for the segment + format: double + type: number + text: + description: Transcribed text of the segment + example: Hello there. + type: string + tokens: + description: Token IDs of the segment + items: + type: integer + type: array + required: + - id + - start + - end + - text + type: object + STTTimestampGranularity: + description: A timestamp detail level for verbose_json transcription responses. + enum: + - word + - segment + example: word + type: string STTUsage: description: Aggregated usage statistics for the request example: @@ -20867,6 +21654,32 @@ components: example: 113 type: integer type: object + STTWord: + description: A timestamped word, returned when the provider includes word-level timestamps + example: + end: 0.4 + start: 0 + word: Hello + properties: + end: + description: Word end time in seconds + example: 0.4 + format: double + type: number + start: + description: Word start time in seconds + example: 0 + format: double + type: number + word: + description: The transcribed word + example: Hello + type: string + required: + - word + - start + - end + type: object SubagentNestedTool: additionalProperties: nullable: true @@ -20974,6 +21787,58 @@ components: $ref: '#/components/schemas/SubagentNestedTool' type: array type: object + SubmitGenerationFeedbackRequest: + description: Structured feedback about a specific generation + example: + category: incorrect_response + comment: The model repeated the same paragraph three times. + generation_id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + properties: + category: + description: The category of feedback being reported + enum: + - latency + - incoherence + - incorrect_response + - formatting + - billing + - api_error + - other + example: incorrect_response + type: string + comment: + description: An optional free-text comment describing the feedback + example: The model repeated the same paragraph three times. + maxLength: 1000 + type: string + generation_id: + description: The generation to submit feedback on + example: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + minLength: 1 + type: string + required: + - generation_id + - category + type: object + SubmitGenerationFeedbackResponse: + description: Confirmation that the feedback was recorded + example: + data: + success: true + properties: + data: + properties: + success: + const: true + description: Whether the feedback was recorded + example: true + type: boolean + required: + - success + type: object + required: + - data + type: object SupportedParameters: additionalProperties: $ref: '#/components/schemas/CapabilityDescriptor' @@ -21852,9 +22717,9 @@ components: enforce_zdr: deprecated: true description: >- - Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other - instead. When provided, its value is copied into any of those per-provider fields that are not explicitly - specified on the request. + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and + enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are + not explicitly specified on the request. example: true nullable: true type: boolean @@ -21875,8 +22740,13 @@ components: type: boolean enforce_zdr_other: description: >- - Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back - to enforce_zdr when not provided. + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls + back to enforce_zdr when not provided. + example: true + nullable: true + type: boolean + enforce_zdr_xai: + description: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. example: true nullable: true type: boolean @@ -21931,6 +22801,7 @@ components: enforce_zdr_google: true enforce_zdr_openai: true enforce_zdr_other: true + enforce_zdr_xai: true id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -21979,7 +22850,7 @@ components: type: boolean filter_rules: allOf: - - $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + - $ref: '#/components/schemas/ObservabilityFilterRulesConfigNullable' - description: Optional structured filter rules. `null` clears the rules. Omitting keeps the current value. name: description: Human-readable name for the destination. @@ -22201,6 +23072,8 @@ components: is_byok: description: Whether a request was made using a Bring Your Own Key configuration type: boolean + server_tool_use_details: + $ref: '#/components/schemas/ServerToolUseDetails' type: object description: Token usage information for the response example: @@ -23541,6 +24414,87 @@ paths: start: '2025-01-01T00:00:00Z' schema: properties: + classifier_dimensions: + description: >- + Group results by custom classifier tags, breaking down metrics by the specified dimension values. + Requires an active classifier on the workspace. + properties: + classifier_id: + description: UUID of the classifier whose tags to group by. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + dimension_names: + items: + description: >- + Classifier dimension name (snake_case identifier). When exactly one name is provided, the + response uses it as the column key; with multiple names or none, the response uses + `clf_dimension_name`/`clf_dimension_value` columns. + example: department + type: string + maxItems: 10 + type: array + include_nulls: + description: >- + When true, also include generations that have no tag from this classifier. Defaults to false, + which returns only classified generations. + type: boolean + required: + - classifier_id + type: object + classifier_filters: + description: >- + Filter results to generations with specific classifier tag values. Can be combined with + classifier_dimensions (must use the same classifier_id) or used independently with standard + dimensions. + properties: + classifier_id: + description: >- + UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id + when both are specified. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + filters: + items: + properties: + field: + description: >- + Classifier dimension name to filter on (snake_case identifier, e.g. "department", + "work_type"). + example: department + type: string + operator: + description: >- + Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered + comparisons are not available because classification values are strings. + example: eq + type: string + value: + anyOf: + - type: string + - format: double + type: number + - items: + anyOf: + - type: string + - format: double + type: number + type: array + description: Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in. + example: Engineering + required: + - field + - operator + - value + type: object + maxItems: 10 + minItems: 1 + type: array + required: + - classifier_id + - filters + type: object dimensions: items: description: Dimension to group by (up to 2). Use the /meta endpoint for available dimensions. @@ -23760,10 +24714,10 @@ paths: application/json: example: input: Hello world - model: elevenlabs/eleven-turbo-v2 + model: mistralai/voxtral-mini-tts-2603 response_format: pcm speed: 1 - voice: alloy + voice: en_paul_neutral schema: $ref: '#/components/schemas/SpeechRequest' required: true @@ -23886,7 +24840,9 @@ paths: x-speakeasy-name-override: createSpeech /audio/transcriptions: post: - description: Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. + description: >- + Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data + file upload, and returns the transcribed text. operationId: createAudioTranscriptions requestBody: content: @@ -23899,6 +24855,50 @@ paths: model: openai/whisper-large-v3 schema: $ref: '#/components/schemas/STTRequest' + multipart/form-data: + example: + file: audio.wav + language: en + model: openai/whisper-large-v3 + schema: + properties: + file: + description: >- + The audio file to transcribe. The format is derived from the filename extension or the file part + content type. Max 25 MB; send larger files as base64 JSON via input_audio. + format: binary + type: string + language: + description: The language of the input audio (ISO-639-1). + type: string + model: + description: The model to use for transcription. + type: string + response_format: + description: >- + The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns + task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). + enum: + - json + - verbose_json + type: string + temperature: + description: The sampling temperature. + type: number + timestamp_granularities[]: + description: >- + Timestamp detail levels to include when response_format is "verbose_json". "word" additionally + returns word-level timestamps in the words array. + items: + enum: + - word + - segment + type: string + type: array + required: + - file + - model + type: object required: true responses: '200': @@ -24452,6 +25452,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -24462,6 +25463,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -24508,6 +25510,7 @@ paths: - crusoe - darkbloom - decart + - deepgram - deepinfra - deepseek - dekallm @@ -24531,6 +25534,7 @@ paths: - liquid - mancer - mara + - meta - minimax - mistral - modelrun @@ -24554,7 +25558,8 @@ paths: - recraft - reka - relace - - sakana-ai + - sail-research + - sakana - sambanova - seed - siliconflow @@ -25641,6 +26646,13 @@ paths: reserved permaslug `other` and is always returned last within its date, so callers can compute `top-50 traffic / total daily traffic` without a second request. + Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time + grain. `modality` and `context_bucket` narrow the exact dataset by output/input + modality (or tool-calling activity) and request context length. `category` and + `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are + weekly-grain estimates — they cannot be combined with each other or with the exact + filters, and reject `period=day` with a 400. + Authenticate with any valid OpenRouter API key (same key used for inference). Rate-limited to 30 requests/minute per key and 500 requests/day per account. @@ -25681,6 +26693,110 @@ paths: example: '2026-05-11' pattern: ^\d{4}-\d{2}-\d{2}$ type: string + - description: >- + Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; + `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are + available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled + datasets `period=month` buckets each week by its week-start month, so totals are approximate at month + boundaries. + in: query + name: period + required: false + schema: + description: >- + Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; + `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are + available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled + datasets `period=month` buckets each week by its week-start month, so totals are approximate at month + boundaries. + enum: + - day + - week + - month + example: day + type: string + - description: >- + Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` + match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset + — cannot be combined with `category` or `language_type`. + in: query + name: modality + required: false + schema: + description: >- + Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / + `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. + Exact dataset — cannot be combined with `category` or `language_type`. + enum: + - text + - image + - image_output + - audio + - tool_calling + example: text + type: string + - description: >- + Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact + dataset — cannot be combined with `category` or `language_type`. + in: query + name: context_bucket + required: false + schema: + description: >- + Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). + Exact dataset — cannot be combined with `category` or `language_type`. + enum: + - 1K + - 10K + - 100K + - 1M + - 10M + example: 100K + type: string + - description: >- + Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, + so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic + past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + in: query + name: category + required: false + schema: + description: >- + Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled + dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include + traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + example: programming + type: string + - description: >- + Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled + dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include + traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + in: query + name: language_type + required: false + schema: + description: >- + Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled + dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include + traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + enum: + - natural + - programming + example: natural + type: string responses: '200': content: @@ -25940,27 +27056,7 @@ paths: format: double type: number cost_details: - description: Breakdown of upstream inference costs - example: - upstream_inference_completions_cost: 0.0004 - upstream_inference_cost: null - upstream_inference_prompt_cost: 0.0008 - nullable: true - properties: - upstream_inference_completions_cost: - format: double - type: number - upstream_inference_cost: - format: double - nullable: true - type: number - upstream_inference_prompt_cost: - format: double - type: number - required: - - upstream_inference_prompt_cost - - upstream_inference_completions_cost - type: object + $ref: '#/components/schemas/CostDetails' is_byok: description: Whether a request was made using a Bring Your Own Key configuration type: boolean @@ -26120,6 +27216,35 @@ paths: get: description: Returns a list of all available embeddings models and their properties operationId: listEmbeddingsModels + parameters: + - description: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + in: query + name: offset + required: false + schema: + default: 0 + description: >- + Number of records to skip for pagination. When both offset and limit are omitted, the full list is + returned + example: 0 + minimum: 0 + nullable: true + type: integer + - description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is + returned + in: query + name: limit + required: false + schema: + default: 500 + description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is + returned + example: 500 + maximum: 1000 + minimum: 1 + type: integer responses: '200': content: @@ -26184,6 +27309,17 @@ paths: tags: - Embeddings x-speakeasy-name-override: listModels + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit /endpoints/zdr: get: operationId: listEndpointsZdr @@ -26988,6 +28124,86 @@ paths: summary: Get stored prompt and completion content for a generation tags: - Generations + /generation/feedback: + post: + description: >- + Submit structured feedback on a generation the authenticated user made. [Management + key](/docs/guides/overview/auth/management-api-keys) required. + operationId: submitGenerationFeedback + requestBody: + content: + application/json: + example: + category: incorrect_response + comment: The model repeated the same paragraph three times. + generation_id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + schema: + $ref: '#/components/schemas/SubmitGenerationFeedbackRequest' + required: true + responses: + '200': + content: + application/json: + example: + data: + success: true + schema: + $ref: '#/components/schemas/SubmitGenerationFeedbackResponse' + description: Feedback recorded successfully + '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 + '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: Submit feedback for a generation + tags: + - Generations + x-speakeasy-name-override: submitFeedback /guardrails: get: description: >- @@ -27000,6 +28216,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27010,6 +28227,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -27104,6 +28322,7 @@ paths: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false ignored_models: null ignored_providers: null limit_usd: 50 @@ -27130,6 +28349,7 @@ paths: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -27356,6 +28576,7 @@ paths: enforce_zdr_google: true enforce_zdr_openai: true enforce_zdr_other: true + enforce_zdr_xai: true id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -27432,6 +28653,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27442,6 +28664,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -27685,6 +28908,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27695,6 +28919,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -27930,6 +29155,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27940,6 +29166,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -28009,6 +29236,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -28019,6 +29247,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -28163,6 +29392,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist + '413': + content: + application/json: + example: + error: + code: 413 + message: Request payload too large + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: Payload Too Large - Request payload exceeds size limits '429': content: application/json: @@ -30143,6 +31382,34 @@ paths: get: operationId: getModels parameters: + - description: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + in: query + name: offset + required: false + schema: + default: 0 + description: >- + Number of records to skip for pagination. When both offset and limit are omitted, the full list is + returned + example: 0 + minimum: 0 + nullable: true + type: integer + - description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is + returned + in: query + name: limit + required: false + schema: + default: 500 + description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is + returned + example: 500 + maximum: 1000 + minimum: 1 + type: integer - description: Filter models by use case category in: query name: category @@ -30188,10 +31455,10 @@ paths: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, - top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial - Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models - without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is - preserved. + top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, + coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best + Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When + omitted, the existing default ordering is preserved. in: query name: sort required: false @@ -30200,10 +31467,10 @@ paths: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, - top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low - (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across - arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing - default ordering is preserved. + top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, + coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best + Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When + omitted, the existing default ordering is preserved. enum: - most-popular - newest @@ -30214,6 +31481,8 @@ paths: - throughput-high-to-low - latency-low-to-high - intelligence-high-to-low + - coding-high-to-low + - agentic-high-to-low - design-arena-elo-high-to-low example: newest type: string @@ -30256,8 +31525,7 @@ paths: schema: description: Minimum context length (tokens). Models with smaller context are excluded. example: 128000 - exclusiveMinimum: true - minimum: 0 + minimum: 1 type: integer - description: Minimum prompt price in $/M tokens. in: query @@ -30334,6 +31602,132 @@ paths: - eu example: eu type: string + - description: Minimum completion (output) price in $/M tokens. + in: query + name: min_output_price + required: false + schema: + description: Minimum completion (output) price in $/M tokens. + example: 0 + minimum: 0 + nullable: true + type: number + - description: Maximum completion (output) price in $/M tokens. + in: query + name: max_output_price + required: false + schema: + description: Maximum completion (output) price in $/M tokens. + example: 10 + minimum: 0 + nullable: true + type: number + - description: Minimum model age in days since its creation date. + in: query + name: min_age_days + required: false + schema: + description: Minimum model age in days since its creation date. + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum model age in days since its creation date. + in: query + name: max_age_days + required: false + schema: + description: Maximum model age in days since its creation date. + example: 90 + minimum: 0 + nullable: true + type: integer + - description: Minimum Artificial Analysis intelligence index. + in: query + name: min_intelligence_index + required: false + schema: + description: Minimum Artificial Analysis intelligence index. + example: 50 + minimum: 0 + nullable: true + type: number + - description: Maximum Artificial Analysis intelligence index. + in: query + name: max_intelligence_index + required: false + schema: + description: Maximum Artificial Analysis intelligence index. + example: 100 + minimum: 0 + nullable: true + type: number + - description: Minimum Artificial Analysis coding index. + in: query + name: min_coding_index + required: false + schema: + description: Minimum Artificial Analysis coding index. + example: 50 + minimum: 0 + nullable: true + type: number + - description: Maximum Artificial Analysis coding index. + in: query + name: max_coding_index + required: false + schema: + description: Maximum Artificial Analysis coding index. + example: 100 + minimum: 0 + nullable: true + type: number + - description: Minimum Artificial Analysis agentic index. + in: query + name: min_agentic_index + required: false + schema: + description: Minimum Artificial Analysis agentic index. + example: 50 + minimum: 0 + nullable: true + type: number + - description: Maximum Artificial Analysis agentic index. + in: query + name: max_agentic_index + required: false + schema: + description: Maximum Artificial Analysis agentic index. + example: 100 + minimum: 0 + nullable: true + type: number + - description: >- + Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a + tool_calls finish reason). + in: query + name: min_tool_success_rate + required: false + schema: + description: >- + Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a + tool_calls finish reason). + example: 0.9 + maximum: 1 + minimum: 0 + nullable: true + type: number + - description: Maximum tool-calling success rate, as a fraction in [0, 1]. + in: query + name: max_tool_success_rate + required: false + schema: + description: Maximum tool-calling success rate, as a fraction in [0, 1]. + example: 1 + maximum: 1 + minimum: 0 + nullable: true + type: number responses: '200': content: @@ -30407,6 +31801,17 @@ paths: tags: - Models x-speakeasy-name-override: list + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit /models/{author}/{slug}/endpoints: get: operationId: listEndpoints @@ -30585,6 +31990,35 @@ paths: `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing). operationId: listModelsUser + parameters: + - description: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + in: query + name: offset + required: false + schema: + default: 0 + description: >- + Number of records to skip for pagination. When both offset and limit are omitted, the full list is + returned + example: 0 + minimum: 0 + nullable: true + type: integer + - description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is + returned + in: query + name: limit + required: false + schema: + default: 500 + description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is + returned + example: 500 + maximum: 1000 + minimum: 1 + type: integer responses: '200': content: @@ -30608,7 +32042,7 @@ paths: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -30664,6 +32098,17 @@ paths: tags: - Models x-speakeasy-name-override: listForUser + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit /observability/destinations: get: description: >- @@ -30678,6 +32123,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -30688,6 +32134,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -31105,6 +32552,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -31115,6 +32563,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -31235,6 +32684,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -31245,6 +32695,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -31800,6 +33251,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -31810,6 +33262,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -33412,6 +34865,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -33422,6 +34876,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -34067,6 +35522,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -34077,6 +35533,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -34251,7 +35708,8 @@ paths: post: description: >- Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. - [Management key](/docs/guides/overview/auth/management-api-keys) required. + SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management + key](/docs/guides/overview/auth/management-api-keys) required. operationId: bulkRemoveWorkspaceMembers parameters: - description: The workspace ID (UUID) or slug diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index dfb21f3..8681e52 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -149,6 +149,104 @@ components: required: - data type: object + AdditionalToolsItem: + description: Additional tools made available to the model at this point in the input + example: + role: developer + tools: + - name: get_weather + parameters: + properties: + location: + type: string + type: object + type: function + type: additional_tools + properties: + id: + nullable: true + type: string + role: + enum: + - unknown + - user + - assistant + - system + - critic + - discriminator + - developer + - tool + type: string + x-speakeasy-unknown-values: allow + tools: + items: + anyOf: + - allOf: + - $ref: '#/components/schemas/FunctionTool' + - properties: {} + type: object + description: Function tool definition + example: + description: Get the current weather in a location + name: get_weather + parameters: + properties: + location: + description: The city and state + type: string + unit: + enum: + - celsius + - fahrenheit + type: string + x-speakeasy-unknown-values: allow + required: + - location + type: object + type: function + - $ref: '#/components/schemas/Preview_WebSearchServerTool' + - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool' + - $ref: '#/components/schemas/Legacy_WebSearchServerTool' + - $ref: '#/components/schemas/WebSearchServerTool' + - $ref: '#/components/schemas/FileSearchServerTool' + - $ref: '#/components/schemas/ComputerUseServerTool' + - $ref: '#/components/schemas/CodeInterpreterServerTool' + - $ref: '#/components/schemas/McpServerTool' + - $ref: '#/components/schemas/ImageGenerationServerTool' + - $ref: '#/components/schemas/CodexLocalShellTool' + - $ref: '#/components/schemas/ShellServerTool' + - $ref: '#/components/schemas/ApplyPatchServerTool' + - $ref: '#/components/schemas/CustomTool' + - $ref: '#/components/schemas/AdvisorServerTool_OpenRouter' + - $ref: '#/components/schemas/SubagentServerTool_OpenRouter' + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/FilesServerTool' + - $ref: '#/components/schemas/FusionServerTool_OpenRouter' + - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' + - $ref: '#/components/schemas/SearchModelsServerTool_OpenRouter' + - $ref: '#/components/schemas/WebFetchServerTool' + - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter' + - $ref: '#/components/schemas/ApplyPatchServerTool_OpenRouter' + - $ref: '#/components/schemas/BashServerTool' + - $ref: '#/components/schemas/ShellServerTool_OpenRouter' + - additionalProperties: + nullable: true + properties: + type: + type: string + required: + - type + type: object + type: array + type: + enum: + - additional_tools + type: string + required: + - type + - role + - tools + type: object AdvisorNestedTool: additionalProperties: nullable: true @@ -266,6 +364,72 @@ components: $ref: '#/components/schemas/AdvisorNestedTool' type: array type: object + AgentMessageItem: + additionalProperties: + nullable: true + description: A message routed between agents in a multi-agent session + example: + author: /root/worker + content: + - text: Task complete. + type: input_text + recipient: /root + type: agent_message + properties: + agent: + additionalProperties: + nullable: true + nullable: true + properties: + agent_name: + type: string + required: + - agent_name + type: object + author: + type: string + content: + items: + oneOf: + - $ref: '#/components/schemas/InputText' + - allOf: + - $ref: '#/components/schemas/InputImage' + - properties: {} + type: object + description: Image input content item + example: + detail: auto + image_url: https://example.com/image.jpg + type: input_image + - additionalProperties: + nullable: true + properties: + encrypted_content: + type: string + type: + enum: + - encrypted_content + type: string + required: + - type + - encrypted_content + type: object + type: array + id: + nullable: true + type: string + recipient: + type: string + type: + enum: + - agent_message + type: string + required: + - type + - author + - recipient + - content + type: object AnnotationAddedEvent: allOf: - $ref: '#/components/schemas/BaseAnnotationAddedEvent' @@ -507,7 +671,7 @@ components: type: object AnthropicCacheControlDirective: description: >- - Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. example: type: ephemeral properties: @@ -808,6 +972,42 @@ components: - start_block_index - end_block_index type: object + AnthropicCitationSearchResultLocationParam: + example: + cited_text: Example cited text + end_block_index: 1 + search_result_index: 0 + source: example_source + start_block_index: 0 + title: Example Result + type: search_result_location + properties: + cited_text: + type: string + end_block_index: + type: integer + search_result_index: + type: integer + source: + type: string + start_block_index: + type: integer + title: + nullable: true + type: string + type: + enum: + - search_result_location + type: string + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + type: object AnthropicCitationWebSearchResultLocation: example: cited_text: Example cited text @@ -836,6 +1036,34 @@ components: - title - url type: object + AnthropicCitationWebSearchResultLocationParam: + example: + cited_text: Example cited text + encrypted_index: enc_idx_0 + title: Example Page + type: web_search_result_location + url: https://example.com + properties: + cited_text: + type: string + encrypted_index: + type: string + title: + nullable: true + type: string + type: + enum: + - web_search_result_location + type: string + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + type: object AnthropicCodeExecution20250825Caller: example: tool_id: toolu_01abc @@ -1455,15 +1683,15 @@ components: char_location: '#/components/schemas/AnthropicCitationCharLocationParam' content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocationParam' page_location: '#/components/schemas/AnthropicCitationPageLocationParam' - search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation' - web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation' + search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocationParam' + web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocationParam' propertyName: type oneOf: - $ref: '#/components/schemas/AnthropicCitationCharLocationParam' - $ref: '#/components/schemas/AnthropicCitationPageLocationParam' - $ref: '#/components/schemas/AnthropicCitationContentBlockLocationParam' - - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation' - - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation' + - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocationParam' + - $ref: '#/components/schemas/AnthropicCitationSearchResultLocationParam' nullable: true type: array text: @@ -3098,8 +3326,12 @@ components: summary: auto nullable: true properties: + context: + $ref: '#/components/schemas/ReasoningContext' effort: $ref: '#/components/schemas/ReasoningEffort' + mode: + $ref: '#/components/schemas/ReasoningMode' summary: $ref: '#/components/schemas/ReasoningSummaryVerbosity' type: object @@ -3997,6 +4229,7 @@ components: - crusoe - darkbloom - decart + - deepgram - deepinfra - deepseek - dekallm @@ -4020,6 +4253,7 @@ components: - liquid - mancer - mara + - meta - minimax - mistral - modelrun @@ -4043,7 +4277,8 @@ components: - recraft - reka - relace - - sakana-ai + - sail-research + - sakana - sambanova - seed - siliconflow @@ -4224,7 +4459,8 @@ components: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - properties: {} type: object - description: Cache control for the content part + description: >- + Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request. example: ttl: 5m type: ephemeral @@ -4319,6 +4555,8 @@ components: properties: cache_control: $ref: '#/components/schemas/ChatContentCacheControl' + prompt_cache_breakpoint: + $ref: '#/components/schemas/PromptCacheBreakpoint' text: type: string type: @@ -4424,6 +4662,18 @@ components: - type - grammar type: object + ChatFormatJsonObjectConfig: + description: JSON object response format + example: + type: json_object + properties: + type: + enum: + - json_object + type: string + required: + - type + type: object ChatFormatJsonSchemaConfig: description: JSON Schema response format for structured outputs example: @@ -4533,6 +4783,7 @@ components: - $ref: '#/components/schemas/BashServerTool' - $ref: '#/components/schemas/DatetimeServerTool' - $ref: '#/components/schemas/FilesServerTool' + - $ref: '#/components/schemas/FusionServerTool_OpenRouter' - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - $ref: '#/components/schemas/ChatSearchModelsServerTool' - $ref: '#/components/schemas/SubagentServerTool_OpenRouter' @@ -4800,6 +5051,11 @@ components: format: double nullable: true type: number + prompt_cache_key: + nullable: true + type: string + prompt_cache_options: + $ref: '#/components/schemas/PromptCacheOptions' provider: $ref: '#/components/schemas/ProviderPreferences' reasoning: @@ -4854,7 +5110,7 @@ components: discriminator: mapping: grammar: '#/components/schemas/ChatFormatGrammarConfig' - json_object: '#/components/schemas/FormatJsonObjectConfig' + json_object: '#/components/schemas/ChatFormatJsonObjectConfig' json_schema: '#/components/schemas/ChatFormatJsonSchemaConfig' python: '#/components/schemas/ChatFormatPythonConfig' text: '#/components/schemas/ChatFormatTextConfig' @@ -4863,7 +5119,7 @@ components: type: json_object oneOf: - $ref: '#/components/schemas/ChatFormatTextConfig' - - $ref: '#/components/schemas/FormatJsonObjectConfig' + - $ref: '#/components/schemas/ChatFormatJsonObjectConfig' - $ref: '#/components/schemas/ChatFormatJsonSchemaConfig' - $ref: '#/components/schemas/ChatFormatGrammarConfig' - $ref: '#/components/schemas/ChatFormatPythonConfig' @@ -5536,24 +5792,7 @@ components: type: integer type: object server_tool_use_details: - description: Usage for server-side tool execution (e.g., web search) - nullable: true - properties: - tool_calls_executed: - description: Number of OpenRouter server tool calls that executed and produced a result - nullable: true - type: integer - tool_calls_requested: - description: >- - Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. - nullable: true - type: integer - web_search_requests: - description: >- - Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. - nullable: true - type: integer - type: object + $ref: '#/components/schemas/ServerToolUseDetails' total_tokens: description: Total number of tokens type: integer @@ -5751,6 +5990,8 @@ components: - type type: object CompactionItem: + additionalProperties: + nullable: true description: A context compaction marker with encrypted summary example: encrypted_content: enc_abc123... @@ -6199,6 +6440,27 @@ components: - type - video_url type: object + ContextCompactionItem: + additionalProperties: + nullable: true + description: A context compaction marker with an optional encrypted summary + example: + encrypted_content: enc_abc123... + type: context_compaction + properties: + encrypted_content: + nullable: true + type: string + id: + nullable: true + type: string + type: + enum: + - context_compaction + type: string + required: + - type + type: object ContextCompressionEngine: description: The compression engine to use. Defaults to "middle-out". enum: @@ -6373,6 +6635,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false ignored_models: null ignored_providers: null limit_usd: 50 @@ -6430,7 +6693,7 @@ components: enforce_zdr: deprecated: true description: >- - Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. example: false nullable: true type: boolean @@ -6451,7 +6714,12 @@ components: type: boolean enforce_zdr_other: description: >- - Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_xai: + description: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. example: false nullable: true type: boolean @@ -6515,6 +6783,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -6564,7 +6833,7 @@ components: example: true type: boolean filter_rules: - $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + $ref: '#/components/schemas/ObservabilityFilterRulesConfigNullable' name: description: Human-readable name for the destination. example: Production Langfuse @@ -8313,7 +8582,7 @@ components: $ref: '#/components/schemas/AnthropicCacheControlDirective' max_completion_tokens: description: >- - Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. + Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to 50000. example: 16384 type: integer max_tool_calls: @@ -8831,6 +9100,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -9011,6 +9281,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -9073,7 +9344,7 @@ components: enforce_zdr: deprecated: true description: >- - Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. example: false nullable: true type: boolean @@ -9094,7 +9365,12 @@ components: type: boolean enforce_zdr_other: description: >- - Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_xai: + description: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. example: false nullable: true type: boolean @@ -9305,8 +9581,8 @@ components: type: integer media_type: description: >- - Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`). - example: image/svg+xml + Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined. + example: image/png type: string type: description: The event type @@ -9320,6 +9596,75 @@ components: - b64_json - created type: object + ImageGenerationProviderPreferences: + description: Provider routing preferences and provider-specific passthrough configuration. + example: + allow_fallbacks: false + only: + - google-ai-studio + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + nullable: true + type: boolean + 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 + nullable: true + type: array + 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 + nullable: true + type: array + options: + allOf: + - $ref: '#/components/schemas/ProviderOptions' + - example: + black-forest-labs: + guidance: 3 + steps: 40 + 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 + nullable: true + type: array + sort: + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + example: price + type: object ImageGenerationRequest: description: Image generation request input example: @@ -9398,16 +9743,7 @@ components: minLength: 1 type: string provider: - description: Provider-specific passthrough configuration - properties: - options: - allOf: - - $ref: '#/components/schemas/ProviderOptions' - - example: - black-forest-labs: - guidance: 3 - steps: 40 - type: object + $ref: '#/components/schemas/ImageGenerationProviderPreferences' quality: description: Rendering quality. Providers without a quality knob ignore this. enum: @@ -9434,7 +9770,7 @@ components: type: integer size: description: >- - Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. example: 2K type: string stream: @@ -9470,8 +9806,8 @@ components: type: string media_type: description: >- - Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`). - example: image/svg+xml + Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined. + example: image/png type: string required: - b64_json @@ -9512,11 +9848,7 @@ components: type: string type: object model: - enum: - - gpt-image-1 - - gpt-image-1-mini type: string - x-speakeasy-unknown-values: allow moderation: enum: - auto @@ -9543,13 +9875,7 @@ components: type: string x-speakeasy-unknown-values: allow size: - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto type: string - x-speakeasy-unknown-values: allow type: enum: - image_generation @@ -9613,6 +9939,8 @@ components: prompt_tokens: 0 total_tokens: 4175 properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' completion_tokens: description: The tokens generated type: integer @@ -9771,6 +10099,45 @@ components: - type - error type: object + ImageGenTextChunkEvent: + description: Emitted when a text chunk becomes available during streaming generation of text-based formats (e.g. SVG) + example: + phase: content + text: + type: image_generation.text_chunk + properties: + phase: + description: >- + The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases. + enum: + - content + - reasoning + - draft + type: string + x-speakeasy-unknown-values: allow + text: + description: A text fragment of the image being generated (e.g. partial SVG markup) + type: string + type: + description: The event type + enum: + - image_generation.text_chunk + type: string + required: + - type + - text + - phase + type: object + ImageInputModality: + enum: + - text + - image + - file + - audio + - video + example: text + type: string + x-speakeasy-unknown-values: allow ImageModelArchitecture: example: input_modalities: @@ -9782,7 +10149,7 @@ components: input_modalities: description: Supported input modalities items: - $ref: '#/components/schemas/InputModality' + $ref: '#/components/schemas/ImageInputModality' type: array output_modalities: description: Supported output modalities @@ -9976,6 +10343,7 @@ components: data: anyOf: - $ref: '#/components/schemas/ImageGenPartialImageEvent' + - $ref: '#/components/schemas/ImageGenTextChunkEvent' - $ref: '#/components/schemas/ImageGenCompletedEvent' - $ref: '#/components/schemas/ImageGenStreamErrorEvent' required: @@ -10311,7 +10679,10 @@ components: - $ref: '#/components/schemas/CustomToolCallItem' - $ref: '#/components/schemas/CustomToolCallOutputItem' - $ref: '#/components/schemas/CompactionItem' + - $ref: '#/components/schemas/ContextCompactionItem' - $ref: '#/components/schemas/ItemReferenceItem' + - $ref: '#/components/schemas/AdditionalToolsItem' + - $ref: '#/components/schemas/AgentMessageItem' type: array description: Input for a response request - can be a string or array of items example: @@ -10323,6 +10694,8 @@ components: text: Hello, how can I help you? type: input_text properties: + prompt_cache_breakpoint: + $ref: '#/components/schemas/PromptCacheBreakpoint' text: type: string type: @@ -10498,11 +10871,22 @@ components: - input_video type: string video_url: - $ref: '#/components/schemas/ChatContentVideoInput' + $ref: '#/components/schemas/Legacy_ChatContentVideoInput' required: - type - video_url type: object + Legacy_ChatContentVideoInput: + description: Video input object + example: + url: https://example.com/video.mp4 + properties: + url: + description: 'URL of the video (data: URLs supported)' + type: string + required: + - url + type: object Legacy_WebSearchServerTool: description: Web search tool configuration example: @@ -10697,6 +11081,7 @@ components: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -11506,6 +11891,8 @@ components: type: string usage: properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' cache_creation_input_tokens: nullable: true type: integer @@ -12291,7 +12678,7 @@ components: - $ref: '#/components/schemas/BashServerTool' - $ref: '#/components/schemas/DatetimeServerTool' - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - - $ref: '#/components/schemas/ChatSearchModelsServerTool' + - $ref: '#/components/schemas/MessagesSearchModelsServerTool' - $ref: '#/components/schemas/WebFetchServerTool' - $ref: '#/components/schemas/OpenRouterWebSearchServerTool' - additionalProperties: @@ -12399,6 +12786,22 @@ components: output_tokens: 15 server_tool_use: null service_tier: standard + MessagesSearchModelsServerTool: + description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter' + example: + parameters: + max_results: 5 + type: openrouter:experimental__search_models + properties: + parameters: + $ref: '#/components/schemas/SearchModelsServerToolConfig' + type: + enum: + - openrouter:experimental__search_models + type: string + required: + - type + type: object MessagesStartEvent: description: Event sent at the start of a streaming message example: @@ -12485,6 +12888,7 @@ components: - Crusoe - Darkbloom - Decart + - Deepgram - DeepInfra - DeepSeek - DekaLLM @@ -12530,6 +12934,7 @@ components: - Recraft - Reka - Relace + - Sail Research - Sakana AI - SambaNova - Seed @@ -12821,35 +13226,7 @@ components: $ref: '#/components/schemas/InputModality' type: array instruct_type: - description: Instruction format type - enum: - - none - - airoboros - - alpaca - - alpaca-modif - - chatml - - claude - - code-llama - - gemma - - llama2 - - llama3 - - mistral - - nemotron - - neural - - openchat - - phi3 - - rwkv - - vicuna - - zephyr - - deepseek-r1 - - deepseek-v3.1 - - qwq - - qwen3 - - null - example: chatml - nullable: true - type: string - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/InstructType' modality: description: Primary modality of the model example: text->text @@ -13055,7 +13432,7 @@ components: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -13074,11 +13451,31 @@ components: context_length: 8192 is_moderated: true max_completion_tokens: 4096 + links: + next: /api/v1/models?offset=500&limit=500 + total_count: 150 properties: data: $ref: '#/components/schemas/ModelsListResponseData' + links: + description: Pagination links + properties: + next: + description: URL for the next page of results, or null if this is the last page + example: /api/v1/models?offset=500&limit=500 + nullable: true + type: string + required: + - next + type: object + total_count: + description: Total number of models matching the query + example: 150 + type: integer required: - data + - total_count + - links type: object ModelsListResponseData: description: List of available models @@ -13100,7 +13497,7 @@ components: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -13666,6 +14063,69 @@ components: - $ref: '#/components/schemas/ObservabilitySnowflakeDestination' - $ref: '#/components/schemas/ObservabilityWeaveDestination' - $ref: '#/components/schemas/ObservabilityWebhookDestination' + ObservabilityFilterRuleGroup: + example: + logic: and + rules: + - field: model + operator: equals + value: openai/gpt-4o + properties: + logic: + default: and + enum: + - and + - or + type: string + x-speakeasy-unknown-values: allow + rules: + items: + properties: + field: + enum: + - model + - provider + - session_id + - user_id + - api_key_name + - finish_reason + - input + - output + - total_cost + - total_tokens + - prompt_tokens + - completion_tokens + type: string + x-speakeasy-unknown-values: allow + operator: + enum: + - equals + - not_equals + - contains + - not_contains + - regex + - starts_with + - ends_with + - gt + - lt + - gte + - lte + - exists + - not_exists + type: string + x-speakeasy-unknown-values: allow + value: + anyOf: + - type: string + - type: number + required: + - field + - operator + type: object + type: array + required: + - rules + type: object ObservabilityFilterRulesConfig: description: Optional structured filter rules controlling which events are forwarded. example: null @@ -13676,62 +14136,22 @@ components: type: boolean groups: items: - properties: - logic: - default: and - enum: - - and - - or - type: string - x-speakeasy-unknown-values: allow - rules: - items: - properties: - field: - enum: - - model - - provider - - session_id - - user_id - - api_key_name - - finish_reason - - input - - output - - total_cost - - total_tokens - - prompt_tokens - - completion_tokens - type: string - x-speakeasy-unknown-values: allow - operator: - enum: - - equals - - not_equals - - contains - - not_contains - - regex - - starts_with - - ends_with - - gt - - lt - - gte - - lte - - exists - - not_exists - type: string - x-speakeasy-unknown-values: allow - value: - anyOf: - - type: string - - type: number - required: - - field - - operator - type: object - type: array - required: - - rules - type: object + $ref: '#/components/schemas/ObservabilityFilterRuleGroup' + type: array + required: + - groups + type: object + ObservabilityFilterRulesConfigNullable: + description: Optional structured filter rules controlling which events are forwarded. + example: null + nullable: true + properties: + enabled: + default: true + type: boolean + groups: + items: + $ref: '#/components/schemas/ObservabilityFilterRuleGroup' type: array required: - groups @@ -15486,6 +15906,9 @@ components: type: integer input_tokens_details: properties: + cache_write_tokens: + nullable: true + type: integer cached_tokens: type: integer required: @@ -17356,6 +17779,7 @@ components: enabled: true id: pareto-router min_coding_score: 0.8 + price_source: prompt properties: enabled: description: Set to false to disable the pareto-router plugin for this request. Defaults to true. @@ -17366,12 +17790,20 @@ components: type: string min_coding_score: description: >- - Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier. + Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66). example: 0.8 format: double maximum: 1 minimum: 0 type: number + price_source: + description: >- + Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt". + enum: + - prompt + - weighted_avg + type: string + x-speakeasy-unknown-values: allow required: - id type: object @@ -17869,6 +18301,82 @@ components: required: - type type: object + PricingOverride: + description: >- + A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price. + example: + completion: '0.00002' + min_prompt_tokens: 200000 + prompt: '0.000005' + properties: + audio: + description: Overridden price in USD per audio input token + type: string + completion: + description: Overridden price in USD per token for completion (output) generation + type: string + input_audio_cache: + description: Overridden price in USD per cached audio input token + type: string + input_cache_read: + description: Overridden price in USD per cached input token (read) + type: string + input_cache_write: + description: Overridden price in USD per cache-write token + type: string + input_cache_write_1h: + description: Overridden price in USD per 1-hour cache-write token + type: string + min_prompt_tokens: + description: >- + Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold + format: double + type: number + prompt: + description: Overridden price in USD per token for prompt (input) processing + type: string + utc_end: + description: 'Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)' + format: double + type: number + utc_start: + description: >- + Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end). + format: double + type: number + type: object + PromptCacheBreakpoint: + description: >- + Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. + example: + mode: explicit + nullable: true + properties: + mode: + enum: + - explicit + type: string + required: + - mode + type: object + PromptCacheOptions: + description: >- + Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + example: + mode: explicit + ttl: 30m + nullable: true + properties: + mode: + enum: + - explicit + type: string + ttl: + nullable: true + type: string + required: + - mode + type: object PromptInjectionScanScope: description: >- Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. @@ -17880,6 +18388,7 @@ components: x-speakeasy-unknown-values: allow ProviderName: enum: + - Meta - AkashML - AI21 - AionLabs @@ -17906,6 +18415,7 @@ components: - Crusoe - Darkbloom - Decart + - Deepgram - DeepInfra - DeepSeek - DekaLLM @@ -17951,6 +18461,7 @@ components: - Recraft - Reka - Relace + - Sail Research - Sakana AI - SambaNova - Seed @@ -18105,6 +18616,10 @@ components: additionalProperties: nullable: true type: object + deepgram: + additionalProperties: + nullable: true + type: object deepinfra: additionalProperties: nullable: true @@ -18369,7 +18884,11 @@ components: additionalProperties: nullable: true type: object - sakana-ai: + sail-research: + additionalProperties: + nullable: true + type: object + sakana: additionalProperties: nullable: true type: object @@ -18716,6 +19235,7 @@ components: - Crusoe - Darkbloom - Decart + - Deepgram - DeepInfra - DeepSeek - DekaLLM @@ -18761,6 +19281,7 @@ components: - Recraft - Reka - Relace + - Sail Research - Sakana AI - SambaNova - Seed @@ -18784,6 +19305,15 @@ components: example: OpenAI type: string x-speakeasy-unknown-values: allow + routed_service_tier: + description: >- + The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ. + enum: + - flex + - priority + example: priority + type: string + x-speakeasy-unknown-values: allow status: description: HTTP status code from the provider example: 200 @@ -18929,6 +19459,12 @@ components: internal_reasoning: description: Price in USD per internal reasoning token type: string + overrides: + description: >- + Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. + items: + $ref: '#/components/schemas/PricingOverride' + type: array prompt: description: Price in USD per token for prompt (input) processing type: string @@ -19046,6 +19582,12 @@ components: internal_reasoning: description: Price in USD per internal reasoning token type: string + overrides: + description: >- + Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. + items: + $ref: '#/components/schemas/PricingOverride' + type: array prompt: description: Price in USD per token for prompt (input) processing type: string @@ -19192,6 +19734,18 @@ components: example: enabled: true summary: auto + ReasoningContext: + description: >- + Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. + enum: + - auto + - all_turns + - current_turn + - null + example: all_turns + nullable: true + type: string + x-speakeasy-unknown-values: allow ReasoningDeltaEvent: allOf: - $ref: '#/components/schemas/BaseReasoningDeltaEvent' @@ -19228,6 +19782,42 @@ components: - type - data type: object + ReasoningDetailServerToolCall: + description: >- + Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation. + example: + arguments: '{"prompt":"Compare carbon tax proposals"}' + result: '{"status":"ok","models":["openai/gpt-4o"]}' + tool_call_id: call_abc123 + tool_name: openrouter:fusion + type: reasoning.server_tool_call + properties: + arguments: + type: string + format: + $ref: '#/components/schemas/ReasoningFormat' + id: + nullable: true + type: string + index: + type: integer + result: + type: string + tool_call_id: + nullable: true + type: string + tool_name: + type: string + type: + enum: + - reasoning.server_tool_call + type: string + required: + - type + - tool_name + - arguments + - result + type: object ReasoningDetailSummary: description: Reasoning detail summary schema example: @@ -19283,6 +19873,7 @@ components: discriminator: mapping: reasoning.encrypted: '#/components/schemas/ReasoningDetailEncrypted' + reasoning.server_tool_call: '#/components/schemas/ReasoningDetailServerToolCall' reasoning.summary: '#/components/schemas/ReasoningDetailSummary' reasoning.text: '#/components/schemas/ReasoningDetailText' propertyName: type @@ -19293,6 +19884,7 @@ components: - $ref: '#/components/schemas/ReasoningDetailSummary' - $ref: '#/components/schemas/ReasoningDetailEncrypted' - $ref: '#/components/schemas/ReasoningDetailText' + - $ref: '#/components/schemas/ReasoningDetailServerToolCall' ReasoningDoneEvent: allOf: - $ref: '#/components/schemas/BaseReasoningDoneEvent' @@ -19355,6 +19947,17 @@ components: - text: Step by step analysis type: summary_text type: reasoning + ReasoningMode: + description: >- + Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. + enum: + - standard + - pro + - null + example: standard + nullable: true + type: string + x-speakeasy-unknown-values: allow ReasoningSummaryPartAddedEvent: allOf: - $ref: '#/components/schemas/BaseReasoningSummaryPartAddedEvent' @@ -19641,6 +20244,7 @@ components: - empty_image_file - failed_to_download_image - image_file_not_found + - bio_policy type: string x-speakeasy-unknown-values: allow message: @@ -19755,6 +20359,8 @@ components: prompt_cache_key: nullable: true type: string + prompt_cache_options: + $ref: '#/components/schemas/PromptCacheOptions' provider: $ref: '#/components/schemas/ProviderPreferences' reasoning: @@ -19843,7 +20449,7 @@ components: - $ref: '#/components/schemas/FilesServerTool' - $ref: '#/components/schemas/FusionServerTool_OpenRouter' - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - - $ref: '#/components/schemas/ChatSearchModelsServerTool' + - $ref: '#/components/schemas/SearchModelsServerTool_OpenRouter' - $ref: '#/components/schemas/WebFetchServerTool' - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter' - $ref: '#/components/schemas/ApplyPatchServerTool_OpenRouter' @@ -19940,6 +20546,22 @@ components: example: medium type: string x-speakeasy-unknown-values: allow + SearchModelsServerTool_OpenRouter: + description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter' + example: + parameters: + max_results: 5 + type: openrouter:experimental__search_models + properties: + parameters: + $ref: '#/components/schemas/SearchModelsServerToolConfig' + type: + enum: + - openrouter:experimental__search_models + type: string + required: + - type + type: object SearchModelsServerToolConfig: description: Configuration for the openrouter:experimental__search_models server tool example: @@ -19960,6 +20582,29 @@ components: example: medium type: string x-speakeasy-unknown-values: allow + ServerToolUseDetails: + description: Usage for server-side tool execution (e.g., web search) + example: + tool_calls_executed: 2 + tool_calls_requested: 2 + web_search_requests: 2 + nullable: true + properties: + tool_calls_executed: + description: Number of OpenRouter server tool calls that executed and produced a result. + nullable: true + type: integer + tool_calls_requested: + description: >- + Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. + nullable: true + type: integer + web_search_requests: + description: >- + Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. + nullable: true + type: integer + type: object ServiceTier: enum: - auto @@ -20187,10 +20832,10 @@ components: description: Text-to-speech request input example: input: Hello world - model: elevenlabs/eleven-turbo-v2 + model: mistralai/voxtral-mini-tts-2603 response_format: pcm speed: 1 - voice: alloy + voice: en_paul_neutral properties: input: description: Text to synthesize @@ -20198,7 +20843,7 @@ components: type: string model: description: TTS model identifier - example: elevenlabs/eleven-turbo-v2 + example: mistralai/voxtral-mini-tts-2603 type: string provider: description: Provider-specific passthrough configuration @@ -20223,7 +20868,7 @@ components: type: number voice: description: Voice identifier (provider-specific). - example: alloy + example: en_paul_neutral type: string required: - model @@ -20678,11 +21323,28 @@ components: options: $ref: '#/components/schemas/ProviderOptions' type: object + response_format: + description: >- + Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + enum: + - json + - verbose_json + example: json + type: string + x-speakeasy-unknown-values: allow temperature: description: Sampling temperature for transcription example: 0 format: double type: number + timestamp_granularities: + description: >- + Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". + example: + - segment + items: + $ref: '#/components/schemas/STTTimestampGranularity' + type: array required: - model - input_audio @@ -20698,6 +21360,24 @@ components: seconds: 9.2 total_tokens: 113 properties: + duration: + description: Duration of the input audio in seconds, present when response_format is verbose_json + example: 9.2 + format: double + type: number + language: + description: Detected or forced language, present when response_format is verbose_json + example: english + type: string + segments: + description: Timestamped transcript segments, present when response_format is verbose_json + items: + $ref: '#/components/schemas/STTSegment' + type: array + task: + description: The task performed, present when response_format is verbose_json + example: transcribe + type: string text: description: The transcribed text example: >- @@ -20705,9 +21385,88 @@ components: type: string usage: $ref: '#/components/schemas/STTUsage' + words: + description: Timestamped words, present when the provider returns word-level timestamps + items: + $ref: '#/components/schemas/STTWord' + type: array required: - text type: object + STTSegment: + description: A timestamped transcript segment, returned when response_format is verbose_json + example: + avg_logprob: -0.28 + compression_ratio: 1.13 + end: 3.2 + id: 0 + no_speech_prob: 0.01 + seek: 0 + start: 0 + temperature: 0 + text: Hello there. + tokens: + - 50364 + - 2425 + - 456 + properties: + avg_logprob: + description: Average log probability of the segment + format: double + type: number + compression_ratio: + description: Compression ratio of the segment + format: double + type: number + end: + description: Segment end time in seconds + example: 3.2 + format: double + type: number + id: + description: Segment index within the transcript + example: 0 + type: integer + no_speech_prob: + description: Probability the segment contains no speech + format: double + type: number + seek: + description: Seek offset of the segment + example: 0 + type: integer + start: + description: Segment start time in seconds + example: 0 + format: double + type: number + temperature: + description: Temperature used for the segment + format: double + type: number + text: + description: Transcribed text of the segment + example: Hello there. + type: string + tokens: + description: Token IDs of the segment + items: + type: integer + type: array + required: + - id + - start + - end + - text + type: object + STTTimestampGranularity: + description: A timestamp detail level for verbose_json transcription responses. + enum: + - word + - segment + example: word + type: string + x-speakeasy-unknown-values: allow STTUsage: description: Aggregated usage statistics for the request example: @@ -20740,6 +21499,32 @@ components: example: 113 type: integer type: object + STTWord: + description: A timestamped word, returned when the provider includes word-level timestamps + example: + end: 0.4 + start: 0 + word: Hello + properties: + end: + description: Word end time in seconds + example: 0.4 + format: double + type: number + start: + description: Word start time in seconds + example: 0 + format: double + type: number + word: + description: The transcribed word + example: Hello + type: string + required: + - word + - start + - end + type: object SubagentNestedTool: additionalProperties: nullable: true @@ -20837,6 +21622,59 @@ components: $ref: '#/components/schemas/SubagentNestedTool' type: array type: object + SubmitGenerationFeedbackRequest: + description: Structured feedback about a specific generation + example: + category: incorrect_response + comment: The model repeated the same paragraph three times. + generation_id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + properties: + category: + description: The category of feedback being reported + enum: + - latency + - incoherence + - incorrect_response + - formatting + - billing + - api_error + - other + example: incorrect_response + type: string + x-speakeasy-unknown-values: allow + comment: + description: An optional free-text comment describing the feedback + example: The model repeated the same paragraph three times. + maxLength: 1000 + type: string + generation_id: + description: The generation to submit feedback on + example: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + minLength: 1 + type: string + required: + - generation_id + - category + type: object + SubmitGenerationFeedbackResponse: + description: Confirmation that the feedback was recorded + example: + data: + success: true + properties: + data: + properties: + success: + const: true + description: Whether the feedback was recorded + example: true + type: boolean + required: + - success + type: object + required: + - data + type: object SupportedParameters: additionalProperties: $ref: '#/components/schemas/CapabilityDescriptor' @@ -21703,7 +22541,7 @@ components: enforce_zdr: deprecated: true description: >- - Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. example: true nullable: true type: boolean @@ -21724,7 +22562,12 @@ components: type: boolean enforce_zdr_other: description: >- - Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. + example: true + nullable: true + type: boolean + enforce_zdr_xai: + description: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. example: true nullable: true type: boolean @@ -21779,6 +22622,7 @@ components: enforce_zdr_google: true enforce_zdr_openai: true enforce_zdr_other: true + enforce_zdr_xai: true id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -21825,7 +22669,7 @@ components: type: boolean filter_rules: allOf: - - $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + - $ref: '#/components/schemas/ObservabilityFilterRulesConfigNullable' - description: Optional structured filter rules. `null` clears the rules. Omitting keeps the current value. name: description: Human-readable name for the destination. @@ -22046,6 +22890,8 @@ components: is_byok: description: Whether a request was made using a Bring Your Own Key configuration type: boolean + server_tool_use_details: + $ref: '#/components/schemas/ServerToolUseDetails' type: object description: Token usage information for the response example: @@ -23366,6 +24212,78 @@ paths: start: '2025-01-01T00:00:00Z' schema: properties: + classifier_dimensions: + description: >- + Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. + properties: + classifier_id: + description: UUID of the classifier whose tags to group by. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + dimension_names: + items: + description: >- + Classifier dimension name (snake_case identifier). When exactly one name is provided, the response uses it as the column key; with multiple names or none, the response uses `clf_dimension_name`/`clf_dimension_value` columns. + example: department + type: string + maxItems: 10 + type: array + include_nulls: + description: >- + When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations. + type: boolean + required: + - classifier_id + type: object + classifier_filters: + description: >- + Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. + properties: + classifier_id: + description: >- + UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + filters: + items: + properties: + field: + description: >- + Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type"). + example: department + type: string + operator: + description: >- + Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings. + example: eq + type: string + value: + anyOf: + - type: string + - format: double + type: number + - items: + anyOf: + - type: string + - format: double + type: number + type: array + description: Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in. + example: Engineering + required: + - field + - operator + - value + type: object + maxItems: 10 + minItems: 1 + type: array + required: + - classifier_id + - filters + type: object dimensions: items: description: Dimension to group by (up to 2). Use the /meta endpoint for available dimensions. @@ -23576,10 +24494,10 @@ paths: application/json: example: input: Hello world - model: elevenlabs/eleven-turbo-v2 + model: mistralai/voxtral-mini-tts-2603 response_format: pcm speed: 1 - voice: alloy + voice: en_paul_neutral schema: $ref: '#/components/schemas/SpeechRequest' required: true @@ -23705,7 +24623,8 @@ paths: - $ref: "#/components/parameters/AppCategories" /audio/transcriptions: post: - description: Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. + description: >- + Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text. operationId: createAudioTranscriptions requestBody: content: @@ -23718,6 +24637,49 @@ paths: model: openai/whisper-large-v3 schema: $ref: '#/components/schemas/STTRequest' + multipart/form-data: + example: + file: audio.wav + language: en + model: openai/whisper-large-v3 + schema: + properties: + file: + description: >- + The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. + format: binary + type: string + language: + description: The language of the input audio (ISO-639-1). + type: string + model: + description: The model to use for transcription. + type: string + response_format: + description: >- + The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). + enum: + - json + - verbose_json + type: string + x-speakeasy-unknown-values: allow + temperature: + description: The sampling temperature. + type: number + timestamp_granularities[]: + description: >- + Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. + items: + enum: + - word + - segment + type: string + x-speakeasy-unknown-values: allow + type: array + required: + - file + - model + type: object required: true responses: '200': @@ -24280,6 +25242,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -24290,6 +25253,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -24336,6 +25300,7 @@ paths: - crusoe - darkbloom - decart + - deepgram - deepinfra - deepseek - dekallm @@ -24359,6 +25324,7 @@ paths: - liquid - mancer - mara + - meta - minimax - mistral - modelrun @@ -24382,7 +25348,8 @@ paths: - recraft - reka - relace - - sakana-ai + - sail-research + - sakana - sambanova - seed - siliconflow @@ -25467,6 +26434,13 @@ paths: reserved permaslug `other` and is always returned last within its date, so callers can compute `top-50 traffic / total daily traffic` without a second request. + Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time + grain. `modality` and `context_bucket` narrow the exact dataset by output/input + modality (or tool-calling activity) and request context length. `category` and + `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are + weekly-grain estimates — they cannot be combined with each other or with the exact + filters, and reject `period=day` with a 400. + Authenticate with any valid OpenRouter API key (same key used for inference). Rate-limited to 30 requests/minute per key and 500 requests/day per account. @@ -25501,6 +26475,93 @@ paths: example: '2026-05-11' pattern: ^\d{4}-\d{2}-\d{2}$ type: string + - description: >- + Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + in: query + name: period + required: false + schema: + description: >- + Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + enum: + - day + - week + - month + example: day + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + in: query + name: modality + required: false + schema: + description: >- + Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + enum: + - text + - image + - image_output + - audio + - tool_calling + example: text + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + in: query + name: context_bucket + required: false + schema: + description: >- + Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + enum: + - 1K + - 10K + - 100K + - 1M + - 10M + example: 100K + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + in: query + name: category + required: false + schema: + description: >- + Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + example: programming + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + in: query + name: language_type + required: false + schema: + description: >- + Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + enum: + - natural + - programming + example: natural + type: string + x-speakeasy-unknown-values: allow responses: '200': content: @@ -25763,27 +26824,7 @@ paths: format: double type: number cost_details: - description: Breakdown of upstream inference costs - example: - upstream_inference_completions_cost: 0.0004 - upstream_inference_cost: null - upstream_inference_prompt_cost: 0.0008 - nullable: true - properties: - upstream_inference_completions_cost: - format: double - type: number - upstream_inference_cost: - format: double - nullable: true - type: number - upstream_inference_prompt_cost: - format: double - type: number - required: - - upstream_inference_prompt_cost - - upstream_inference_completions_cost - type: object + $ref: '#/components/schemas/CostDetails' is_byok: description: Whether a request was made using a Bring Your Own Key configuration type: boolean @@ -25945,6 +26986,32 @@ paths: get: description: Returns a list of all available embeddings models and their properties operationId: listEmbeddingsModels + parameters: + - description: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + in: query + name: offset + required: false + schema: + default: 0 + description: >- + Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + example: 0 + minimum: 0 + nullable: false + type: integer + - description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned + in: query + name: limit + required: false + schema: + default: 500 + description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned + example: 500 + maximum: 1000 + minimum: 1 + type: integer responses: '200': content: @@ -26009,6 +27076,17 @@ paths: tags: - Embeddings x-speakeasy-name-override: listModels + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" @@ -26840,6 +27918,89 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /generation/feedback: + post: + description: >- + Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: submitGenerationFeedback + requestBody: + content: + application/json: + example: + category: incorrect_response + comment: The model repeated the same paragraph three times. + generation_id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + schema: + $ref: '#/components/schemas/SubmitGenerationFeedbackRequest' + required: true + responses: + '200': + content: + application/json: + example: + data: + success: true + schema: + $ref: '#/components/schemas/SubmitGenerationFeedbackResponse' + description: Feedback recorded successfully + '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 + '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: Submit feedback for a generation + tags: + - Generations + x-speakeasy-name-override: submitFeedback + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails: get: description: >- @@ -26851,6 +28012,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -26861,6 +28023,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -26954,6 +28117,7 @@ paths: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false ignored_models: null ignored_providers: null limit_usd: 50 @@ -26980,6 +28144,7 @@ paths: enforce_zdr_google: false enforce_zdr_openai: true enforce_zdr_other: false + enforce_zdr_xai: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -27209,6 +28374,7 @@ paths: enforce_zdr_google: true enforce_zdr_openai: true enforce_zdr_other: true + enforce_zdr_xai: true id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -27288,6 +28454,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27298,6 +28465,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -27546,6 +28714,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27556,6 +28725,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -27796,6 +28966,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27806,6 +28977,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -27878,6 +29050,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -27888,6 +29061,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -28036,6 +29210,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist + '413': + content: + application/json: + example: + error: + code: 413 + message: Request payload too large + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: Payload Too Large - Request payload exceeds size limits '429': content: application/json: @@ -30031,6 +31215,31 @@ paths: get: operationId: getModels parameters: + - description: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + in: query + name: offset + required: false + schema: + default: 0 + description: >- + Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + example: 0 + minimum: 0 + nullable: false + type: integer + - description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned + in: query + name: limit + required: false + schema: + default: 500 + description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned + example: 500 + maximum: 1000 + minimum: 1 + type: integer - description: Filter models by use case category in: query name: category @@ -30072,13 +31281,13 @@ paths: example: text type: string - description: >- - Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. + Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. in: query name: sort required: false schema: description: >- - Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. + Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. enum: - most-popular - newest @@ -30089,6 +31298,8 @@ paths: - throughput-high-to-low - latency-low-to-high - intelligence-high-to-low + - coding-high-to-low + - agentic-high-to-low - design-arena-elo-high-to-low example: newest type: string @@ -30116,8 +31327,7 @@ paths: schema: description: Minimum context length (tokens). Models with smaller context are excluded. example: 128000 - exclusiveMinimum: true - minimum: 0 + minimum: 1 type: integer - description: Minimum prompt price in $/M tokens. in: query @@ -30195,6 +31405,130 @@ paths: - eu example: eu type: string + - description: Minimum completion (output) price in $/M tokens. + in: query + name: min_output_price + required: false + schema: + description: Minimum completion (output) price in $/M tokens. + example: 0 + minimum: 0 + nullable: true + type: number + - description: Maximum completion (output) price in $/M tokens. + in: query + name: max_output_price + required: false + schema: + description: Maximum completion (output) price in $/M tokens. + example: 10 + minimum: 0 + nullable: true + type: number + - description: Minimum model age in days since its creation date. + in: query + name: min_age_days + required: false + schema: + description: Minimum model age in days since its creation date. + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum model age in days since its creation date. + in: query + name: max_age_days + required: false + schema: + description: Maximum model age in days since its creation date. + example: 90 + minimum: 0 + nullable: true + type: integer + - description: Minimum Artificial Analysis intelligence index. + in: query + name: min_intelligence_index + required: false + schema: + description: Minimum Artificial Analysis intelligence index. + example: 50 + minimum: 0 + nullable: true + type: number + - description: Maximum Artificial Analysis intelligence index. + in: query + name: max_intelligence_index + required: false + schema: + description: Maximum Artificial Analysis intelligence index. + example: 100 + minimum: 0 + nullable: true + type: number + - description: Minimum Artificial Analysis coding index. + in: query + name: min_coding_index + required: false + schema: + description: Minimum Artificial Analysis coding index. + example: 50 + minimum: 0 + nullable: true + type: number + - description: Maximum Artificial Analysis coding index. + in: query + name: max_coding_index + required: false + schema: + description: Maximum Artificial Analysis coding index. + example: 100 + minimum: 0 + nullable: true + type: number + - description: Minimum Artificial Analysis agentic index. + in: query + name: min_agentic_index + required: false + schema: + description: Minimum Artificial Analysis agentic index. + example: 50 + minimum: 0 + nullable: true + type: number + - description: Maximum Artificial Analysis agentic index. + in: query + name: max_agentic_index + required: false + schema: + description: Maximum Artificial Analysis agentic index. + example: 100 + minimum: 0 + nullable: true + type: number + - description: >- + Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason). + in: query + name: min_tool_success_rate + required: false + schema: + description: >- + Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason). + example: 0.9 + maximum: 1 + minimum: 0 + nullable: true + type: number + - description: Maximum tool-calling success rate, as a fraction in [0, 1]. + in: query + name: max_tool_success_rate + required: false + schema: + description: Maximum tool-calling success rate, as a fraction in [0, 1]. + example: 1 + maximum: 1 + minimum: 0 + nullable: true + type: number responses: '200': content: @@ -30262,6 +31596,17 @@ paths: tags: - Models x-speakeasy-name-override: list + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" @@ -30446,6 +31791,32 @@ paths: description: >- List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing). operationId: listModelsUser + parameters: + - description: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + in: query + name: offset + required: false + schema: + default: 0 + description: >- + Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + example: 0 + minimum: 0 + nullable: false + type: integer + - description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned + in: query + name: limit + required: false + schema: + default: 500 + description: >- + Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned + example: 500 + maximum: 1000 + minimum: 1 + type: integer responses: '200': content: @@ -30469,7 +31840,7 @@ paths: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -30525,6 +31896,17 @@ paths: tags: - Models x-speakeasy-name-override: listForUser + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" @@ -30540,6 +31922,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -30550,6 +31933,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -30969,6 +32353,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -30979,6 +32364,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -31104,6 +32490,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -31114,6 +32501,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -31686,6 +33074,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -31696,6 +33085,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -33327,6 +34717,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -33337,6 +34728,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -33990,6 +35382,7 @@ paths: name: offset required: false schema: + default: 0 description: Number of records to skip for pagination example: 0 minimum: 0 @@ -34000,6 +35393,7 @@ paths: name: limit required: false schema: + default: 50 description: Maximum number of records to return (max 100) example: 50 maximum: 100 @@ -34180,7 +35574,7 @@ paths: /workspaces/{id}/members/remove: post: description: >- - Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. operationId: bulkRemoveWorkspaceMembers parameters: - description: The workspace ID (UUID) or slug diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2b0692f..23755dd 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:5381277309ba2f3a4a3e0719b00425be3f93c3103717316e6625bd5caf15b277 - sourceBlobDigest: sha256:def8d29511aca594e11c3367b7013a64c8733cc8050e23deae98d9cc5df55c93 + sourceRevisionDigest: sha256:1b18bfafe3a31635470908ce53c1bb12af21a82d371f6f979bb5e8463f52afb3 + sourceBlobDigest: sha256:506597a9fce25fe757037a95da952e36f33dd702afa16c13d43c2df2d5da1ece tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:5381277309ba2f3a4a3e0719b00425be3f93c3103717316e6625bd5caf15b277 - sourceBlobDigest: sha256:def8d29511aca594e11c3367b7013a64c8733cc8050e23deae98d9cc5df55c93 + sourceRevisionDigest: sha256:1b18bfafe3a31635470908ce53c1bb12af21a82d371f6f979bb5e8463f52afb3 + sourceBlobDigest: sha256:506597a9fce25fe757037a95da952e36f33dd702afa16c13d43c2df2d5da1ece codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:18d6fc594c9338480cbc65842c3f276ad0a58f2ceda311aff3d70ea33dbd6e6d + codeSamplesRevisionDigest: sha256:7ae639df01271894474a52b709810943afd11f8d9acde069336e9a1f8588ec56 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/README-PYPI.md b/README-PYPI.md index 9fdbe27..633da1b 100644 --- a/README-PYPI.md +++ b/README-PYPI.md @@ -189,7 +189,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.byok.list() + res = open_router.byok.list(offset=0, limit=50) while res is not None: # Handle items @@ -221,10 +221,10 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.files.upload(file={ + res = open_router.stt.create_transcription_multipart(file={ "file_name": "example.file", "content": open("example.file", "rb"), - }) + }, model="openai/whisper-large-v3", language="en") # Handle response print(res) diff --git a/README.md b/README.md index 9fdbe27..633da1b 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.byok.list() + res = open_router.byok.list(offset=0, limit=50) while res is not None: # Handle items @@ -221,10 +221,10 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.files.upload(file={ + res = open_router.stt.create_transcription_multipart(file={ "file_name": "example.file", "content": open("example.file", "rb"), - }) + }, model="openai/whisper-large-v3", language="en") # Handle response print(res) diff --git a/RELEASES.md b/RELEASES.md index cb58658..d0b72cb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -138,4 +138,304 @@ Based on: ### Generated - [python v0.11.3] . ### Releases -- [PyPI v0.11.3] https://pypi.org/project/openrouter/0.11.3 - . \ No newline at end of file +- [PyPI v0.11.3] https://pypi.org/project/openrouter/0.11.3 - . + +## 2026-07-07 14:30:37 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.4] . +### Releases +- [PyPI v0.11.4] https://pypi.org/project/openrouter/0.11.4 - . + +## 2026-07-07 17:24:44 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.5] . +### Releases +- [PyPI v0.11.5] https://pypi.org/project/openrouter/0.11.5 - . + +## 2026-07-07 19:09:09 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.6] . +### Releases +- [PyPI v0.11.6] https://pypi.org/project/openrouter/0.11.6 - . + +## 2026-07-07 21:46:35 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.7] . +### Releases +- [PyPI v0.11.7] https://pypi.org/project/openrouter/0.11.7 - . + +## 2026-07-08 03:29:04 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.8] . +### Releases +- [PyPI v0.11.8] https://pypi.org/project/openrouter/0.11.8 - . + +## 2026-07-08 07:00:39 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.9] . +### Releases +- [PyPI v0.11.9] https://pypi.org/project/openrouter/0.11.9 - . + +## 2026-07-08 09:31:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.10] . +### Releases +- [PyPI v0.11.10] https://pypi.org/project/openrouter/0.11.10 - . + +## 2026-07-08 19:07:22 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.11] . +### Releases +- [PyPI v0.11.11] https://pypi.org/project/openrouter/0.11.11 - . + +## 2026-07-09 10:13:53 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.12] . +### Releases +- [PyPI v0.11.12] https://pypi.org/project/openrouter/0.11.12 - . + +## 2026-07-09 17:12:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.13] . +### Releases +- [PyPI v0.11.13] https://pypi.org/project/openrouter/0.11.13 - . + +## 2026-07-09 17:28:34 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.14] . +### Releases +- [PyPI v0.11.14] https://pypi.org/project/openrouter/0.11.14 - . + +## 2026-07-09 18:16:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.15] . +### Releases +- [PyPI v0.11.15] https://pypi.org/project/openrouter/0.11.15 - . + +## 2026-07-09 19:48:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.16] . +### Releases +- [PyPI v0.11.16] https://pypi.org/project/openrouter/0.11.16 - . + +## 2026-07-09 21:34:56 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.17] . +### Releases +- [PyPI v0.11.17] https://pypi.org/project/openrouter/0.11.17 - . + +## 2026-07-10 01:18:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.18] . +### Releases +- [PyPI v0.11.18] https://pypi.org/project/openrouter/0.11.18 - . + +## 2026-07-10 15:41:48 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.19] . +### Releases +- [PyPI v0.11.19] https://pypi.org/project/openrouter/0.11.19 - . + +## 2026-07-10 20:14:59 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.20] . +### Releases +- [PyPI v0.11.20] https://pypi.org/project/openrouter/0.11.20 - . + +## 2026-07-10 23:01:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.21] . +### Releases +- [PyPI v0.11.21] https://pypi.org/project/openrouter/0.11.21 - . + +## 2026-07-11 03:19:26 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.22] . +### Releases +- [PyPI v0.11.22] https://pypi.org/project/openrouter/0.11.22 - . + +## 2026-07-12 16:36:57 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.23] . +### Releases +- [PyPI v0.11.23] https://pypi.org/project/openrouter/0.11.23 - . + +## 2026-07-13 17:54:57 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.24] . +### Releases +- [PyPI v0.11.24] https://pypi.org/project/openrouter/0.11.24 - . + +## 2026-07-13 19:18:28 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.25] . +### Releases +- [PyPI v0.11.25] https://pypi.org/project/openrouter/0.11.25 - . + +## 2026-07-13 19:27:34 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.26] . +### Releases +- [PyPI v0.11.26] https://pypi.org/project/openrouter/0.11.26 - . + +## 2026-07-13 20:42:45 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.27] . +### Releases +- [PyPI v0.11.27] https://pypi.org/project/openrouter/0.11.27 - . + +## 2026-07-14 05:35:17 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.28] . +### Releases +- [PyPI v0.11.28] https://pypi.org/project/openrouter/0.11.28 - . + +## 2026-07-14 14:49:30 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.29] . +### Releases +- [PyPI v0.11.29] https://pypi.org/project/openrouter/0.11.29 - . + +## 2026-07-14 17:49:24 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.30] . +### Releases +- [PyPI v0.11.30] https://pypi.org/project/openrouter/0.11.30 - . + +## 2026-07-14 21:03:59 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.31] . +### Releases +- [PyPI v0.11.31] https://pypi.org/project/openrouter/0.11.31 - . + +## 2026-07-14 21:26:36 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.32] . +### Releases +- [PyPI v0.11.32] https://pypi.org/project/openrouter/0.11.32 - . + +## 2026-07-14 22:07:41 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.33] . +### Releases +- [PyPI v0.11.33] https://pypi.org/project/openrouter/0.11.33 - . \ No newline at end of file diff --git a/docs/components/additionaltoolsitem.mdx b/docs/components/additionaltoolsitem.mdx new file mode 100644 index 0000000..34d2291 --- /dev/null +++ b/docs/components/additionaltoolsitem.mdx @@ -0,0 +1,15 @@ +--- +title: "AdditionalToolsItem" +--- + +Additional tools made available to the model at this point in the input + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `role` | [components.AdditionalToolsItemRole](../components/additionaltoolsitemrole.mdx) | :heavy_check_mark: | N/A | +| `tools` | List[[components.AdditionalToolsItemToolUnion](../components/additionaltoolsitemtoolunion.mdx)] | :heavy_check_mark: | N/A | +| `type` | [components.TypeAdditionalTools](../components/typeadditionaltools.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/additionaltoolsitemrole.mdx b/docs/components/additionaltoolsitemrole.mdx new file mode 100644 index 0000000..2e7f805 --- /dev/null +++ b/docs/components/additionaltoolsitemrole.mdx @@ -0,0 +1,26 @@ +--- +title: "AdditionalToolsItemRole" +--- + +## Example Usage + +```python +from openrouter.components import AdditionalToolsItemRole + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AdditionalToolsItemRole = "unknown" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"unknown"` +- `"user"` +- `"assistant"` +- `"system"` +- `"critic"` +- `"discriminator"` +- `"developer"` +- `"tool"` diff --git a/docs/components/additionaltoolsitemtool.mdx b/docs/components/additionaltoolsitemtool.mdx new file mode 100644 index 0000000..9dcea23 --- /dev/null +++ b/docs/components/additionaltoolsitemtool.mdx @@ -0,0 +1,10 @@ +--- +title: "AdditionalToolsItemTool" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `type` | *str* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/additionaltoolsitemtoolfunction.mdx b/docs/components/additionaltoolsitemtoolfunction.mdx new file mode 100644 index 0000000..d787143 --- /dev/null +++ b/docs/components/additionaltoolsitemtoolfunction.mdx @@ -0,0 +1,16 @@ +--- +title: "AdditionalToolsItemToolFunction" +--- + +Function tool definition + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `parameters` | Dict[str, *Nullable[Any]*] | :heavy_check_mark: | N/A | +| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `type` | [components.AdditionalToolsItemTypeFunction](../components/additionaltoolsitemtypefunction.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/additionaltoolsitemtoolunion.mdx b/docs/components/additionaltoolsitemtoolunion.mdx new file mode 100644 index 0000000..31c6852 --- /dev/null +++ b/docs/components/additionaltoolsitemtoolunion.mdx @@ -0,0 +1,168 @@ +--- +title: "AdditionalToolsItemToolUnion" +--- + +## Supported Types + +### `components.AdditionalToolsItemToolFunction` + +```python +value: components.AdditionalToolsItemToolFunction = /* values here */ +``` + +### `components.PreviewWebSearchServerTool` + +```python +value: components.PreviewWebSearchServerTool = /* values here */ +``` + +### `components.Preview20250311WebSearchServerTool` + +```python +value: components.Preview20250311WebSearchServerTool = /* values here */ +``` + +### `components.LegacyWebSearchServerTool` + +```python +value: components.LegacyWebSearchServerTool = /* values here */ +``` + +### `components.WebSearchServerTool` + +```python +value: components.WebSearchServerTool = /* values here */ +``` + +### `components.FileSearchServerTool` + +```python +value: components.FileSearchServerTool = /* values here */ +``` + +### `components.ComputerUseServerTool` + +```python +value: components.ComputerUseServerTool = /* values here */ +``` + +### `components.CodeInterpreterServerTool` + +```python +value: components.CodeInterpreterServerTool = /* values here */ +``` + +### `components.McpServerTool` + +```python +value: components.McpServerTool = /* values here */ +``` + +### `components.ImageGenerationServerTool` + +```python +value: components.ImageGenerationServerTool = /* values here */ +``` + +### `components.CodexLocalShellTool` + +```python +value: components.CodexLocalShellTool = /* values here */ +``` + +### `components.ShellServerTool` + +```python +value: components.ShellServerTool = /* values here */ +``` + +### `components.ApplyPatchServerTool` + +```python +value: components.ApplyPatchServerTool = /* values here */ +``` + +### `components.CustomTool` + +```python +value: components.CustomTool = /* values here */ +``` + +### `components.AdvisorServerToolOpenRouter` + +```python +value: components.AdvisorServerToolOpenRouter = /* values here */ +``` + +### `components.SubagentServerToolOpenRouter` + +```python +value: components.SubagentServerToolOpenRouter = /* values here */ +``` + +### `components.DatetimeServerTool` + +```python +value: components.DatetimeServerTool = /* values here */ +``` + +### `components.FilesServerTool` + +```python +value: components.FilesServerTool = /* values here */ +``` + +### `components.FusionServerToolOpenRouter` + +```python +value: components.FusionServerToolOpenRouter = /* values here */ +``` + +### `components.ImageGenerationServerToolOpenRouter` + +```python +value: components.ImageGenerationServerToolOpenRouter = /* values here */ +``` + +### `components.SearchModelsServerToolOpenRouter` + +```python +value: components.SearchModelsServerToolOpenRouter = /* values here */ +``` + +### `components.WebFetchServerTool` + +```python +value: components.WebFetchServerTool = /* values here */ +``` + +### `components.WebSearchServerToolOpenRouter` + +```python +value: components.WebSearchServerToolOpenRouter = /* values here */ +``` + +### `components.ApplyPatchServerToolOpenRouter` + +```python +value: components.ApplyPatchServerToolOpenRouter = /* values here */ +``` + +### `components.BashServerTool` + +```python +value: components.BashServerTool = /* values here */ +``` + +### `components.ShellServerToolOpenRouter` + +```python +value: components.ShellServerToolOpenRouter = /* values here */ +``` + +### `components.AdditionalToolsItemTool` + +```python +value: components.AdditionalToolsItemTool = /* values here */ +``` + diff --git a/docs/components/additionaltoolsitemtypefunction.mdx b/docs/components/additionaltoolsitemtypefunction.mdx new file mode 100644 index 0000000..00ce08a --- /dev/null +++ b/docs/components/additionaltoolsitemtypefunction.mdx @@ -0,0 +1,15 @@ +--- +title: "AdditionalToolsItemTypeFunction" +--- + +## Example Usage + +```python +from openrouter.components import AdditionalToolsItemTypeFunction +value: AdditionalToolsItemTypeFunction = "function" +``` + + +## Values + +- `"function"` diff --git a/docs/components/agent.mdx b/docs/components/agent.mdx new file mode 100644 index 0000000..d030046 --- /dev/null +++ b/docs/components/agent.mdx @@ -0,0 +1,10 @@ +--- +title: "Agent" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `agent_name` | *str* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/agentmessageitem.mdx b/docs/components/agentmessageitem.mdx new file mode 100644 index 0000000..f50b6f3 --- /dev/null +++ b/docs/components/agentmessageitem.mdx @@ -0,0 +1,18 @@ +--- +title: "AgentMessageItem" +--- + +A message routed between agents in a multi-agent session + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `agent` | [OptionalNullable[components.Agent]](../components/agent.mdx) | :heavy_minus_sign: | N/A | | +| `author` | *str* | :heavy_check_mark: | N/A | | +| `content` | List[[components.AgentMessageItemContentUnion](../components/agentmessageitemcontentunion.mdx)] | :heavy_check_mark: | N/A | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `recipient` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.TypeAgentMessage](../components/typeagentmessage.mdx) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \{
"author": "/root/worker",
"content": [
\{
"text": "Task complete.",
"type": "input_text"
}
],
"recipient": "/root",
"type": "agent_message"
} | \ No newline at end of file diff --git a/docs/components/agentmessageitemcontentinputimage.mdx b/docs/components/agentmessageitemcontentinputimage.mdx new file mode 100644 index 0000000..67e9a24 --- /dev/null +++ b/docs/components/agentmessageitemcontentinputimage.mdx @@ -0,0 +1,14 @@ +--- +title: "AgentMessageItemContentInputImage" +--- + +Image input content item + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `detail` | [components.AgentMessageItemDetail](../components/agentmessageitemdetail.mdx) | :heavy_check_mark: | N/A | +| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `type` | [components.AgentMessageItemTypeInputImage](../components/agentmessageitemtypeinputimage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/agentmessageitemcontentunion.mdx b/docs/components/agentmessageitemcontentunion.mdx new file mode 100644 index 0000000..0ffa1e9 --- /dev/null +++ b/docs/components/agentmessageitemcontentunion.mdx @@ -0,0 +1,24 @@ +--- +title: "AgentMessageItemContentUnion" +--- + +## Supported Types + +### `components.InputText` + +```python +value: components.InputText = /* values here */ +``` + +### `components.AgentMessageItemContentInputImage` + +```python +value: components.AgentMessageItemContentInputImage = /* values here */ +``` + +### `components.ContentEncryptedContent` + +```python +value: components.ContentEncryptedContent = /* values here */ +``` + diff --git a/docs/components/size.mdx b/docs/components/agentmessageitemdetail.mdx similarity index 55% rename from docs/components/size.mdx rename to docs/components/agentmessageitemdetail.mdx index 707abe9..1e49ee6 100644 --- a/docs/components/size.mdx +++ b/docs/components/agentmessageitemdetail.mdx @@ -1,14 +1,14 @@ --- -title: "Size" +title: "AgentMessageItemDetail" --- ## Example Usage ```python -from openrouter.components import Size +from openrouter.components import AgentMessageItemDetail # Open enum: unrecognized values are captured as UnrecognizedStr -value: Size = "1024x1024" +value: AgentMessageItemDetail = "auto" ``` @@ -16,7 +16,7 @@ value: Size = "1024x1024" This is an open enum. Unrecognized values will not fail type checks. -- `"1024x1024"` -- `"1024x1536"` -- `"1536x1024"` - `"auto"` +- `"high"` +- `"low"` +- `"original"` diff --git a/docs/components/agentmessageitemtypeinputimage.mdx b/docs/components/agentmessageitemtypeinputimage.mdx new file mode 100644 index 0000000..4acb9c2 --- /dev/null +++ b/docs/components/agentmessageitemtypeinputimage.mdx @@ -0,0 +1,15 @@ +--- +title: "AgentMessageItemTypeInputImage" +--- + +## Example Usage + +```python +from openrouter.components import AgentMessageItemTypeInputImage +value: AgentMessageItemTypeInputImage = "input_image" +``` + + +## Values + +- `"input_image"` diff --git a/docs/components/anthropiccachecontroldirective.mdx b/docs/components/anthropiccachecontroldirective.mdx index 5f75598..12b753f 100644 --- a/docs/components/anthropiccachecontroldirective.mdx +++ b/docs/components/anthropiccachecontroldirective.mdx @@ -2,7 +2,7 @@ title: "AnthropicCacheControlDirective" --- -Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. +Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. ## Fields diff --git a/docs/components/anthropiccachecreation.mdx b/docs/components/anthropiccachecreation.mdx new file mode 100644 index 0000000..c9562a6 --- /dev/null +++ b/docs/components/anthropiccachecreation.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicCacheCreation" +--- + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `ephemeral_1h_input_tokens` | *int* | :heavy_check_mark: | N/A | +| `ephemeral_5m_input_tokens` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationsearchresultlocation.mdx b/docs/components/anthropiccitationsearchresultlocation.mdx deleted file mode 100644 index 4766fca..0000000 --- a/docs/components/anthropiccitationsearchresultlocation.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "AnthropicCitationSearchResultLocation" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `cited_text` | *str* | :heavy_check_mark: | N/A | -| `end_block_index` | *int* | :heavy_check_mark: | N/A | -| `search_result_index` | *int* | :heavy_check_mark: | N/A | -| `source` | *str* | :heavy_check_mark: | N/A | -| `start_block_index` | *int* | :heavy_check_mark: | N/A | -| `title` | *Nullable[str]* | :heavy_check_mark: | N/A | -| `type` | [components.AnthropicCitationSearchResultLocationType](../components/anthropiccitationsearchresultlocationtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationsearchresultlocationparam.mdx b/docs/components/anthropiccitationsearchresultlocationparam.mdx new file mode 100644 index 0000000..8d0c9d2 --- /dev/null +++ b/docs/components/anthropiccitationsearchresultlocationparam.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationSearchResultLocationParam" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `cited_text` | *str* | :heavy_check_mark: | N/A | +| `end_block_index` | *int* | :heavy_check_mark: | N/A | +| `search_result_index` | *int* | :heavy_check_mark: | N/A | +| `source` | *str* | :heavy_check_mark: | N/A | +| `start_block_index` | *int* | :heavy_check_mark: | N/A | +| `title` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCitationSearchResultLocationParamType](../components/anthropiccitationsearchresultlocationparamtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationsearchresultlocationparamtype.mdx b/docs/components/anthropiccitationsearchresultlocationparamtype.mdx new file mode 100644 index 0000000..36ba3e4 --- /dev/null +++ b/docs/components/anthropiccitationsearchresultlocationparamtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationSearchResultLocationParamType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCitationSearchResultLocationParamType +value: AnthropicCitationSearchResultLocationParamType = "search_result_location" +``` + + +## Values + +- `"search_result_location"` diff --git a/docs/components/anthropiccitationsearchresultlocationtype.mdx b/docs/components/anthropiccitationsearchresultlocationtype.mdx deleted file mode 100644 index 096cc0d..0000000 --- a/docs/components/anthropiccitationsearchresultlocationtype.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "AnthropicCitationSearchResultLocationType" ---- - -## Example Usage - -```python -from openrouter.components import AnthropicCitationSearchResultLocationType -value: AnthropicCitationSearchResultLocationType = "search_result_location" -``` - - -## Values - -- `"search_result_location"` diff --git a/docs/components/anthropiccitationwebsearchresultlocation.mdx b/docs/components/anthropiccitationwebsearchresultlocation.mdx deleted file mode 100644 index b03268f..0000000 --- a/docs/components/anthropiccitationwebsearchresultlocation.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "AnthropicCitationWebSearchResultLocation" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `cited_text` | *str* | :heavy_check_mark: | N/A | -| `encrypted_index` | *str* | :heavy_check_mark: | N/A | -| `title` | *Nullable[str]* | :heavy_check_mark: | N/A | -| `type` | [components.AnthropicCitationWebSearchResultLocationType](../components/anthropiccitationwebsearchresultlocationtype.mdx) | :heavy_check_mark: | N/A | -| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationwebsearchresultlocationparam.mdx b/docs/components/anthropiccitationwebsearchresultlocationparam.mdx new file mode 100644 index 0000000..9b59d45 --- /dev/null +++ b/docs/components/anthropiccitationwebsearchresultlocationparam.mdx @@ -0,0 +1,13 @@ +--- +title: "AnthropicCitationWebSearchResultLocationParam" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `cited_text` | *str* | :heavy_check_mark: | N/A | +| `encrypted_index` | *str* | :heavy_check_mark: | N/A | +| `title` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCitationWebSearchResultLocationParamType](../components/anthropiccitationwebsearchresultlocationparamtype.mdx) | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationwebsearchresultlocationparamtype.mdx b/docs/components/anthropiccitationwebsearchresultlocationparamtype.mdx new file mode 100644 index 0000000..4bc0197 --- /dev/null +++ b/docs/components/anthropiccitationwebsearchresultlocationparamtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationWebSearchResultLocationParamType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCitationWebSearchResultLocationParamType +value: AnthropicCitationWebSearchResultLocationParamType = "web_search_result_location" +``` + + +## Values + +- `"web_search_result_location"` diff --git a/docs/components/anthropiccitationwebsearchresultlocationtype.mdx b/docs/components/anthropiccitationwebsearchresultlocationtype.mdx deleted file mode 100644 index 9cb6d29..0000000 --- a/docs/components/anthropiccitationwebsearchresultlocationtype.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "AnthropicCitationWebSearchResultLocationType" ---- - -## Example Usage - -```python -from openrouter.components import AnthropicCitationWebSearchResultLocationType -value: AnthropicCitationWebSearchResultLocationType = "web_search_result_location" -``` - - -## Values - -- `"web_search_result_location"` diff --git a/docs/components/anthropicdocumentblockparam.mdx b/docs/components/anthropicdocumentblockparam.mdx index 5a24251..1ed7b7c 100644 --- a/docs/components/anthropicdocumentblockparam.mdx +++ b/docs/components/anthropicdocumentblockparam.mdx @@ -4,11 +4,11 @@ title: "AnthropicDocumentBlockParam" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `citations` | [OptionalNullable[components.AnthropicDocumentBlockParamCitations]](../components/anthropicdocumentblockparamcitations.mdx) | :heavy_minus_sign: | N/A | | -| `context` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `source` | [components.AnthropicDocumentBlockParamSourceUnion](../components/anthropicdocumentblockparamsourceunion.mdx) | :heavy_check_mark: | N/A | | -| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `type` | [components.TypeDocument](../components/typedocument.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `citations` | [OptionalNullable[components.AnthropicDocumentBlockParamCitations]](../components/anthropicdocumentblockparamcitations.mdx) | :heavy_minus_sign: | N/A | | +| `context` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `source` | [components.AnthropicDocumentBlockParamSourceUnion](../components/anthropicdocumentblockparamsourceunion.mdx) | :heavy_check_mark: | N/A | | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `type` | [components.TypeDocument](../components/typedocument.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicimageblockparam.mdx b/docs/components/anthropicimageblockparam.mdx index 2d95dd4..9be25ef 100644 --- a/docs/components/anthropicimageblockparam.mdx +++ b/docs/components/anthropicimageblockparam.mdx @@ -4,8 +4,8 @@ title: "AnthropicImageBlockParam" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `source` | [components.AnthropicImageBlockParamSource](../components/anthropicimageblockparamsource.mdx) | :heavy_check_mark: | N/A | | -| `type` | [components.AnthropicImageBlockParamType](../components/anthropicimageblockparamtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `source` | [components.AnthropicImageBlockParamSource](../components/anthropicimageblockparamsource.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicImageBlockParamType](../components/anthropicimageblockparamtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicsearchresultblockparam.mdx b/docs/components/anthropicsearchresultblockparam.mdx index 517785e..89ae1af 100644 --- a/docs/components/anthropicsearchresultblockparam.mdx +++ b/docs/components/anthropicsearchresultblockparam.mdx @@ -4,11 +4,11 @@ title: "AnthropicSearchResultBlockParam" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `citations` | [Optional[components.AnthropicSearchResultBlockParamCitations]](../components/anthropicsearchresultblockparamcitations.mdx) | :heavy_minus_sign: | N/A | | -| `content` | List[[components.AnthropicTextBlockParam](../components/anthropictextblockparam.mdx)] | :heavy_check_mark: | N/A | | -| `source` | *str* | :heavy_check_mark: | N/A | | -| `title` | *str* | :heavy_check_mark: | N/A | | -| `type` | [components.AnthropicSearchResultBlockParamType](../components/anthropicsearchresultblockparamtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `citations` | [Optional[components.AnthropicSearchResultBlockParamCitations]](../components/anthropicsearchresultblockparamcitations.mdx) | :heavy_minus_sign: | N/A | | +| `content` | List[[components.AnthropicTextBlockParam](../components/anthropictextblockparam.mdx)] | :heavy_check_mark: | N/A | | +| `source` | *str* | :heavy_check_mark: | N/A | | +| `title` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicSearchResultBlockParamType](../components/anthropicsearchresultblockparamtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropictextblockparam.mdx b/docs/components/anthropictextblockparam.mdx index 6d00495..502d15e 100644 --- a/docs/components/anthropictextblockparam.mdx +++ b/docs/components/anthropictextblockparam.mdx @@ -4,9 +4,9 @@ title: "AnthropicTextBlockParam" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `citations` | List[[components.Citation](../components/citation.mdx)] | :heavy_minus_sign: | N/A | | -| `text` | *str* | :heavy_check_mark: | N/A | | -| `type` | [components.AnthropicTextBlockParamType](../components/anthropictextblockparamtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `citations` | List[[components.Citation](../components/citation.mdx)] | :heavy_minus_sign: | N/A | | +| `text` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicTextBlockParamType](../components/anthropictextblockparamtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/basereasoningconfig.mdx b/docs/components/basereasoningconfig.mdx index 6282519..6f900a9 100644 --- a/docs/components/basereasoningconfig.mdx +++ b/docs/components/basereasoningconfig.mdx @@ -4,7 +4,9 @@ title: "BaseReasoningConfig" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | -| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `context` | [OptionalNullable[components.ReasoningContext]](../components/reasoningcontext.mdx) | :heavy_minus_sign: | Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. | all_turns | +| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | +| `mode` | [OptionalNullable[components.ReasoningMode]](../components/reasoningmode.mdx) | :heavy_minus_sign: | Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. | standard | +| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | \ No newline at end of file diff --git a/docs/components/byokproviderslug.mdx b/docs/components/byokproviderslug.mdx index 439563d..7f17d7c 100644 --- a/docs/components/byokproviderslug.mdx +++ b/docs/components/byokproviderslug.mdx @@ -43,6 +43,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"crusoe"` - `"darkbloom"` - `"decart"` +- `"deepgram"` - `"deepinfra"` - `"deepseek"` - `"dekallm"` @@ -66,6 +67,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"liquid"` - `"mancer"` - `"mara"` +- `"meta"` - `"minimax"` - `"mistral"` - `"modelrun"` @@ -89,7 +91,8 @@ This is an open enum. Unrecognized values will not fail type checks. - `"recraft"` - `"reka"` - `"relace"` -- `"sakana-ai"` +- `"sail-research"` +- `"sakana"` - `"sambanova"` - `"seed"` - `"siliconflow"` diff --git a/docs/components/caching.mdx b/docs/components/caching.mdx index d9c7199..0d7013f 100644 --- a/docs/components/caching.mdx +++ b/docs/components/caching.mdx @@ -2,7 +2,7 @@ title: "Caching" --- -Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. +Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. ## Fields diff --git a/docs/components/category.mdx b/docs/components/category.mdx new file mode 100644 index 0000000..e67ca2a --- /dev/null +++ b/docs/components/category.mdx @@ -0,0 +1,27 @@ +--- +title: "Category" +--- + +The category of feedback being reported + +## Example Usage + +```python +from openrouter.components import Category + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Category = "latency" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"latency"` +- `"incoherence"` +- `"incorrect_response"` +- `"formatting"` +- `"billing"` +- `"api_error"` +- `"other"` diff --git a/docs/components/chatcontentcachecontrol.mdx b/docs/components/chatcontentcachecontrol.mdx index 250fd47..6f1d2f8 100644 --- a/docs/components/chatcontentcachecontrol.mdx +++ b/docs/components/chatcontentcachecontrol.mdx @@ -2,7 +2,7 @@ title: "ChatContentCacheControl" --- -Cache control for the content part +Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request. ## Fields diff --git a/docs/components/chatcontenttext.mdx b/docs/components/chatcontenttext.mdx index a59dafe..b31006b 100644 --- a/docs/components/chatcontenttext.mdx +++ b/docs/components/chatcontenttext.mdx @@ -7,8 +7,9 @@ Text content part ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.ChatContentCacheControl]](../components/chatcontentcachecontrol.mdx) | :heavy_minus_sign: | Cache control for the content part | \{
"ttl": "5m",
"type": "ephemeral"
} | -| `text` | *str* | :heavy_check_mark: | N/A | | -| `type` | [components.ChatContentTextType](../components/chatcontenttexttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cache_control` | [Optional[components.ChatContentCacheControl]](../components/chatcontentcachecontrol.mdx) | :heavy_minus_sign: | Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request. | \{
"ttl": "5m",
"type": "ephemeral"
} | +| `prompt_cache_breakpoint` | [OptionalNullable[components.PromptCacheBreakpoint]](../components/promptcachebreakpoint.mdx) | :heavy_minus_sign: | Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. | \{
"mode": "explicit"
} | +| `text` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.ChatContentTextType](../components/chatcontenttexttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/chatformatjsonobjectconfig.mdx b/docs/components/chatformatjsonobjectconfig.mdx new file mode 100644 index 0000000..5dae96c --- /dev/null +++ b/docs/components/chatformatjsonobjectconfig.mdx @@ -0,0 +1,12 @@ +--- +title: "ChatFormatJSONObjectConfig" +--- + +JSON object response format + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `type` | [components.ChatFormatJSONObjectConfigType](../components/chatformatjsonobjectconfigtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/chatformatjsonobjectconfigtype.mdx b/docs/components/chatformatjsonobjectconfigtype.mdx new file mode 100644 index 0000000..617987c --- /dev/null +++ b/docs/components/chatformatjsonobjectconfigtype.mdx @@ -0,0 +1,15 @@ +--- +title: "ChatFormatJSONObjectConfigType" +--- + +## Example Usage + +```python +from openrouter.components import ChatFormatJSONObjectConfigType +value: ChatFormatJSONObjectConfigType = "json_object" +``` + + +## Values + +- `"json_object"` diff --git a/docs/components/chatfunctiontool.mdx b/docs/components/chatfunctiontool.mdx index 41b4523..bc9f2fa 100644 --- a/docs/components/chatfunctiontool.mdx +++ b/docs/components/chatfunctiontool.mdx @@ -37,6 +37,12 @@ value: components.DatetimeServerTool = /* values here */ value: components.FilesServerTool = /* values here */ ``` +### `components.FusionServerToolOpenRouter` + +```python +value: components.FusionServerToolOpenRouter = /* values here */ +``` + ### `components.ImageGenerationServerToolOpenRouter` ```python diff --git a/docs/components/chatfunctiontoolfunction.mdx b/docs/components/chatfunctiontoolfunction.mdx index 7619eec..a6cf73c 100644 --- a/docs/components/chatfunctiontoolfunction.mdx +++ b/docs/components/chatfunctiontoolfunction.mdx @@ -6,6 +6,6 @@ title: "ChatFunctionToolFunction" | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.ChatContentCacheControl]](../components/chatcontentcachecontrol.mdx) | :heavy_minus_sign: | Cache control for the content part | \{
"ttl": "5m",
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.ChatContentCacheControl]](../components/chatcontentcachecontrol.mdx) | :heavy_minus_sign: | Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request. | \{
"ttl": "5m",
"type": "ephemeral"
} | | `function` | [components.ChatFunctionToolFunctionFunction](../components/chatfunctiontoolfunctionfunction.mdx) | :heavy_check_mark: | Function definition for tool calling | \{
"description": "Get the current weather for a location",
"name": "get_weather",
"parameters": \{
"properties": \{
"location": \{
"description": "City name",
"type": "string"
}
},
"required": [
"location"
],
"type": "object"
}
} | | `type` | [components.ChatFunctionToolType](../components/chatfunctiontooltype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/chatrequest.mdx b/docs/components/chatrequest.mdx index 1cc4f0f..e831058 100644 --- a/docs/components/chatrequest.mdx +++ b/docs/components/chatrequest.mdx @@ -9,7 +9,7 @@ Chat completion request parameters | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `debug` | [Optional[components.ChatDebugOptions]](../components/chatdebugoptions.mdx) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | \{
"echo_upstream_body": true
} | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 | | `image_config` | Dict[str, [components.ImageConfig](../components/imageconfig.mdx)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | \{
"aspect_ratio": "16:9",
"quality": "high"
} | @@ -26,6 +26,8 @@ Chat completion request parameters | `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. | true | | `plugins` | List[[components.ChatRequestPlugin](../components/chatrequestplugin.mdx)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [Optional[components.ChatRequestReasoning]](../components/chatrequestreasoning.mdx) | :heavy_minus_sign: | Configuration options for reasoning models | \{
"effort": "medium",
"summary": "concise"
} | | `reasoning_effort` | [OptionalNullable[components.ChatRequestReasoningEffort]](../components/chatrequestreasoningeffort.mdx) | :heavy_minus_sign: | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | medium | diff --git a/docs/components/chatusage.mdx b/docs/components/chatusage.mdx index a45747f..a32fff4 100644 --- a/docs/components/chatusage.mdx +++ b/docs/components/chatusage.mdx @@ -16,5 +16,5 @@ Token usage statistics | `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | | `prompt_tokens` | *int* | :heavy_check_mark: | Number of tokens in the prompt | | | `prompt_tokens_details` | [OptionalNullable[components.ChatUsagePromptTokensDetails]](../components/chatusageprompttokensdetails.mdx) | :heavy_minus_sign: | Detailed prompt token usage | | -| `server_tool_use_details` | [OptionalNullable[components.ServerToolUseDetails]](../components/servertoolusedetails.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `server_tool_use_details` | [OptionalNullable[components.ServerToolUseDetails]](../components/servertoolusedetails.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | \{
"tool_calls_executed": 2,
"tool_calls_requested": 2,
"web_search_requests": 2
} | | `total_tokens` | *int* | :heavy_check_mark: | Total number of tokens | | \ No newline at end of file diff --git a/docs/components/citation.mdx b/docs/components/citation.mdx index 9e50368..2622868 100644 --- a/docs/components/citation.mdx +++ b/docs/components/citation.mdx @@ -22,15 +22,15 @@ value: components.AnthropicCitationContentBlockLocationParam = /* values here */ value: components.AnthropicCitationPageLocationParam = /* values here */ ``` -### `components.AnthropicCitationSearchResultLocation` +### `components.AnthropicCitationSearchResultLocationParam` ```python -value: components.AnthropicCitationSearchResultLocation = /* values here */ +value: components.AnthropicCitationSearchResultLocationParam = /* values here */ ``` -### `components.AnthropicCitationWebSearchResultLocation` +### `components.AnthropicCitationWebSearchResultLocationParam` ```python -value: components.AnthropicCitationWebSearchResultLocation = /* values here */ +value: components.AnthropicCitationWebSearchResultLocationParam = /* values here */ ``` diff --git a/docs/components/code.mdx b/docs/components/code.mdx index dc6776c..7605a85 100644 --- a/docs/components/code.mdx +++ b/docs/components/code.mdx @@ -34,3 +34,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"empty_image_file"` - `"failed_to_download_image"` - `"image_file_not_found"` +- `"bio_policy"` diff --git a/docs/components/compactionitem.mdx b/docs/components/compactionitem.mdx index 7fb1a63..52161ac 100644 --- a/docs/components/compactionitem.mdx +++ b/docs/components/compactionitem.mdx @@ -7,8 +7,9 @@ A context compaction marker with encrypted summary ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `encrypted_content` | *str* | :heavy_check_mark: | N/A | -| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `type` | [components.CompactionItemType](../components/compactionitemtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `encrypted_content` | *str* | :heavy_check_mark: | N/A | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `type` | [components.CompactionItemType](../components/compactionitemtype.mdx) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \{
"encrypted_content": "enc_abc123...",
"type": "compaction"
} | \ No newline at end of file diff --git a/docs/components/contentcompaction.mdx b/docs/components/contentcompaction.mdx index 39acf3a..87f9c8d 100644 --- a/docs/components/contentcompaction.mdx +++ b/docs/components/contentcompaction.mdx @@ -4,8 +4,8 @@ title: "ContentCompaction" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `content` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| `type` | [components.MessagesMessageParamTypeCompaction](../components/messagesmessageparamtypecompaction.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `content` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `type` | [components.MessagesMessageParamTypeCompaction](../components/messagesmessageparamtypecompaction.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/contentencryptedcontent.mdx b/docs/components/contentencryptedcontent.mdx new file mode 100644 index 0000000..f6d3a51 --- /dev/null +++ b/docs/components/contentencryptedcontent.mdx @@ -0,0 +1,11 @@ +--- +title: "ContentEncryptedContent" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `encrypted_content` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.TypeEncryptedContent](../components/typeencryptedcontent.mdx) | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/contentservertooluse.mdx b/docs/components/contentservertooluse.mdx index 527a1c1..86c112e 100644 --- a/docs/components/contentservertooluse.mdx +++ b/docs/components/contentservertooluse.mdx @@ -4,10 +4,10 @@ title: "ContentServerToolUse" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `id` | *str* | :heavy_check_mark: | N/A | | -| `input` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | | -| `name` | *str* | :heavy_check_mark: | N/A | | -| `type` | [components.TypeServerToolUse](../components/typeservertooluse.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `input` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | | +| `name` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.TypeServerToolUse](../components/typeservertooluse.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/contenttoolresult.mdx b/docs/components/contenttoolresult.mdx index 4abde66..f83588a 100644 --- a/docs/components/contenttoolresult.mdx +++ b/docs/components/contenttoolresult.mdx @@ -4,10 +4,10 @@ title: "ContentToolResult" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `content` | [Optional[components.MessagesMessageParamContentUnion2]](../components/messagesmessageparamcontentunion2.mdx) | :heavy_minus_sign: | N/A | | -| `is_error` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | -| `type` | [components.TypeToolResult](../components/typetoolresult.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `content` | [Optional[components.MessagesMessageParamContentUnion2]](../components/messagesmessageparamcontentunion2.mdx) | :heavy_minus_sign: | N/A | | +| `is_error` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.TypeToolResult](../components/typetoolresult.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/contenttooluse.mdx b/docs/components/contenttooluse.mdx index e29dae1..7149ea5 100644 --- a/docs/components/contenttooluse.mdx +++ b/docs/components/contenttooluse.mdx @@ -4,10 +4,10 @@ title: "ContentToolUse" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `id` | *str* | :heavy_check_mark: | N/A | | -| `input` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | | -| `name` | *str* | :heavy_check_mark: | N/A | | -| `type` | [components.TypeToolUse](../components/typetooluse.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `input` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | | +| `name` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.TypeToolUse](../components/typetooluse.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/contentwebsearchtoolresult.mdx b/docs/components/contentwebsearchtoolresult.mdx index a2664d1..9a9180d 100644 --- a/docs/components/contentwebsearchtoolresult.mdx +++ b/docs/components/contentwebsearchtoolresult.mdx @@ -4,9 +4,9 @@ title: "ContentWebSearchToolResult" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `content` | [components.MessagesMessageParamContentUnion3](../components/messagesmessageparamcontentunion3.mdx) | :heavy_check_mark: | N/A | | -| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | -| `type` | [components.TypeWebSearchToolResult](../components/typewebsearchtoolresult.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `content` | [components.MessagesMessageParamContentUnion3](../components/messagesmessageparamcontentunion3.mdx) | :heavy_check_mark: | N/A | | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.TypeWebSearchToolResult](../components/typewebsearchtoolresult.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/contextcompactionitem.mdx b/docs/components/contextcompactionitem.mdx new file mode 100644 index 0000000..4410f49 --- /dev/null +++ b/docs/components/contextcompactionitem.mdx @@ -0,0 +1,15 @@ +--- +title: "ContextCompactionItem" +--- + +A context compaction marker with an optional encrypted summary + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `type` | [components.ContextCompactionItemType](../components/contextcompactionitemtype.mdx) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \{
"encrypted_content": "enc_abc123...",
"type": "context_compaction"
} | \ No newline at end of file diff --git a/docs/components/contextcompactionitemtype.mdx b/docs/components/contextcompactionitemtype.mdx new file mode 100644 index 0000000..a8256a8 --- /dev/null +++ b/docs/components/contextcompactionitemtype.mdx @@ -0,0 +1,15 @@ +--- +title: "ContextCompactionItemType" +--- + +## Example Usage + +```python +from openrouter.components import ContextCompactionItemType +value: ContextCompactionItemType = "context_compaction" +``` + + +## Values + +- `"context_compaction"` diff --git a/docs/components/createguardrailrequest.mdx b/docs/components/createguardrailrequest.mdx index f26042f..1c7c87d 100644 --- a/docs/components/createguardrailrequest.mdx +++ b/docs/components/createguardrailrequest.mdx @@ -4,21 +4,22 @@ title: "CreateGuardrailRequest" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | -| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | -| `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | -| ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | -| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | false | -| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | -| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | -| `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | -| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the guardrail in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | +| ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | +| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_xai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. | false | +| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | +| `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | +| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the guardrail in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/createguardrailresponse.mdx b/docs/components/createguardrailresponse.mdx index e876cac..b7e89dc 100644 --- a/docs/components/createguardrailresponse.mdx +++ b/docs/components/createguardrailresponse.mdx @@ -4,6 +4,6 @@ title: "CreateGuardrailResponse" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [components.Guardrail](../components/guardrail.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.Guardrail](../components/guardrail.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"enforce_zdr_xai": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file diff --git a/docs/components/createobservabilitydestinationrequest.mdx b/docs/components/createobservabilitydestinationrequest.mdx index a3435fe..065e043 100644 --- a/docs/components/createobservabilitydestinationrequest.mdx +++ b/docs/components/createobservabilitydestinationrequest.mdx @@ -9,7 +9,7 @@ title: "CreateObservabilityDestinationRequest" | `api_key_hashes` | List[*str*] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. | null | | `config` | Dict[str, *Nullable[Any]*] | :heavy_check_mark: | Provider-specific configuration. The shape depends on `type` and is validated server-side. | \{
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
} | | `enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether this destination should be enabled immediately. | true | -| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfig]](../components/observabilityfilterrulesconfig.mdx) | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | null | +| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfigNullable]](../components/observabilityfilterrulesconfignullable.mdx) | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | null | | `name` | *str* | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `privacy_mode` | *Optional[bool]* | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | | `sampling_rate` | *Optional[float]* | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | diff --git a/docs/components/fusionservertoolconfig.mdx b/docs/components/fusionservertoolconfig.mdx index 6852708..1247ee7 100644 --- a/docs/components/fusionservertoolconfig.mdx +++ b/docs/components/fusionservertoolconfig.mdx @@ -7,13 +7,13 @@ Configuration for the openrouter:fusion server tool. ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `analysis_models` | List[*str*] | :heavy_minus_sign: | Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion. | [
"~anthropic/claude-opus-latest",
"~openai/gpt-latest",
"~google/gemini-pro-latest"
] | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `max_completion_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. | 16384 | -| `max_tool_calls` | *Optional[int]* | :heavy_minus_sign: | Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. | 12 | -| `model` | *Optional[str]* | :heavy_minus_sign: | Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request. | ~anthropic/claude-opus-latest | -| `reasoning` | [Optional[components.FusionServerToolConfigReasoning]](../components/fusionservertoolconfigreasoning.mdx) | :heavy_minus_sign: | Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking. | | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | Temperature forwarded to panelist inner calls. The judge always runs at temperature 0 regardless of this value. When omitted, the provider's default applies. | 0.7 | -| `tools` | List[[components.FusionServerToolConfigTool](../components/fusionservertoolconfigtool.mdx)] | :heavy_minus_sign: | Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). | [
\{
"parameters": \{
"excluded_domains": [
"example.com"
]
},
"type": "openrouter:web_search"
},
\{
"type": "openrouter:web_fetch"
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `analysis_models` | List[*str*] | :heavy_minus_sign: | Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion. | [
"~anthropic/claude-opus-latest",
"~openai/gpt-latest",
"~google/gemini-pro-latest"
] | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `max_completion_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to 50000. | 16384 | +| `max_tool_calls` | *Optional[int]* | :heavy_minus_sign: | Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. | 12 | +| `model` | *Optional[str]* | :heavy_minus_sign: | Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request. | ~anthropic/claude-opus-latest | +| `reasoning` | [Optional[components.FusionServerToolConfigReasoning]](../components/fusionservertoolconfigreasoning.mdx) | :heavy_minus_sign: | Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking. | | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | Temperature forwarded to panelist inner calls. The judge always runs at temperature 0 regardless of this value. When omitted, the provider's default applies. | 0.7 | +| `tools` | List[[components.FusionServerToolConfigTool](../components/fusionservertoolconfigtool.mdx)] | :heavy_minus_sign: | Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). | [
\{
"parameters": \{
"excluded_domains": [
"example.com"
]
},
"type": "openrouter:web_search"
},
\{
"type": "openrouter:web_fetch"
}
] | \ No newline at end of file diff --git a/docs/components/getguardrailresponse.mdx b/docs/components/getguardrailresponse.mdx index 7a49600..0b5936f 100644 --- a/docs/components/getguardrailresponse.mdx +++ b/docs/components/getguardrailresponse.mdx @@ -4,6 +4,6 @@ title: "GetGuardrailResponse" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [components.Guardrail](../components/guardrail.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.Guardrail](../components/guardrail.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"enforce_zdr_xai": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file diff --git a/docs/components/guardrail.mdx b/docs/components/guardrail.mdx index dc72fbb..7d6c170 100644 --- a/docs/components/guardrail.mdx +++ b/docs/components/guardrail.mdx @@ -4,24 +4,25 @@ title: "Guardrail" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | -| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntry](../components/contentfilterbuiltinentry.mdx)] | :heavy_minus_sign: | Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector. | [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
] | -| `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters applied to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | -| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | -| ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | -| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | false | -| `id` | *str* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | -| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs to exclude from routing | [
"openai/gpt-4o-mini-2024-07-18"
] | -| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | -| `name` | *str* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | -| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | -| `updated_at` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | -| `workspace_id` | *str* | :heavy_check_mark: | The workspace ID this guardrail belongs to. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntry](../components/contentfilterbuiltinentry.mdx)] | :heavy_minus_sign: | Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector. | [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
] | +| `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters applied to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | +| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_xai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. | false | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs to exclude from routing | [
"openai/gpt-4o-mini-2024-07-18"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `name` | *str* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `updated_at` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | +| `workspace_id` | *str* | :heavy_check_mark: | The workspace ID this guardrail belongs to. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/components/imagegencompletedevent.mdx b/docs/components/imagegencompletedevent.mdx index 90ddd67..247d9e4 100644 --- a/docs/components/imagegencompletedevent.mdx +++ b/docs/components/imagegencompletedevent.mdx @@ -7,10 +7,10 @@ Emitted when generation completes and the final image is available ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `b64_json` | *str* | :heavy_check_mark: | Base64-encoded final image data | | -| `created` | *int* | :heavy_check_mark: | Unix timestamp (seconds) when the image was generated | | -| `media_type` | *Optional[str]* | :heavy_minus_sign: | Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`). | image/svg+xml | -| `type` | [components.ImageGenCompletedEventType](../components/imagegencompletedeventtype.mdx) | :heavy_check_mark: | The event type | | -| `usage` | [Optional[components.ImageGenerationUsage]](../components/imagegenerationusage.mdx) | :heavy_minus_sign: | Token and cost usage for the image generation request, when available | \{
"completion_tokens": 4175,
"cost": 0.04,
"prompt_tokens": 0,
"total_tokens": 4175
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `b64_json` | *str* | :heavy_check_mark: | Base64-encoded final image data | | +| `created` | *int* | :heavy_check_mark: | Unix timestamp (seconds) when the image was generated | | +| `media_type` | *Optional[str]* | :heavy_minus_sign: | Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined. | image/png | +| `type` | [components.ImageGenCompletedEventType](../components/imagegencompletedeventtype.mdx) | :heavy_check_mark: | The event type | | +| `usage` | [Optional[components.ImageGenerationUsage]](../components/imagegenerationusage.mdx) | :heavy_minus_sign: | Token and cost usage for the image generation request, when available | \{
"completion_tokens": 4175,
"cost": 0.04,
"prompt_tokens": 0,
"total_tokens": 4175
} | \ No newline at end of file diff --git a/docs/components/imagegenerationproviderpreferences.mdx b/docs/components/imagegenerationproviderpreferences.mdx new file mode 100644 index 0000000..b98f786 --- /dev/null +++ b/docs/components/imagegenerationproviderpreferences.mdx @@ -0,0 +1,17 @@ +--- +title: "ImageGenerationProviderPreferences" +--- + +Provider routing preferences and provider-specific passthrough configuration. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| | +| `ignore` | List[[components.ImageGenerationProviderPreferencesIgnore](../components/imagegenerationproviderpreferencesignore.mdx)] | :heavy_minus_sign: | 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.ImageGenerationProviderPreferencesOnly](../components/imagegenerationproviderpreferencesonly.mdx)] | :heavy_minus_sign: | 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.ImageGenerationProviderPreferencesOptions]](../components/imagegenerationproviderpreferencesoptions.mdx) | :heavy_minus_sign: | N/A | \{
"black-forest-labs": \{
"guidance": 3,
"steps": 40
}
} | +| `order` | List[[components.ImageGenerationProviderPreferencesOrder](../components/imagegenerationproviderpreferencesorder.mdx)] | :heavy_minus_sign: | 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"
] | +| `sort` | [OptionalNullable[components.ImageGenerationProviderPreferencesSort]](../components/imagegenerationproviderpreferencessort.mdx) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | \ No newline at end of file diff --git a/docs/components/imagegenerationproviderpreferencesignore.mdx b/docs/components/imagegenerationproviderpreferencesignore.mdx new file mode 100644 index 0000000..5f20d5e --- /dev/null +++ b/docs/components/imagegenerationproviderpreferencesignore.mdx @@ -0,0 +1,18 @@ +--- +title: "ImageGenerationProviderPreferencesIgnore" +--- + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/imagegenerationproviderpreferencesonly.mdx b/docs/components/imagegenerationproviderpreferencesonly.mdx new file mode 100644 index 0000000..11f1471 --- /dev/null +++ b/docs/components/imagegenerationproviderpreferencesonly.mdx @@ -0,0 +1,18 @@ +--- +title: "ImageGenerationProviderPreferencesOnly" +--- + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/imagegenerationrequestoptions.mdx b/docs/components/imagegenerationproviderpreferencesoptions.mdx similarity index 97% rename from docs/components/imagegenerationrequestoptions.mdx rename to docs/components/imagegenerationproviderpreferencesoptions.mdx index 26f3f1e..9f867b4 100644 --- a/docs/components/imagegenerationrequestoptions.mdx +++ b/docs/components/imagegenerationproviderpreferencesoptions.mdx @@ -1,5 +1,5 @@ --- -title: "ImageGenerationRequestOptions" +title: "ImageGenerationProviderPreferencesOptions" --- Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. @@ -40,6 +40,7 @@ Provider-specific options keyed by provider slug. Only options for the matched p | `crusoe` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `darkbloom` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `decart` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `deepgram` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `deepinfra` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `deepseek` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `dekallm` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | @@ -106,7 +107,8 @@ Provider-specific options keyed by provider slug. Only options for the matched p | `reka` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `relace` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `replicate` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | -| `sakana_ai` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `sail_research` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `sakana` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `sambanova` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `sambanova_cloaked` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `seed` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | diff --git a/docs/components/imagegenerationproviderpreferencesorder.mdx b/docs/components/imagegenerationproviderpreferencesorder.mdx new file mode 100644 index 0000000..3125f8b --- /dev/null +++ b/docs/components/imagegenerationproviderpreferencesorder.mdx @@ -0,0 +1,18 @@ +--- +title: "ImageGenerationProviderPreferencesOrder" +--- + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/imagegenerationproviderpreferencessort.mdx b/docs/components/imagegenerationproviderpreferencessort.mdx new file mode 100644 index 0000000..7696bf5 --- /dev/null +++ b/docs/components/imagegenerationproviderpreferencessort.mdx @@ -0,0 +1,27 @@ +--- +title: "ImageGenerationProviderPreferencesSort" +--- + +The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + + +## Supported Types + +### `components.ProviderSort` + +```python +value: components.ProviderSort = /* values here */ +``` + +### `components.ProviderSortConfig` + +```python +value: components.ProviderSortConfig = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/imagegenerationrequest.mdx b/docs/components/imagegenerationrequest.mdx index 1d6369d..36805ca 100644 --- a/docs/components/imagegenerationrequest.mdx +++ b/docs/components/imagegenerationrequest.mdx @@ -7,19 +7,19 @@ Image generation request input ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../components/imagegenerationrequestaspectratio.mdx) | :heavy_minus_sign: | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | -| `background` | [Optional[components.ImageGenerationRequestBackground]](../components/imagegenerationrequestbackground.mdx) | :heavy_minus_sign: | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | -| `input_references` | List[[components.ContentPartImage](../components/contentpartimage.mdx)] | :heavy_minus_sign: | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | -| `model` | *str* | :heavy_check_mark: | The image generation model to use | bytedance-seed/seedream-4.5 | -| `n` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. | 1 | -| `output_compression` | *Optional[int]* | :heavy_minus_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 | -| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../components/imagegenerationrequestoutputformat.mdx) | :heavy_minus_sign: | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | -| `prompt` | *str* | :heavy_check_mark: | Text description of the desired image | a red panda astronaut floating in space, studio lighting | -| `provider` | [Optional[components.ImageGenerationRequestProvider]](../components/imagegenerationrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `quality` | [Optional[components.ImageGenerationRequestQuality]](../components/imagegenerationrequestquality.mdx) | :heavy_minus_sign: | Rendering quality. Providers without a quality knob ignore this. | high | -| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../components/imagegenerationrequestresolution.mdx) | :heavy_minus_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | -| `seed` | *Optional[int]* | :heavy_minus_sign: | 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. | | -| `size` | *Optional[str]* | :heavy_minus_sign: | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. | 2K | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../components/imagegenerationrequestaspectratio.mdx) | :heavy_minus_sign: | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | +| `background` | [Optional[components.ImageGenerationRequestBackground]](../components/imagegenerationrequestbackground.mdx) | :heavy_minus_sign: | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | +| `input_references` | List[[components.ContentPartImage](../components/contentpartimage.mdx)] | :heavy_minus_sign: | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | +| `model` | *str* | :heavy_check_mark: | The image generation model to use | bytedance-seed/seedream-4.5 | +| `n` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. | 1 | +| `output_compression` | *Optional[int]* | :heavy_minus_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 | +| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../components/imagegenerationrequestoutputformat.mdx) | :heavy_minus_sign: | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | +| `prompt` | *str* | :heavy_check_mark: | Text description of the desired image | a red panda astronaut floating in space, studio lighting | +| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../components/imagegenerationproviderpreferences.mdx) | :heavy_minus_sign: | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | +| `quality` | [Optional[components.ImageGenerationRequestQuality]](../components/imagegenerationrequestquality.mdx) | :heavy_minus_sign: | Rendering quality. Providers without a quality knob ignore this. | high | +| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../components/imagegenerationrequestresolution.mdx) | :heavy_minus_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | +| `seed` | *Optional[int]* | :heavy_minus_sign: | 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. | | +| `size` | *Optional[str]* | :heavy_minus_sign: | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. | 2K | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | \ No newline at end of file diff --git a/docs/components/imagegenerationresponsedata.mdx b/docs/components/imagegenerationresponsedata.mdx index 78ec1e1..e36ed89 100644 --- a/docs/components/imagegenerationresponsedata.mdx +++ b/docs/components/imagegenerationresponsedata.mdx @@ -4,7 +4,7 @@ title: "ImageGenerationResponseData" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `b64_json` | *str* | :heavy_check_mark: | Base64-encoded image bytes | | -| `media_type` | *Optional[str]* | :heavy_minus_sign: | Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`). | image/svg+xml | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `b64_json` | *str* | :heavy_check_mark: | Base64-encoded image bytes | | +| `media_type` | *Optional[str]* | :heavy_minus_sign: | Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined. | image/png | \ No newline at end of file diff --git a/docs/components/imagegenerationservertool.mdx b/docs/components/imagegenerationservertool.mdx index c290753..c620407 100644 --- a/docs/components/imagegenerationservertool.mdx +++ b/docs/components/imagegenerationservertool.mdx @@ -12,11 +12,11 @@ Image generation tool configuration | `background` | [Optional[components.ImageGenerationServerToolBackground]](../components/imagegenerationservertoolbackground.mdx) | :heavy_minus_sign: | N/A | | `input_fidelity` | [OptionalNullable[components.InputFidelity]](../components/inputfidelity.mdx) | :heavy_minus_sign: | N/A | | `input_image_mask` | [Optional[components.InputImageMask]](../components/inputimagemask.mdx) | :heavy_minus_sign: | N/A | -| `model` | [Optional[components.ModelEnum]](../components/modelenum.mdx) | :heavy_minus_sign: | N/A | +| `model` | *Optional[str]* | :heavy_minus_sign: | N/A | | `moderation` | [Optional[components.Moderation]](../components/moderation.mdx) | :heavy_minus_sign: | N/A | | `output_compression` | *Optional[int]* | :heavy_minus_sign: | N/A | | `output_format` | [Optional[components.ImageGenerationServerToolOutputFormat]](../components/imagegenerationservertooloutputformat.mdx) | :heavy_minus_sign: | N/A | | `partial_images` | *Optional[int]* | :heavy_minus_sign: | N/A | | `quality` | [Optional[components.ImageGenerationServerToolQuality]](../components/imagegenerationservertoolquality.mdx) | :heavy_minus_sign: | N/A | -| `size` | [Optional[components.Size]](../components/size.mdx) | :heavy_minus_sign: | N/A | +| `size` | *Optional[str]* | :heavy_minus_sign: | N/A | | `type` | [components.ImageGenerationServerToolType](../components/imagegenerationservertooltype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/imagegenerationusage.mdx b/docs/components/imagegenerationusage.mdx index be9fe8f..cb01cf3 100644 --- a/docs/components/imagegenerationusage.mdx +++ b/docs/components/imagegenerationusage.mdx @@ -9,6 +9,7 @@ Token and cost usage for the image generation request, when available | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `cache_creation` | [OptionalNullable[components.AnthropicCacheCreation]](../components/anthropiccachecreation.mdx) | :heavy_minus_sign: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} | | `completion_tokens` | *int* | :heavy_check_mark: | The tokens generated | | | `completion_tokens_details` | [OptionalNullable[components.ImageGenerationUsageCompletionTokensDetails]](../components/imagegenerationusagecompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | | | `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | | diff --git a/docs/components/imagegentextchunkevent.mdx b/docs/components/imagegentextchunkevent.mdx new file mode 100644 index 0000000..9c2837a --- /dev/null +++ b/docs/components/imagegentextchunkevent.mdx @@ -0,0 +1,14 @@ +--- +title: "ImageGenTextChunkEvent" +--- + +Emitted when a text chunk becomes available during streaming generation of text-based formats (e.g. SVG) + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `phase` | [components.ImageGenTextChunkEventPhase](../components/imagegentextchunkeventphase.mdx) | :heavy_check_mark: | The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases. | +| `text` | *str* | :heavy_check_mark: | A text fragment of the image being generated (e.g. partial SVG markup) | +| `type` | [components.ImageGenTextChunkEventType](../components/imagegentextchunkeventtype.mdx) | :heavy_check_mark: | The event type | \ No newline at end of file diff --git a/docs/components/imagegentextchunkeventphase.mdx b/docs/components/imagegentextchunkeventphase.mdx new file mode 100644 index 0000000..b9333b1 --- /dev/null +++ b/docs/components/imagegentextchunkeventphase.mdx @@ -0,0 +1,23 @@ +--- +title: "ImageGenTextChunkEventPhase" +--- + +The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases. + +## Example Usage + +```python +from openrouter.components import ImageGenTextChunkEventPhase + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ImageGenTextChunkEventPhase = "content" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"content"` +- `"reasoning"` +- `"draft"` diff --git a/docs/components/imagegentextchunkeventtype.mdx b/docs/components/imagegentextchunkeventtype.mdx new file mode 100644 index 0000000..fffb82a --- /dev/null +++ b/docs/components/imagegentextchunkeventtype.mdx @@ -0,0 +1,17 @@ +--- +title: "ImageGenTextChunkEventType" +--- + +The event type + +## Example Usage + +```python +from openrouter.components import ImageGenTextChunkEventType +value: ImageGenTextChunkEventType = "image_generation.text_chunk" +``` + + +## Values + +- `"image_generation.text_chunk"` diff --git a/docs/components/imageinputmodality.mdx b/docs/components/imageinputmodality.mdx new file mode 100644 index 0000000..9062baf --- /dev/null +++ b/docs/components/imageinputmodality.mdx @@ -0,0 +1,23 @@ +--- +title: "ImageInputModality" +--- + +## Example Usage + +```python +from openrouter.components import ImageInputModality + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ImageInputModality = "text" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"text"` +- `"image"` +- `"file"` +- `"audio"` +- `"video"` diff --git a/docs/components/imagemodelarchitecture.mdx b/docs/components/imagemodelarchitecture.mdx index 6842d9d..860b662 100644 --- a/docs/components/imagemodelarchitecture.mdx +++ b/docs/components/imagemodelarchitecture.mdx @@ -6,5 +6,5 @@ title: "ImageModelArchitecture" | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `input_modalities` | List[[components.InputModality](../components/inputmodality.mdx)] | :heavy_check_mark: | Supported input modalities | +| `input_modalities` | List[[components.ImageInputModality](../components/imageinputmodality.mdx)] | :heavy_check_mark: | Supported input modalities | | `output_modalities` | List[[components.ImageOutputModality](../components/imageoutputmodality.mdx)] | :heavy_check_mark: | Supported output modalities | \ No newline at end of file diff --git a/docs/components/imagestreamingresponsedata.mdx b/docs/components/imagestreamingresponsedata.mdx index 1040027..290f451 100644 --- a/docs/components/imagestreamingresponsedata.mdx +++ b/docs/components/imagestreamingresponsedata.mdx @@ -10,6 +10,12 @@ title: "ImageStreamingResponseData" value: components.ImageGenPartialImageEvent = /* values here */ ``` +### `components.ImageGenTextChunkEvent` + +```python +value: components.ImageGenTextChunkEvent = /* values here */ +``` + ### `components.ImageGenCompletedEvent` ```python diff --git a/docs/components/inputsunion1.mdx b/docs/components/inputsunion1.mdx index 9d37626..2e56403 100644 --- a/docs/components/inputsunion1.mdx +++ b/docs/components/inputsunion1.mdx @@ -274,9 +274,27 @@ value: components.CustomToolCallOutputItem = /* values here */ value: components.CompactionItem = /* values here */ ``` +### `components.ContextCompactionItem` + +```python +value: components.ContextCompactionItem = /* values here */ +``` + ### `components.ItemReferenceItem` ```python value: components.ItemReferenceItem = /* values here */ ``` +### `components.AdditionalToolsItem` + +```python +value: components.AdditionalToolsItem = /* values here */ +``` + +### `components.AgentMessageItem` + +```python +value: components.AgentMessageItem = /* values here */ +``` + diff --git a/docs/components/inputtext.mdx b/docs/components/inputtext.mdx index 5ebcb83..5908413 100644 --- a/docs/components/inputtext.mdx +++ b/docs/components/inputtext.mdx @@ -7,7 +7,8 @@ Text input content item ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [components.InputTextType](../components/inputtexttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `prompt_cache_breakpoint` | [OptionalNullable[components.PromptCacheBreakpoint]](../components/promptcachebreakpoint.mdx) | :heavy_minus_sign: | Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. | \{
"mode": "explicit"
} | +| `text` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.InputTextType](../components/inputtexttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/inputtokensdetails.mdx b/docs/components/inputtokensdetails.mdx index c58b1d0..daa531b 100644 --- a/docs/components/inputtokensdetails.mdx +++ b/docs/components/inputtokensdetails.mdx @@ -4,6 +4,7 @@ title: "InputTokensDetails" ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `cached_tokens` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `cache_write_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `cached_tokens` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/legacychatcontentvideo.mdx b/docs/components/legacychatcontentvideo.mdx index f1d4b3d..74b480b 100644 --- a/docs/components/legacychatcontentvideo.mdx +++ b/docs/components/legacychatcontentvideo.mdx @@ -9,7 +9,7 @@ Video input content part (legacy format - deprecated) ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `type` | [components.LegacyChatContentVideoType](../components/legacychatcontentvideotype.mdx) | :heavy_check_mark: | N/A | | -| `video_url` | [components.ChatContentVideoInput](../components/chatcontentvideoinput.mdx) | :heavy_check_mark: | Video input object | \{
"url": "https://example.com/video.mp4"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `type` | [components.LegacyChatContentVideoType](../components/legacychatcontentvideotype.mdx) | :heavy_check_mark: | N/A | | +| `video_url` | [components.LegacyChatContentVideoInput](../components/legacychatcontentvideoinput.mdx) | :heavy_check_mark: | Video input object | \{
"url": "https://example.com/video.mp4"
} | \ No newline at end of file diff --git a/docs/components/legacychatcontentvideoinput.mdx b/docs/components/legacychatcontentvideoinput.mdx new file mode 100644 index 0000000..d79ac06 --- /dev/null +++ b/docs/components/legacychatcontentvideoinput.mdx @@ -0,0 +1,12 @@ +--- +title: "LegacyChatContentVideoInput" +--- + +Video input object + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `url` | *str* | :heavy_check_mark: | URL of the video (data: URLs supported) | \ No newline at end of file diff --git a/docs/components/links.mdx b/docs/components/links.mdx new file mode 100644 index 0000000..6debf47 --- /dev/null +++ b/docs/components/links.mdx @@ -0,0 +1,12 @@ +--- +title: "Links" +--- + +Pagination links + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `next` | *Nullable[str]* | :heavy_check_mark: | URL for the next page of results, or null if this is the last page | /api/v1/models?offset=500&limit=500 | \ No newline at end of file diff --git a/docs/components/messagesrequest.mdx b/docs/components/messagesrequest.mdx index 2b25d42..89b9780 100644 --- a/docs/components/messagesrequest.mdx +++ b/docs/components/messagesrequest.mdx @@ -9,7 +9,7 @@ Request schema for Anthropic Messages API endpoint | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `context_management` | [OptionalNullable[components.ContextManagement]](../components/contextmanagement.mdx) | :heavy_minus_sign: | N/A | | | `fallbacks` | List[[components.MessagesFallbackParam](../components/messagesfallbackparam.mdx)] | :heavy_minus_sign: | Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. | [
\{
"model": "claude-opus-4-8"
}
] | | `max_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | | diff --git a/docs/components/messagesrequesttoolunion.mdx b/docs/components/messagesrequesttoolunion.mdx index b24e866..f5868bf 100644 --- a/docs/components/messagesrequesttoolunion.mdx +++ b/docs/components/messagesrequesttoolunion.mdx @@ -58,10 +58,10 @@ value: components.DatetimeServerTool = /* values here */ value: components.ImageGenerationServerToolOpenRouter = /* values here */ ``` -### `components.ChatSearchModelsServerTool` +### `components.MessagesSearchModelsServerTool` ```python -value: components.ChatSearchModelsServerTool = /* values here */ +value: components.MessagesSearchModelsServerTool = /* values here */ ``` ### `components.WebFetchServerTool` diff --git a/docs/components/imagegenerationrequestprovider.mdx b/docs/components/messagessearchmodelsservertool.mdx similarity index 53% rename from docs/components/imagegenerationrequestprovider.mdx rename to docs/components/messagessearchmodelsservertool.mdx index 51188d0..e13f74e 100644 --- a/docs/components/imagegenerationrequestprovider.mdx +++ b/docs/components/messagessearchmodelsservertool.mdx @@ -1,12 +1,13 @@ --- -title: "ImageGenerationRequestProvider" +title: "MessagesSearchModelsServerTool" --- -Provider-specific passthrough configuration +OpenRouter built-in server tool: searches and filters AI models available on OpenRouter ## Fields | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `options` | [Optional[components.ImageGenerationRequestOptions]](../components/imagegenerationrequestoptions.mdx) | :heavy_minus_sign: | N/A | \{
"black-forest-labs": \{
"guidance": 3,
"steps": 40
}
} | \ No newline at end of file +| `parameters` | [Optional[components.SearchModelsServerToolConfig]](../components/searchmodelsservertoolconfig.mdx) | :heavy_minus_sign: | Configuration for the openrouter:experimental__search_models server tool | \{
"max_results": 5
} | +| `type` | [components.MessagesSearchModelsServerToolType](../components/messagessearchmodelsservertooltype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/messagessearchmodelsservertooltype.mdx b/docs/components/messagessearchmodelsservertooltype.mdx new file mode 100644 index 0000000..52ce907 --- /dev/null +++ b/docs/components/messagessearchmodelsservertooltype.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesSearchModelsServerToolType" +--- + +## Example Usage + +```python +from openrouter.components import MessagesSearchModelsServerToolType +value: MessagesSearchModelsServerToolType = "openrouter:experimental__search_models" +``` + + +## Values + +- `"openrouter:experimental__search_models"` diff --git a/docs/components/modelarchitecture.mdx b/docs/components/modelarchitecture.mdx index 3035c9b..d46fef4 100644 --- a/docs/components/modelarchitecture.mdx +++ b/docs/components/modelarchitecture.mdx @@ -7,10 +7,10 @@ Model architecture information ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `input_modalities` | List[[components.InputModality](../components/inputmodality.mdx)] | :heavy_check_mark: | Supported input modalities | | -| `instruct_type` | [OptionalNullable[components.ModelArchitectureInstructType]](../components/modelarchitectureinstructtype.mdx) | :heavy_minus_sign: | Instruction format type | chatml | -| `modality` | *Nullable[str]* | :heavy_check_mark: | Primary modality of the model | text->text | -| `output_modalities` | List[[components.OutputModality](../components/outputmodality.mdx)] | :heavy_check_mark: | Supported output modalities | | -| `tokenizer` | [Optional[components.ModelGroup]](../components/modelgroup.mdx) | :heavy_minus_sign: | Tokenizer type used by the model | GPT | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `input_modalities` | List[[components.InputModality](../components/inputmodality.mdx)] | :heavy_check_mark: | Supported input modalities | | +| `instruct_type` | [OptionalNullable[components.InstructType]](../components/instructtype.mdx) | :heavy_minus_sign: | Instruction format type | chatml | +| `modality` | *Nullable[str]* | :heavy_check_mark: | Primary modality of the model | text->text | +| `output_modalities` | List[[components.OutputModality](../components/outputmodality.mdx)] | :heavy_check_mark: | Supported output modalities | | +| `tokenizer` | [Optional[components.ModelGroup]](../components/modelgroup.mdx) | :heavy_minus_sign: | Tokenizer type used by the model | GPT | \ No newline at end of file diff --git a/docs/components/modelarchitectureinstructtype.mdx b/docs/components/modelarchitectureinstructtype.mdx deleted file mode 100644 index c8d0213..0000000 --- a/docs/components/modelarchitectureinstructtype.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: "ModelArchitectureInstructType" ---- - -Instruction format type - -## Example Usage - -```python -from openrouter.components import ModelArchitectureInstructType - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: ModelArchitectureInstructType = "none" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"none"` -- `"airoboros"` -- `"alpaca"` -- `"alpaca-modif"` -- `"chatml"` -- `"claude"` -- `"code-llama"` -- `"gemma"` -- `"llama2"` -- `"llama3"` -- `"mistral"` -- `"nemotron"` -- `"neural"` -- `"openchat"` -- `"phi3"` -- `"rwkv"` -- `"vicuna"` -- `"zephyr"` -- `"deepseek-r1"` -- `"deepseek-v3.1"` -- `"qwq"` -- `"qwen3"` diff --git a/docs/components/modelslistresponse.mdx b/docs/components/modelslistresponse.mdx index 140ec11..ac531b9 100644 --- a/docs/components/modelslistresponse.mdx +++ b/docs/components/modelslistresponse.mdx @@ -7,6 +7,8 @@ List of available models ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `data` | List[[components.Model](../components/model.mdx)] | :heavy_check_mark: | List of available models | [
\{
"architecture": \{
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": \{
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": \{
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
],
"supported_voices": null,
"top_provider": \{
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | List[[components.Model](../components/model.mdx)] | :heavy_check_mark: | List of available models | [
\{
"architecture": \{
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": \{
"details": "/api/v1/models/openai/gpt-4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": \{
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
],
"supported_voices": null,
"top_provider": \{
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
}
] | +| `links` | [components.Links](../components/links.mdx) | :heavy_check_mark: | Pagination links | | +| `total_count` | *int* | :heavy_check_mark: | Total number of models matching the query | 150 | \ No newline at end of file diff --git a/docs/components/group.mdx b/docs/components/observabilityfilterrulegroup.mdx similarity index 95% rename from docs/components/group.mdx rename to docs/components/observabilityfilterrulegroup.mdx index 34495da..95aa7cf 100644 --- a/docs/components/group.mdx +++ b/docs/components/observabilityfilterrulegroup.mdx @@ -1,5 +1,5 @@ --- -title: "Group" +title: "ObservabilityFilterRuleGroup" --- ## Fields diff --git a/docs/components/observabilityfilterrulesconfigvalue.mdx b/docs/components/observabilityfilterrulegroupvalue.mdx similarity index 76% rename from docs/components/observabilityfilterrulesconfigvalue.mdx rename to docs/components/observabilityfilterrulegroupvalue.mdx index 6b335f6..af2effd 100644 --- a/docs/components/observabilityfilterrulesconfigvalue.mdx +++ b/docs/components/observabilityfilterrulegroupvalue.mdx @@ -1,5 +1,5 @@ --- -title: "ObservabilityFilterRulesConfigValue" +title: "ObservabilityFilterRuleGroupValue" --- ## Supported Types diff --git a/docs/components/observabilityfilterrulesconfig.mdx b/docs/components/observabilityfilterrulesconfig.mdx index 4633042..8393404 100644 --- a/docs/components/observabilityfilterrulesconfig.mdx +++ b/docs/components/observabilityfilterrulesconfig.mdx @@ -7,7 +7,7 @@ Optional structured filter rules controlling which events are forwarded. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `groups` | List[[components.Group](../components/group.mdx)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `groups` | List[[components.ObservabilityFilterRuleGroup](../components/observabilityfilterrulegroup.mdx)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/observabilityfilterrulesconfignullable.mdx b/docs/components/observabilityfilterrulesconfignullable.mdx new file mode 100644 index 0000000..842fa8f --- /dev/null +++ b/docs/components/observabilityfilterrulesconfignullable.mdx @@ -0,0 +1,13 @@ +--- +title: "ObservabilityFilterRulesConfigNullable" +--- + +Optional structured filter rules controlling which events are forwarded. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `groups` | List[[components.ObservabilityFilterRuleGroup](../components/observabilityfilterrulegroup.mdx)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/paretorouterplugin.mdx b/docs/components/paretorouterplugin.mdx index c7ff4bd..072b9b7 100644 --- a/docs/components/paretorouterplugin.mdx +++ b/docs/components/paretorouterplugin.mdx @@ -4,8 +4,9 @@ title: "ParetoRouterPlugin" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the pareto-router plugin for this request. Defaults to true. | | -| `id` | [components.ParetoRouterPluginID](../components/paretorouterpluginid.mdx) | :heavy_check_mark: | N/A | | -| `min_coding_score` | *Optional[float]* | :heavy_minus_sign: | Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier. | 0.8 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the pareto-router plugin for this request. Defaults to true. | | +| `id` | [components.ParetoRouterPluginID](../components/paretorouterpluginid.mdx) | :heavy_check_mark: | N/A | | +| `min_coding_score` | *Optional[float]* | :heavy_minus_sign: | Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66). | 0.8 | +| `price_source` | [Optional[components.PriceSource]](../components/pricesource.mdx) | :heavy_minus_sign: | Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt". | | \ No newline at end of file diff --git a/docs/components/pricesource.mdx b/docs/components/pricesource.mdx new file mode 100644 index 0000000..3d34032 --- /dev/null +++ b/docs/components/pricesource.mdx @@ -0,0 +1,22 @@ +--- +title: "PriceSource" +--- + +Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt". + +## Example Usage + +```python +from openrouter.components import PriceSource + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PriceSource = "prompt" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"prompt"` +- `"weighted_avg"` diff --git a/docs/components/pricing.mdx b/docs/components/pricing.mdx index 78ac34b..e60ec6c 100644 --- a/docs/components/pricing.mdx +++ b/docs/components/pricing.mdx @@ -4,20 +4,21 @@ title: "Pricing" ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token | -| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token | -| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation | -| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) | -| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image | -| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image | -| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token | -| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token | -| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) | -| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. | -| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. | -| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token | -| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing | -| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request | -| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token | +| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token | +| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation | +| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) | +| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image | +| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image | +| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token | +| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token | +| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) | +| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. | +| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. | +| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token | +| `overrides` | List[[components.PricingOverride](../components/pricingoverride.mdx)] | :heavy_minus_sign: | Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. | +| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing | +| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request | +| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search | \ No newline at end of file diff --git a/docs/components/pricingoverride.mdx b/docs/components/pricingoverride.mdx new file mode 100644 index 0000000..5fb1b76 --- /dev/null +++ b/docs/components/pricingoverride.mdx @@ -0,0 +1,21 @@ +--- +title: "PricingOverride" +--- + +A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `audio` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per audio input token | +| `completion` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per token for completion (output) generation | +| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per cached audio input token | +| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per cached input token (read) | +| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per cache-write token | +| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per 1-hour cache-write token | +| `min_prompt_tokens` | *Optional[float]* | :heavy_minus_sign: | Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold | +| `prompt` | *Optional[str]* | :heavy_minus_sign: | Overridden price in USD per token for prompt (input) processing | +| `utc_end` | *Optional[float]* | :heavy_minus_sign: | Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00) | +| `utc_start` | *Optional[float]* | :heavy_minus_sign: | Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end). | \ No newline at end of file diff --git a/docs/components/promptcachebreakpoint.mdx b/docs/components/promptcachebreakpoint.mdx new file mode 100644 index 0000000..313ab84 --- /dev/null +++ b/docs/components/promptcachebreakpoint.mdx @@ -0,0 +1,12 @@ +--- +title: "PromptCacheBreakpoint" +--- + +Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `mode` | [components.PromptCacheBreakpointMode](../components/promptcachebreakpointmode.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/promptcachebreakpointmode.mdx b/docs/components/promptcachebreakpointmode.mdx new file mode 100644 index 0000000..37263b5 --- /dev/null +++ b/docs/components/promptcachebreakpointmode.mdx @@ -0,0 +1,15 @@ +--- +title: "PromptCacheBreakpointMode" +--- + +## Example Usage + +```python +from openrouter.components import PromptCacheBreakpointMode +value: PromptCacheBreakpointMode = "explicit" +``` + + +## Values + +- `"explicit"` diff --git a/docs/components/promptcacheoptions.mdx b/docs/components/promptcacheoptions.mdx new file mode 100644 index 0000000..a9b20d3 --- /dev/null +++ b/docs/components/promptcacheoptions.mdx @@ -0,0 +1,13 @@ +--- +title: "PromptCacheOptions" +--- + +Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `mode` | [components.PromptCacheOptionsMode](../components/promptcacheoptionsmode.mdx) | :heavy_check_mark: | N/A | +| `ttl` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/promptcacheoptionsmode.mdx b/docs/components/promptcacheoptionsmode.mdx new file mode 100644 index 0000000..b9df1b4 --- /dev/null +++ b/docs/components/promptcacheoptionsmode.mdx @@ -0,0 +1,15 @@ +--- +title: "PromptCacheOptionsMode" +--- + +## Example Usage + +```python +from openrouter.components import PromptCacheOptionsMode +value: PromptCacheOptionsMode = "explicit" +``` + + +## Values + +- `"explicit"` diff --git a/docs/components/providername.mdx b/docs/components/providername.mdx index f7cde44..c92f453 100644 --- a/docs/components/providername.mdx +++ b/docs/components/providername.mdx @@ -8,7 +8,7 @@ title: "ProviderName" from openrouter.components import ProviderName # Open enum: unrecognized values are captured as UnrecognizedStr -value: ProviderName = "AkashML" +value: ProviderName = "Meta" ``` @@ -16,6 +16,7 @@ value: ProviderName = "AkashML" This is an open enum. Unrecognized values will not fail type checks. +- `"Meta"` - `"AkashML"` - `"AI21"` - `"AionLabs"` @@ -42,6 +43,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"Crusoe"` - `"Darkbloom"` - `"Decart"` +- `"Deepgram"` - `"DeepInfra"` - `"DeepSeek"` - `"DekaLLM"` @@ -87,6 +89,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"Recraft"` - `"Reka"` - `"Relace"` +- `"Sail Research"` - `"Sakana AI"` - `"SambaNova"` - `"Seed"` diff --git a/docs/components/provideroptions.mdx b/docs/components/provideroptions.mdx index b15b96f..5ea7d4f 100644 --- a/docs/components/provideroptions.mdx +++ b/docs/components/provideroptions.mdx @@ -40,6 +40,7 @@ Provider-specific options keyed by provider slug. Only options for the matched p | `crusoe` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `darkbloom` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `decart` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `deepgram` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `deepinfra` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `deepseek` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `dekallm` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | @@ -106,7 +107,8 @@ Provider-specific options keyed by provider slug. Only options for the matched p | `reka` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `relace` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `replicate` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | -| `sakana_ai` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `sail_research` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `sakana` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `sambanova` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `sambanova_cloaked` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `seed` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | diff --git a/docs/components/providerpreferences.mdx b/docs/components/providerpreferences.mdx index 750d3a2..a312c6f 100644 --- a/docs/components/providerpreferences.mdx +++ b/docs/components/providerpreferences.mdx @@ -12,13 +12,13 @@ When multiple model providers are available, optionally indicate your routing pr | `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| | | `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.mdx) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | | `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true | -| `ignore` | List[[components.Ignore](../components/ignore.mdx)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | [
"openai",
"anthropic"
] | +| `ignore` | List[[components.ProviderPreferencesIgnore](../components/providerpreferencesignore.mdx)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | [
"openai",
"anthropic"
] | | `max_price` | [Optional[components.MaxPrice]](../components/maxprice.mdx) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | | -| `only` | List[[components.Only](../components/only.mdx)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | [
"openai",
"anthropic"
] | -| `order` | List[[components.Order](../components/order.mdx)] | :heavy_minus_sign: | 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"
] | +| `only` | List[[components.ProviderPreferencesOnly](../components/providerpreferencesonly.mdx)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | [
"openai",
"anthropic"
] | +| `order` | List[[components.ProviderPreferencesOrder](../components/providerpreferencesorder.mdx)] | :heavy_minus_sign: | 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"
] | | `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.mdx) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 | | `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.mdx) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 | | `quantizations` | List[[components.Quantization](../components/quantization.mdx)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | | -| `sort` | [OptionalNullable[components.Sort]](../components/sort.mdx) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | +| `sort` | [OptionalNullable[components.ProviderPreferencesSort]](../components/providerpreferencessort.mdx) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | | `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true | \ No newline at end of file diff --git a/docs/components/only.mdx b/docs/components/providerpreferencesignore.mdx similarity index 83% rename from docs/components/only.mdx rename to docs/components/providerpreferencesignore.mdx index cc284e2..77ecc57 100644 --- a/docs/components/only.mdx +++ b/docs/components/providerpreferencesignore.mdx @@ -1,5 +1,5 @@ --- -title: "Only" +title: "ProviderPreferencesIgnore" --- ## Supported Types diff --git a/docs/components/ignore.mdx b/docs/components/providerpreferencesonly.mdx similarity index 84% rename from docs/components/ignore.mdx rename to docs/components/providerpreferencesonly.mdx index 8ba1315..a6e0692 100644 --- a/docs/components/ignore.mdx +++ b/docs/components/providerpreferencesonly.mdx @@ -1,5 +1,5 @@ --- -title: "Ignore" +title: "ProviderPreferencesOnly" --- ## Supported Types diff --git a/docs/components/order.mdx b/docs/components/providerpreferencesorder.mdx similarity index 84% rename from docs/components/order.mdx rename to docs/components/providerpreferencesorder.mdx index edc1ffc..b9fce30 100644 --- a/docs/components/order.mdx +++ b/docs/components/providerpreferencesorder.mdx @@ -1,5 +1,5 @@ --- -title: "Order" +title: "ProviderPreferencesOrder" --- ## Supported Types diff --git a/docs/components/sort.mdx b/docs/components/providerpreferencessort.mdx similarity index 92% rename from docs/components/sort.mdx rename to docs/components/providerpreferencessort.mdx index b12340f..72d6807 100644 --- a/docs/components/sort.mdx +++ b/docs/components/providerpreferencessort.mdx @@ -1,5 +1,5 @@ --- -title: "Sort" +title: "ProviderPreferencesSort" --- The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. diff --git a/docs/components/providerresponse.mdx b/docs/components/providerresponse.mdx index 65abb90..dd376f0 100644 --- a/docs/components/providerresponse.mdx +++ b/docs/components/providerresponse.mdx @@ -7,12 +7,13 @@ Details of a provider response for a generation attempt ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `endpoint_id` | *Optional[str]* | :heavy_minus_sign: | Internal endpoint identifier | ep_abc123 | -| `id` | *Optional[str]* | :heavy_minus_sign: | Upstream provider response identifier | chatcmpl-abc123 | -| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether the request used a bring-your-own-key | false | -| `latency` | *Optional[float]* | :heavy_minus_sign: | Response latency in milliseconds | 1200 | -| `model_permaslug` | *Optional[str]* | :heavy_minus_sign: | Canonical model slug | openai/gpt-4 | -| `provider_name` | [Optional[components.ProviderResponseProviderName]](../components/providerresponseprovidername.mdx) | :heavy_minus_sign: | Name of the provider | OpenAI | -| `status` | *Nullable[int]* | :heavy_check_mark: | HTTP status code from the provider | 200 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `endpoint_id` | *Optional[str]* | :heavy_minus_sign: | Internal endpoint identifier | ep_abc123 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Upstream provider response identifier | chatcmpl-abc123 | +| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether the request used a bring-your-own-key | false | +| `latency` | *Optional[float]* | :heavy_minus_sign: | Response latency in milliseconds | 1200 | +| `model_permaslug` | *Optional[str]* | :heavy_minus_sign: | Canonical model slug | openai/gpt-4 | +| `provider_name` | [Optional[components.ProviderResponseProviderName]](../components/providerresponseprovidername.mdx) | :heavy_minus_sign: | Name of the provider | OpenAI | +| `routed_service_tier` | [Optional[components.RoutedServiceTier]](../components/routedservicetier.mdx) | :heavy_minus_sign: | The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ. | priority | +| `status` | *Nullable[int]* | :heavy_check_mark: | HTTP status code from the provider | 200 | \ No newline at end of file diff --git a/docs/components/providerresponseprovidername.mdx b/docs/components/providerresponseprovidername.mdx index 85c97ab..aa00e25 100644 --- a/docs/components/providerresponseprovidername.mdx +++ b/docs/components/providerresponseprovidername.mdx @@ -73,6 +73,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"Crusoe"` - `"Darkbloom"` - `"Decart"` +- `"Deepgram"` - `"DeepInfra"` - `"DeepSeek"` - `"DekaLLM"` @@ -118,6 +119,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"Recraft"` - `"Reka"` - `"Relace"` +- `"Sail Research"` - `"Sakana AI"` - `"SambaNova"` - `"Seed"` diff --git a/docs/components/publicpricing.mdx b/docs/components/publicpricing.mdx index 0d8f6cf..894ca95 100644 --- a/docs/components/publicpricing.mdx +++ b/docs/components/publicpricing.mdx @@ -7,20 +7,21 @@ Pricing information for the model ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token | -| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token | -| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation | -| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) | -| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image | -| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image | -| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token | -| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token | -| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) | -| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. | -| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. | -| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token | -| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing | -| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request | -| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token | +| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token | +| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation | +| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) | +| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image | +| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image | +| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token | +| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token | +| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) | +| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. | +| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. | +| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token | +| `overrides` | List[[components.PricingOverride](../components/pricingoverride.mdx)] | :heavy_minus_sign: | Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. | +| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing | +| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request | +| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search | \ No newline at end of file diff --git a/docs/components/reasoningconfig.mdx b/docs/components/reasoningconfig.mdx index 819b083..d087355 100644 --- a/docs/components/reasoningconfig.mdx +++ b/docs/components/reasoningconfig.mdx @@ -7,9 +7,11 @@ Configuration for reasoning mode in the response ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | -| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | -| `enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `context` | [OptionalNullable[components.ReasoningContext]](../components/reasoningcontext.mdx) | :heavy_minus_sign: | Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. | all_turns | +| `effort` | [OptionalNullable[components.ReasoningEffort]](../components/reasoningeffort.mdx) | :heavy_minus_sign: | N/A | medium | +| `mode` | [OptionalNullable[components.ReasoningMode]](../components/reasoningmode.mdx) | :heavy_minus_sign: | Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. | standard | +| `summary` | [OptionalNullable[components.ReasoningSummaryVerbosity]](../components/reasoningsummaryverbosity.mdx) | :heavy_minus_sign: | N/A | auto | +| `enabled` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/reasoningcontext.mdx b/docs/components/reasoningcontext.mdx new file mode 100644 index 0000000..fa199a5 --- /dev/null +++ b/docs/components/reasoningcontext.mdx @@ -0,0 +1,23 @@ +--- +title: "ReasoningContext" +--- + +Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer. + +## Example Usage + +```python +from openrouter.components import ReasoningContext + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ReasoningContext = "auto" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"auto"` +- `"all_turns"` +- `"current_turn"` diff --git a/docs/components/reasoningdetailservertoolcall.mdx b/docs/components/reasoningdetailservertoolcall.mdx new file mode 100644 index 0000000..78f316a --- /dev/null +++ b/docs/components/reasoningdetailservertoolcall.mdx @@ -0,0 +1,19 @@ +--- +title: "ReasoningDetailServerToolCall" +--- + +Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `arguments` | *str* | :heavy_check_mark: | N/A | | +| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | :heavy_minus_sign: | N/A | unknown | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `index` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| `result` | *str* | :heavy_check_mark: | N/A | | +| `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `tool_name` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.ReasoningDetailServerToolCallType](../components/reasoningdetailservertoolcalltype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/reasoningdetailservertoolcalltype.mdx b/docs/components/reasoningdetailservertoolcalltype.mdx new file mode 100644 index 0000000..cb6b4d6 --- /dev/null +++ b/docs/components/reasoningdetailservertoolcalltype.mdx @@ -0,0 +1,15 @@ +--- +title: "ReasoningDetailServerToolCallType" +--- + +## Example Usage + +```python +from openrouter.components import ReasoningDetailServerToolCallType +value: ReasoningDetailServerToolCallType = "reasoning.server_tool_call" +``` + + +## Values + +- `"reasoning.server_tool_call"` diff --git a/docs/components/reasoningdetailunion.mdx b/docs/components/reasoningdetailunion.mdx index 49ac02b..1903984 100644 --- a/docs/components/reasoningdetailunion.mdx +++ b/docs/components/reasoningdetailunion.mdx @@ -13,6 +13,12 @@ Reasoning detail union schema value: components.ReasoningDetailEncrypted = /* values here */ ``` +### `components.ReasoningDetailServerToolCall` + +```python +value: components.ReasoningDetailServerToolCall = /* values here */ +``` + ### `components.ReasoningDetailSummary` ```python diff --git a/docs/components/reasoningmode.mdx b/docs/components/reasoningmode.mdx new file mode 100644 index 0000000..d288ff3 --- /dev/null +++ b/docs/components/reasoningmode.mdx @@ -0,0 +1,22 @@ +--- +title: "ReasoningMode" +--- + +Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer. + +## Example Usage + +```python +from openrouter.components import ReasoningMode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ReasoningMode = "standard" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"standard"` +- `"pro"` diff --git a/docs/components/responseformat.mdx b/docs/components/responseformat.mdx index 29709ef..4715eae 100644 --- a/docs/components/responseformat.mdx +++ b/docs/components/responseformat.mdx @@ -13,10 +13,10 @@ Response format configuration value: components.ChatFormatGrammarConfig = /* values here */ ``` -### `components.FormatJSONObjectConfig` +### `components.ChatFormatJSONObjectConfig` ```python -value: components.FormatJSONObjectConfig = /* values here */ +value: components.ChatFormatJSONObjectConfig = /* values here */ ``` ### `components.ChatFormatJSONSchemaConfig` diff --git a/docs/components/responsesrequest.mdx b/docs/components/responsesrequest.mdx index eb2f654..3090f61 100644 --- a/docs/components/responsesrequest.mdx +++ b/docs/components/responsesrequest.mdx @@ -10,7 +10,7 @@ Request schema for Responses endpoint | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `debug` | [Optional[components.ChatDebugOptions]](../components/chatdebugoptions.mdx) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | \{
"echo_upstream_body": true
} | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `image_config` | Dict[str, [components.ImageConfig](../components/imageconfig.mdx)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | \{
"aspect_ratio": "16:9",
"quality": "high"
} | @@ -29,6 +29,7 @@ Request schema for Responses endpoint | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../components/reasoningconfig.mdx) | :heavy_minus_sign: | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | diff --git a/docs/components/responsesrequesttoolunion.mdx b/docs/components/responsesrequesttoolunion.mdx index bfec11b..b06f8e7 100644 --- a/docs/components/responsesrequesttoolunion.mdx +++ b/docs/components/responsesrequesttoolunion.mdx @@ -124,10 +124,10 @@ value: components.FusionServerToolOpenRouter = /* values here */ value: components.ImageGenerationServerToolOpenRouter = /* values here */ ``` -### `components.ChatSearchModelsServerTool` +### `components.SearchModelsServerToolOpenRouter` ```python -value: components.ChatSearchModelsServerTool = /* values here */ +value: components.SearchModelsServerToolOpenRouter = /* values here */ ``` ### `components.WebFetchServerTool` diff --git a/docs/components/routedservicetier.mdx b/docs/components/routedservicetier.mdx new file mode 100644 index 0000000..0c82631 --- /dev/null +++ b/docs/components/routedservicetier.mdx @@ -0,0 +1,22 @@ +--- +title: "RoutedServiceTier" +--- + +The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ. + +## Example Usage + +```python +from openrouter.components import RoutedServiceTier + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: RoutedServiceTier = "flex" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"flex"` +- `"priority"` diff --git a/docs/components/rule.mdx b/docs/components/rule.mdx index d585c3b..14a9f71 100644 --- a/docs/components/rule.mdx +++ b/docs/components/rule.mdx @@ -4,8 +4,8 @@ title: "Rule" ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `field` | [components.FieldT](../components/fieldt.mdx) | :heavy_check_mark: | N/A | -| `operator` | [components.Operator](../components/operator.mdx) | :heavy_check_mark: | N/A | -| `value` | [Optional[components.ObservabilityFilterRulesConfigValue]](../components/observabilityfilterrulesconfigvalue.mdx) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `field` | [components.FieldT](../components/fieldt.mdx) | :heavy_check_mark: | N/A | +| `operator` | [components.Operator](../components/operator.mdx) | :heavy_check_mark: | N/A | +| `value` | [Optional[components.ObservabilityFilterRuleGroupValue]](../components/observabilityfilterrulegroupvalue.mdx) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/searchmodelsservertoolopenrouter.mdx b/docs/components/searchmodelsservertoolopenrouter.mdx new file mode 100644 index 0000000..e72c5e1 --- /dev/null +++ b/docs/components/searchmodelsservertoolopenrouter.mdx @@ -0,0 +1,13 @@ +--- +title: "SearchModelsServerToolOpenRouter" +--- + +OpenRouter built-in server tool: searches and filters AI models available on OpenRouter + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `parameters` | [Optional[components.SearchModelsServerToolConfig]](../components/searchmodelsservertoolconfig.mdx) | :heavy_minus_sign: | Configuration for the openrouter:experimental__search_models server tool | \{
"max_results": 5
} | +| `type` | [components.SearchModelsServerToolOpenRouterType](../components/searchmodelsservertoolopenroutertype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/searchmodelsservertoolopenroutertype.mdx b/docs/components/searchmodelsservertoolopenroutertype.mdx new file mode 100644 index 0000000..e57b048 --- /dev/null +++ b/docs/components/searchmodelsservertoolopenroutertype.mdx @@ -0,0 +1,15 @@ +--- +title: "SearchModelsServerToolOpenRouterType" +--- + +## Example Usage + +```python +from openrouter.components import SearchModelsServerToolOpenRouterType +value: SearchModelsServerToolOpenRouterType = "openrouter:experimental__search_models" +``` + + +## Values + +- `"openrouter:experimental__search_models"` diff --git a/docs/components/servertoolusedetails.mdx b/docs/components/servertoolusedetails.mdx index a9f0d64..de0d677 100644 --- a/docs/components/servertoolusedetails.mdx +++ b/docs/components/servertoolusedetails.mdx @@ -9,6 +9,6 @@ Usage for server-side tool execution (e.g., web search) | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `tool_calls_executed` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result | +| `tool_calls_executed` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result. | | `tool_calls_requested` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. | | `web_search_requests` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. | \ No newline at end of file diff --git a/docs/components/speechrequest.mdx b/docs/components/speechrequest.mdx index e984d1f..de4caac 100644 --- a/docs/components/speechrequest.mdx +++ b/docs/components/speechrequest.mdx @@ -10,8 +10,8 @@ Text-to-speech request input | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `input` | *str* | :heavy_check_mark: | Text to synthesize | Hello world | -| `model` | *str* | :heavy_check_mark: | TTS model identifier | elevenlabs/eleven-turbo-v2 | +| `model` | *str* | :heavy_check_mark: | TTS model identifier | mistralai/voxtral-mini-tts-2603 | | `provider` | [Optional[components.SpeechRequestProvider]](../components/speechrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `response_format` | [Optional[components.ResponseFormatEnum]](../components/responseformatenum.mdx) | :heavy_minus_sign: | Audio output format | pcm | +| `response_format` | [Optional[components.SpeechRequestResponseFormat]](../components/speechrequestresponseformat.mdx) | :heavy_minus_sign: | Audio output format | pcm | | `speed` | *Optional[float]* | :heavy_minus_sign: | Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. | 1 | -| `voice` | *str* | :heavy_check_mark: | Voice identifier (provider-specific). | alloy | \ No newline at end of file +| `voice` | *str* | :heavy_check_mark: | Voice identifier (provider-specific). | en_paul_neutral | \ No newline at end of file diff --git a/docs/components/responseformatenum.mdx b/docs/components/speechrequestresponseformat.mdx similarity index 61% rename from docs/components/responseformatenum.mdx rename to docs/components/speechrequestresponseformat.mdx index 0b7c4b0..9af8a5a 100644 --- a/docs/components/responseformatenum.mdx +++ b/docs/components/speechrequestresponseformat.mdx @@ -1,5 +1,5 @@ --- -title: "ResponseFormatEnum" +title: "SpeechRequestResponseFormat" --- Audio output format @@ -7,10 +7,10 @@ Audio output format ## Example Usage ```python -from openrouter.components import ResponseFormatEnum +from openrouter.components import SpeechRequestResponseFormat # Open enum: unrecognized values are captured as UnrecognizedStr -value: ResponseFormatEnum = "mp3" +value: SpeechRequestResponseFormat = "mp3" ``` diff --git a/docs/components/sttrequest.mdx b/docs/components/sttrequest.mdx index 198ca47..e81d9df 100644 --- a/docs/components/sttrequest.mdx +++ b/docs/components/sttrequest.mdx @@ -7,10 +7,12 @@ Speech-to-text request input. Accepts a JSON body with input_audio containing ba ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `input_audio` | [components.STTInputAudio](../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{
"data": "UklGRiQA...",
"format": "wav"
} | -| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en | -| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 | -| `provider` | [Optional[components.STTRequestProvider]](../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input_audio` | [components.STTInputAudio](../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{
"data": "UklGRiQA...",
"format": "wav"
} | +| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en | +| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 | +| `provider` | [Optional[components.STTRequestProvider]](../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | +| `response_format` | [Optional[components.STTRequestResponseFormat]](../components/sttrequestresponseformat.mdx) | :heavy_minus_sign: | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 | +| `timestamp_granularities` | List[[components.STTTimestampGranularity](../components/stttimestampgranularity.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". | [
"segment"
] | \ No newline at end of file diff --git a/docs/components/sttrequestresponseformat.mdx b/docs/components/sttrequestresponseformat.mdx new file mode 100644 index 0000000..d016021 --- /dev/null +++ b/docs/components/sttrequestresponseformat.mdx @@ -0,0 +1,22 @@ +--- +title: "STTRequestResponseFormat" +--- + +Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + +## Example Usage + +```python +from openrouter.components import STTRequestResponseFormat + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: STTRequestResponseFormat = "json" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"json"` +- `"verbose_json"` diff --git a/docs/components/sttresponse.mdx b/docs/components/sttresponse.mdx index 9a61014..5868e50 100644 --- a/docs/components/sttresponse.mdx +++ b/docs/components/sttresponse.mdx @@ -9,5 +9,10 @@ STT response containing transcribed text and optional usage statistics | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `duration` | *Optional[float]* | :heavy_minus_sign: | Duration of the input audio in seconds, present when response_format is verbose_json | 9.2 | +| `language` | *Optional[str]* | :heavy_minus_sign: | Detected or forced language, present when response_format is verbose_json | english | +| `segments` | List[[components.STTSegment](../components/sttsegment.mdx)] | :heavy_minus_sign: | Timestamped transcript segments, present when response_format is verbose_json | | +| `task` | *Optional[str]* | :heavy_minus_sign: | The task performed, present when response_format is verbose_json | transcribe | | `text` | *str* | :heavy_check_mark: | The transcribed text | Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees. | -| `usage` | [Optional[components.STTUsage]](../components/sttusage.mdx) | :heavy_minus_sign: | Aggregated usage statistics for the request | \{
"cost": 0.000508,
"input_tokens": 83,
"output_tokens": 30,
"seconds": 9.2,
"total_tokens": 113
} | \ No newline at end of file +| `usage` | [Optional[components.STTUsage]](../components/sttusage.mdx) | :heavy_minus_sign: | Aggregated usage statistics for the request | \{
"cost": 0.000508,
"input_tokens": 83,
"output_tokens": 30,
"seconds": 9.2,
"total_tokens": 113
} | +| `words` | List[[components.STTWord](../components/sttword.mdx)] | :heavy_minus_sign: | Timestamped words, present when the provider returns word-level timestamps | | \ No newline at end of file diff --git a/docs/components/sttsegment.mdx b/docs/components/sttsegment.mdx new file mode 100644 index 0000000..d0bcd9a --- /dev/null +++ b/docs/components/sttsegment.mdx @@ -0,0 +1,21 @@ +--- +title: "STTSegment" +--- + +A timestamped transcript segment, returned when response_format is verbose_json + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `avg_logprob` | *Optional[float]* | :heavy_minus_sign: | Average log probability of the segment | | +| `compression_ratio` | *Optional[float]* | :heavy_minus_sign: | Compression ratio of the segment | | +| `end` | *float* | :heavy_check_mark: | Segment end time in seconds | 3.2 | +| `id` | *int* | :heavy_check_mark: | Segment index within the transcript | 0 | +| `no_speech_prob` | *Optional[float]* | :heavy_minus_sign: | Probability the segment contains no speech | | +| `seek` | *Optional[int]* | :heavy_minus_sign: | Seek offset of the segment | 0 | +| `start` | *float* | :heavy_check_mark: | Segment start time in seconds | 0 | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | Temperature used for the segment | | +| `text` | *str* | :heavy_check_mark: | Transcribed text of the segment | Hello there. | +| `tokens` | List[*int*] | :heavy_minus_sign: | Token IDs of the segment | | \ No newline at end of file diff --git a/docs/components/stttimestampgranularity.mdx b/docs/components/stttimestampgranularity.mdx new file mode 100644 index 0000000..3505a51 --- /dev/null +++ b/docs/components/stttimestampgranularity.mdx @@ -0,0 +1,22 @@ +--- +title: "STTTimestampGranularity" +--- + +A timestamp detail level for verbose_json transcription responses. + +## Example Usage + +```python +from openrouter.components import STTTimestampGranularity + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: STTTimestampGranularity = "word" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"word"` +- `"segment"` diff --git a/docs/components/sttword.mdx b/docs/components/sttword.mdx new file mode 100644 index 0000000..994522a --- /dev/null +++ b/docs/components/sttword.mdx @@ -0,0 +1,14 @@ +--- +title: "STTWord" +--- + +A timestamped word, returned when the provider includes word-level timestamps + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `end` | *float* | :heavy_check_mark: | Word end time in seconds | 0.4 | +| `start` | *float* | :heavy_check_mark: | Word start time in seconds | 0 | +| `word` | *str* | :heavy_check_mark: | The transcribed word | Hello | \ No newline at end of file diff --git a/docs/components/submitgenerationfeedbackrequest.mdx b/docs/components/submitgenerationfeedbackrequest.mdx new file mode 100644 index 0000000..9e56152 --- /dev/null +++ b/docs/components/submitgenerationfeedbackrequest.mdx @@ -0,0 +1,14 @@ +--- +title: "SubmitGenerationFeedbackRequest" +--- + +Structured feedback about a specific generation + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `category` | [components.Category](../components/category.mdx) | :heavy_check_mark: | The category of feedback being reported | incorrect_response | +| `comment` | *Optional[str]* | :heavy_minus_sign: | An optional free-text comment describing the feedback | The model repeated the same paragraph three times. | +| `generation_id` | *str* | :heavy_check_mark: | The generation to submit feedback on | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG | \ No newline at end of file diff --git a/docs/components/submitgenerationfeedbackresponse.mdx b/docs/components/submitgenerationfeedbackresponse.mdx new file mode 100644 index 0000000..ba546e0 --- /dev/null +++ b/docs/components/submitgenerationfeedbackresponse.mdx @@ -0,0 +1,12 @@ +--- +title: "SubmitGenerationFeedbackResponse" +--- + +Confirmation that the feedback was recorded + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `data` | [components.SubmitGenerationFeedbackResponseData](../components/submitgenerationfeedbackresponsedata.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/submitgenerationfeedbackresponsedata.mdx b/docs/components/submitgenerationfeedbackresponsedata.mdx new file mode 100644 index 0000000..2b6ccfe --- /dev/null +++ b/docs/components/submitgenerationfeedbackresponsedata.mdx @@ -0,0 +1,9 @@ +--- +title: "SubmitGenerationFeedbackResponseData" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `success` | *Literal[True]* | :heavy_check_mark: | Whether the feedback was recorded | true | \ No newline at end of file diff --git a/docs/components/tooladvisor20260301.mdx b/docs/components/tooladvisor20260301.mdx index ee1f63b..a00186b 100644 --- a/docs/components/tooladvisor20260301.mdx +++ b/docs/components/tooladvisor20260301.mdx @@ -4,13 +4,13 @@ title: "ToolAdvisor20260301" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_callers` | List[[components.AnthropicAllowedCallers](../components/anthropicallowedcallers.mdx)] | :heavy_minus_sign: | N/A | [
"direct"
] | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `caching` | [OptionalNullable[components.Caching]](../components/caching.mdx) | :heavy_minus_sign: | N/A | \{
"type": "ephemeral"
} | -| `defer_loading` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `max_uses` | *Optional[int]* | :heavy_minus_sign: | N/A | | -| `model` | *str* | :heavy_check_mark: | N/A | | -| `name` | [components.NameAdvisor](../components/nameadvisor.mdx) | :heavy_check_mark: | N/A | | -| `type` | [components.TypeAdvisor20260301](../components/typeadvisor20260301.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `allowed_callers` | List[[components.AnthropicAllowedCallers](../components/anthropicallowedcallers.mdx)] | :heavy_minus_sign: | N/A | [
"direct"
] | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `caching` | [OptionalNullable[components.Caching]](../components/caching.mdx) | :heavy_minus_sign: | N/A | \{
"type": "ephemeral"
} | +| `defer_loading` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `max_uses` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| `model` | *str* | :heavy_check_mark: | N/A | | +| `name` | [components.NameAdvisor](../components/nameadvisor.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.TypeAdvisor20260301](../components/typeadvisor20260301.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/toolbash20250124.mdx b/docs/components/toolbash20250124.mdx index d9f17ef..d3a3ea6 100644 --- a/docs/components/toolbash20250124.mdx +++ b/docs/components/toolbash20250124.mdx @@ -4,8 +4,8 @@ title: "ToolBash20250124" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `name` | [components.NameBash](../components/namebash.mdx) | :heavy_check_mark: | N/A | | -| `type` | [components.TypeBash20250124](../components/typebash20250124.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `name` | [components.NameBash](../components/namebash.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.TypeBash20250124](../components/typebash20250124.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/toolcustom.mdx b/docs/components/toolcustom.mdx index 57073f6..ce9be3c 100644 --- a/docs/components/toolcustom.mdx +++ b/docs/components/toolcustom.mdx @@ -4,10 +4,10 @@ title: "ToolCustom" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `description` | *Optional[str]* | :heavy_minus_sign: | N/A | | -| `input_schema` | [components.InputSchema](../components/inputschema.mdx) | :heavy_check_mark: | N/A | | -| `name` | *str* | :heavy_check_mark: | N/A | | -| `type` | [Optional[components.ToolTypeCustom]](../components/tooltypecustom.mdx) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `description` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `input_schema` | [components.InputSchema](../components/inputschema.mdx) | :heavy_check_mark: | N/A | | +| `name` | *str* | :heavy_check_mark: | N/A | | +| `type` | [Optional[components.ToolTypeCustom]](../components/tooltypecustom.mdx) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/tooltexteditor20250124.mdx b/docs/components/tooltexteditor20250124.mdx index 0fe06a9..a7f1a27 100644 --- a/docs/components/tooltexteditor20250124.mdx +++ b/docs/components/tooltexteditor20250124.mdx @@ -4,8 +4,8 @@ title: "ToolTextEditor20250124" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `name` | [components.NameStrReplaceEditor](../components/namestrreplaceeditor.mdx) | :heavy_check_mark: | N/A | | -| `type` | [components.TypeTextEditor20250124](../components/typetexteditor20250124.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `name` | [components.NameStrReplaceEditor](../components/namestrreplaceeditor.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.TypeTextEditor20250124](../components/typetexteditor20250124.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/toolwebsearch20250305.mdx b/docs/components/toolwebsearch20250305.mdx index 3351013..36a0964 100644 --- a/docs/components/toolwebsearch20250305.mdx +++ b/docs/components/toolwebsearch20250305.mdx @@ -4,12 +4,12 @@ title: "ToolWebSearch20250305" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | | -| `blocked_domains` | List[*str*] | :heavy_minus_sign: | N/A | | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `max_uses` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | -| `name` | [components.NameWebSearch1](../components/namewebsearch1.mdx) | :heavy_check_mark: | N/A | | -| `type` | [components.TypeWebSearch20250305](../components/typewebsearch20250305.mdx) | :heavy_check_mark: | N/A | | -| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | :heavy_minus_sign: | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | | +| `blocked_domains` | List[*str*] | :heavy_minus_sign: | N/A | | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `max_uses` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `name` | [components.NameWebSearch1](../components/namewebsearch1.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.TypeWebSearch20250305](../components/typewebsearch20250305.mdx) | :heavy_check_mark: | N/A | | +| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | :heavy_minus_sign: | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/components/toolwebsearch20260209.mdx b/docs/components/toolwebsearch20260209.mdx index a70393e..062b315 100644 --- a/docs/components/toolwebsearch20260209.mdx +++ b/docs/components/toolwebsearch20260209.mdx @@ -4,13 +4,13 @@ title: "ToolWebSearch20260209" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_callers` | List[[components.AnthropicAllowedCallers](../components/anthropicallowedcallers.mdx)] | :heavy_minus_sign: | N/A | [
"direct"
] | -| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | | -| `blocked_domains` | List[*str*] | :heavy_minus_sign: | N/A | | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | -| `max_uses` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | -| `name` | [components.NameWebSearch2](../components/namewebsearch2.mdx) | :heavy_check_mark: | N/A | | -| `type` | [components.TypeWebSearch20260209](../components/typewebsearch20260209.mdx) | :heavy_check_mark: | N/A | | -| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | :heavy_minus_sign: | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `allowed_callers` | List[[components.AnthropicAllowedCallers](../components/anthropicallowedcallers.mdx)] | :heavy_minus_sign: | N/A | [
"direct"
] | +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | | +| `blocked_domains` | List[*str*] | :heavy_minus_sign: | N/A | | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | +| `max_uses` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `name` | [components.NameWebSearch2](../components/namewebsearch2.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.TypeWebSearch20260209](../components/typewebsearch20260209.mdx) | :heavy_check_mark: | N/A | | +| `user_location` | [OptionalNullable[components.AnthropicWebSearchToolUserLocation]](../components/anthropicwebsearchtooluserlocation.mdx) | :heavy_minus_sign: | N/A | \{
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/components/typeadditionaltools.mdx b/docs/components/typeadditionaltools.mdx new file mode 100644 index 0000000..fd61616 --- /dev/null +++ b/docs/components/typeadditionaltools.mdx @@ -0,0 +1,15 @@ +--- +title: "TypeAdditionalTools" +--- + +## Example Usage + +```python +from openrouter.components import TypeAdditionalTools +value: TypeAdditionalTools = "additional_tools" +``` + + +## Values + +- `"additional_tools"` diff --git a/docs/components/typeagentmessage.mdx b/docs/components/typeagentmessage.mdx new file mode 100644 index 0000000..b03f1ab --- /dev/null +++ b/docs/components/typeagentmessage.mdx @@ -0,0 +1,15 @@ +--- +title: "TypeAgentMessage" +--- + +## Example Usage + +```python +from openrouter.components import TypeAgentMessage +value: TypeAgentMessage = "agent_message" +``` + + +## Values + +- `"agent_message"` diff --git a/docs/components/typeencryptedcontent.mdx b/docs/components/typeencryptedcontent.mdx new file mode 100644 index 0000000..62d36e2 --- /dev/null +++ b/docs/components/typeencryptedcontent.mdx @@ -0,0 +1,15 @@ +--- +title: "TypeEncryptedContent" +--- + +## Example Usage + +```python +from openrouter.components import TypeEncryptedContent +value: TypeEncryptedContent = "encrypted_content" +``` + + +## Values + +- `"encrypted_content"` diff --git a/docs/components/updateguardrailrequest.mdx b/docs/components/updateguardrailrequest.mdx index 6127914..be349dd 100644 --- a/docs/components/updateguardrailrequest.mdx +++ b/docs/components/updateguardrailrequest.mdx @@ -4,20 +4,21 @@ title: "UpdateGuardrailRequest" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | -| `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | -| `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | -| ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | -| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | true | -| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | true | -| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | true | -| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | true | -| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | -| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | -| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | -| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | +| ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | +| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_xai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. | true | +| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | +| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | +| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | \ No newline at end of file diff --git a/docs/components/updateguardrailresponse.mdx b/docs/components/updateguardrailresponse.mdx index 9c95861..7fd2bca 100644 --- a/docs/components/updateguardrailresponse.mdx +++ b/docs/components/updateguardrailresponse.mdx @@ -4,6 +4,6 @@ title: "UpdateGuardrailResponse" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [components.Guardrail](../components/guardrail.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.Guardrail](../components/guardrail.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"enforce_zdr_xai": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file diff --git a/docs/components/updateobservabilitydestinationrequest.mdx b/docs/components/updateobservabilitydestinationrequest.mdx index 1a6d041..f133842 100644 --- a/docs/components/updateobservabilitydestinationrequest.mdx +++ b/docs/components/updateobservabilitydestinationrequest.mdx @@ -9,7 +9,7 @@ title: "UpdateObservabilityDestinationRequest" | `api_key_hashes` | List[*str*] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. | null | | `config` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value. | \{
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
} | | `enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether the destination is enabled. | true | -| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfig]](../components/observabilityfilterrulesconfig.mdx) | :heavy_minus_sign: | N/A | null | +| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfigNullable]](../components/observabilityfilterrulesconfignullable.mdx) | :heavy_minus_sign: | N/A | null | | `name` | *Optional[str]* | :heavy_minus_sign: | Human-readable name for the destination. | Production Langfuse | | `privacy_mode` | *Optional[bool]* | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | | `sampling_rate` | *Optional[float]* | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | \ No newline at end of file diff --git a/docs/components/usage.mdx b/docs/components/usage.mdx index c400fc4..2b20336 100644 --- a/docs/components/usage.mdx +++ b/docs/components/usage.mdx @@ -7,13 +7,14 @@ Token usage information for the response ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `input_tokens` | *int* | :heavy_check_mark: | N/A | -| `input_tokens_details` | [components.InputTokensDetails](../components/inputtokensdetails.mdx) | :heavy_check_mark: | N/A | -| `output_tokens` | *int* | :heavy_check_mark: | N/A | -| `output_tokens_details` | [components.OutputTokensDetails](../components/outputtokensdetails.mdx) | :heavy_check_mark: | N/A | -| `total_tokens` | *int* | :heavy_check_mark: | N/A | -| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | -| `cost_details` | [Optional[components.UsageCostDetails]](../components/usagecostdetails.mdx) | :heavy_minus_sign: | N/A | -| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `input_tokens` | *int* | :heavy_check_mark: | N/A | | +| `input_tokens_details` | [components.InputTokensDetails](../components/inputtokensdetails.mdx) | :heavy_check_mark: | N/A | | +| `output_tokens` | *int* | :heavy_check_mark: | N/A | | +| `output_tokens_details` | [components.OutputTokensDetails](../components/outputtokensdetails.mdx) | :heavy_check_mark: | N/A | | +| `total_tokens` | *int* | :heavy_check_mark: | N/A | | +| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | | +| `cost_details` | [Optional[components.UsageCostDetails]](../components/usagecostdetails.mdx) | :heavy_minus_sign: | N/A | | +| `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `server_tool_use_details` | [OptionalNullable[components.ServerToolUseDetails]](../components/servertoolusedetails.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | \{
"tool_calls_executed": 2,
"tool_calls_requested": 2,
"web_search_requests": 2
} | \ No newline at end of file diff --git a/docs/components/videogenerationrequestoptions.mdx b/docs/components/videogenerationrequestoptions.mdx index f3d6474..3f914db 100644 --- a/docs/components/videogenerationrequestoptions.mdx +++ b/docs/components/videogenerationrequestoptions.mdx @@ -40,6 +40,7 @@ Provider-specific options keyed by provider slug. Only options for the matched p | `crusoe` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `darkbloom` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `decart` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `deepgram` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `deepinfra` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `deepseek` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `dekallm` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | @@ -106,7 +107,8 @@ Provider-specific options keyed by provider slug. Only options for the matched p | `reka` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `relace` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `replicate` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | -| `sakana_ai` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `sail_research` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | +| `sakana` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `sambanova` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `sambanova_cloaked` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | | `seed` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | diff --git a/docs/operations/classifierdimensions.mdx b/docs/operations/classifierdimensions.mdx new file mode 100644 index 0000000..f7cf34f --- /dev/null +++ b/docs/operations/classifierdimensions.mdx @@ -0,0 +1,14 @@ +--- +title: "ClassifierDimensions" +--- + +Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `classifier_id` | *str* | :heavy_check_mark: | UUID of the classifier whose tags to group by. | 550e8400-e29b-41d4-a716-446655440000 | +| `dimension_names` | List[*str*] | :heavy_minus_sign: | N/A | | +| `include_nulls` | *Optional[bool]* | :heavy_minus_sign: | When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations. | | \ No newline at end of file diff --git a/docs/operations/classifierfilters.mdx b/docs/operations/classifierfilters.mdx new file mode 100644 index 0000000..db4dbe9 --- /dev/null +++ b/docs/operations/classifierfilters.mdx @@ -0,0 +1,13 @@ +--- +title: "ClassifierFilters" +--- + +Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `classifier_id` | *str* | :heavy_check_mark: | UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified. | 550e8400-e29b-41d4-a716-446655440000 | +| `filters` | List[[operations.ClassifierFiltersFilter](../operations/classifierfiltersfilter.mdx)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/classifierfiltersfilter.mdx b/docs/operations/classifierfiltersfilter.mdx new file mode 100644 index 0000000..f09e983 --- /dev/null +++ b/docs/operations/classifierfiltersfilter.mdx @@ -0,0 +1,11 @@ +--- +title: "ClassifierFiltersFilter" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `field` | *str* | :heavy_check_mark: | Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type"). | department | +| `operator` | *str* | :heavy_check_mark: | Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings. | eq | +| `value` | [operations.ClassifierFiltersValue](../operations/classifierfiltersvalue.mdx) | :heavy_check_mark: | Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in. | Engineering | \ No newline at end of file diff --git a/docs/operations/classifierfiltersvalue.mdx b/docs/operations/classifierfiltersvalue.mdx new file mode 100644 index 0000000..47e7dc4 --- /dev/null +++ b/docs/operations/classifierfiltersvalue.mdx @@ -0,0 +1,27 @@ +--- +title: "ClassifierFiltersValue" +--- + +Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `List[operations.ValueClassifierFilters]` + +```python +value: List[operations.ValueClassifierFilters] = /* values here */ +``` + diff --git a/docs/operations/contextbucket.mdx b/docs/operations/contextbucket.mdx new file mode 100644 index 0000000..d246161 --- /dev/null +++ b/docs/operations/contextbucket.mdx @@ -0,0 +1,25 @@ +--- +title: "ContextBucket" +--- + +Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + +## Example Usage + +```python +from openrouter.operations import ContextBucket + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ContextBucket = "1K" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"1K"` +- `"10K"` +- `"100K"` +- `"1M"` +- `"10M"` diff --git a/docs/operations/costdetails.mdx b/docs/operations/costdetails.mdx deleted file mode 100644 index 753493b..0000000 --- a/docs/operations/costdetails.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "CostDetails" ---- - -Breakdown of upstream inference costs - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | -| `upstream_inference_completions_cost` | *float* | :heavy_check_mark: | N/A | -| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `upstream_inference_prompt_cost` | *float* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/createaudiospeechrequest.mdx b/docs/operations/createaudiospeechrequest.mdx index 176fe25..a9aaac3 100644 --- a/docs/operations/createaudiospeechrequest.mdx +++ b/docs/operations/createaudiospeechrequest.mdx @@ -9,4 +9,4 @@ title: "CreateAudioSpeechRequest" | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `speech_request` | [components.SpeechRequest](../components/speechrequest.mdx) | :heavy_check_mark: | N/A | \{
"input": "Hello world",
"model": "elevenlabs/eleven-turbo-v2",
"response_format": "pcm",
"speed": 1,
"voice": "alloy"
} | \ No newline at end of file +| `speech_request` | [components.SpeechRequest](../components/speechrequest.mdx) | :heavy_check_mark: | N/A | \{
"input": "Hello world",
"model": "mistralai/voxtral-mini-tts-2603",
"response_format": "pcm",
"speed": 1,
"voice": "en_paul_neutral"
} | \ No newline at end of file diff --git a/docs/operations/createaudiotranscriptionsmultipartfile.mdx b/docs/operations/createaudiotranscriptionsmultipartfile.mdx new file mode 100644 index 0000000..3fa3d99 --- /dev/null +++ b/docs/operations/createaudiotranscriptionsmultipartfile.mdx @@ -0,0 +1,11 @@ +--- +title: "CreateAudioTranscriptionsMultipartFile" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `file_name` | *str* | :heavy_check_mark: | N/A | +| `content` | *Union[bytes, IO[bytes], io.IOBase]* | :heavy_check_mark: | N/A | +| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/operations/createaudiotranscriptionsmultipartglobals.mdx b/docs/operations/createaudiotranscriptionsmultipartglobals.mdx new file mode 100644 index 0000000..40d3f12 --- /dev/null +++ b/docs/operations/createaudiotranscriptionsmultipartglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "CreateAudioTranscriptionsMultipartGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createaudiotranscriptionsmultipartrequest.mdx b/docs/operations/createaudiotranscriptionsmultipartrequest.mdx new file mode 100644 index 0000000..b503166 --- /dev/null +++ b/docs/operations/createaudiotranscriptionsmultipartrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "CreateAudioTranscriptionsMultipartRequest" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `request_body` | [operations.CreateAudioTranscriptionsMultipartRequestBody](../operations/createaudiotranscriptionsmultipartrequestbody.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx b/docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx new file mode 100644 index 0000000..3054ebe --- /dev/null +++ b/docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx @@ -0,0 +1,14 @@ +--- +title: "CreateAudioTranscriptionsMultipartRequestBody" +--- + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. | +| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). | +| `model` | *str* | :heavy_check_mark: | The model to use for transcription. | +| `response_format` | [Optional[operations.ResponseFormat]](../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. | +| `timestamp_granularities` | List[[operations.TimestampGranularities](../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. | \ No newline at end of file diff --git a/docs/operations/createembeddingsusage.mdx b/docs/operations/createembeddingsusage.mdx index 1050293..1218cf9 100644 --- a/docs/operations/createembeddingsusage.mdx +++ b/docs/operations/createembeddingsusage.mdx @@ -10,7 +10,7 @@ Token usage statistics | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cost` | *Optional[float]* | :heavy_minus_sign: | Cost of the request in credits | 0.0001 | -| `cost_details` | [OptionalNullable[operations.CostDetails]](../operations/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} | +| `cost_details` | [OptionalNullable[components.CostDetails]](../components/costdetails.mdx) | :heavy_minus_sign: | Breakdown of upstream inference costs | \{
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} | | `is_byok` | *Optional[bool]* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | | `prompt_tokens` | *int* | :heavy_check_mark: | Number of tokens in the input | 8 | | `prompt_tokens_details` | [Optional[operations.PromptTokensDetails]](../operations/prompttokensdetails.mdx) | :heavy_minus_sign: | Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. | | diff --git a/docs/operations/createguardrailrequest.mdx b/docs/operations/createguardrailrequest.mdx index 906c993..645bf9a 100644 --- a/docs/operations/createguardrailrequest.mdx +++ b/docs/operations/createguardrailrequest.mdx @@ -4,9 +4,9 @@ title: "CreateGuardrailRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `create_guardrail_request` | [components.CreateGuardrailRequest](../components/createguardrailrequest.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"deepseek"
],
"content_filter_builtins": [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
],
"content_filters": null,
"description": "A guardrail for limiting API usage",
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 50,
"name": "My New Guardrail",
"reset_interval": "monthly"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `create_guardrail_request` | [components.CreateGuardrailRequest](../components/createguardrailrequest.mdx) | :heavy_check_mark: | N/A | \{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"deepseek"
],
"content_filter_builtins": [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
],
"content_filters": null,
"description": "A guardrail for limiting API usage",
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"enforce_zdr_xai": false,
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 50,
"name": "My New Guardrail",
"reset_interval": "monthly"
} | \ No newline at end of file diff --git a/docs/operations/getmodelsrequest.mdx b/docs/operations/getmodelsrequest.mdx index 272e144..532a1ab 100644 --- a/docs/operations/getmodelsrequest.mdx +++ b/docs/operations/getmodelsrequest.mdx @@ -4,23 +4,37 @@ title: "GetModelsRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `category` | [Optional[operations.GetModelsCategory]](../operations/getmodelscategory.mdx) | :heavy_minus_sign: | Filter models by use case category | programming | -| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature | -| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | -| `sort` | [Optional[operations.GetModelsSort]](../operations/getmodelssort.mdx) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest | -| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 | -| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image | -| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 | -| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 | -| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 | -| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT | -| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic | -| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic | -| `distillable` | [Optional[operations.Distillable]](../operations/distillable.mdx) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true | -| `zdr` | [Optional[operations.Zdr]](../operations/zdr.mdx) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true | -| `region` | [Optional[operations.Region]](../operations/region.mdx) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | +| `category` | [Optional[operations.GetModelsCategory]](../operations/getmodelscategory.mdx) | :heavy_minus_sign: | Filter models by use case category | programming | +| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature | +| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | +| `sort` | [Optional[operations.GetModelsSort]](../operations/getmodelssort.mdx) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest | +| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 | +| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image | +| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 | +| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 | +| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 | +| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT | +| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic | +| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic | +| `distillable` | [Optional[operations.Distillable]](../operations/distillable.mdx) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true | +| `zdr` | [Optional[operations.Zdr]](../operations/zdr.mdx) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true | +| `region` | [Optional[operations.Region]](../operations/region.mdx) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu | +| `min_output_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum completion (output) price in $/M tokens. | 0 | +| `max_output_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum completion (output) price in $/M tokens. | 10 | +| `min_age_days` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum model age in days since its creation date. | 0 | +| `max_age_days` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum model age in days since its creation date. | 90 | +| `min_intelligence_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum Artificial Analysis intelligence index. | 50 | +| `max_intelligence_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum Artificial Analysis intelligence index. | 100 | +| `min_coding_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum Artificial Analysis coding index. | 50 | +| `max_coding_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum Artificial Analysis coding index. | 100 | +| `min_agentic_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum Artificial Analysis agentic index. | 50 | +| `max_agentic_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum Artificial Analysis agentic index. | 100 | +| `min_tool_success_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason). | 0.9 | +| `max_tool_success_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tool-calling success rate, as a fraction in [0, 1]. | 1 | \ No newline at end of file diff --git a/docs/operations/getmodelsresponse.mdx b/docs/operations/getmodelsresponse.mdx new file mode 100644 index 0000000..c7353f3 --- /dev/null +++ b/docs/operations/getmodelsresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "GetModelsResponse" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `result` | [components.ModelsListResponse](../components/modelslistresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [
\{
"architecture": \{
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": \{
"details": "/api/v1/models/openai/gpt-4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": \{
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens",
"frequency_penalty",
"presence_penalty"
],
"supported_voices": null,
"top_provider": \{
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
}
],
"links": \{
"next": "/api/v1/models?offset=500\u0026limit=500"
},
"total_count": 150
} | \ No newline at end of file diff --git a/docs/operations/getmodelssort.mdx b/docs/operations/getmodelssort.mdx index 9a5681e..537a70d 100644 --- a/docs/operations/getmodelssort.mdx +++ b/docs/operations/getmodelssort.mdx @@ -2,7 +2,7 @@ title: "GetModelsSort" --- -Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. +Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. ## Example Usage @@ -27,4 +27,6 @@ This is an open enum. Unrecognized values will not fail type checks. - `"throughput-high-to-low"` - `"latency-low-to-high"` - `"intelligence-high-to-low"` +- `"coding-high-to-low"` +- `"agentic-high-to-low"` - `"design-arena-elo-high-to-low"` diff --git a/docs/operations/getrankingsdailycategory.mdx b/docs/operations/getrankingsdailycategory.mdx new file mode 100644 index 0000000..a81ff4b --- /dev/null +++ b/docs/operations/getrankingsdailycategory.mdx @@ -0,0 +1,32 @@ +--- +title: "GetRankingsDailyCategory" +--- + +Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + +## Example Usage + +```python +from openrouter.operations import GetRankingsDailyCategory + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: GetRankingsDailyCategory = "programming" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"programming"` +- `"roleplay"` +- `"marketing"` +- `"marketing/seo"` +- `"technology"` +- `"science"` +- `"translation"` +- `"legal"` +- `"finance"` +- `"health"` +- `"trivia"` +- `"academia"` diff --git a/docs/operations/getrankingsdailyrequest.mdx b/docs/operations/getrankingsdailyrequest.mdx index 1788b94..04784a9 100644 --- a/docs/operations/getrankingsdailyrequest.mdx +++ b/docs/operations/getrankingsdailyrequest.mdx @@ -4,10 +4,15 @@ title: "GetRankingsDailyRequest" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | -| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | +| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | +| `period` | [Optional[operations.Period]](../operations/period.mdx) | :heavy_minus_sign: | Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. | day | +| `modality` | [Optional[operations.Modality]](../operations/modality.mdx) | :heavy_minus_sign: | Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. | text | +| `context_bucket` | [Optional[operations.ContextBucket]](../operations/contextbucket.mdx) | :heavy_minus_sign: | Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. | 100K | +| `category` | [Optional[operations.GetRankingsDailyCategory]](../operations/getrankingsdailycategory.mdx) | :heavy_minus_sign: | Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. | programming | +| `language_type` | [Optional[operations.LanguageType]](../operations/languagetype.mdx) | :heavy_minus_sign: | Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. | natural | \ No newline at end of file diff --git a/docs/operations/languagetype.mdx b/docs/operations/languagetype.mdx new file mode 100644 index 0000000..0d94d66 --- /dev/null +++ b/docs/operations/languagetype.mdx @@ -0,0 +1,22 @@ +--- +title: "LanguageType" +--- + +Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + +## Example Usage + +```python +from openrouter.operations import LanguageType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: LanguageType = "natural" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"natural"` +- `"programming"` diff --git a/docs/operations/listembeddingsmodelsrequest.mdx b/docs/operations/listembeddingsmodelsrequest.mdx index 76c365b..7e49148 100644 --- a/docs/operations/listembeddingsmodelsrequest.mdx +++ b/docs/operations/listembeddingsmodelsrequest.mdx @@ -4,8 +4,10 @@ title: "ListEmbeddingsModelsRequest" ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | \ No newline at end of file diff --git a/docs/operations/listembeddingsmodelsresponse.mdx b/docs/operations/listembeddingsmodelsresponse.mdx new file mode 100644 index 0000000..053af0a --- /dev/null +++ b/docs/operations/listembeddingsmodelsresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "ListEmbeddingsModelsResponse" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `result` | [components.ModelsListResponse](../components/modelslistresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [
\{
"architecture": \{
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": \{
"details": "/api/v1/models/openai/gpt-4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": \{
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens",
"frequency_penalty",
"presence_penalty"
],
"supported_voices": null,
"top_provider": \{
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
}
],
"links": \{
"next": "/api/v1/models?offset=500\u0026limit=500"
},
"total_count": 150
} | \ No newline at end of file diff --git a/docs/operations/listguardrailsresponse.mdx b/docs/operations/listguardrailsresponse.mdx index 519808b..48f98d5 100644 --- a/docs/operations/listguardrailsresponse.mdx +++ b/docs/operations/listguardrailsresponse.mdx @@ -4,6 +4,6 @@ title: "ListGuardrailsResponse" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `result` | [components.ListGuardrailsResponse](../components/listguardrailsresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [
\{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
}
],
"total_count": 1
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `result` | [components.ListGuardrailsResponse](../components/listguardrailsresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [
\{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
\{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"enforce_zdr_xai": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/operations/listmodelsuserrequest.mdx b/docs/operations/listmodelsuserrequest.mdx index 3b65b53..ca39aea 100644 --- a/docs/operations/listmodelsuserrequest.mdx +++ b/docs/operations/listmodelsuserrequest.mdx @@ -4,8 +4,10 @@ title: "ListModelsUserRequest" ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | \ No newline at end of file diff --git a/docs/operations/listmodelsuserresponse.mdx b/docs/operations/listmodelsuserresponse.mdx new file mode 100644 index 0000000..380f686 --- /dev/null +++ b/docs/operations/listmodelsuserresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "ListModelsUserResponse" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `result` | [components.ModelsListResponse](../components/modelslistresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [
\{
"architecture": \{
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": \{
"details": "/api/v1/models/openai/gpt-4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": \{
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens",
"frequency_penalty",
"presence_penalty"
],
"supported_voices": null,
"top_provider": \{
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
}
],
"links": \{
"next": "/api/v1/models?offset=500\u0026limit=500"
},
"total_count": 150
} | \ No newline at end of file diff --git a/docs/operations/modality.mdx b/docs/operations/modality.mdx new file mode 100644 index 0000000..63f8e98 --- /dev/null +++ b/docs/operations/modality.mdx @@ -0,0 +1,25 @@ +--- +title: "Modality" +--- + +Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + +## Example Usage + +```python +from openrouter.operations import Modality + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Modality = "text" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"text"` +- `"image"` +- `"image_output"` +- `"audio"` +- `"tool_calling"` diff --git a/docs/operations/period.mdx b/docs/operations/period.mdx new file mode 100644 index 0000000..a1fdee3 --- /dev/null +++ b/docs/operations/period.mdx @@ -0,0 +1,23 @@ +--- +title: "Period" +--- + +Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + +## Example Usage + +```python +from openrouter.operations import Period + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Period = "day" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"day"` +- `"week"` +- `"month"` diff --git a/docs/operations/provider.mdx b/docs/operations/provider.mdx index 1b6b620..8ea30eb 100644 --- a/docs/operations/provider.mdx +++ b/docs/operations/provider.mdx @@ -43,6 +43,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"crusoe"` - `"darkbloom"` - `"decart"` +- `"deepgram"` - `"deepinfra"` - `"deepseek"` - `"dekallm"` @@ -66,6 +67,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"liquid"` - `"mancer"` - `"mara"` +- `"meta"` - `"minimax"` - `"mistral"` - `"modelrun"` @@ -89,7 +91,8 @@ This is an open enum. Unrecognized values will not fail type checks. - `"recraft"` - `"reka"` - `"relace"` -- `"sakana-ai"` +- `"sail-research"` +- `"sakana"` - `"sambanova"` - `"seed"` - `"siliconflow"` diff --git a/docs/operations/queryanalyticsrequestbody.mdx b/docs/operations/queryanalyticsrequestbody.mdx index 79876b7..ceec61f 100644 --- a/docs/operations/queryanalyticsrequestbody.mdx +++ b/docs/operations/queryanalyticsrequestbody.mdx @@ -6,6 +6,8 @@ title: "QueryAnalyticsRequestBody" | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `classifier_dimensions` | [Optional[operations.ClassifierDimensions]](../operations/classifierdimensions.mdx) | :heavy_minus_sign: | Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. | | +| `classifier_filters` | [Optional[operations.ClassifierFilters]](../operations/classifierfilters.mdx) | :heavy_minus_sign: | Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. | | | `dimensions` | List[*str*] | :heavy_minus_sign: | N/A | | | `filters` | List[[operations.Filter](../operations/filter_.mdx)] | :heavy_minus_sign: | N/A | | | `granularity` | *Optional[str]* | :heavy_minus_sign: | Time granularity | day | diff --git a/docs/operations/responseformat.mdx b/docs/operations/responseformat.mdx new file mode 100644 index 0000000..b7f7723 --- /dev/null +++ b/docs/operations/responseformat.mdx @@ -0,0 +1,22 @@ +--- +title: "ResponseFormat" +--- + +The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). + +## Example Usage + +```python +from openrouter.operations import ResponseFormat + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ResponseFormat = "json" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"json"` +- `"verbose_json"` diff --git a/docs/operations/submitgenerationfeedbackglobals.mdx b/docs/operations/submitgenerationfeedbackglobals.mdx new file mode 100644 index 0000000..bbd731b --- /dev/null +++ b/docs/operations/submitgenerationfeedbackglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "SubmitGenerationFeedbackGlobals" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/submitgenerationfeedbackrequest.mdx b/docs/operations/submitgenerationfeedbackrequest.mdx new file mode 100644 index 0000000..18f5cc3 --- /dev/null +++ b/docs/operations/submitgenerationfeedbackrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "SubmitGenerationFeedbackRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `submit_generation_feedback_request` | [components.SubmitGenerationFeedbackRequest](../components/submitgenerationfeedbackrequest.mdx) | :heavy_check_mark: | N/A | \{
"category": "incorrect_response",
"comment": "The model repeated the same paragraph three times.",
"generation_id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG"
} | \ No newline at end of file diff --git a/docs/components/modelenum.mdx b/docs/operations/timestampgranularities.mdx similarity index 55% rename from docs/components/modelenum.mdx rename to docs/operations/timestampgranularities.mdx index 815fb46..c783ad0 100644 --- a/docs/components/modelenum.mdx +++ b/docs/operations/timestampgranularities.mdx @@ -1,14 +1,14 @@ --- -title: "ModelEnum" +title: "TimestampGranularities" --- ## Example Usage ```python -from openrouter.components import ModelEnum +from openrouter.operations import TimestampGranularities # Open enum: unrecognized values are captured as UnrecognizedStr -value: ModelEnum = "gpt-image-1" +value: TimestampGranularities = "word" ``` @@ -16,5 +16,5 @@ value: ModelEnum = "gpt-image-1" This is an open enum. Unrecognized values will not fail type checks. -- `"gpt-image-1"` -- `"gpt-image-1-mini"` +- `"word"` +- `"segment"` diff --git a/docs/operations/file.mdx b/docs/operations/uploadfilefile.mdx similarity index 97% rename from docs/operations/file.mdx rename to docs/operations/uploadfilefile.mdx index 0c3c666..f07c77d 100644 --- a/docs/operations/file.mdx +++ b/docs/operations/uploadfilefile.mdx @@ -1,5 +1,5 @@ --- -title: "File" +title: "UploadFileFile" --- ## Fields diff --git a/docs/operations/uploadfilerequestbody.mdx b/docs/operations/uploadfilerequestbody.mdx index 4a9975f..e91f2d3 100644 --- a/docs/operations/uploadfilerequestbody.mdx +++ b/docs/operations/uploadfilerequestbody.mdx @@ -4,6 +4,6 @@ title: "UploadFileRequestBody" ## Fields -| Field | Type | Required | Description | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `file` | [operations.File](../operations/file.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `file` | [operations.UploadFileFile](../operations/uploadfilefile.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/valueclassifierfilters.mdx b/docs/operations/valueclassifierfilters.mdx new file mode 100644 index 0000000..9280541 --- /dev/null +++ b/docs/operations/valueclassifierfilters.mdx @@ -0,0 +1,18 @@ +--- +title: "ValueClassifierFilters" +--- + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/sdks/betaanalytics/README.mdx b/docs/sdks/betaanalytics/README.mdx index 716e463..6e4b06f 100644 --- a/docs/sdks/betaanalytics/README.mdx +++ b/docs/sdks/betaanalytics/README.mdx @@ -100,6 +100,8 @@ with OpenRouter( | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `classifier_dimensions` | [Optional[operations.ClassifierDimensions]](../../operations/classifierdimensions.mdx) | :heavy_minus_sign: | Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. | | +| `classifier_filters` | [Optional[operations.ClassifierFilters]](../../operations/classifierfilters.mdx) | :heavy_minus_sign: | Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. | | | `dimensions` | List[*str*] | :heavy_minus_sign: | N/A | | | `filters` | List[[operations.Filter](../../operations/filter_.mdx)] | :heavy_minus_sign: | N/A | | | `granularity` | *Optional[str]* | :heavy_minus_sign: | Time granularity | day | diff --git a/docs/sdks/byok/README.mdx b/docs/sdks/byok/README.mdx index f1da2da..513bb72 100644 --- a/docs/sdks/byok/README.mdx +++ b/docs/sdks/byok/README.mdx @@ -33,7 +33,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.byok.list() + res = open_router.byok.list(offset=0, limit=50) while res is not None: # Handle items diff --git a/docs/sdks/chat/README.mdx b/docs/sdks/chat/README.mdx index 390ca7c..70aca7d 100644 --- a/docs/sdks/chat/README.mdx +++ b/docs/sdks/chat/README.mdx @@ -84,7 +84,7 @@ with OpenRouter( | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `x_open_router_metadata` | [Optional[components.MetadataLevel]](../../components/metadatalevel.mdx) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `debug` | [Optional[components.ChatDebugOptions]](../../components/chatdebugoptions.mdx) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | \{
"echo_upstream_body": true
} | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 | | `image_config` | Dict[str, [components.ImageConfig](../../components/imageconfig.mdx)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | \{
"aspect_ratio": "16:9",
"quality": "high"
} | @@ -100,6 +100,8 @@ with OpenRouter( | `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. | true | | `plugins` | List[[components.ChatRequestPlugin](../../components/chatrequestplugin.mdx)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [Optional[components.ChatRequestReasoning]](../../components/chatrequestreasoning.mdx) | :heavy_minus_sign: | Configuration options for reasoning models | \{
"effort": "medium",
"summary": "concise"
} | | `reasoning_effort` | [OptionalNullable[components.ChatRequestReasoningEffort]](../../components/chatrequestreasoningeffort.mdx) | :heavy_minus_sign: | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | medium | diff --git a/docs/sdks/datasets/README.mdx b/docs/sdks/datasets/README.mdx index 9cdcae1..ef43241 100644 --- a/docs/sdks/datasets/README.mdx +++ b/docs/sdks/datasets/README.mdx @@ -102,6 +102,13 @@ Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the reserved permaslug `other` and is always returned last within its date, so callers can compute `top-50 traffic / total daily traffic` without a second request. +Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time +grain. `modality` and `context_bucket` narrow the exact dataset by output/input +modality (or tool-calling activity) and request context length. `category` and +`language_type` instead read a sampled, upsampled dataset whose `total_tokens` are +weekly-grain estimates — they cannot be combined with each other or with the exact +filters, and reject `period=day` with a 400. + Authenticate with any valid OpenRouter API key (same key used for inference). Rate-limited to 30 requests/minute per key and 500 requests/day per account. @@ -136,14 +143,19 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | -| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | +| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | +| `period` | [Optional[operations.Period]](../../operations/period.mdx) | :heavy_minus_sign: | Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. | day | +| `modality` | [Optional[operations.Modality]](../../operations/modality.mdx) | :heavy_minus_sign: | Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. | text | +| `context_bucket` | [Optional[operations.ContextBucket]](../../operations/contextbucket.mdx) | :heavy_minus_sign: | Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. | 100K | +| `category` | [Optional[operations.GetRankingsDailyCategory]](../../operations/getrankingsdailycategory.mdx) | :heavy_minus_sign: | Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. | programming | +| `language_type` | [Optional[operations.LanguageType]](../../operations/languagetype.mdx) | :heavy_minus_sign: | Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. | natural | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/embeddings/README.mdx b/docs/sdks/embeddings/README.mdx index bf8b8c5..0ec380e 100644 --- a/docs/sdks/embeddings/README.mdx +++ b/docs/sdks/embeddings/README.mdx @@ -91,25 +91,29 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.embeddings.list_models() + res = open_router.embeddings.list_models(offset=0, limit=500) - # Handle response - print(res) + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[components.ModelsListResponse](../../components/modelslistresponse.mdx)** +**[operations.ListEmbeddingsModelsResponse](../../operations/listembeddingsmodelsresponse.mdx)** ### Errors diff --git a/docs/sdks/files/README.mdx b/docs/sdks/files/README.mdx index 5327882..8ed39ab 100644 --- a/docs/sdks/files/README.mdx +++ b/docs/sdks/files/README.mdx @@ -100,7 +100,7 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` | [operations.File](../../operations/file.mdx) | :heavy_check_mark: | N/A | | +| `file` | [operations.UploadFileFile](../../operations/uploadfilefile.mdx) | :heavy_check_mark: | N/A | | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | diff --git a/docs/sdks/generations/README.mdx b/docs/sdks/generations/README.mdx index b29ea12..f262b34 100644 --- a/docs/sdks/generations/README.mdx +++ b/docs/sdks/generations/README.mdx @@ -11,6 +11,7 @@ Generation history endpoints * [get_generation](#get_generation) - Get request & usage metadata for a generation * [list_generation_content](#list_generation_content) - Get stored prompt and completion content for a generation +* [submit_feedback](#submit_feedback) - Submit feedback for a generation ## get_generation @@ -116,4 +117,56 @@ with OpenRouter( | errors.BadGatewayResponseError | 502 | application/json | | errors.EdgeNetworkTimeoutResponseError | 524 | application/json | | errors.ProviderOverloadedResponseError | 529 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## submit_feedback + +Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + http_referer="", + x_open_router_title="", + x_open_router_categories="", + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.generations.submit_feedback(category="incorrect_response", generation_id="gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", comment="The model repeated the same paragraph three times.") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `category` | [components.Category](../../components/category.mdx) | :heavy_check_mark: | The category of feedback being reported | incorrect_response | +| `generation_id` | *str* | :heavy_check_mark: | The generation to submit feedback on | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `comment` | *Optional[str]* | :heavy_minus_sign: | An optional free-text comment describing the feedback | The model repeated the same paragraph three times. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.SubmitGenerationFeedbackResponse](../../components/submitgenerationfeedbackresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | 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 diff --git a/docs/sdks/guardrails/README.mdx b/docs/sdks/guardrails/README.mdx index d164a1d..db67983 100644 --- a/docs/sdks/guardrails/README.mdx +++ b/docs/sdks/guardrails/README.mdx @@ -41,7 +41,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrails.list() + res = open_router.guardrails.list(offset=0, limit=50) while res is not None: # Handle items @@ -96,7 +96,7 @@ with OpenRouter( "openai", "anthropic", "deepseek", - ], description="A guardrail for limiting API usage", enforce_zdr_anthropic=True, enforce_zdr_google=False, enforce_zdr_openai=True, enforce_zdr_other=False, ignored_models=None, ignored_providers=None, limit_usd=50, reset_interval="monthly") + ], description="A guardrail for limiting API usage", enforce_zdr_anthropic=True, enforce_zdr_google=False, enforce_zdr_openai=True, enforce_zdr_other=False, enforce_zdr_xai=False, ignored_models=None, ignored_providers=None, limit_usd=50, reset_interval="monthly") # Handle response print(res) @@ -105,28 +105,29 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | -| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | -| `content_filters` | List[[components.ContentFilterEntry](../../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | -| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | -| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | -| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | false | -| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | -| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | -| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the guardrail in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filters` | List[[components.ContentFilterEntry](../../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | +| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. | false | +| `enforce_zdr_xai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. | false | +| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | +| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the guardrail in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -265,28 +266,29 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | -| `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | -| `content_filters` | List[[components.ContentFilterEntry](../../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | -| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | -| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | true | -| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | true | -| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | true | -| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | true | -| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | -| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | -| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | -| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filters` | List[[components.ContentFilterEntry](../../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | +| `enforce_zdr_anthropic` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_google` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_openai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_other` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. | true | +| `enforce_zdr_xai` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. | true | +| `ignored_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | +| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | +| `reset_interval` | [OptionalNullable[components.GuardrailInterval]](../../components/guardrailinterval.mdx) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -320,7 +322,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrails.list_guardrail_key_assignments(id="550e8400-e29b-41d4-a716-446655440000") + res = open_router.guardrails.list_guardrail_key_assignments(id="550e8400-e29b-41d4-a716-446655440000", offset=0, limit=50) while res is not None: # Handle items @@ -476,7 +478,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrails.list_guardrail_member_assignments(id="550e8400-e29b-41d4-a716-446655440000") + res = open_router.guardrails.list_guardrail_member_assignments(id="550e8400-e29b-41d4-a716-446655440000", offset=0, limit=50) while res is not None: # Handle items @@ -634,7 +636,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrails.list_key_assignments() + res = open_router.guardrails.list_key_assignments(offset=0, limit=50) while res is not None: # Handle items @@ -684,7 +686,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.guardrails.list_member_assignments() + res = open_router.guardrails.list_member_assignments(offset=0, limit=50) while res is not None: # Handle items diff --git a/docs/sdks/images/README.mdx b/docs/sdks/images/README.mdx index cb61de8..4b35085 100644 --- a/docs/sdks/images/README.mdx +++ b/docs/sdks/images/README.mdx @@ -42,26 +42,26 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `model` | *str* | :heavy_check_mark: | The image generation model to use | bytedance-seed/seedream-4.5 | -| `prompt` | *str* | :heavy_check_mark: | Text description of the desired image | a red panda astronaut floating in space, studio lighting | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../../components/imagegenerationrequestaspectratio.mdx) | :heavy_minus_sign: | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | -| `background` | [Optional[components.ImageGenerationRequestBackground]](../../components/imagegenerationrequestbackground.mdx) | :heavy_minus_sign: | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | -| `input_references` | List[[components.ContentPartImage](../../components/contentpartimage.mdx)] | :heavy_minus_sign: | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | -| `n` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. | 1 | -| `output_compression` | *Optional[int]* | :heavy_minus_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 | -| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../../components/imagegenerationrequestoutputformat.mdx) | :heavy_minus_sign: | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | -| `provider` | [Optional[components.ImageGenerationRequestProvider]](../../components/imagegenerationrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `quality` | [Optional[components.ImageGenerationRequestQuality]](../../components/imagegenerationrequestquality.mdx) | :heavy_minus_sign: | Rendering quality. Providers without a quality knob ignore this. | high | -| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../../components/imagegenerationrequestresolution.mdx) | :heavy_minus_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | -| `seed` | *Optional[int]* | :heavy_minus_sign: | 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. | | -| `size` | *Optional[str]* | :heavy_minus_sign: | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. | 2K | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `model` | *str* | :heavy_check_mark: | The image generation model to use | bytedance-seed/seedream-4.5 | +| `prompt` | *str* | :heavy_check_mark: | Text description of the desired image | a red panda astronaut floating in space, studio lighting | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../../components/imagegenerationrequestaspectratio.mdx) | :heavy_minus_sign: | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | +| `background` | [Optional[components.ImageGenerationRequestBackground]](../../components/imagegenerationrequestbackground.mdx) | :heavy_minus_sign: | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | +| `input_references` | List[[components.ContentPartImage](../../components/contentpartimage.mdx)] | :heavy_minus_sign: | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | +| `n` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. | 1 | +| `output_compression` | *Optional[int]* | :heavy_minus_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 | +| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../../components/imagegenerationrequestoutputformat.mdx) | :heavy_minus_sign: | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png | +| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../../components/imagegenerationproviderpreferences.mdx) | :heavy_minus_sign: | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | +| `quality` | [Optional[components.ImageGenerationRequestQuality]](../../components/imagegenerationrequestquality.mdx) | :heavy_minus_sign: | Rendering quality. Providers without a quality knob ignore this. | high | +| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../../components/imagegenerationrequestresolution.mdx) | :heavy_minus_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | +| `seed` | *Optional[int]* | :heavy_minus_sign: | 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. | | +| `size` | *Optional[str]* | :heavy_minus_sign: | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. | 2K | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -76,6 +76,7 @@ with OpenRouter( | errors.PaymentRequiredResponseError | 402 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | | errors.TooManyRequestsResponseError | 429 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | diff --git a/docs/sdks/models/README.mdx b/docs/sdks/models/README.mdx index cc84c8d..dd4b542 100644 --- a/docs/sdks/models/README.mdx +++ b/docs/sdks/models/README.mdx @@ -80,40 +80,56 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.models.list() + res = open_router.models.list(offset=0, limit=500) - # Handle response - print(res) + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `category` | [Optional[operations.GetModelsCategory]](../../operations/getmodelscategory.mdx) | :heavy_minus_sign: | Filter models by use case category | programming | -| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature | -| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | -| `sort` | [Optional[operations.GetModelsSort]](../../operations/getmodelssort.mdx) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest | -| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 | -| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image | -| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 | -| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 | -| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 | -| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT | -| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic | -| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic | -| `distillable` | [Optional[operations.Distillable]](../../operations/distillable.mdx) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true | -| `zdr` | [Optional[operations.Zdr]](../../operations/zdr.mdx) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true | -| `region` | [Optional[operations.Region]](../../operations/region.mdx) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | +| `category` | [Optional[operations.GetModelsCategory]](../../operations/getmodelscategory.mdx) | :heavy_minus_sign: | Filter models by use case category | programming | +| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature | +| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | +| `sort` | [Optional[operations.GetModelsSort]](../../operations/getmodelssort.mdx) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest | +| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 | +| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image | +| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 | +| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 | +| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 | +| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT | +| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic | +| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic | +| `distillable` | [Optional[operations.Distillable]](../../operations/distillable.mdx) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true | +| `zdr` | [Optional[operations.Zdr]](../../operations/zdr.mdx) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true | +| `region` | [Optional[operations.Region]](../../operations/region.mdx) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu | +| `min_output_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum completion (output) price in $/M tokens. | 0 | +| `max_output_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum completion (output) price in $/M tokens. | 10 | +| `min_age_days` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum model age in days since its creation date. | 0 | +| `max_age_days` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum model age in days since its creation date. | 90 | +| `min_intelligence_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum Artificial Analysis intelligence index. | 50 | +| `max_intelligence_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum Artificial Analysis intelligence index. | 100 | +| `min_coding_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum Artificial Analysis coding index. | 50 | +| `max_coding_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum Artificial Analysis coding index. | 100 | +| `min_agentic_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum Artificial Analysis agentic index. | 50 | +| `max_agentic_index` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum Artificial Analysis agentic index. | 100 | +| `min_tool_success_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason). | 0.9 | +| `max_tool_success_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tool-calling success rate, as a fraction in [0, 1]. | 1 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[components.ModelsListResponse](../../components/modelslistresponse.mdx)** +**[operations.GetModelsResponse](../../operations/getmodelsresponse.mdx)** ### Errors @@ -189,26 +205,30 @@ with OpenRouter( res = open_router.models.list_for_user(security=operations.ListModelsUserSecurity( bearer=os.getenv("OPENROUTER_BEARER", ""), - )) + ), offset=0, limit=500) - # Handle response - print(res) + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `security` | [operations.ListModelsUserSecurity](../../operations/listmodelsusersecurity.mdx) | :heavy_check_mark: | N/A | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [operations.ListModelsUserSecurity](../../operations/listmodelsusersecurity.mdx) | :heavy_check_mark: | N/A | | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[components.ModelsListResponse](../../components/modelslistresponse.mdx)** +**[operations.ListModelsUserResponse](../../operations/listmodelsuserresponse.mdx)** ### Errors diff --git a/docs/sdks/observability/README.mdx b/docs/sdks/observability/README.mdx index 869bf82..fb37fc0 100644 --- a/docs/sdks/observability/README.mdx +++ b/docs/sdks/observability/README.mdx @@ -33,7 +33,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.observability.list() + res = open_router.observability.list(offset=0, limit=50) while res is not None: # Handle items @@ -107,7 +107,7 @@ with OpenRouter( | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `api_key_hashes` | List[*str*] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. | null | | `enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether this destination should be enabled immediately. | true | -| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfig]](../../components/observabilityfilterrulesconfig.mdx) | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | null | +| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfigNullable]](../../components/observabilityfilterrulesconfignullable.mdx) | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | null | | `privacy_mode` | *Optional[bool]* | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | | `sampling_rate` | *Optional[float]* | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | | `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Optional workspace ID. Defaults to the authenticated entity's default workspace. | 550e8400-e29b-41d4-a716-446655440000 | @@ -260,7 +260,7 @@ with OpenRouter( | `api_key_hashes` | List[*str*] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. | null | | `config` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value. | \{
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
} | | `enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether the destination is enabled. | true | -| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfig]](../../components/observabilityfilterrulesconfig.mdx) | :heavy_minus_sign: | N/A | null | +| `filter_rules` | [OptionalNullable[components.ObservabilityFilterRulesConfigNullable]](../../components/observabilityfilterrulesconfignullable.mdx) | :heavy_minus_sign: | N/A | null | | `name` | *Optional[str]* | :heavy_minus_sign: | Human-readable name for the destination. | Production Langfuse | | `privacy_mode` | *Optional[bool]* | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | | `sampling_rate` | *Optional[float]* | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | diff --git a/docs/sdks/organization/README.mdx b/docs/sdks/organization/README.mdx index 6e199ab..32a291c 100644 --- a/docs/sdks/organization/README.mdx +++ b/docs/sdks/organization/README.mdx @@ -29,7 +29,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.organization.list_members() + res = open_router.organization.list_members(offset=0, limit=50) while res is not None: # Handle items diff --git a/docs/sdks/presets/README.mdx b/docs/sdks/presets/README.mdx index 5e8523f..82e78fb 100644 --- a/docs/sdks/presets/README.mdx +++ b/docs/sdks/presets/README.mdx @@ -35,7 +35,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.presets.list() + res = open_router.presets.list(offset=0, limit=50) while res is not None: # Handle items @@ -160,7 +160,7 @@ with OpenRouter( | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `debug` | [Optional[components.ChatDebugOptions]](../../components/chatdebugoptions.mdx) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | \{
"echo_upstream_body": true
} | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 | | `image_config` | Dict[str, [components.ImageConfig](../../components/imageconfig.mdx)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | \{
"aspect_ratio": "16:9",
"quality": "high"
} | @@ -176,6 +176,8 @@ with OpenRouter( | `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. | true | | `plugins` | List[[components.ChatRequestPlugin](../../components/chatrequestplugin.mdx)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [Optional[components.ChatRequestReasoning]](../../components/chatrequestreasoning.mdx) | :heavy_minus_sign: | Configuration options for reasoning models | \{
"effort": "medium",
"summary": "concise"
} | | `reasoning_effort` | [OptionalNullable[components.ChatRequestReasoningEffort]](../../components/chatrequestreasoningeffort.mdx) | :heavy_minus_sign: | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | medium | @@ -255,7 +257,7 @@ with OpenRouter( | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `context_management` | [OptionalNullable[components.ContextManagement]](../../components/contextmanagement.mdx) | :heavy_minus_sign: | N/A | | | `fallbacks` | List[[components.MessagesFallbackParam](../../components/messagesfallbackparam.mdx)] | :heavy_minus_sign: | Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. | [
\{
"model": "claude-opus-4-8"
}
] | | `max_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | | @@ -331,7 +333,7 @@ with OpenRouter( | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `debug` | [Optional[components.ChatDebugOptions]](../../components/chatdebugoptions.mdx) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | \{
"echo_upstream_body": true
} | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `image_config` | Dict[str, [components.ImageConfig](../../components/imageconfig.mdx)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | \{
"aspect_ratio": "16:9",
"quality": "high"
} | @@ -350,6 +352,7 @@ with OpenRouter( | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../../components/reasoningconfig.mdx) | :heavy_minus_sign: | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | @@ -403,7 +406,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.presets.list_versions(slug="my-preset") + res = open_router.presets.list_versions(slug="my-preset", offset=0, limit=50) while res is not None: # Handle items diff --git a/docs/sdks/responses/README.mdx b/docs/sdks/responses/README.mdx index 03281f8..708c8a1 100644 --- a/docs/sdks/responses/README.mdx +++ b/docs/sdks/responses/README.mdx @@ -69,7 +69,7 @@ with OpenRouter( | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `x_open_router_metadata` | [Optional[components.MetadataLevel]](../../components/metadatalevel.mdx) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled | | `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | -| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{
"type": "ephemeral"
} | +| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{
"type": "ephemeral"
} | | `debug` | [Optional[components.ChatDebugOptions]](../../components/chatdebugoptions.mdx) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | \{
"echo_upstream_body": true
} | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `image_config` | Dict[str, [components.ImageConfig](../../components/imageconfig.mdx)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | \{
"aspect_ratio": "16:9",
"quality": "high"
} | @@ -88,6 +88,7 @@ with OpenRouter( | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.mdx) | :heavy_minus_sign: | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | :heavy_minus_sign: | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../../components/reasoningconfig.mdx) | :heavy_minus_sign: | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | diff --git a/docs/sdks/stt/README.mdx b/docs/sdks/stt/README.mdx index a5097c9..003f859 100644 --- a/docs/sdks/stt/README.mdx +++ b/docs/sdks/stt/README.mdx @@ -10,10 +10,11 @@ Speech-to-text endpoints ### Available Operations * [create_transcription](#create_transcription) - Create transcription +* [create_transcription_multipart](#create_transcription_multipart) - Create transcription ## create_transcription -Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. +Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text. ### Example Usage @@ -41,17 +42,82 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input_audio` | [components.STTInputAudio](../../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{
"data": "UklGRiQA...",
"format": "wav"
} | -| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en | -| `provider` | [Optional[components.STTRequestProvider]](../../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input_audio` | [components.STTInputAudio](../../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{
"data": "UklGRiQA...",
"format": "wav"
} | +| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en | +| `provider` | [Optional[components.STTRequestProvider]](../../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | +| `response_format` | [Optional[components.STTRequestResponseFormat]](../../components/sttrequestresponseformat.mdx) | :heavy_minus_sign: | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 | +| `timestamp_granularities` | List[[components.STTTimestampGranularity](../../components/stttimestampgranularity.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". | [
"segment"
] | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.STTResponse](../../components/sttresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.PaymentRequiredResponseError | 402 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.TooManyRequestsResponseError | 429 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.BadGatewayResponseError | 502 | application/json | +| errors.ServiceUnavailableResponseError | 503 | application/json | +| errors.EdgeNetworkTimeoutResponseError | 524 | application/json | +| errors.ProviderOverloadedResponseError | 529 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create_transcription_multipart + +Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text. + +### 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.stt.create_transcription_multipart(file={ + "file_name": "example.file", + "content": open("example.file", "rb"), + }, model="openai/whisper-large-v3", language="en") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. | +| `model` | *str* | :heavy_check_mark: | The model to use for transcription. | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). | +| `response_format` | [Optional[operations.ResponseFormat]](../../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. | +| `timestamp_granularities` | List[[operations.TimestampGranularities](../../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/tts/README.mdx b/docs/sdks/tts/README.mdx index ece7fa9..f02ae88 100644 --- a/docs/sdks/tts/README.mdx +++ b/docs/sdks/tts/README.mdx @@ -29,7 +29,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.tts.create_speech(input="Hello world", model="elevenlabs/eleven-turbo-v2", voice="alloy", response_format="pcm", speed=1) + res = open_router.tts.create_speech(input="Hello world", model="mistralai/voxtral-mini-tts-2603", voice="en_paul_neutral", response_format="pcm", speed=1) # Handle response print(res) @@ -41,13 +41,13 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `input` | *str* | :heavy_check_mark: | Text to synthesize | Hello world | -| `model` | *str* | :heavy_check_mark: | TTS model identifier | elevenlabs/eleven-turbo-v2 | -| `voice` | *str* | :heavy_check_mark: | Voice identifier (provider-specific). | alloy | +| `model` | *str* | :heavy_check_mark: | TTS model identifier | mistralai/voxtral-mini-tts-2603 | +| `voice` | *str* | :heavy_check_mark: | Voice identifier (provider-specific). | en_paul_neutral | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `provider` | [Optional[components.SpeechRequestProvider]](../../components/speechrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `response_format` | [Optional[components.ResponseFormatEnum]](../../components/responseformatenum.mdx) | :heavy_minus_sign: | Audio output format | pcm | +| `response_format` | [Optional[components.SpeechRequestResponseFormat]](../../components/speechrequestresponseformat.mdx) | :heavy_minus_sign: | Audio output format | pcm | | `speed` | *Optional[float]* | :heavy_minus_sign: | Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. | 1 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | diff --git a/docs/sdks/workspaces/README.mdx b/docs/sdks/workspaces/README.mdx index 37f2346..0c43dff 100644 --- a/docs/sdks/workspaces/README.mdx +++ b/docs/sdks/workspaces/README.mdx @@ -39,7 +39,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.workspaces.list() + res = open_router.workspaces.list(offset=0, limit=50) while res is not None: # Handle items @@ -455,7 +455,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.workspaces.list_members(id="production") + res = open_router.workspaces.list_members(id="production", offset=0, limit=50) while res is not None: # Handle items @@ -546,7 +546,7 @@ with OpenRouter( ## bulk_remove_members -Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage diff --git a/pyproject.toml b/pyproject.toml index 0ee40fc..9fb7964 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.11.3" +version = "0.11.33" 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 c226327..22f63c2 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.11.3" +__version__: str = "0.11.33" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 0.11.3 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.11.33 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/beta_analytics.py b/src/openrouter/beta_analytics.py index bcf5829..1b01f0c 100644 --- a/src/openrouter/beta_analytics.py +++ b/src/openrouter/beta_analytics.py @@ -273,6 +273,15 @@ class BetaAnalytics(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + classifier_dimensions: Optional[ + Union[ + operations.ClassifierDimensions, + operations.ClassifierDimensionsTypedDict, + ] + ] = None, + classifier_filters: Optional[ + Union[operations.ClassifierFilters, operations.ClassifierFiltersTypedDict] + ] = None, dimensions: Optional[Iterable[str]] = None, filters: Optional[ Union[Iterable[operations.Filter], Iterable[operations.FilterTypedDict]] @@ -303,6 +312,8 @@ class BetaAnalytics(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param classifier_dimensions: Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. + :param classifier_filters: Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. :param dimensions: :param filters: :param granularity: Time granularity @@ -330,6 +341,12 @@ class BetaAnalytics(BaseSDK): x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, request_body=operations.QueryAnalyticsRequestBody( + classifier_dimensions=utils.get_pydantic_model( + classifier_dimensions, Optional[operations.ClassifierDimensions] + ), + classifier_filters=utils.get_pydantic_model( + classifier_filters, Optional[operations.ClassifierFilters] + ), dimensions=utils.unmarshal(dimensions, Optional[List[str]]), filters=utils.get_pydantic_model( filters, Optional[List[operations.Filter]] @@ -453,6 +470,15 @@ class BetaAnalytics(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + classifier_dimensions: Optional[ + Union[ + operations.ClassifierDimensions, + operations.ClassifierDimensionsTypedDict, + ] + ] = None, + classifier_filters: Optional[ + Union[operations.ClassifierFilters, operations.ClassifierFiltersTypedDict] + ] = None, dimensions: Optional[Iterable[str]] = None, filters: Optional[ Union[Iterable[operations.Filter], Iterable[operations.FilterTypedDict]] @@ -483,6 +509,8 @@ class BetaAnalytics(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param classifier_dimensions: Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace. + :param classifier_filters: Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions. :param dimensions: :param filters: :param granularity: Time granularity @@ -510,6 +538,12 @@ class BetaAnalytics(BaseSDK): x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, request_body=operations.QueryAnalyticsRequestBody( + classifier_dimensions=utils.get_pydantic_model( + classifier_dimensions, Optional[operations.ClassifierDimensions] + ), + classifier_filters=utils.get_pydantic_model( + classifier_filters, Optional[operations.ClassifierFilters] + ), dimensions=utils.unmarshal(dimensions, Optional[List[str]]), filters=utils.get_pydantic_model( filters, Optional[List[operations.Filter]] diff --git a/src/openrouter/byok.py b/src/openrouter/byok.py index fcbfd1a..08b177b 100644 --- a/src/openrouter/byok.py +++ b/src/openrouter/byok.py @@ -19,8 +19,8 @@ class Byok(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, workspace_id: Optional[str] = None, provider: Optional[operations.Provider] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -129,7 +129,7 @@ class Byok(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -185,8 +185,8 @@ class Byok(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, workspace_id: Optional[str] = None, provider: Optional[operations.Provider] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -298,7 +298,7 @@ class Byok(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) diff --git a/src/openrouter/chat.py b/src/openrouter/chat.py index ab93b1b..f14c3b5 100644 --- a/src/openrouter/chat.py +++ b/src/openrouter/chat.py @@ -65,6 +65,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -135,7 +139,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -151,6 +155,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -223,6 +229,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -293,7 +303,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -309,6 +319,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -381,6 +393,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -453,7 +469,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -469,6 +485,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -540,6 +558,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -612,7 +634,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -628,6 +650,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -701,6 +725,11 @@ class Chat(BaseSDK): plugins, Optional[List[components.ChatRequestPlugin]] ), presence_penalty=presence_penalty, + prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -977,6 +1006,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1047,7 +1080,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1063,6 +1096,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1135,6 +1170,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1205,7 +1244,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1221,6 +1260,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1293,6 +1334,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1366,7 +1411,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1382,6 +1427,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1453,6 +1500,10 @@ class Chat(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1526,7 +1577,7 @@ class Chat(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1542,6 +1593,8 @@ class Chat(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1615,6 +1668,11 @@ class Chat(BaseSDK): plugins, Optional[List[components.ChatRequestPlugin]] ), presence_penalty=presence_penalty, + prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 192d308..c2d2d47 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -8,6 +8,19 @@ if TYPE_CHECKING: from .aabenchmarkentry import AABenchmarkEntry, AABenchmarkEntryTypedDict from .activityitem import ActivityItem, ActivityItemTypedDict from .activityresponse import ActivityResponse, ActivityResponseTypedDict + from .additionaltoolsitem import ( + AdditionalToolsItem, + AdditionalToolsItemRole, + AdditionalToolsItemTool, + AdditionalToolsItemToolFunction, + AdditionalToolsItemToolFunctionTypedDict, + AdditionalToolsItemToolTypedDict, + AdditionalToolsItemToolUnion, + AdditionalToolsItemToolUnionTypedDict, + AdditionalToolsItemTypeFunction, + AdditionalToolsItemTypedDict, + TypeAdditionalTools, + ) from .advisornestedtool import AdvisorNestedTool, AdvisorNestedToolTypedDict from .advisorreasoning import ( AdvisorReasoning, @@ -23,6 +36,22 @@ if TYPE_CHECKING: AdvisorServerToolConfig, AdvisorServerToolConfigTypedDict, ) + from .agentmessageitem import ( + Agent, + AgentMessageItem, + AgentMessageItemContentInputImage, + AgentMessageItemContentInputImageTypedDict, + AgentMessageItemContentUnion, + AgentMessageItemContentUnionTypedDict, + AgentMessageItemDetail, + AgentMessageItemTypeInputImage, + AgentMessageItemTypedDict, + AgentTypedDict, + ContentEncryptedContent, + ContentEncryptedContentTypedDict, + TypeAgentMessage, + TypeEncryptedContent, + ) from .annotationaddedevent import ( AnnotationAddedEvent, AnnotationAddedEventType, @@ -51,6 +80,10 @@ if TYPE_CHECKING: AnthropicCacheControlDirectiveTypedDict, ) from .anthropiccachecontrolttl import AnthropicCacheControlTTL + from .anthropiccachecreation import ( + AnthropicCacheCreation, + AnthropicCacheCreationTypedDict, + ) from .anthropiccitationcharlocationparam import ( AnthropicCitationCharLocationParam, AnthropicCitationCharLocationParamType, @@ -66,15 +99,15 @@ if TYPE_CHECKING: AnthropicCitationPageLocationParamType, AnthropicCitationPageLocationParamTypedDict, ) - from .anthropiccitationsearchresultlocation import ( - AnthropicCitationSearchResultLocation, - AnthropicCitationSearchResultLocationType, - AnthropicCitationSearchResultLocationTypedDict, + from .anthropiccitationsearchresultlocationparam import ( + AnthropicCitationSearchResultLocationParam, + AnthropicCitationSearchResultLocationParamType, + AnthropicCitationSearchResultLocationParamTypedDict, ) - from .anthropiccitationwebsearchresultlocation import ( - AnthropicCitationWebSearchResultLocation, - AnthropicCitationWebSearchResultLocationType, - AnthropicCitationWebSearchResultLocationTypedDict, + from .anthropiccitationwebsearchresultlocationparam import ( + AnthropicCitationWebSearchResultLocationParam, + AnthropicCitationWebSearchResultLocationParamType, + AnthropicCitationWebSearchResultLocationParamTypedDict, ) from .anthropiccompactionusageiteration import ( AnthropicCompactionUsageIteration, @@ -441,6 +474,11 @@ if TYPE_CHECKING: ChatFormatGrammarConfigType, ChatFormatGrammarConfigTypedDict, ) + from .chatformatjsonobjectconfig import ( + ChatFormatJSONObjectConfig, + ChatFormatJSONObjectConfigType, + ChatFormatJSONObjectConfigTypedDict, + ) from .chatformatjsonschemaconfig import ( ChatFormatJSONSchemaConfig, ChatFormatJSONSchemaConfigType, @@ -573,8 +611,6 @@ if TYPE_CHECKING: ChatUsagePromptTokensDetails, ChatUsagePromptTokensDetailsTypedDict, ChatUsageTypedDict, - ServerToolUseDetails, - ServerToolUseDetailsTypedDict, ) from .chatusermessage import ( ChatUserMessage, @@ -698,6 +734,11 @@ if TYPE_CHECKING: VideoURL, VideoURLTypedDict, ) + from .contextcompactionitem import ( + ContextCompactionItem, + ContextCompactionItemType, + ContextCompactionItemTypedDict, + ) from .contextcompressionengine import ContextCompressionEngine from .contextcompressionplugin import ( ContextCompressionPlugin, @@ -1110,15 +1151,25 @@ if TYPE_CHECKING: ImageGenCompletedEventType, ImageGenCompletedEventTypedDict, ) + from .imagegenerationproviderpreferences import ( + ImageGenerationProviderPreferences, + ImageGenerationProviderPreferencesIgnore, + ImageGenerationProviderPreferencesIgnoreTypedDict, + ImageGenerationProviderPreferencesOnly, + ImageGenerationProviderPreferencesOnlyTypedDict, + ImageGenerationProviderPreferencesOptions, + ImageGenerationProviderPreferencesOptionsTypedDict, + ImageGenerationProviderPreferencesOrder, + ImageGenerationProviderPreferencesOrderTypedDict, + ImageGenerationProviderPreferencesSort, + ImageGenerationProviderPreferencesSortTypedDict, + ImageGenerationProviderPreferencesTypedDict, + ) from .imagegenerationrequest import ( ImageGenerationRequest, ImageGenerationRequestAspectRatio, ImageGenerationRequestBackground, - ImageGenerationRequestOptions, - ImageGenerationRequestOptionsTypedDict, ImageGenerationRequestOutputFormat, - ImageGenerationRequestProvider, - ImageGenerationRequestProviderTypedDict, ImageGenerationRequestQuality, ImageGenerationRequestResolution, ImageGenerationRequestTypedDict, @@ -1139,9 +1190,7 @@ if TYPE_CHECKING: InputFidelity, InputImageMask, InputImageMaskTypedDict, - ModelEnum, Moderation, - Size, ) from .imagegenerationservertool_openrouter import ( ImageGenerationServerToolOpenRouter, @@ -1179,6 +1228,13 @@ if TYPE_CHECKING: ImageGenStreamErrorEventType, ImageGenStreamErrorEventTypedDict, ) + from .imagegentextchunkevent import ( + ImageGenTextChunkEvent, + ImageGenTextChunkEventPhase, + ImageGenTextChunkEventType, + ImageGenTextChunkEventTypedDict, + ) + from .imageinputmodality import ImageInputModality from .imagemodelarchitecture import ( ImageModelArchitecture, ImageModelArchitectureTypedDict, @@ -1289,6 +1345,10 @@ if TYPE_CHECKING: LegacyChatContentVideoType, LegacyChatContentVideoTypedDict, ) + from .legacy_chatcontentvideoinput import ( + LegacyChatContentVideoInput, + LegacyChatContentVideoInputTypedDict, + ) from .legacy_websearchservertool import ( LegacyWebSearchServerTool, LegacyWebSearchServerToolType, @@ -1548,13 +1608,14 @@ if TYPE_CHECKING: TypeWebSearch20250305, TypeWebSearch20260209, ) + from .messagessearchmodelsservertool import ( + MessagesSearchModelsServerTool, + MessagesSearchModelsServerToolType, + MessagesSearchModelsServerToolTypedDict, + ) from .metadatalevel import MetadataLevel from .model import Model, ModelTypedDict - from .modelarchitecture import ( - ModelArchitecture, - ModelArchitectureInstructType, - ModelArchitectureTypedDict, - ) + from .modelarchitecture import ModelArchitecture, ModelArchitectureTypedDict from .modelbenchmarks import ModelBenchmarks, ModelBenchmarksTypedDict from .modelgroup import ModelGroup from .modellinks import ModelLinks, ModelLinksTypedDict @@ -1566,7 +1627,12 @@ if TYPE_CHECKING: ModelsCountResponseDataTypedDict, ModelsCountResponseTypedDict, ) - from .modelslistresponse import ModelsListResponse, ModelsListResponseTypedDict + from .modelslistresponse import ( + Links, + LinksTypedDict, + ModelsListResponse, + ModelsListResponseTypedDict, + ) from .moderationplugin import ( ModerationPlugin, ModerationPluginID, @@ -1610,19 +1676,25 @@ if TYPE_CHECKING: ObservabilityDestinationTypedDict, UnknownObservabilityDestination, ) - from .observabilityfilterrulesconfig import ( + from .observabilityfilterrulegroup import ( FieldT, - Group, - GroupTypedDict, Logic, - ObservabilityFilterRulesConfig, - ObservabilityFilterRulesConfigTypedDict, - ObservabilityFilterRulesConfigValue, - ObservabilityFilterRulesConfigValueTypedDict, + ObservabilityFilterRuleGroup, + ObservabilityFilterRuleGroupTypedDict, + ObservabilityFilterRuleGroupValue, + ObservabilityFilterRuleGroupValueTypedDict, Operator, Rule, RuleTypedDict, ) + from .observabilityfilterrulesconfig import ( + ObservabilityFilterRulesConfig, + ObservabilityFilterRulesConfigTypedDict, + ) + from .observabilityfilterrulesconfignullable import ( + ObservabilityFilterRulesConfigNullable, + ObservabilityFilterRulesConfigNullableTypedDict, + ) from .observabilitygrafanadestination import ( ObservabilityGrafanaDestination, ObservabilityGrafanaDestinationConfig, @@ -2074,6 +2146,7 @@ if TYPE_CHECKING: ParetoRouterPlugin, ParetoRouterPluginID, ParetoRouterPluginTypedDict, + PriceSource, ) from .payloadtoolargeresponseerrordata import ( PayloadTooLargeResponseErrorData, @@ -2132,6 +2205,17 @@ if TYPE_CHECKING: PreviewWebSearchUserLocationType, PreviewWebSearchUserLocationTypedDict, ) + from .pricingoverride import PricingOverride, PricingOverrideTypedDict + from .promptcachebreakpoint import ( + PromptCacheBreakpoint, + PromptCacheBreakpointMode, + PromptCacheBreakpointTypedDict, + ) + from .promptcacheoptions import ( + PromptCacheOptions, + PromptCacheOptionsMode, + PromptCacheOptionsTypedDict, + ) from .promptinjectionscanscope import PromptInjectionScanScope from .providername import ProviderName from .provideroptions import ProviderOptions, ProviderOptionsTypedDict @@ -2141,23 +2225,24 @@ if TYPE_CHECKING: ) from .providerpreferences import ( DataCollection, - Ignore, - IgnoreTypedDict, MaxPrice, MaxPriceTypedDict, - Only, - OnlyTypedDict, - Order, - OrderTypedDict, ProviderPreferences, + ProviderPreferencesIgnore, + ProviderPreferencesIgnoreTypedDict, + ProviderPreferencesOnly, + ProviderPreferencesOnlyTypedDict, + ProviderPreferencesOrder, + ProviderPreferencesOrderTypedDict, + ProviderPreferencesSort, + ProviderPreferencesSortTypedDict, ProviderPreferencesTypedDict, - Sort, - SortTypedDict, ) from .providerresponse import ( ProviderResponse, ProviderResponseProviderName, ProviderResponseTypedDict, + RoutedServiceTier, ) from .providersort import ProviderSort from .providersortconfig import ( @@ -2191,6 +2276,7 @@ if TYPE_CHECKING: RankingsDailyResponseTypedDict, ) from .reasoningconfig import ReasoningConfig, ReasoningConfigTypedDict + from .reasoningcontext import ReasoningContext from .reasoningdeltaevent import ( ReasoningDeltaEvent, ReasoningDeltaEventType, @@ -2201,6 +2287,11 @@ if TYPE_CHECKING: ReasoningDetailEncryptedType, ReasoningDetailEncryptedTypedDict, ) + from .reasoningdetailservertoolcall import ( + ReasoningDetailServerToolCall, + ReasoningDetailServerToolCallType, + ReasoningDetailServerToolCallTypedDict, + ) from .reasoningdetailsummary import ( ReasoningDetailSummary, ReasoningDetailSummaryType, @@ -2233,6 +2324,7 @@ if TYPE_CHECKING: ReasoningItemType, ReasoningItemTypedDict, ) + from .reasoningmode import ReasoningMode from .reasoningsummarypartaddedevent import ( ReasoningSummaryPartAddedEvent, ReasoningSummaryPartAddedEventType, @@ -2318,12 +2410,21 @@ if TYPE_CHECKING: from .routerparams import RouterParams, RouterParamsTypedDict from .routingstrategy import RoutingStrategy from .searchcontextsizeenum import SearchContextSizeEnum + from .searchmodelsservertool_openrouter import ( + SearchModelsServerToolOpenRouter, + SearchModelsServerToolOpenRouterType, + SearchModelsServerToolOpenRouterTypedDict, + ) from .searchmodelsservertoolconfig import ( SearchModelsServerToolConfig, SearchModelsServerToolConfigTypedDict, ) from .searchqualitylevel import SearchQualityLevel from .security import Security, SecurityTypedDict + from .servertoolusedetails import ( + ServerToolUseDetails, + ServerToolUseDetailsTypedDict, + ) from .serviceunavailableresponseerrordata import ( ServiceUnavailableResponseErrorData, ServiceUnavailableResponseErrorDataTypedDict, @@ -2365,10 +2466,10 @@ if TYPE_CHECKING: ShellServerToolEnvironmentTypedDict, ) from .speechrequest import ( - ResponseFormatEnum, SpeechRequest, SpeechRequestProvider, SpeechRequestProviderTypedDict, + SpeechRequestResponseFormat, SpeechRequestTypedDict, ) from .stopservertoolswhencondition import ( @@ -2442,10 +2543,14 @@ if TYPE_CHECKING: STTRequest, STTRequestProvider, STTRequestProviderTypedDict, + STTRequestResponseFormat, STTRequestTypedDict, ) from .sttresponse import STTResponse, STTResponseTypedDict + from .sttsegment import STTSegment, STTSegmentTypedDict + from .stttimestampgranularity import STTTimestampGranularity from .sttusage import STTUsage, STTUsageTypedDict + from .sttword import STTWord, STTWordTypedDict from .subagentnestedtool import SubagentNestedTool, SubagentNestedToolTypedDict from .subagentreasoning import ( SubagentReasoning, @@ -2461,6 +2566,17 @@ if TYPE_CHECKING: SubagentServerToolConfig, SubagentServerToolConfigTypedDict, ) + from .submitgenerationfeedbackrequest import ( + Category, + SubmitGenerationFeedbackRequest, + SubmitGenerationFeedbackRequestTypedDict, + ) + from .submitgenerationfeedbackresponse import ( + SubmitGenerationFeedbackResponse, + SubmitGenerationFeedbackResponseData, + SubmitGenerationFeedbackResponseDataTypedDict, + SubmitGenerationFeedbackResponseTypedDict, + ) from .taskclassificationitem import ( TaskClassificationItem, TaskClassificationItemTypedDict, @@ -2731,6 +2847,16 @@ __all__ = [ "ActivityItemTypedDict", "ActivityResponse", "ActivityResponseTypedDict", + "AdditionalToolsItem", + "AdditionalToolsItemRole", + "AdditionalToolsItemTool", + "AdditionalToolsItemToolFunction", + "AdditionalToolsItemToolFunctionTypedDict", + "AdditionalToolsItemToolTypedDict", + "AdditionalToolsItemToolUnion", + "AdditionalToolsItemToolUnionTypedDict", + "AdditionalToolsItemTypeFunction", + "AdditionalToolsItemTypedDict", "AdvisorNestedTool", "AdvisorNestedToolTypedDict", "AdvisorReasoning", @@ -2741,6 +2867,16 @@ __all__ = [ "AdvisorServerToolOpenRouter", "AdvisorServerToolOpenRouterType", "AdvisorServerToolOpenRouterTypedDict", + "Agent", + "AgentMessageItem", + "AgentMessageItemContentInputImage", + "AgentMessageItemContentInputImageTypedDict", + "AgentMessageItemContentUnion", + "AgentMessageItemContentUnionTypedDict", + "AgentMessageItemDetail", + "AgentMessageItemTypeInputImage", + "AgentMessageItemTypedDict", + "AgentTypedDict", "AllowedTools", "AllowedToolsTypedDict", "AllowedToolsUnion", @@ -2765,6 +2901,8 @@ __all__ = [ "AnthropicCacheControlDirectiveType", "AnthropicCacheControlDirectiveTypedDict", "AnthropicCacheControlTTL", + "AnthropicCacheCreation", + "AnthropicCacheCreationTypedDict", "AnthropicCitationCharLocationParam", "AnthropicCitationCharLocationParamType", "AnthropicCitationCharLocationParamTypedDict", @@ -2774,12 +2912,12 @@ __all__ = [ "AnthropicCitationPageLocationParam", "AnthropicCitationPageLocationParamType", "AnthropicCitationPageLocationParamTypedDict", - "AnthropicCitationSearchResultLocation", - "AnthropicCitationSearchResultLocationType", - "AnthropicCitationSearchResultLocationTypedDict", - "AnthropicCitationWebSearchResultLocation", - "AnthropicCitationWebSearchResultLocationType", - "AnthropicCitationWebSearchResultLocationTypedDict", + "AnthropicCitationSearchResultLocationParam", + "AnthropicCitationSearchResultLocationParamType", + "AnthropicCitationSearchResultLocationParamTypedDict", + "AnthropicCitationWebSearchResultLocationParam", + "AnthropicCitationWebSearchResultLocationParamType", + "AnthropicCitationWebSearchResultLocationParamTypedDict", "AnthropicCompactionUsageIteration", "AnthropicCompactionUsageIterationType", "AnthropicCompactionUsageIterationTypedDict", @@ -2968,6 +3106,7 @@ __all__ = [ "CachingTypedDict", "CapabilityDescriptor", "CapabilityDescriptorTypedDict", + "Category", "ChatAssistantImages", "ChatAssistantImagesImageURL", "ChatAssistantImagesImageURLTypedDict", @@ -3019,6 +3158,9 @@ __all__ = [ "ChatFormatGrammarConfig", "ChatFormatGrammarConfigType", "ChatFormatGrammarConfigTypedDict", + "ChatFormatJSONObjectConfig", + "ChatFormatJSONObjectConfigType", + "ChatFormatJSONObjectConfigTypedDict", "ChatFormatJSONSchemaConfig", "ChatFormatJSONSchemaConfigType", "ChatFormatJSONSchemaConfigTypedDict", @@ -3159,6 +3301,8 @@ __all__ = [ "ContainerTypedDict", "ContentCompaction", "ContentCompactionTypedDict", + "ContentEncryptedContent", + "ContentEncryptedContentTypedDict", "ContentFilterAction", "ContentFilterBuiltinAction", "ContentFilterBuiltinEntry", @@ -3214,6 +3358,9 @@ __all__ = [ "ContentWebSearchToolResultError", "ContentWebSearchToolResultErrorTypedDict", "ContentWebSearchToolResultTypedDict", + "ContextCompactionItem", + "ContextCompactionItemType", + "ContextCompactionItemTypedDict", "ContextCompressionEngine", "ContextCompressionPlugin", "ContextCompressionPluginID", @@ -3494,13 +3641,9 @@ __all__ = [ "GetPresetVersionResponseTypedDict", "GetWorkspaceResponse", "GetWorkspaceResponseTypedDict", - "Group", - "GroupTypedDict", "Guardrail", "GuardrailInterval", "GuardrailTypedDict", - "Ignore", - "IgnoreTypedDict", "ImageConfig", "ImageConfigTypedDict", "ImageEndpoint", @@ -3528,14 +3671,26 @@ __all__ = [ "ImageGenStreamErrorEventErrorTypedDict", "ImageGenStreamErrorEventType", "ImageGenStreamErrorEventTypedDict", + "ImageGenTextChunkEvent", + "ImageGenTextChunkEventPhase", + "ImageGenTextChunkEventType", + "ImageGenTextChunkEventTypedDict", + "ImageGenerationProviderPreferences", + "ImageGenerationProviderPreferencesIgnore", + "ImageGenerationProviderPreferencesIgnoreTypedDict", + "ImageGenerationProviderPreferencesOnly", + "ImageGenerationProviderPreferencesOnlyTypedDict", + "ImageGenerationProviderPreferencesOptions", + "ImageGenerationProviderPreferencesOptionsTypedDict", + "ImageGenerationProviderPreferencesOrder", + "ImageGenerationProviderPreferencesOrderTypedDict", + "ImageGenerationProviderPreferencesSort", + "ImageGenerationProviderPreferencesSortTypedDict", + "ImageGenerationProviderPreferencesTypedDict", "ImageGenerationRequest", "ImageGenerationRequestAspectRatio", "ImageGenerationRequestBackground", - "ImageGenerationRequestOptions", - "ImageGenerationRequestOptionsTypedDict", "ImageGenerationRequestOutputFormat", - "ImageGenerationRequestProvider", - "ImageGenerationRequestProviderTypedDict", "ImageGenerationRequestQuality", "ImageGenerationRequestResolution", "ImageGenerationRequestTypedDict", @@ -3563,6 +3718,7 @@ __all__ = [ "ImageGenerationUsagePromptTokensDetails", "ImageGenerationUsagePromptTokensDetailsTypedDict", "ImageGenerationUsageTypedDict", + "ImageInputModality", "ImageModelArchitecture", "ImageModelArchitectureTypedDict", "ImageModelEndpointsResponse", @@ -3672,11 +3828,15 @@ __all__ = [ "KeyAssignment", "KeyAssignmentTypedDict", "LegacyChatContentVideo", + "LegacyChatContentVideoInput", + "LegacyChatContentVideoInputTypedDict", "LegacyChatContentVideoType", "LegacyChatContentVideoTypedDict", "LegacyWebSearchServerTool", "LegacyWebSearchServerToolType", "LegacyWebSearchServerToolTypedDict", + "Links", + "LinksTypedDict", "ListBYOKKeysResponse", "ListBYOKKeysResponseTypedDict", "ListEndpointsResponse", @@ -3767,6 +3927,9 @@ __all__ = [ "MessagesRequestToolUnion", "MessagesRequestToolUnionTypedDict", "MessagesRequestTypedDict", + "MessagesSearchModelsServerTool", + "MessagesSearchModelsServerToolType", + "MessagesSearchModelsServerToolTypedDict", "MetadataLevel", "Method", "Modality", @@ -3776,11 +3939,9 @@ __all__ = [ "ModeTypedDict", "Model", "ModelArchitecture", - "ModelArchitectureInstructType", "ModelArchitectureTypedDict", "ModelBenchmarks", "ModelBenchmarksTypedDict", - "ModelEnum", "ModelGroup", "ModelLinks", "ModelLinksTypedDict", @@ -3832,10 +3993,14 @@ __all__ = [ "ObservabilityDatadogDestinationTypedDict", "ObservabilityDestination", "ObservabilityDestinationTypedDict", + "ObservabilityFilterRuleGroup", + "ObservabilityFilterRuleGroupTypedDict", + "ObservabilityFilterRuleGroupValue", + "ObservabilityFilterRuleGroupValueTypedDict", "ObservabilityFilterRulesConfig", + "ObservabilityFilterRulesConfigNullable", + "ObservabilityFilterRulesConfigNullableTypedDict", "ObservabilityFilterRulesConfigTypedDict", - "ObservabilityFilterRulesConfigValue", - "ObservabilityFilterRulesConfigValueTypedDict", "ObservabilityGrafanaDestination", "ObservabilityGrafanaDestinationConfig", "ObservabilityGrafanaDestinationConfigTypedDict", @@ -3901,8 +4066,6 @@ __all__ = [ "ObservabilityWebhookDestinationConfigTypedDict", "ObservabilityWebhookDestinationType", "ObservabilityWebhookDestinationTypedDict", - "Only", - "OnlyTypedDict", "OpenAIResponseCustomToolCall", "OpenAIResponseCustomToolCallOutput", "OpenAIResponseCustomToolCallOutputOutput1", @@ -3979,8 +4142,6 @@ __all__ = [ "OpenRouterWebSearchServerToolType", "OpenRouterWebSearchServerToolTypedDict", "Operator", - "Order", - "OrderTypedDict", "Outcome", "OutcomeExit", "OutcomeExitTypedDict", @@ -4192,8 +4353,17 @@ __all__ = [ "PreviewWebSearchUserLocation", "PreviewWebSearchUserLocationType", "PreviewWebSearchUserLocationTypedDict", + "PriceSource", "Pricing", + "PricingOverride", + "PricingOverrideTypedDict", "PricingTypedDict", + "PromptCacheBreakpoint", + "PromptCacheBreakpointMode", + "PromptCacheBreakpointTypedDict", + "PromptCacheOptions", + "PromptCacheOptionsMode", + "PromptCacheOptionsTypedDict", "PromptInjectionScanScope", "ProviderName", "ProviderOptions", @@ -4201,6 +4371,14 @@ __all__ = [ "ProviderOverloadedResponseErrorData", "ProviderOverloadedResponseErrorDataTypedDict", "ProviderPreferences", + "ProviderPreferencesIgnore", + "ProviderPreferencesIgnoreTypedDict", + "ProviderPreferencesOnly", + "ProviderPreferencesOnlyTypedDict", + "ProviderPreferencesOrder", + "ProviderPreferencesOrderTypedDict", + "ProviderPreferencesSort", + "ProviderPreferencesSortTypedDict", "ProviderPreferencesTypedDict", "ProviderResponse", "ProviderResponseProviderName", @@ -4230,12 +4408,16 @@ __all__ = [ "Reason", "ReasoningConfig", "ReasoningConfigTypedDict", + "ReasoningContext", "ReasoningDeltaEvent", "ReasoningDeltaEventType", "ReasoningDeltaEventTypedDict", "ReasoningDetailEncrypted", "ReasoningDetailEncryptedType", "ReasoningDetailEncryptedTypedDict", + "ReasoningDetailServerToolCall", + "ReasoningDetailServerToolCallType", + "ReasoningDetailServerToolCallTypedDict", "ReasoningDetailSummary", "ReasoningDetailSummaryType", "ReasoningDetailSummaryTypedDict", @@ -4257,6 +4439,7 @@ __all__ = [ "ReasoningItemStatusUnionTypedDict", "ReasoningItemType", "ReasoningItemTypedDict", + "ReasoningMode", "ReasoningSummaryPartAddedEvent", "ReasoningSummaryPartAddedEventType", "ReasoningSummaryPartAddedEventTypedDict", @@ -4294,7 +4477,6 @@ __all__ = [ "ResetInterval", "Response", "ResponseFormat", - "ResponseFormatEnum", "ResponseFormatTypedDict", "ResponseHealingPlugin", "ResponseHealingPluginID", @@ -4320,6 +4502,7 @@ __all__ = [ "ResponsesRequestTypedDict", "ResponsesStreamingResponse", "ResponsesStreamingResponseTypedDict", + "RoutedServiceTier", "RouterAttempt", "RouterAttemptTypedDict", "RouterParams", @@ -4332,14 +4515,23 @@ __all__ = [ "STTRequest", "STTRequestProvider", "STTRequestProviderTypedDict", + "STTRequestResponseFormat", "STTRequestTypedDict", "STTResponse", "STTResponseTypedDict", + "STTSegment", + "STTSegmentTypedDict", + "STTTimestampGranularity", "STTUsage", "STTUsageTypedDict", + "STTWord", + "STTWordTypedDict", "SearchContextSizeEnum", "SearchModelsServerToolConfig", "SearchModelsServerToolConfigTypedDict", + "SearchModelsServerToolOpenRouter", + "SearchModelsServerToolOpenRouterType", + "SearchModelsServerToolOpenRouterTypedDict", "SearchQualityLevel", "Security", "SecurityTypedDict", @@ -4373,15 +4565,13 @@ __all__ = [ "ShellServerToolOpenRouterTypedDict", "ShellServerToolType", "ShellServerToolTypedDict", - "Size", - "Sort", - "SortTypedDict", "SourceContent", "SourceContentTypedDict", "SourceType", "SpeechRequest", "SpeechRequestProvider", "SpeechRequestProviderTypedDict", + "SpeechRequestResponseFormat", "SpeechRequestTypedDict", "Speed", "Stance", @@ -4438,6 +4628,12 @@ __all__ = [ "SubagentServerToolOpenRouter", "SubagentServerToolOpenRouterType", "SubagentServerToolOpenRouterTypedDict", + "SubmitGenerationFeedbackRequest", + "SubmitGenerationFeedbackRequestTypedDict", + "SubmitGenerationFeedbackResponse", + "SubmitGenerationFeedbackResponseData", + "SubmitGenerationFeedbackResponseDataTypedDict", + "SubmitGenerationFeedbackResponseTypedDict", "SupportedAspectRatio", "SupportedFrameImage", "SupportedResolution", @@ -4520,7 +4716,9 @@ __all__ = [ "Truncation", "Type", "TypeAdaptive", + "TypeAdditionalTools", "TypeAdvisor20260301", + "TypeAgentMessage", "TypeAny", "TypeBash20250124", "TypeClearThinking20251015", @@ -4531,6 +4729,7 @@ __all__ = [ "TypeDisabled", "TypeDocument", "TypeEnabled", + "TypeEncryptedContent", "TypeExec", "TypeExit", "TypeFileSearch", @@ -4716,6 +4915,17 @@ _dynamic_imports: dict[str, str] = { "ActivityItemTypedDict": ".activityitem", "ActivityResponse": ".activityresponse", "ActivityResponseTypedDict": ".activityresponse", + "AdditionalToolsItem": ".additionaltoolsitem", + "AdditionalToolsItemRole": ".additionaltoolsitem", + "AdditionalToolsItemTool": ".additionaltoolsitem", + "AdditionalToolsItemToolFunction": ".additionaltoolsitem", + "AdditionalToolsItemToolFunctionTypedDict": ".additionaltoolsitem", + "AdditionalToolsItemToolTypedDict": ".additionaltoolsitem", + "AdditionalToolsItemToolUnion": ".additionaltoolsitem", + "AdditionalToolsItemToolUnionTypedDict": ".additionaltoolsitem", + "AdditionalToolsItemTypeFunction": ".additionaltoolsitem", + "AdditionalToolsItemTypedDict": ".additionaltoolsitem", + "TypeAdditionalTools": ".additionaltoolsitem", "AdvisorNestedTool": ".advisornestedtool", "AdvisorNestedToolTypedDict": ".advisornestedtool", "AdvisorReasoning": ".advisorreasoning", @@ -4726,6 +4936,20 @@ _dynamic_imports: dict[str, str] = { "AdvisorServerToolOpenRouterTypedDict": ".advisorservertool_openrouter", "AdvisorServerToolConfig": ".advisorservertoolconfig", "AdvisorServerToolConfigTypedDict": ".advisorservertoolconfig", + "Agent": ".agentmessageitem", + "AgentMessageItem": ".agentmessageitem", + "AgentMessageItemContentInputImage": ".agentmessageitem", + "AgentMessageItemContentInputImageTypedDict": ".agentmessageitem", + "AgentMessageItemContentUnion": ".agentmessageitem", + "AgentMessageItemContentUnionTypedDict": ".agentmessageitem", + "AgentMessageItemDetail": ".agentmessageitem", + "AgentMessageItemTypeInputImage": ".agentmessageitem", + "AgentMessageItemTypedDict": ".agentmessageitem", + "AgentTypedDict": ".agentmessageitem", + "ContentEncryptedContent": ".agentmessageitem", + "ContentEncryptedContentTypedDict": ".agentmessageitem", + "TypeAgentMessage": ".agentmessageitem", + "TypeEncryptedContent": ".agentmessageitem", "AnnotationAddedEvent": ".annotationaddedevent", "AnnotationAddedEventType": ".annotationaddedevent", "AnnotationAddedEventTypedDict": ".annotationaddedevent", @@ -4744,6 +4968,8 @@ _dynamic_imports: dict[str, str] = { "AnthropicCacheControlDirectiveType": ".anthropiccachecontroldirective", "AnthropicCacheControlDirectiveTypedDict": ".anthropiccachecontroldirective", "AnthropicCacheControlTTL": ".anthropiccachecontrolttl", + "AnthropicCacheCreation": ".anthropiccachecreation", + "AnthropicCacheCreationTypedDict": ".anthropiccachecreation", "AnthropicCitationCharLocationParam": ".anthropiccitationcharlocationparam", "AnthropicCitationCharLocationParamType": ".anthropiccitationcharlocationparam", "AnthropicCitationCharLocationParamTypedDict": ".anthropiccitationcharlocationparam", @@ -4753,12 +4979,12 @@ _dynamic_imports: dict[str, str] = { "AnthropicCitationPageLocationParam": ".anthropiccitationpagelocationparam", "AnthropicCitationPageLocationParamType": ".anthropiccitationpagelocationparam", "AnthropicCitationPageLocationParamTypedDict": ".anthropiccitationpagelocationparam", - "AnthropicCitationSearchResultLocation": ".anthropiccitationsearchresultlocation", - "AnthropicCitationSearchResultLocationType": ".anthropiccitationsearchresultlocation", - "AnthropicCitationSearchResultLocationTypedDict": ".anthropiccitationsearchresultlocation", - "AnthropicCitationWebSearchResultLocation": ".anthropiccitationwebsearchresultlocation", - "AnthropicCitationWebSearchResultLocationType": ".anthropiccitationwebsearchresultlocation", - "AnthropicCitationWebSearchResultLocationTypedDict": ".anthropiccitationwebsearchresultlocation", + "AnthropicCitationSearchResultLocationParam": ".anthropiccitationsearchresultlocationparam", + "AnthropicCitationSearchResultLocationParamType": ".anthropiccitationsearchresultlocationparam", + "AnthropicCitationSearchResultLocationParamTypedDict": ".anthropiccitationsearchresultlocationparam", + "AnthropicCitationWebSearchResultLocationParam": ".anthropiccitationwebsearchresultlocationparam", + "AnthropicCitationWebSearchResultLocationParamType": ".anthropiccitationwebsearchresultlocationparam", + "AnthropicCitationWebSearchResultLocationParamTypedDict": ".anthropiccitationwebsearchresultlocationparam", "AnthropicCompactionUsageIteration": ".anthropiccompactionusageiteration", "AnthropicCompactionUsageIterationType": ".anthropiccompactionusageiteration", "AnthropicCompactionUsageIterationTypedDict": ".anthropiccompactionusageiteration", @@ -5003,6 +5229,9 @@ _dynamic_imports: dict[str, str] = { "ChatFormatGrammarConfig": ".chatformatgrammarconfig", "ChatFormatGrammarConfigType": ".chatformatgrammarconfig", "ChatFormatGrammarConfigTypedDict": ".chatformatgrammarconfig", + "ChatFormatJSONObjectConfig": ".chatformatjsonobjectconfig", + "ChatFormatJSONObjectConfigType": ".chatformatjsonobjectconfig", + "ChatFormatJSONObjectConfigTypedDict": ".chatformatjsonobjectconfig", "ChatFormatJSONSchemaConfig": ".chatformatjsonschemaconfig", "ChatFormatJSONSchemaConfigType": ".chatformatjsonschemaconfig", "ChatFormatJSONSchemaConfigTypedDict": ".chatformatjsonschemaconfig", @@ -5104,8 +5333,6 @@ _dynamic_imports: dict[str, str] = { "ChatUsagePromptTokensDetails": ".chatusage", "ChatUsagePromptTokensDetailsTypedDict": ".chatusage", "ChatUsageTypedDict": ".chatusage", - "ServerToolUseDetails": ".chatusage", - "ServerToolUseDetailsTypedDict": ".chatusage", "ChatUserMessage": ".chatusermessage", "ChatUserMessageContent": ".chatusermessage", "ChatUserMessageContentTypedDict": ".chatusermessage", @@ -5189,6 +5416,9 @@ _dynamic_imports: dict[str, str] = { "ContentPartVideoTypedDict": ".contentpartvideo", "VideoURL": ".contentpartvideo", "VideoURLTypedDict": ".contentpartvideo", + "ContextCompactionItem": ".contextcompactionitem", + "ContextCompactionItemType": ".contextcompactionitem", + "ContextCompactionItemTypedDict": ".contextcompactionitem", "ContextCompressionEngine": ".contextcompressionengine", "ContextCompressionPlugin": ".contextcompressionplugin", "ContextCompressionPluginID": ".contextcompressionplugin", @@ -5493,14 +5723,22 @@ _dynamic_imports: dict[str, str] = { "ImageGenCompletedEvent": ".imagegencompletedevent", "ImageGenCompletedEventType": ".imagegencompletedevent", "ImageGenCompletedEventTypedDict": ".imagegencompletedevent", + "ImageGenerationProviderPreferences": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesIgnore": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesIgnoreTypedDict": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesOnly": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesOnlyTypedDict": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesOptions": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesOptionsTypedDict": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesOrder": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesOrderTypedDict": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesSort": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesSortTypedDict": ".imagegenerationproviderpreferences", + "ImageGenerationProviderPreferencesTypedDict": ".imagegenerationproviderpreferences", "ImageGenerationRequest": ".imagegenerationrequest", "ImageGenerationRequestAspectRatio": ".imagegenerationrequest", "ImageGenerationRequestBackground": ".imagegenerationrequest", - "ImageGenerationRequestOptions": ".imagegenerationrequest", - "ImageGenerationRequestOptionsTypedDict": ".imagegenerationrequest", "ImageGenerationRequestOutputFormat": ".imagegenerationrequest", - "ImageGenerationRequestProvider": ".imagegenerationrequest", - "ImageGenerationRequestProviderTypedDict": ".imagegenerationrequest", "ImageGenerationRequestQuality": ".imagegenerationrequest", "ImageGenerationRequestResolution": ".imagegenerationrequest", "ImageGenerationRequestTypedDict": ".imagegenerationrequest", @@ -5517,9 +5755,7 @@ _dynamic_imports: dict[str, str] = { "InputFidelity": ".imagegenerationservertool", "InputImageMask": ".imagegenerationservertool", "InputImageMaskTypedDict": ".imagegenerationservertool", - "ModelEnum": ".imagegenerationservertool", "Moderation": ".imagegenerationservertool", - "Size": ".imagegenerationservertool", "ImageGenerationServerToolOpenRouter": ".imagegenerationservertool_openrouter", "ImageGenerationServerToolOpenRouterType": ".imagegenerationservertool_openrouter", "ImageGenerationServerToolOpenRouterTypedDict": ".imagegenerationservertool_openrouter", @@ -5544,6 +5780,11 @@ _dynamic_imports: dict[str, str] = { "ImageGenStreamErrorEventErrorTypedDict": ".imagegenstreamerrorevent", "ImageGenStreamErrorEventType": ".imagegenstreamerrorevent", "ImageGenStreamErrorEventTypedDict": ".imagegenstreamerrorevent", + "ImageGenTextChunkEvent": ".imagegentextchunkevent", + "ImageGenTextChunkEventPhase": ".imagegentextchunkevent", + "ImageGenTextChunkEventType": ".imagegentextchunkevent", + "ImageGenTextChunkEventTypedDict": ".imagegentextchunkevent", + "ImageInputModality": ".imageinputmodality", "ImageModelArchitecture": ".imagemodelarchitecture", "ImageModelArchitectureTypedDict": ".imagemodelarchitecture", "ImageModelEndpointsResponse": ".imagemodelendpointsresponse", @@ -5641,6 +5882,8 @@ _dynamic_imports: dict[str, str] = { "LegacyChatContentVideo": ".legacy_chatcontentvideo", "LegacyChatContentVideoType": ".legacy_chatcontentvideo", "LegacyChatContentVideoTypedDict": ".legacy_chatcontentvideo", + "LegacyChatContentVideoInput": ".legacy_chatcontentvideoinput", + "LegacyChatContentVideoInputTypedDict": ".legacy_chatcontentvideoinput", "LegacyWebSearchServerTool": ".legacy_websearchservertool", "LegacyWebSearchServerToolType": ".legacy_websearchservertool", "LegacyWebSearchServerToolTypedDict": ".legacy_websearchservertool", @@ -5860,11 +6103,13 @@ _dynamic_imports: dict[str, str] = { "TypeTool": ".messagesrequest", "TypeWebSearch20250305": ".messagesrequest", "TypeWebSearch20260209": ".messagesrequest", + "MessagesSearchModelsServerTool": ".messagessearchmodelsservertool", + "MessagesSearchModelsServerToolType": ".messagessearchmodelsservertool", + "MessagesSearchModelsServerToolTypedDict": ".messagessearchmodelsservertool", "MetadataLevel": ".metadatalevel", "Model": ".model", "ModelTypedDict": ".model", "ModelArchitecture": ".modelarchitecture", - "ModelArchitectureInstructType": ".modelarchitecture", "ModelArchitectureTypedDict": ".modelarchitecture", "ModelBenchmarks": ".modelbenchmarks", "ModelBenchmarksTypedDict": ".modelbenchmarks", @@ -5880,6 +6125,8 @@ _dynamic_imports: dict[str, str] = { "ModelsCountResponseData": ".modelscountresponse", "ModelsCountResponseDataTypedDict": ".modelscountresponse", "ModelsCountResponseTypedDict": ".modelscountresponse", + "Links": ".modelslistresponse", + "LinksTypedDict": ".modelslistresponse", "ModelsListResponse": ".modelslistresponse", "ModelsListResponseTypedDict": ".modelslistresponse", "ModerationPlugin": ".moderationplugin", @@ -5912,17 +6159,19 @@ _dynamic_imports: dict[str, str] = { "ObservabilityDestination": ".observabilitydestination", "ObservabilityDestinationTypedDict": ".observabilitydestination", "UnknownObservabilityDestination": ".observabilitydestination", - "FieldT": ".observabilityfilterrulesconfig", - "Group": ".observabilityfilterrulesconfig", - "GroupTypedDict": ".observabilityfilterrulesconfig", - "Logic": ".observabilityfilterrulesconfig", + "FieldT": ".observabilityfilterrulegroup", + "Logic": ".observabilityfilterrulegroup", + "ObservabilityFilterRuleGroup": ".observabilityfilterrulegroup", + "ObservabilityFilterRuleGroupTypedDict": ".observabilityfilterrulegroup", + "ObservabilityFilterRuleGroupValue": ".observabilityfilterrulegroup", + "ObservabilityFilterRuleGroupValueTypedDict": ".observabilityfilterrulegroup", + "Operator": ".observabilityfilterrulegroup", + "Rule": ".observabilityfilterrulegroup", + "RuleTypedDict": ".observabilityfilterrulegroup", "ObservabilityFilterRulesConfig": ".observabilityfilterrulesconfig", "ObservabilityFilterRulesConfigTypedDict": ".observabilityfilterrulesconfig", - "ObservabilityFilterRulesConfigValue": ".observabilityfilterrulesconfig", - "ObservabilityFilterRulesConfigValueTypedDict": ".observabilityfilterrulesconfig", - "Operator": ".observabilityfilterrulesconfig", - "Rule": ".observabilityfilterrulesconfig", - "RuleTypedDict": ".observabilityfilterrulesconfig", + "ObservabilityFilterRulesConfigNullable": ".observabilityfilterrulesconfignullable", + "ObservabilityFilterRulesConfigNullableTypedDict": ".observabilityfilterrulesconfignullable", "ObservabilityGrafanaDestination": ".observabilitygrafanadestination", "ObservabilityGrafanaDestinationConfig": ".observabilitygrafanadestination", "ObservabilityGrafanaDestinationConfigTypedDict": ".observabilitygrafanadestination", @@ -6262,6 +6511,7 @@ _dynamic_imports: dict[str, str] = { "ParetoRouterPlugin": ".paretorouterplugin", "ParetoRouterPluginID": ".paretorouterplugin", "ParetoRouterPluginTypedDict": ".paretorouterplugin", + "PriceSource": ".paretorouterplugin", "PayloadTooLargeResponseErrorData": ".payloadtoolargeresponseerrordata", "PayloadTooLargeResponseErrorDataTypedDict": ".payloadtoolargeresponseerrordata", "PaymentRequiredResponseErrorData": ".paymentrequiredresponseerrordata", @@ -6303,6 +6553,14 @@ _dynamic_imports: dict[str, str] = { "PreviewWebSearchUserLocation": ".preview_websearchuserlocation", "PreviewWebSearchUserLocationType": ".preview_websearchuserlocation", "PreviewWebSearchUserLocationTypedDict": ".preview_websearchuserlocation", + "PricingOverride": ".pricingoverride", + "PricingOverrideTypedDict": ".pricingoverride", + "PromptCacheBreakpoint": ".promptcachebreakpoint", + "PromptCacheBreakpointMode": ".promptcachebreakpoint", + "PromptCacheBreakpointTypedDict": ".promptcachebreakpoint", + "PromptCacheOptions": ".promptcacheoptions", + "PromptCacheOptionsMode": ".promptcacheoptions", + "PromptCacheOptionsTypedDict": ".promptcacheoptions", "PromptInjectionScanScope": ".promptinjectionscanscope", "ProviderName": ".providername", "ProviderOptions": ".provideroptions", @@ -6310,21 +6568,22 @@ _dynamic_imports: dict[str, str] = { "ProviderOverloadedResponseErrorData": ".provideroverloadedresponseerrordata", "ProviderOverloadedResponseErrorDataTypedDict": ".provideroverloadedresponseerrordata", "DataCollection": ".providerpreferences", - "Ignore": ".providerpreferences", - "IgnoreTypedDict": ".providerpreferences", "MaxPrice": ".providerpreferences", "MaxPriceTypedDict": ".providerpreferences", - "Only": ".providerpreferences", - "OnlyTypedDict": ".providerpreferences", - "Order": ".providerpreferences", - "OrderTypedDict": ".providerpreferences", "ProviderPreferences": ".providerpreferences", + "ProviderPreferencesIgnore": ".providerpreferences", + "ProviderPreferencesIgnoreTypedDict": ".providerpreferences", + "ProviderPreferencesOnly": ".providerpreferences", + "ProviderPreferencesOnlyTypedDict": ".providerpreferences", + "ProviderPreferencesOrder": ".providerpreferences", + "ProviderPreferencesOrderTypedDict": ".providerpreferences", + "ProviderPreferencesSort": ".providerpreferences", + "ProviderPreferencesSortTypedDict": ".providerpreferences", "ProviderPreferencesTypedDict": ".providerpreferences", - "Sort": ".providerpreferences", - "SortTypedDict": ".providerpreferences", "ProviderResponse": ".providerresponse", "ProviderResponseProviderName": ".providerresponse", "ProviderResponseTypedDict": ".providerresponse", + "RoutedServiceTier": ".providerresponse", "ProviderSort": ".providersort", "By": ".providersortconfig", "Partition": ".providersortconfig", @@ -6350,12 +6609,16 @@ _dynamic_imports: dict[str, str] = { "RankingsDailyResponseTypedDict": ".rankingsdailyresponse", "ReasoningConfig": ".reasoningconfig", "ReasoningConfigTypedDict": ".reasoningconfig", + "ReasoningContext": ".reasoningcontext", "ReasoningDeltaEvent": ".reasoningdeltaevent", "ReasoningDeltaEventType": ".reasoningdeltaevent", "ReasoningDeltaEventTypedDict": ".reasoningdeltaevent", "ReasoningDetailEncrypted": ".reasoningdetailencrypted", "ReasoningDetailEncryptedType": ".reasoningdetailencrypted", "ReasoningDetailEncryptedTypedDict": ".reasoningdetailencrypted", + "ReasoningDetailServerToolCall": ".reasoningdetailservertoolcall", + "ReasoningDetailServerToolCallType": ".reasoningdetailservertoolcall", + "ReasoningDetailServerToolCallTypedDict": ".reasoningdetailservertoolcall", "ReasoningDetailSummary": ".reasoningdetailsummary", "ReasoningDetailSummaryType": ".reasoningdetailsummary", "ReasoningDetailSummaryTypedDict": ".reasoningdetailsummary", @@ -6378,6 +6641,7 @@ _dynamic_imports: dict[str, str] = { "ReasoningItemStatusUnionTypedDict": ".reasoningitem", "ReasoningItemType": ".reasoningitem", "ReasoningItemTypedDict": ".reasoningitem", + "ReasoningMode": ".reasoningmode", "ReasoningSummaryPartAddedEvent": ".reasoningsummarypartaddedevent", "ReasoningSummaryPartAddedEventType": ".reasoningsummarypartaddedevent", "ReasoningSummaryPartAddedEventTypedDict": ".reasoningsummarypartaddedevent", @@ -6437,11 +6701,16 @@ _dynamic_imports: dict[str, str] = { "RouterParamsTypedDict": ".routerparams", "RoutingStrategy": ".routingstrategy", "SearchContextSizeEnum": ".searchcontextsizeenum", + "SearchModelsServerToolOpenRouter": ".searchmodelsservertool_openrouter", + "SearchModelsServerToolOpenRouterType": ".searchmodelsservertool_openrouter", + "SearchModelsServerToolOpenRouterTypedDict": ".searchmodelsservertool_openrouter", "SearchModelsServerToolConfig": ".searchmodelsservertoolconfig", "SearchModelsServerToolConfigTypedDict": ".searchmodelsservertoolconfig", "SearchQualityLevel": ".searchqualitylevel", "Security": ".security", "SecurityTypedDict": ".security", + "ServerToolUseDetails": ".servertoolusedetails", + "ServerToolUseDetailsTypedDict": ".servertoolusedetails", "ServiceUnavailableResponseErrorData": ".serviceunavailableresponseerrordata", "ServiceUnavailableResponseErrorDataTypedDict": ".serviceunavailableresponseerrordata", "ShellCallItem": ".shellcallitem", @@ -6468,10 +6737,10 @@ _dynamic_imports: dict[str, str] = { "ShellServerToolEngine": ".shellservertoolengine", "ShellServerToolEnvironment": ".shellservertoolenvironment", "ShellServerToolEnvironmentTypedDict": ".shellservertoolenvironment", - "ResponseFormatEnum": ".speechrequest", "SpeechRequest": ".speechrequest", "SpeechRequestProvider": ".speechrequest", "SpeechRequestProviderTypedDict": ".speechrequest", + "SpeechRequestResponseFormat": ".speechrequest", "SpeechRequestTypedDict": ".speechrequest", "StopServerToolsWhenCondition": ".stopservertoolswhencondition", "StopServerToolsWhenConditionTypedDict": ".stopservertoolswhencondition", @@ -6521,11 +6790,17 @@ _dynamic_imports: dict[str, str] = { "STTRequest": ".sttrequest", "STTRequestProvider": ".sttrequest", "STTRequestProviderTypedDict": ".sttrequest", + "STTRequestResponseFormat": ".sttrequest", "STTRequestTypedDict": ".sttrequest", "STTResponse": ".sttresponse", "STTResponseTypedDict": ".sttresponse", + "STTSegment": ".sttsegment", + "STTSegmentTypedDict": ".sttsegment", + "STTTimestampGranularity": ".stttimestampgranularity", "STTUsage": ".sttusage", "STTUsageTypedDict": ".sttusage", + "STTWord": ".sttword", + "STTWordTypedDict": ".sttword", "SubagentNestedTool": ".subagentnestedtool", "SubagentNestedToolTypedDict": ".subagentnestedtool", "SubagentReasoning": ".subagentreasoning", @@ -6536,6 +6811,13 @@ _dynamic_imports: dict[str, str] = { "SubagentServerToolOpenRouterTypedDict": ".subagentservertool_openrouter", "SubagentServerToolConfig": ".subagentservertoolconfig", "SubagentServerToolConfigTypedDict": ".subagentservertoolconfig", + "Category": ".submitgenerationfeedbackrequest", + "SubmitGenerationFeedbackRequest": ".submitgenerationfeedbackrequest", + "SubmitGenerationFeedbackRequestTypedDict": ".submitgenerationfeedbackrequest", + "SubmitGenerationFeedbackResponse": ".submitgenerationfeedbackresponse", + "SubmitGenerationFeedbackResponseData": ".submitgenerationfeedbackresponse", + "SubmitGenerationFeedbackResponseDataTypedDict": ".submitgenerationfeedbackresponse", + "SubmitGenerationFeedbackResponseTypedDict": ".submitgenerationfeedbackresponse", "TaskClassificationItem": ".taskclassificationitem", "TaskClassificationItemTypedDict": ".taskclassificationitem", "TaskClassificationMacroCategory": ".taskclassificationmacrocategory", diff --git a/src/openrouter/components/additionaltoolsitem.py b/src/openrouter/components/additionaltoolsitem.py new file mode 100644 index 0000000..6f22028 --- /dev/null +++ b/src/openrouter/components/additionaltoolsitem.py @@ -0,0 +1,284 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .advisorservertool_openrouter import ( + AdvisorServerToolOpenRouter, + AdvisorServerToolOpenRouterTypedDict, +) +from .applypatchservertool import ApplyPatchServerTool, ApplyPatchServerToolTypedDict +from .applypatchservertool_openrouter import ( + ApplyPatchServerToolOpenRouter, + ApplyPatchServerToolOpenRouterTypedDict, +) +from .bashservertool import BashServerTool, BashServerToolTypedDict +from .codeinterpreterservertool import ( + CodeInterpreterServerTool, + CodeInterpreterServerToolTypedDict, +) +from .codexlocalshelltool import CodexLocalShellTool, CodexLocalShellToolTypedDict +from .computeruseservertool import ComputerUseServerTool, ComputerUseServerToolTypedDict +from .customtool import CustomTool, CustomToolTypedDict +from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict +from .filesearchservertool import FileSearchServerTool, FileSearchServerToolTypedDict +from .filesservertool import FilesServerTool, FilesServerToolTypedDict +from .fusionservertool_openrouter import ( + FusionServerToolOpenRouter, + FusionServerToolOpenRouterTypedDict, +) +from .imagegenerationservertool import ( + ImageGenerationServerTool, + ImageGenerationServerToolTypedDict, +) +from .imagegenerationservertool_openrouter import ( + ImageGenerationServerToolOpenRouter, + ImageGenerationServerToolOpenRouterTypedDict, +) +from .legacy_websearchservertool import ( + LegacyWebSearchServerTool, + LegacyWebSearchServerToolTypedDict, +) +from .mcpservertool import McpServerTool, McpServerToolTypedDict +from .preview_20250311_websearchservertool import ( + Preview20250311WebSearchServerTool, + Preview20250311WebSearchServerToolTypedDict, +) +from .preview_websearchservertool import ( + PreviewWebSearchServerTool, + PreviewWebSearchServerToolTypedDict, +) +from .searchmodelsservertool_openrouter import ( + SearchModelsServerToolOpenRouter, + SearchModelsServerToolOpenRouterTypedDict, +) +from .shellservertool import ShellServerTool, ShellServerToolTypedDict +from .shellservertool_openrouter import ( + ShellServerToolOpenRouter, + ShellServerToolOpenRouterTypedDict, +) +from .subagentservertool_openrouter import ( + SubagentServerToolOpenRouter, + SubagentServerToolOpenRouterTypedDict, +) +from .webfetchservertool import WebFetchServerTool, WebFetchServerToolTypedDict +from .websearchservertool import WebSearchServerTool, WebSearchServerToolTypedDict +from .websearchservertool_openrouter import ( + WebSearchServerToolOpenRouter, + WebSearchServerToolOpenRouterTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List, Literal, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +AdditionalToolsItemRole = Union[ + Literal[ + "unknown", + "user", + "assistant", + "system", + "critic", + "discriminator", + "developer", + "tool", + ], + UnrecognizedStr, +] + + +class AdditionalToolsItemToolTypedDict(TypedDict): + type: str + + +class AdditionalToolsItemTool(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False) + + type: str + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + +AdditionalToolsItemTypeFunction = Literal["function",] + + +class AdditionalToolsItemToolFunctionTypedDict(TypedDict): + r"""Function tool definition""" + + name: str + parameters: Nullable[Dict[str, Nullable[Any]]] + type: AdditionalToolsItemTypeFunction + description: NotRequired[Nullable[str]] + strict: NotRequired[Nullable[bool]] + + +class AdditionalToolsItemToolFunction(BaseModel): + r"""Function tool definition""" + + name: str + + parameters: Nullable[Dict[str, Nullable[Any]]] + + type: AdditionalToolsItemTypeFunction + + description: OptionalNullable[str] = UNSET + + strict: OptionalNullable[bool] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + nullable_fields = set(["description", "parameters", "strict"]) + 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 + + +AdditionalToolsItemToolUnionTypedDict = TypeAliasType( + "AdditionalToolsItemToolUnionTypedDict", + Union[ + CodexLocalShellToolTypedDict, + ApplyPatchServerToolTypedDict, + ShellServerToolTypedDict, + FusionServerToolOpenRouterTypedDict, + ImageGenerationServerToolOpenRouterTypedDict, + AdditionalToolsItemToolTypedDict, + ShellServerToolOpenRouterTypedDict, + CodeInterpreterServerToolTypedDict, + BashServerToolTypedDict, + ApplyPatchServerToolOpenRouterTypedDict, + WebSearchServerToolOpenRouterTypedDict, + WebFetchServerToolTypedDict, + SearchModelsServerToolOpenRouterTypedDict, + FilesServerToolTypedDict, + AdvisorServerToolOpenRouterTypedDict, + SubagentServerToolOpenRouterTypedDict, + DatetimeServerToolTypedDict, + CustomToolTypedDict, + ComputerUseServerToolTypedDict, + AdditionalToolsItemToolFunctionTypedDict, + FileSearchServerToolTypedDict, + WebSearchServerToolTypedDict, + PreviewWebSearchServerToolTypedDict, + Preview20250311WebSearchServerToolTypedDict, + LegacyWebSearchServerToolTypedDict, + McpServerToolTypedDict, + ImageGenerationServerToolTypedDict, + ], +) + + +AdditionalToolsItemToolUnion = TypeAliasType( + "AdditionalToolsItemToolUnion", + Union[ + CodexLocalShellTool, + ApplyPatchServerTool, + ShellServerTool, + FusionServerToolOpenRouter, + ImageGenerationServerToolOpenRouter, + AdditionalToolsItemTool, + ShellServerToolOpenRouter, + CodeInterpreterServerTool, + BashServerTool, + ApplyPatchServerToolOpenRouter, + WebSearchServerToolOpenRouter, + WebFetchServerTool, + SearchModelsServerToolOpenRouter, + FilesServerTool, + AdvisorServerToolOpenRouter, + SubagentServerToolOpenRouter, + DatetimeServerTool, + CustomTool, + ComputerUseServerTool, + AdditionalToolsItemToolFunction, + FileSearchServerTool, + WebSearchServerTool, + PreviewWebSearchServerTool, + Preview20250311WebSearchServerTool, + LegacyWebSearchServerTool, + McpServerTool, + ImageGenerationServerTool, + ], +) + + +TypeAdditionalTools = Literal["additional_tools",] + + +class AdditionalToolsItemTypedDict(TypedDict): + r"""Additional tools made available to the model at this point in the input""" + + role: AdditionalToolsItemRole + tools: List[AdditionalToolsItemToolUnionTypedDict] + type: TypeAdditionalTools + id: NotRequired[Nullable[str]] + + +class AdditionalToolsItem(BaseModel): + r"""Additional tools made available to the model at this point in the input""" + + role: AdditionalToolsItemRole + + tools: List[AdditionalToolsItemToolUnion] + + type: TypeAdditionalTools + + id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id"]) + nullable_fields = set(["id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/agentmessageitem.py b/src/openrouter/components/agentmessageitem.py new file mode 100644 index 0000000..612d339 --- /dev/null +++ b/src/openrouter/components/agentmessageitem.py @@ -0,0 +1,213 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .inputtext import InputText, InputTextTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import get_discriminator +import pydantic +from pydantic import ConfigDict, Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class AgentTypedDict(TypedDict): + agent_name: str + + +class Agent(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False) + + agent_name: str + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + +TypeEncryptedContent = Literal["encrypted_content",] + + +class ContentEncryptedContentTypedDict(TypedDict): + encrypted_content: str + type: TypeEncryptedContent + + +class ContentEncryptedContent(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False) + + encrypted_content: str + + type: TypeEncryptedContent + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + +AgentMessageItemDetail = Union[ + Literal[ + "auto", + "high", + "low", + "original", + ], + UnrecognizedStr, +] + + +AgentMessageItemTypeInputImage = Literal["input_image",] + + +class AgentMessageItemContentInputImageTypedDict(TypedDict): + r"""Image input content item""" + + detail: AgentMessageItemDetail + type: AgentMessageItemTypeInputImage + image_url: NotRequired[Nullable[str]] + + +class AgentMessageItemContentInputImage(BaseModel): + r"""Image input content item""" + + detail: AgentMessageItemDetail + + type: AgentMessageItemTypeInputImage + + image_url: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["image_url"]) + nullable_fields = set(["image_url"]) + 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 + + +AgentMessageItemContentUnionTypedDict = TypeAliasType( + "AgentMessageItemContentUnionTypedDict", + Union[ + InputTextTypedDict, + AgentMessageItemContentInputImageTypedDict, + ContentEncryptedContentTypedDict, + ], +) + + +AgentMessageItemContentUnion = Annotated[ + Union[ + Annotated[InputText, Tag("input_text")], + Annotated[AgentMessageItemContentInputImage, Tag("input_image")], + Annotated[ContentEncryptedContent, Tag("encrypted_content")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] + + +TypeAgentMessage = Literal["agent_message",] + + +class AgentMessageItemTypedDict(TypedDict): + r"""A message routed between agents in a multi-agent session""" + + author: str + content: List[AgentMessageItemContentUnionTypedDict] + recipient: str + type: TypeAgentMessage + agent: NotRequired[Nullable[AgentTypedDict]] + id: NotRequired[Nullable[str]] + + +class AgentMessageItem(BaseModel): + r"""A message routed between agents in a multi-agent session""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False) + + author: str + + content: List[AgentMessageItemContentUnion] + + recipient: str + + type: TypeAgentMessage + + agent: OptionalNullable[Agent] = UNSET + + id: OptionalNullable[str] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["agent", "id"]) + nullable_fields = set(["agent", "id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + 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 + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/openrouter/components/anthropiccachecontroldirective.py b/src/openrouter/components/anthropiccachecontroldirective.py index a9292b2..05b36d1 100644 --- a/src/openrouter/components/anthropiccachecontroldirective.py +++ b/src/openrouter/components/anthropiccachecontroldirective.py @@ -12,14 +12,14 @@ AnthropicCacheControlDirectiveType = Literal["ephemeral",] class AnthropicCacheControlDirectiveTypedDict(TypedDict): - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" type: AnthropicCacheControlDirectiveType ttl: NotRequired[AnthropicCacheControlTTL] class AnthropicCacheControlDirective(BaseModel): - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" type: AnthropicCacheControlDirectiveType diff --git a/src/openrouter/components/anthropiccachecreation.py b/src/openrouter/components/anthropiccachecreation.py new file mode 100644 index 0000000..b08b10c --- /dev/null +++ b/src/openrouter/components/anthropiccachecreation.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class AnthropicCacheCreationTypedDict(TypedDict): + ephemeral_1h_input_tokens: int + ephemeral_5m_input_tokens: int + + +class AnthropicCacheCreation(BaseModel): + ephemeral_1h_input_tokens: int + + ephemeral_5m_input_tokens: int diff --git a/src/openrouter/components/anthropiccitationsearchresultlocation.py b/src/openrouter/components/anthropiccitationsearchresultlocationparam.py similarity index 73% rename from src/openrouter/components/anthropiccitationsearchresultlocation.py rename to src/openrouter/components/anthropiccitationsearchresultlocationparam.py index 8a90ed4..77b17e5 100644 --- a/src/openrouter/components/anthropiccitationsearchresultlocation.py +++ b/src/openrouter/components/anthropiccitationsearchresultlocationparam.py @@ -7,20 +7,20 @@ from typing import Literal from typing_extensions import TypedDict -AnthropicCitationSearchResultLocationType = Literal["search_result_location",] +AnthropicCitationSearchResultLocationParamType = Literal["search_result_location",] -class AnthropicCitationSearchResultLocationTypedDict(TypedDict): +class AnthropicCitationSearchResultLocationParamTypedDict(TypedDict): cited_text: str end_block_index: int search_result_index: int source: str start_block_index: int title: Nullable[str] - type: AnthropicCitationSearchResultLocationType + type: AnthropicCitationSearchResultLocationParamType -class AnthropicCitationSearchResultLocation(BaseModel): +class AnthropicCitationSearchResultLocationParam(BaseModel): cited_text: str end_block_index: int @@ -33,7 +33,7 @@ class AnthropicCitationSearchResultLocation(BaseModel): title: Nullable[str] - type: AnthropicCitationSearchResultLocationType + type: AnthropicCitationSearchResultLocationParamType @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/components/anthropiccitationwebsearchresultlocation.py b/src/openrouter/components/anthropiccitationwebsearchresultlocationparam.py similarity index 69% rename from src/openrouter/components/anthropiccitationwebsearchresultlocation.py rename to src/openrouter/components/anthropiccitationwebsearchresultlocationparam.py index 4d061c6..9be8376 100644 --- a/src/openrouter/components/anthropiccitationwebsearchresultlocation.py +++ b/src/openrouter/components/anthropiccitationwebsearchresultlocationparam.py @@ -7,25 +7,27 @@ from typing import Literal from typing_extensions import TypedDict -AnthropicCitationWebSearchResultLocationType = Literal["web_search_result_location",] +AnthropicCitationWebSearchResultLocationParamType = Literal[ + "web_search_result_location", +] -class AnthropicCitationWebSearchResultLocationTypedDict(TypedDict): +class AnthropicCitationWebSearchResultLocationParamTypedDict(TypedDict): cited_text: str encrypted_index: str title: Nullable[str] - type: AnthropicCitationWebSearchResultLocationType + type: AnthropicCitationWebSearchResultLocationParamType url: str -class AnthropicCitationWebSearchResultLocation(BaseModel): +class AnthropicCitationWebSearchResultLocationParam(BaseModel): cited_text: str encrypted_index: str title: Nullable[str] - type: AnthropicCitationWebSearchResultLocationType + type: AnthropicCitationWebSearchResultLocationParamType url: str diff --git a/src/openrouter/components/anthropicdocumentblockparam.py b/src/openrouter/components/anthropicdocumentblockparam.py index 686764b..be2d48f 100644 --- a/src/openrouter/components/anthropicdocumentblockparam.py +++ b/src/openrouter/components/anthropicdocumentblockparam.py @@ -135,7 +135,7 @@ class AnthropicDocumentBlockParamTypedDict(TypedDict): source: AnthropicDocumentBlockParamSourceUnionTypedDict type: TypeDocument cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" citations: NotRequired[Nullable[AnthropicDocumentBlockParamCitationsTypedDict]] context: NotRequired[Nullable[str]] title: NotRequired[Nullable[str]] @@ -147,7 +147,7 @@ class AnthropicDocumentBlockParam(BaseModel): type: TypeDocument cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" citations: OptionalNullable[AnthropicDocumentBlockParamCitations] = UNSET diff --git a/src/openrouter/components/anthropicimageblockparam.py b/src/openrouter/components/anthropicimageblockparam.py index 979d046..7b5effb 100644 --- a/src/openrouter/components/anthropicimageblockparam.py +++ b/src/openrouter/components/anthropicimageblockparam.py @@ -42,7 +42,7 @@ class AnthropicImageBlockParamTypedDict(TypedDict): source: AnthropicImageBlockParamSourceTypedDict type: AnthropicImageBlockParamType cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" class AnthropicImageBlockParam(BaseModel): @@ -51,7 +51,7 @@ class AnthropicImageBlockParam(BaseModel): type: AnthropicImageBlockParamType cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/components/anthropicsearchresultblockparam.py b/src/openrouter/components/anthropicsearchresultblockparam.py index 5925732..14967a2 100644 --- a/src/openrouter/components/anthropicsearchresultblockparam.py +++ b/src/openrouter/components/anthropicsearchresultblockparam.py @@ -48,7 +48,7 @@ class AnthropicSearchResultBlockParamTypedDict(TypedDict): title: str type: AnthropicSearchResultBlockParamType cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" citations: NotRequired[AnthropicSearchResultBlockParamCitationsTypedDict] @@ -62,7 +62,7 @@ class AnthropicSearchResultBlockParam(BaseModel): type: AnthropicSearchResultBlockParamType cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" citations: Optional[AnthropicSearchResultBlockParamCitations] = None diff --git a/src/openrouter/components/anthropictextblockparam.py b/src/openrouter/components/anthropictextblockparam.py index ed10fdc..31a1df2 100644 --- a/src/openrouter/components/anthropictextblockparam.py +++ b/src/openrouter/components/anthropictextblockparam.py @@ -17,13 +17,13 @@ from .anthropiccitationpagelocationparam import ( AnthropicCitationPageLocationParam, AnthropicCitationPageLocationParamTypedDict, ) -from .anthropiccitationsearchresultlocation import ( - AnthropicCitationSearchResultLocation, - AnthropicCitationSearchResultLocationTypedDict, +from .anthropiccitationsearchresultlocationparam import ( + AnthropicCitationSearchResultLocationParam, + AnthropicCitationSearchResultLocationParamTypedDict, ) -from .anthropiccitationwebsearchresultlocation import ( - AnthropicCitationWebSearchResultLocation, - AnthropicCitationWebSearchResultLocationTypedDict, +from .anthropiccitationwebsearchresultlocationparam import ( + AnthropicCitationWebSearchResultLocationParam, + AnthropicCitationWebSearchResultLocationParamTypedDict, ) from openrouter.types import ( BaseModel, @@ -41,11 +41,11 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict CitationTypedDict = TypeAliasType( "CitationTypedDict", Union[ - AnthropicCitationWebSearchResultLocationTypedDict, + AnthropicCitationWebSearchResultLocationParamTypedDict, AnthropicCitationCharLocationParamTypedDict, AnthropicCitationPageLocationParamTypedDict, AnthropicCitationContentBlockLocationParamTypedDict, - AnthropicCitationSearchResultLocationTypedDict, + AnthropicCitationSearchResultLocationParamTypedDict, ], ) @@ -57,9 +57,12 @@ Citation = Annotated[ AnthropicCitationContentBlockLocationParam, Tag("content_block_location") ], Annotated[AnthropicCitationPageLocationParam, Tag("page_location")], - Annotated[AnthropicCitationSearchResultLocation, Tag("search_result_location")], Annotated[ - AnthropicCitationWebSearchResultLocation, Tag("web_search_result_location") + AnthropicCitationSearchResultLocationParam, Tag("search_result_location") + ], + Annotated[ + AnthropicCitationWebSearchResultLocationParam, + Tag("web_search_result_location"), ], ], Discriminator(lambda m: get_discriminator(m, "type", "type")), @@ -73,7 +76,7 @@ class AnthropicTextBlockParamTypedDict(TypedDict): text: str type: AnthropicTextBlockParamType cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" citations: NotRequired[Nullable[List[CitationTypedDict]]] @@ -83,7 +86,7 @@ class AnthropicTextBlockParam(BaseModel): type: AnthropicTextBlockParamType cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" citations: OptionalNullable[List[Citation]] = UNSET diff --git a/src/openrouter/components/baseinputs_union.py b/src/openrouter/components/baseinputs_union.py index 56b48e7..f662ef4 100644 --- a/src/openrouter/components/baseinputs_union.py +++ b/src/openrouter/components/baseinputs_union.py @@ -53,7 +53,7 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict BaseInputsContent1TypedDict = TypeAliasType( "BaseInputsContent1TypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputImageTypedDict, InputFileTypedDict + InputAudioTypedDict, InputTextTypedDict, InputImageTypedDict, InputFileTypedDict ], ) diff --git a/src/openrouter/components/basereasoningconfig.py b/src/openrouter/components/basereasoningconfig.py index 35d8ea7..c70517b 100644 --- a/src/openrouter/components/basereasoningconfig.py +++ b/src/openrouter/components/basereasoningconfig.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .reasoningcontext import ReasoningContext from .reasoningeffort import ReasoningEffort +from .reasoningmode import ReasoningMode from .reasoningsummaryverbosity import ReasoningSummaryVerbosity from openrouter.types import ( BaseModel, @@ -15,19 +17,29 @@ from typing_extensions import NotRequired, TypedDict class BaseReasoningConfigTypedDict(TypedDict): + context: NotRequired[Nullable[ReasoningContext]] + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" effort: NotRequired[Nullable[ReasoningEffort]] + mode: NotRequired[Nullable[ReasoningMode]] + r"""Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.""" summary: NotRequired[Nullable[ReasoningSummaryVerbosity]] class BaseReasoningConfig(BaseModel): + context: OptionalNullable[ReasoningContext] = UNSET + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" + effort: OptionalNullable[ReasoningEffort] = UNSET + mode: OptionalNullable[ReasoningMode] = UNSET + r"""Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.""" + summary: OptionalNullable[ReasoningSummaryVerbosity] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["effort", "summary"]) - nullable_fields = set(["effort", "summary"]) + optional_fields = set(["context", "effort", "mode", "summary"]) + nullable_fields = set(["context", "effort", "mode", "summary"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/byokproviderslug.py b/src/openrouter/components/byokproviderslug.py index 38050fd..3eeec99 100644 --- a/src/openrouter/components/byokproviderslug.py +++ b/src/openrouter/components/byokproviderslug.py @@ -32,6 +32,7 @@ BYOKProviderSlug = Union[ "crusoe", "darkbloom", "decart", + "deepgram", "deepinfra", "deepseek", "dekallm", @@ -55,6 +56,7 @@ BYOKProviderSlug = Union[ "liquid", "mancer", "mara", + "meta", "minimax", "mistral", "modelrun", @@ -78,7 +80,8 @@ BYOKProviderSlug = Union[ "recraft", "reka", "relace", - "sakana-ai", + "sail-research", + "sakana", "sambanova", "seed", "siliconflow", diff --git a/src/openrouter/components/chatcontentcachecontrol.py b/src/openrouter/components/chatcontentcachecontrol.py index e23d405..d60c7b1 100644 --- a/src/openrouter/components/chatcontentcachecontrol.py +++ b/src/openrouter/components/chatcontentcachecontrol.py @@ -12,14 +12,14 @@ ChatContentCacheControlType = Literal["ephemeral",] class ChatContentCacheControlTypedDict(TypedDict): - r"""Cache control for the content part""" + r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" type: ChatContentCacheControlType ttl: NotRequired[AnthropicCacheControlTTL] class ChatContentCacheControl(BaseModel): - r"""Cache control for the content part""" + r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" type: ChatContentCacheControlType diff --git a/src/openrouter/components/chatcontenttext.py b/src/openrouter/components/chatcontenttext.py index 86d0a04..45f9d3e 100644 --- a/src/openrouter/components/chatcontenttext.py +++ b/src/openrouter/components/chatcontenttext.py @@ -5,7 +5,14 @@ from .chatcontentcachecontrol import ( ChatContentCacheControl, ChatContentCacheControlTypedDict, ) -from openrouter.types import BaseModel, UNSET_SENTINEL +from .promptcachebreakpoint import PromptCacheBreakpoint, PromptCacheBreakpointTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from pydantic import model_serializer from typing import Literal, Optional from typing_extensions import NotRequired, TypedDict @@ -20,7 +27,9 @@ class ChatContentTextTypedDict(TypedDict): text: str type: ChatContentTextType cache_control: NotRequired[ChatContentCacheControlTypedDict] - r"""Cache control for the content part""" + r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" + prompt_cache_breakpoint: NotRequired[Nullable[PromptCacheBreakpointTypedDict]] + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" class ChatContentText(BaseModel): @@ -31,20 +40,32 @@ class ChatContentText(BaseModel): type: ChatContentTextType cache_control: Optional[ChatContentCacheControl] = None - r"""Cache control for the content part""" + r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" + + prompt_cache_breakpoint: OptionalNullable[PromptCacheBreakpoint] = UNSET + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["cache_control"]) + optional_fields = set(["cache_control", "prompt_cache_breakpoint"]) + nullable_fields = set(["prompt_cache_breakpoint"]) 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 diff --git a/src/openrouter/components/chatformatjsonobjectconfig.py b/src/openrouter/components/chatformatjsonobjectconfig.py new file mode 100644 index 0000000..450c8f6 --- /dev/null +++ b/src/openrouter/components/chatformatjsonobjectconfig.py @@ -0,0 +1,21 @@ +"""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 + + +ChatFormatJSONObjectConfigType = Literal["json_object",] + + +class ChatFormatJSONObjectConfigTypedDict(TypedDict): + r"""JSON object response format""" + + type: ChatFormatJSONObjectConfigType + + +class ChatFormatJSONObjectConfig(BaseModel): + r"""JSON object response format""" + + type: ChatFormatJSONObjectConfigType diff --git a/src/openrouter/components/chatfunctiontool.py b/src/openrouter/components/chatfunctiontool.py index b62a155..69f8f1c 100644 --- a/src/openrouter/components/chatfunctiontool.py +++ b/src/openrouter/components/chatfunctiontool.py @@ -20,6 +20,10 @@ from .chatwebsearchshorthand import ( ) from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict from .filesservertool import FilesServerTool, FilesServerToolTypedDict +from .fusionservertool_openrouter import ( + FusionServerToolOpenRouter, + FusionServerToolOpenRouterTypedDict, +) from .imagegenerationservertool_openrouter import ( ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouterTypedDict, @@ -107,7 +111,7 @@ class ChatFunctionToolFunctionTypedDict(TypedDict): r"""Function definition for tool calling""" type: ChatFunctionToolType cache_control: NotRequired[ChatContentCacheControlTypedDict] - r"""Cache control for the content part""" + r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" class ChatFunctionToolFunction(BaseModel): @@ -117,7 +121,7 @@ class ChatFunctionToolFunction(BaseModel): type: ChatFunctionToolType cache_control: Optional[ChatContentCacheControl] = None - r"""Cache control for the content part""" + r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -143,6 +147,7 @@ ChatFunctionToolTypedDict = TypeAliasType( BashServerToolTypedDict, DatetimeServerToolTypedDict, FilesServerToolTypedDict, + FusionServerToolOpenRouterTypedDict, ImageGenerationServerToolOpenRouterTypedDict, ChatSearchModelsServerToolTypedDict, SubagentServerToolOpenRouterTypedDict, @@ -162,6 +167,7 @@ ChatFunctionTool = TypeAliasType( BashServerTool, DatetimeServerTool, FilesServerTool, + FusionServerToolOpenRouter, ImageGenerationServerToolOpenRouter, ChatSearchModelsServerTool, SubagentServerToolOpenRouter, diff --git a/src/openrouter/components/chatrequest.py b/src/openrouter/components/chatrequest.py index 3ab5ba1..4c79a21 100644 --- a/src/openrouter/components/chatrequest.py +++ b/src/openrouter/components/chatrequest.py @@ -11,6 +11,10 @@ from .chatformatgrammarconfig import ( ChatFormatGrammarConfig, ChatFormatGrammarConfigTypedDict, ) +from .chatformatjsonobjectconfig import ( + ChatFormatJSONObjectConfig, + ChatFormatJSONObjectConfigTypedDict, +) from .chatformatjsonschemaconfig import ( ChatFormatJSONSchemaConfig, ChatFormatJSONSchemaConfigTypedDict, @@ -30,14 +34,11 @@ from .contextcompressionplugin import ( ContextCompressionPluginTypedDict, ) from .fileparserplugin import FileParserPlugin, FileParserPluginTypedDict -from .formatjsonobjectconfig import ( - FormatJSONObjectConfig, - FormatJSONObjectConfigTypedDict, -) from .fusionplugin import FusionPlugin, FusionPluginTypedDict from .imageconfig import ImageConfig, ImageConfigTypedDict from .moderationplugin import ModerationPlugin, ModerationPluginTypedDict from .paretorouterplugin import ParetoRouterPlugin, ParetoRouterPluginTypedDict +from .promptcacheoptions import PromptCacheOptions, PromptCacheOptionsTypedDict from .providerpreferences import ProviderPreferences, ProviderPreferencesTypedDict from .responsehealingplugin import ResponseHealingPlugin, ResponseHealingPluginTypedDict from .stopservertoolswhencondition import ( @@ -78,8 +79,8 @@ ChatRequestPluginTypedDict = TypeAliasType( ResponseHealingPluginTypedDict, FileParserPluginTypedDict, ContextCompressionPluginTypedDict, - ParetoRouterPluginTypedDict, AutoRouterPluginTypedDict, + ParetoRouterPluginTypedDict, WebFetchPluginTypedDict, FusionPluginTypedDict, WebSearchPluginTypedDict, @@ -179,7 +180,7 @@ ResponseFormatTypedDict = TypeAliasType( "ResponseFormatTypedDict", Union[ ChatFormatTextConfigTypedDict, - FormatJSONObjectConfigTypedDict, + ChatFormatJSONObjectConfigTypedDict, ChatFormatPythonConfigTypedDict, ChatFormatJSONSchemaConfigTypedDict, ChatFormatGrammarConfigTypedDict, @@ -191,7 +192,7 @@ r"""Response format configuration""" ResponseFormat = Annotated[ Union[ Annotated[ChatFormatGrammarConfig, Tag("grammar")], - Annotated[FormatJSONObjectConfig, Tag("json_object")], + Annotated[ChatFormatJSONObjectConfig, Tag("json_object")], Annotated[ChatFormatJSONSchemaConfig, Tag("json_schema")], Annotated[ChatFormatPythonConfig, Tag("python")], Annotated[ChatFormatTextConfig, Tag("text")], @@ -228,7 +229,7 @@ class ChatRequestTypedDict(TypedDict): messages: List[ChatMessagesTypedDict] r"""List of messages for the conversation""" cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" debug: NotRequired[ChatDebugOptionsTypedDict] r"""Debug options for inspecting request transformations (streaming only)""" frequency_penalty: NotRequired[Nullable[float]] @@ -259,6 +260,9 @@ class ChatRequestTypedDict(TypedDict): r"""Plugins you want to enable for this request, including their settings.""" presence_penalty: NotRequired[Nullable[float]] r"""Presence penalty (-2.0 to 2.0)""" + prompt_cache_key: NotRequired[Nullable[str]] + prompt_cache_options: NotRequired[Nullable[PromptCacheOptionsTypedDict]] + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" provider: NotRequired[Nullable[ProviderPreferencesTypedDict]] r"""When multiple model providers are available, optionally indicate your routing preference.""" reasoning: NotRequired[ChatRequestReasoningTypedDict] @@ -310,7 +314,7 @@ class ChatRequest(BaseModel): r"""List of messages for the conversation""" cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" debug: Optional[ChatDebugOptions] = None r"""Debug options for inspecting request transformations (streaming only)""" @@ -357,6 +361,11 @@ class ChatRequest(BaseModel): presence_penalty: OptionalNullable[float] = UNSET r"""Presence penalty (-2.0 to 2.0)""" + prompt_cache_key: OptionalNullable[str] = UNSET + + prompt_cache_options: OptionalNullable[PromptCacheOptions] = UNSET + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + provider: OptionalNullable[ProviderPreferences] = UNSET r"""When multiple model providers are available, optionally indicate your routing preference.""" @@ -440,6 +449,8 @@ class ChatRequest(BaseModel): "parallel_tool_calls", "plugins", "presence_penalty", + "prompt_cache_key", + "prompt_cache_options", "provider", "reasoning", "reasoning_effort", @@ -473,6 +484,8 @@ class ChatRequest(BaseModel): "min_p", "parallel_tool_calls", "presence_penalty", + "prompt_cache_key", + "prompt_cache_options", "provider", "reasoning_effort", "repetition_penalty", diff --git a/src/openrouter/components/chatusage.py b/src/openrouter/components/chatusage.py index 1410ca9..4fd2be3 100644 --- a/src/openrouter/components/chatusage.py +++ b/src/openrouter/components/chatusage.py @@ -2,6 +2,7 @@ from __future__ import annotations from .costdetails import CostDetails, CostDetailsTypedDict +from .servertoolusedetails import ServerToolUseDetails, ServerToolUseDetailsTypedDict from openrouter.types import ( BaseModel, Nullable, @@ -129,59 +130,6 @@ class ChatUsagePromptTokensDetails(BaseModel): return m -class ServerToolUseDetailsTypedDict(TypedDict): - r"""Usage for server-side tool execution (e.g., web search)""" - - tool_calls_executed: NotRequired[Nullable[int]] - r"""Number of OpenRouter server tool calls that executed and produced a result""" - tool_calls_requested: NotRequired[Nullable[int]] - r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" - web_search_requests: NotRequired[Nullable[int]] - r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" - - -class ServerToolUseDetails(BaseModel): - r"""Usage for server-side tool execution (e.g., web search)""" - - tool_calls_executed: OptionalNullable[int] = UNSET - r"""Number of OpenRouter server tool calls that executed and produced a result""" - - tool_calls_requested: OptionalNullable[int] = UNSET - r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" - - web_search_requests: OptionalNullable[int] = UNSET - r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["tool_calls_executed", "tool_calls_requested", "web_search_requests"] - ) - nullable_fields = set( - ["tool_calls_executed", "tool_calls_requested", "web_search_requests"] - ) - 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 ChatUsageTypedDict(TypedDict): r"""Token usage statistics""" diff --git a/src/openrouter/components/compactionitem.py b/src/openrouter/components/compactionitem.py index 0c6d749..fd2fa67 100644 --- a/src/openrouter/components/compactionitem.py +++ b/src/openrouter/components/compactionitem.py @@ -8,8 +8,9 @@ from openrouter.types import ( UNSET, UNSET_SENTINEL, ) -from pydantic import model_serializer -from typing import Literal +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Literal from typing_extensions import NotRequired, TypedDict @@ -27,12 +28,25 @@ class CompactionItemTypedDict(TypedDict): class CompactionItem(BaseModel): r"""A context compaction marker with encrypted summary""" + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False) + encrypted_content: str type: CompactionItemType id: OptionalNullable[str] = UNSET + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set(["id"]) @@ -43,6 +57,7 @@ class CompactionItem(BaseModel): for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) is_nullable_and_explicitly_set = ( k in nullable_fields and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member @@ -55,5 +70,7 @@ class CompactionItem(BaseModel): or is_nullable_and_explicitly_set ): m[k] = val + for k, v in serialized.items(): + m[k] = v return m diff --git a/src/openrouter/components/contextcompactionitem.py b/src/openrouter/components/contextcompactionitem.py new file mode 100644 index 0000000..591e51c --- /dev/null +++ b/src/openrouter/components/contextcompactionitem.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Literal +from typing_extensions import NotRequired, TypedDict + + +ContextCompactionItemType = Literal["context_compaction",] + + +class ContextCompactionItemTypedDict(TypedDict): + r"""A context compaction marker with an optional encrypted summary""" + + type: ContextCompactionItemType + encrypted_content: NotRequired[Nullable[str]] + id: NotRequired[Nullable[str]] + + +class ContextCompactionItem(BaseModel): + r"""A context compaction marker with an optional encrypted summary""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False) + + type: ContextCompactionItemType + + encrypted_content: OptionalNullable[str] = UNSET + + id: OptionalNullable[str] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["encrypted_content", "id"]) + nullable_fields = set(["encrypted_content", "id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + 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 + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/openrouter/components/createguardrailrequest.py b/src/openrouter/components/createguardrailrequest.py index fb9dae6..83ee2b3 100644 --- a/src/openrouter/components/createguardrailrequest.py +++ b/src/openrouter/components/createguardrailrequest.py @@ -36,7 +36,7 @@ class CreateGuardrailRequestTypedDict(TypedDict): description: NotRequired[Nullable[str]] r"""Description of the guardrail""" enforce_zdr: NotRequired[Nullable[bool]] - r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" + r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" enforce_zdr_anthropic: NotRequired[Nullable[bool]] r"""Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.""" enforce_zdr_google: NotRequired[Nullable[bool]] @@ -44,7 +44,9 @@ class CreateGuardrailRequestTypedDict(TypedDict): enforce_zdr_openai: NotRequired[Nullable[bool]] r"""Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.""" enforce_zdr_other: NotRequired[Nullable[bool]] - r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.""" + r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.""" + enforce_zdr_xai: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.""" ignored_models: NotRequired[Nullable[List[str]]] r"""Array of model identifiers to exclude from routing (slug or canonical_slug accepted)""" ignored_providers: NotRequired[Nullable[List[str]]] @@ -84,7 +86,7 @@ class CreateGuardrailRequest(BaseModel): deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." ), ] = UNSET - r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" + r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" enforce_zdr_anthropic: OptionalNullable[bool] = UNSET r"""Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.""" @@ -96,7 +98,10 @@ class CreateGuardrailRequest(BaseModel): r"""Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.""" enforce_zdr_other: OptionalNullable[bool] = UNSET - r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.""" + r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.""" + + enforce_zdr_xai: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.""" ignored_models: OptionalNullable[List[str]] = UNSET r"""Array of model identifiers to exclude from routing (slug or canonical_slug accepted)""" @@ -127,6 +132,7 @@ class CreateGuardrailRequest(BaseModel): "enforce_zdr_google", "enforce_zdr_openai", "enforce_zdr_other", + "enforce_zdr_xai", "ignored_models", "ignored_providers", "limit_usd", @@ -146,6 +152,7 @@ class CreateGuardrailRequest(BaseModel): "enforce_zdr_google", "enforce_zdr_openai", "enforce_zdr_other", + "enforce_zdr_xai", "ignored_models", "ignored_providers", "limit_usd", diff --git a/src/openrouter/components/createobservabilitydestinationrequest.py b/src/openrouter/components/createobservabilitydestinationrequest.py index b7bf975..6cd46b4 100644 --- a/src/openrouter/components/createobservabilitydestinationrequest.py +++ b/src/openrouter/components/createobservabilitydestinationrequest.py @@ -1,9 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .observabilityfilterrulesconfig import ( - ObservabilityFilterRulesConfig, - ObservabilityFilterRulesConfigTypedDict, +from .observabilityfilterrulesconfignullable import ( + ObservabilityFilterRulesConfigNullable, + ObservabilityFilterRulesConfigNullableTypedDict, ) from openrouter.types import ( BaseModel, @@ -54,7 +54,7 @@ class CreateObservabilityDestinationRequestTypedDict(TypedDict): r"""Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided.""" enabled: NotRequired[bool] r"""Whether this destination should be enabled immediately.""" - filter_rules: NotRequired[Nullable[ObservabilityFilterRulesConfigTypedDict]] + filter_rules: NotRequired[Nullable[ObservabilityFilterRulesConfigNullableTypedDict]] r"""Optional structured filter rules controlling which events are forwarded.""" privacy_mode: NotRequired[bool] r"""When true, request/response bodies are not forwarded — only metadata.""" @@ -80,7 +80,7 @@ class CreateObservabilityDestinationRequest(BaseModel): enabled: Optional[bool] = True r"""Whether this destination should be enabled immediately.""" - filter_rules: OptionalNullable[ObservabilityFilterRulesConfig] = UNSET + filter_rules: OptionalNullable[ObservabilityFilterRulesConfigNullable] = UNSET r"""Optional structured filter rules controlling which events are forwarded.""" privacy_mode: Optional[bool] = False diff --git a/src/openrouter/components/easyinputmessage.py b/src/openrouter/components/easyinputmessage.py index acc023a..814efc2 100644 --- a/src/openrouter/components/easyinputmessage.py +++ b/src/openrouter/components/easyinputmessage.py @@ -79,9 +79,9 @@ class EasyInputMessageContentInputImage(BaseModel): EasyInputMessageContentUnion1TypedDict = TypeAliasType( "EasyInputMessageContentUnion1TypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputVideoTypedDict, + InputTextTypedDict, EasyInputMessageContentInputImageTypedDict, InputFileTypedDict, ], diff --git a/src/openrouter/components/fusionservertoolconfig.py b/src/openrouter/components/fusionservertoolconfig.py index 5803dc6..f7377d2 100644 --- a/src/openrouter/components/fusionservertoolconfig.py +++ b/src/openrouter/components/fusionservertoolconfig.py @@ -98,9 +98,9 @@ class FusionServerToolConfigTypedDict(TypedDict): analysis_models: NotRequired[List[str]] r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.""" cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" max_completion_tokens: NotRequired[int] - r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies.""" + r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to 50000.""" max_tool_calls: NotRequired[int] r"""Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16.""" model: NotRequired[str] @@ -120,10 +120,10 @@ class FusionServerToolConfig(BaseModel): r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion.""" cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" max_completion_tokens: Optional[int] = None - r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies.""" + r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to 50000.""" max_tool_calls: Optional[int] = None r"""Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16.""" diff --git a/src/openrouter/components/guardrail.py b/src/openrouter/components/guardrail.py index b087dc3..7839f84 100644 --- a/src/openrouter/components/guardrail.py +++ b/src/openrouter/components/guardrail.py @@ -42,7 +42,7 @@ class GuardrailTypedDict(TypedDict): description: NotRequired[Nullable[str]] r"""Description of the guardrail""" enforce_zdr: NotRequired[Nullable[bool]] - r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" + r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" enforce_zdr_anthropic: NotRequired[Nullable[bool]] r"""Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.""" enforce_zdr_google: NotRequired[Nullable[bool]] @@ -50,7 +50,9 @@ class GuardrailTypedDict(TypedDict): enforce_zdr_openai: NotRequired[Nullable[bool]] r"""Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.""" enforce_zdr_other: NotRequired[Nullable[bool]] - r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.""" + r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.""" + enforce_zdr_xai: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.""" ignored_models: NotRequired[Nullable[List[str]]] r"""Array of model canonical_slugs to exclude from routing""" ignored_providers: NotRequired[Nullable[List[str]]] @@ -97,7 +99,7 @@ class Guardrail(BaseModel): deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." ), ] = UNSET - r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" + r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" enforce_zdr_anthropic: OptionalNullable[bool] = UNSET r"""Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.""" @@ -109,7 +111,10 @@ class Guardrail(BaseModel): r"""Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.""" enforce_zdr_other: OptionalNullable[bool] = UNSET - r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.""" + r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.""" + + enforce_zdr_xai: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.""" ignored_models: OptionalNullable[List[str]] = UNSET r"""Array of model canonical_slugs to exclude from routing""" @@ -140,6 +145,7 @@ class Guardrail(BaseModel): "enforce_zdr_google", "enforce_zdr_openai", "enforce_zdr_other", + "enforce_zdr_xai", "ignored_models", "ignored_providers", "limit_usd", @@ -159,6 +165,7 @@ class Guardrail(BaseModel): "enforce_zdr_google", "enforce_zdr_openai", "enforce_zdr_other", + "enforce_zdr_xai", "ignored_models", "ignored_providers", "limit_usd", diff --git a/src/openrouter/components/imagegencompletedevent.py b/src/openrouter/components/imagegencompletedevent.py index ca3f68a..6b9a899 100644 --- a/src/openrouter/components/imagegencompletedevent.py +++ b/src/openrouter/components/imagegencompletedevent.py @@ -22,7 +22,7 @@ class ImageGenCompletedEventTypedDict(TypedDict): type: ImageGenCompletedEventType r"""The event type""" media_type: NotRequired[str] - r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`).""" + r"""Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.""" usage: NotRequired[ImageGenerationUsageTypedDict] r"""Token and cost usage for the image generation request, when available""" @@ -40,7 +40,7 @@ class ImageGenCompletedEvent(BaseModel): r"""The event type""" media_type: Optional[str] = None - r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`).""" + r"""Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.""" usage: Optional[ImageGenerationUsage] = None r"""Token and cost usage for the image generation request, when available""" diff --git a/src/openrouter/components/imagegenerationproviderpreferences.py b/src/openrouter/components/imagegenerationproviderpreferences.py new file mode 100644 index 0000000..f31f0c0 --- /dev/null +++ b/src/openrouter/components/imagegenerationproviderpreferences.py @@ -0,0 +1,705 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .providername import ProviderName +from .providersort import ProviderSort +from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ImageGenerationProviderPreferencesIgnoreTypedDict = TypeAliasType( + "ImageGenerationProviderPreferencesIgnoreTypedDict", Union[ProviderName, str] +) + + +ImageGenerationProviderPreferencesIgnore = TypeAliasType( + "ImageGenerationProviderPreferencesIgnore", Union[ProviderName, str] +) + + +ImageGenerationProviderPreferencesOnlyTypedDict = TypeAliasType( + "ImageGenerationProviderPreferencesOnlyTypedDict", Union[ProviderName, str] +) + + +ImageGenerationProviderPreferencesOnly = TypeAliasType( + "ImageGenerationProviderPreferencesOnly", Union[ProviderName, str] +) + + +class ImageGenerationProviderPreferencesOptionsTypedDict(TypedDict): + r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" + + oneai: NotRequired[Dict[str, Nullable[Any]]] + ai21: NotRequired[Dict[str, Nullable[Any]]] + aion_labs: NotRequired[Dict[str, Nullable[Any]]] + akashml: NotRequired[Dict[str, Nullable[Any]]] + alibaba: NotRequired[Dict[str, Nullable[Any]]] + amazon_bedrock: NotRequired[Dict[str, Nullable[Any]]] + amazon_nova: NotRequired[Dict[str, Nullable[Any]]] + ambient: NotRequired[Dict[str, Nullable[Any]]] + anthropic: NotRequired[Dict[str, Nullable[Any]]] + anyscale: NotRequired[Dict[str, Nullable[Any]]] + arcee_ai: NotRequired[Dict[str, Nullable[Any]]] + atlas_cloud: NotRequired[Dict[str, Nullable[Any]]] + atoma: NotRequired[Dict[str, Nullable[Any]]] + avian: NotRequired[Dict[str, Nullable[Any]]] + azure: NotRequired[Dict[str, Nullable[Any]]] + baidu: NotRequired[Dict[str, Nullable[Any]]] + baseten: NotRequired[Dict[str, Nullable[Any]]] + black_forest_labs: NotRequired[Dict[str, Nullable[Any]]] + byteplus: NotRequired[Dict[str, Nullable[Any]]] + centml: NotRequired[Dict[str, Nullable[Any]]] + cerebras: NotRequired[Dict[str, Nullable[Any]]] + chutes: NotRequired[Dict[str, Nullable[Any]]] + cirrascale: NotRequired[Dict[str, Nullable[Any]]] + clarifai: NotRequired[Dict[str, Nullable[Any]]] + cloudflare: NotRequired[Dict[str, Nullable[Any]]] + cohere: NotRequired[Dict[str, Nullable[Any]]] + crofai: NotRequired[Dict[str, Nullable[Any]]] + crucible: NotRequired[Dict[str, Nullable[Any]]] + crusoe: NotRequired[Dict[str, Nullable[Any]]] + darkbloom: NotRequired[Dict[str, Nullable[Any]]] + decart: NotRequired[Dict[str, Nullable[Any]]] + deepgram: NotRequired[Dict[str, Nullable[Any]]] + deepinfra: NotRequired[Dict[str, Nullable[Any]]] + deepseek: NotRequired[Dict[str, Nullable[Any]]] + dekallm: NotRequired[Dict[str, Nullable[Any]]] + digitalocean: NotRequired[Dict[str, Nullable[Any]]] + enfer: NotRequired[Dict[str, Nullable[Any]]] + fake_provider: NotRequired[Dict[str, Nullable[Any]]] + featherless: NotRequired[Dict[str, Nullable[Any]]] + fireworks: NotRequired[Dict[str, Nullable[Any]]] + friendli: NotRequired[Dict[str, Nullable[Any]]] + gmicloud: NotRequired[Dict[str, Nullable[Any]]] + google_ai_studio: NotRequired[Dict[str, Nullable[Any]]] + google_vertex: NotRequired[Dict[str, Nullable[Any]]] + gopomelo: NotRequired[Dict[str, Nullable[Any]]] + groq: NotRequired[Dict[str, Nullable[Any]]] + heygen: NotRequired[Dict[str, Nullable[Any]]] + huggingface: NotRequired[Dict[str, Nullable[Any]]] + hyperbolic: NotRequired[Dict[str, Nullable[Any]]] + hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]] + inception: NotRequired[Dict[str, Nullable[Any]]] + inceptron: NotRequired[Dict[str, Nullable[Any]]] + inferact_vllm: NotRequired[Dict[str, Nullable[Any]]] + inference_net: NotRequired[Dict[str, Nullable[Any]]] + infermatic: NotRequired[Dict[str, Nullable[Any]]] + inflection: NotRequired[Dict[str, Nullable[Any]]] + inocloud: NotRequired[Dict[str, Nullable[Any]]] + io_net: NotRequired[Dict[str, Nullable[Any]]] + ionstream: NotRequired[Dict[str, Nullable[Any]]] + klusterai: NotRequired[Dict[str, Nullable[Any]]] + lambda_: NotRequired[Dict[str, Nullable[Any]]] + lepton: NotRequired[Dict[str, Nullable[Any]]] + liquid: NotRequired[Dict[str, Nullable[Any]]] + lynn: NotRequired[Dict[str, Nullable[Any]]] + lynn_private: NotRequired[Dict[str, Nullable[Any]]] + mancer: NotRequired[Dict[str, Nullable[Any]]] + mancer_old: NotRequired[Dict[str, Nullable[Any]]] + mara: NotRequired[Dict[str, Nullable[Any]]] + meta: NotRequired[Dict[str, Nullable[Any]]] + minimax: NotRequired[Dict[str, Nullable[Any]]] + mistral: NotRequired[Dict[str, Nullable[Any]]] + modal: NotRequired[Dict[str, Nullable[Any]]] + modelrun: NotRequired[Dict[str, Nullable[Any]]] + modular: NotRequired[Dict[str, Nullable[Any]]] + moonshotai: NotRequired[Dict[str, Nullable[Any]]] + morph: NotRequired[Dict[str, Nullable[Any]]] + ncompass: NotRequired[Dict[str, Nullable[Any]]] + nebius: NotRequired[Dict[str, Nullable[Any]]] + nex_agi: NotRequired[Dict[str, Nullable[Any]]] + nextbit: NotRequired[Dict[str, Nullable[Any]]] + nineteen: NotRequired[Dict[str, Nullable[Any]]] + novita: NotRequired[Dict[str, Nullable[Any]]] + nvidia: NotRequired[Dict[str, Nullable[Any]]] + octoai: NotRequired[Dict[str, Nullable[Any]]] + open_inference: NotRequired[Dict[str, Nullable[Any]]] + openai: NotRequired[Dict[str, Nullable[Any]]] + parasail: NotRequired[Dict[str, Nullable[Any]]] + perceptron: NotRequired[Dict[str, Nullable[Any]]] + perplexity: NotRequired[Dict[str, Nullable[Any]]] + phala: NotRequired[Dict[str, Nullable[Any]]] + poolside: NotRequired[Dict[str, Nullable[Any]]] + quiver: NotRequired[Dict[str, Nullable[Any]]] + recraft: NotRequired[Dict[str, Nullable[Any]]] + recursal: NotRequired[Dict[str, Nullable[Any]]] + reflection: NotRequired[Dict[str, Nullable[Any]]] + reka: NotRequired[Dict[str, Nullable[Any]]] + relace: NotRequired[Dict[str, Nullable[Any]]] + replicate: NotRequired[Dict[str, Nullable[Any]]] + sail_research: NotRequired[Dict[str, Nullable[Any]]] + sakana: NotRequired[Dict[str, Nullable[Any]]] + sambanova: NotRequired[Dict[str, Nullable[Any]]] + sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]] + seed: NotRequired[Dict[str, Nullable[Any]]] + sf_compute: NotRequired[Dict[str, Nullable[Any]]] + siliconflow: NotRequired[Dict[str, Nullable[Any]]] + sourceful: NotRequired[Dict[str, Nullable[Any]]] + stealth: NotRequired[Dict[str, Nullable[Any]]] + stepfun: NotRequired[Dict[str, Nullable[Any]]] + streamlake: NotRequired[Dict[str, Nullable[Any]]] + switchpoint: NotRequired[Dict[str, Nullable[Any]]] + targon: NotRequired[Dict[str, Nullable[Any]]] + tenstorrent: NotRequired[Dict[str, Nullable[Any]]] + together: NotRequired[Dict[str, Nullable[Any]]] + together_lite: NotRequired[Dict[str, Nullable[Any]]] + ubicloud: NotRequired[Dict[str, Nullable[Any]]] + upstage: NotRequired[Dict[str, Nullable[Any]]] + venice: NotRequired[Dict[str, Nullable[Any]]] + wafer: NotRequired[Dict[str, Nullable[Any]]] + wandb: NotRequired[Dict[str, Nullable[Any]]] + xai: NotRequired[Dict[str, Nullable[Any]]] + xiaomi: NotRequired[Dict[str, Nullable[Any]]] + z_ai: NotRequired[Dict[str, Nullable[Any]]] + + +class ImageGenerationProviderPreferencesOptions(BaseModel): + r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" + + oneai: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="01ai") + ] = None + + ai21: Optional[Dict[str, Nullable[Any]]] = None + + aion_labs: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="aion-labs") + ] = None + + akashml: Optional[Dict[str, Nullable[Any]]] = None + + alibaba: Optional[Dict[str, Nullable[Any]]] = None + + amazon_bedrock: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-bedrock") + ] = None + + amazon_nova: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-nova") + ] = None + + ambient: Optional[Dict[str, Nullable[Any]]] = None + + anthropic: Optional[Dict[str, Nullable[Any]]] = None + + anyscale: Optional[Dict[str, Nullable[Any]]] = None + + arcee_ai: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="arcee-ai") + ] = None + + atlas_cloud: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="atlas-cloud") + ] = None + + atoma: Optional[Dict[str, Nullable[Any]]] = None + + avian: Optional[Dict[str, Nullable[Any]]] = None + + azure: Optional[Dict[str, Nullable[Any]]] = None + + baidu: Optional[Dict[str, Nullable[Any]]] = None + + baseten: Optional[Dict[str, Nullable[Any]]] = None + + black_forest_labs: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="black-forest-labs") + ] = None + + byteplus: Optional[Dict[str, Nullable[Any]]] = None + + centml: Optional[Dict[str, Nullable[Any]]] = None + + cerebras: Optional[Dict[str, Nullable[Any]]] = None + + chutes: Optional[Dict[str, Nullable[Any]]] = None + + cirrascale: Optional[Dict[str, Nullable[Any]]] = None + + clarifai: Optional[Dict[str, Nullable[Any]]] = None + + cloudflare: Optional[Dict[str, Nullable[Any]]] = None + + cohere: Optional[Dict[str, Nullable[Any]]] = None + + crofai: Optional[Dict[str, Nullable[Any]]] = None + + crucible: Optional[Dict[str, Nullable[Any]]] = None + + crusoe: Optional[Dict[str, Nullable[Any]]] = None + + darkbloom: Optional[Dict[str, Nullable[Any]]] = None + + decart: Optional[Dict[str, Nullable[Any]]] = None + + deepgram: Optional[Dict[str, Nullable[Any]]] = None + + deepinfra: Optional[Dict[str, Nullable[Any]]] = None + + deepseek: Optional[Dict[str, Nullable[Any]]] = None + + dekallm: Optional[Dict[str, Nullable[Any]]] = None + + digitalocean: Optional[Dict[str, Nullable[Any]]] = None + + enfer: Optional[Dict[str, Nullable[Any]]] = None + + fake_provider: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="fake-provider") + ] = None + + featherless: Optional[Dict[str, Nullable[Any]]] = None + + fireworks: Optional[Dict[str, Nullable[Any]]] = None + + friendli: Optional[Dict[str, Nullable[Any]]] = None + + gmicloud: Optional[Dict[str, Nullable[Any]]] = None + + google_ai_studio: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-ai-studio") + ] = None + + google_vertex: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-vertex") + ] = None + + gopomelo: Optional[Dict[str, Nullable[Any]]] = None + + groq: Optional[Dict[str, Nullable[Any]]] = None + + heygen: Optional[Dict[str, Nullable[Any]]] = None + + huggingface: Optional[Dict[str, Nullable[Any]]] = None + + hyperbolic: Optional[Dict[str, Nullable[Any]]] = None + + hyperbolic_quantized: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="hyperbolic-quantized") + ] = None + + inception: Optional[Dict[str, Nullable[Any]]] = None + + inceptron: Optional[Dict[str, Nullable[Any]]] = None + + inferact_vllm: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inferact-vllm") + ] = None + + inference_net: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net") + ] = None + + infermatic: Optional[Dict[str, Nullable[Any]]] = None + + inflection: Optional[Dict[str, Nullable[Any]]] = None + + inocloud: Optional[Dict[str, Nullable[Any]]] = None + + io_net: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="io-net") + ] = None + + ionstream: Optional[Dict[str, Nullable[Any]]] = None + + klusterai: Optional[Dict[str, Nullable[Any]]] = None + + lambda_: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lambda") + ] = None + + lepton: Optional[Dict[str, Nullable[Any]]] = None + + liquid: Optional[Dict[str, Nullable[Any]]] = None + + lynn: Optional[Dict[str, Nullable[Any]]] = None + + lynn_private: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lynn-private") + ] = None + + mancer: Optional[Dict[str, Nullable[Any]]] = None + + mancer_old: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="mancer-old") + ] = None + + mara: Optional[Dict[str, Nullable[Any]]] = None + + meta: Optional[Dict[str, Nullable[Any]]] = None + + minimax: Optional[Dict[str, Nullable[Any]]] = None + + mistral: Optional[Dict[str, Nullable[Any]]] = None + + modal: Optional[Dict[str, Nullable[Any]]] = None + + modelrun: Optional[Dict[str, Nullable[Any]]] = None + + modular: Optional[Dict[str, Nullable[Any]]] = None + + moonshotai: Optional[Dict[str, Nullable[Any]]] = None + + morph: Optional[Dict[str, Nullable[Any]]] = None + + ncompass: Optional[Dict[str, Nullable[Any]]] = None + + nebius: Optional[Dict[str, Nullable[Any]]] = None + + nex_agi: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="nex-agi") + ] = None + + nextbit: Optional[Dict[str, Nullable[Any]]] = None + + nineteen: Optional[Dict[str, Nullable[Any]]] = None + + novita: Optional[Dict[str, Nullable[Any]]] = None + + nvidia: Optional[Dict[str, Nullable[Any]]] = None + + octoai: Optional[Dict[str, Nullable[Any]]] = None + + open_inference: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="open-inference") + ] = None + + openai: Optional[Dict[str, Nullable[Any]]] = None + + parasail: Optional[Dict[str, Nullable[Any]]] = None + + perceptron: Optional[Dict[str, Nullable[Any]]] = None + + perplexity: Optional[Dict[str, Nullable[Any]]] = None + + phala: Optional[Dict[str, Nullable[Any]]] = None + + poolside: Optional[Dict[str, Nullable[Any]]] = None + + quiver: Optional[Dict[str, Nullable[Any]]] = None + + recraft: Optional[Dict[str, Nullable[Any]]] = None + + recursal: Optional[Dict[str, Nullable[Any]]] = None + + reflection: Optional[Dict[str, Nullable[Any]]] = None + + reka: Optional[Dict[str, Nullable[Any]]] = None + + relace: Optional[Dict[str, Nullable[Any]]] = None + + replicate: Optional[Dict[str, Nullable[Any]]] = None + + sail_research: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sail-research") + ] = None + + sakana: Optional[Dict[str, Nullable[Any]]] = None + + sambanova: Optional[Dict[str, Nullable[Any]]] = None + + sambanova_cloaked: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sambanova-cloaked") + ] = None + + seed: Optional[Dict[str, Nullable[Any]]] = None + + sf_compute: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sf-compute") + ] = None + + siliconflow: Optional[Dict[str, Nullable[Any]]] = None + + sourceful: Optional[Dict[str, Nullable[Any]]] = None + + stealth: Optional[Dict[str, Nullable[Any]]] = None + + stepfun: Optional[Dict[str, Nullable[Any]]] = None + + streamlake: Optional[Dict[str, Nullable[Any]]] = None + + switchpoint: Optional[Dict[str, Nullable[Any]]] = None + + targon: Optional[Dict[str, Nullable[Any]]] = None + + tenstorrent: Optional[Dict[str, Nullable[Any]]] = None + + together: Optional[Dict[str, Nullable[Any]]] = None + + together_lite: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="together-lite") + ] = None + + ubicloud: Optional[Dict[str, Nullable[Any]]] = None + + upstage: Optional[Dict[str, Nullable[Any]]] = None + + venice: Optional[Dict[str, Nullable[Any]]] = None + + wafer: Optional[Dict[str, Nullable[Any]]] = None + + wandb: Optional[Dict[str, Nullable[Any]]] = None + + xai: Optional[Dict[str, Nullable[Any]]] = None + + xiaomi: Optional[Dict[str, Nullable[Any]]] = None + + z_ai: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="z-ai") + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "01ai", + "ai21", + "aion-labs", + "akashml", + "alibaba", + "amazon-bedrock", + "amazon-nova", + "ambient", + "anthropic", + "anyscale", + "arcee-ai", + "atlas-cloud", + "atoma", + "avian", + "azure", + "baidu", + "baseten", + "black-forest-labs", + "byteplus", + "centml", + "cerebras", + "chutes", + "cirrascale", + "clarifai", + "cloudflare", + "cohere", + "crofai", + "crucible", + "crusoe", + "darkbloom", + "decart", + "deepgram", + "deepinfra", + "deepseek", + "dekallm", + "digitalocean", + "enfer", + "fake-provider", + "featherless", + "fireworks", + "friendli", + "gmicloud", + "google-ai-studio", + "google-vertex", + "gopomelo", + "groq", + "heygen", + "huggingface", + "hyperbolic", + "hyperbolic-quantized", + "inception", + "inceptron", + "inferact-vllm", + "inference-net", + "infermatic", + "inflection", + "inocloud", + "io-net", + "ionstream", + "klusterai", + "lambda", + "lepton", + "liquid", + "lynn", + "lynn-private", + "mancer", + "mancer-old", + "mara", + "meta", + "minimax", + "mistral", + "modal", + "modelrun", + "modular", + "moonshotai", + "morph", + "ncompass", + "nebius", + "nex-agi", + "nextbit", + "nineteen", + "novita", + "nvidia", + "octoai", + "open-inference", + "openai", + "parasail", + "perceptron", + "perplexity", + "phala", + "poolside", + "quiver", + "recraft", + "recursal", + "reflection", + "reka", + "relace", + "replicate", + "sail-research", + "sakana", + "sambanova", + "sambanova-cloaked", + "seed", + "sf-compute", + "siliconflow", + "sourceful", + "stealth", + "stepfun", + "streamlake", + "switchpoint", + "targon", + "tenstorrent", + "together", + "together-lite", + "ubicloud", + "upstage", + "venice", + "wafer", + "wandb", + "xai", + "xiaomi", + "z-ai", + ] + ) + 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 + + +ImageGenerationProviderPreferencesOrderTypedDict = TypeAliasType( + "ImageGenerationProviderPreferencesOrderTypedDict", Union[ProviderName, str] +) + + +ImageGenerationProviderPreferencesOrder = TypeAliasType( + "ImageGenerationProviderPreferencesOrder", Union[ProviderName, str] +) + + +ImageGenerationProviderPreferencesSortTypedDict = TypeAliasType( + "ImageGenerationProviderPreferencesSortTypedDict", + Union[ProviderSortConfigTypedDict, ProviderSort, Any], +) +r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + +ImageGenerationProviderPreferencesSort = TypeAliasType( + "ImageGenerationProviderPreferencesSort", + Union[ProviderSortConfig, ProviderSort, Any], +) +r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + +class ImageGenerationProviderPreferencesTypedDict(TypedDict): + r"""Provider routing preferences and provider-specific passthrough configuration.""" + + allow_fallbacks: NotRequired[Nullable[bool]] + r"""Whether to allow backup providers to serve requests + - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider. + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + """ + ignore: NotRequired[ + Nullable[List[ImageGenerationProviderPreferencesIgnoreTypedDict]] + ] + 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[ImageGenerationProviderPreferencesOnlyTypedDict]]] + 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[ImageGenerationProviderPreferencesOptionsTypedDict] + order: NotRequired[Nullable[List[ImageGenerationProviderPreferencesOrderTypedDict]]] + 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.""" + sort: NotRequired[Nullable[ImageGenerationProviderPreferencesSortTypedDict]] + r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + +class ImageGenerationProviderPreferences(BaseModel): + r"""Provider routing preferences and provider-specific passthrough configuration.""" + + allow_fallbacks: OptionalNullable[bool] = UNSET + r"""Whether to allow backup providers to serve requests + - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider. + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + """ + + ignore: OptionalNullable[List[ImageGenerationProviderPreferencesIgnore]] = 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[ImageGenerationProviderPreferencesOnly]] = 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[ImageGenerationProviderPreferencesOptions] = None + + order: OptionalNullable[List[ImageGenerationProviderPreferencesOrder]] = 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.""" + + sort: OptionalNullable[ImageGenerationProviderPreferencesSort] = UNSET + r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["allow_fallbacks", "ignore", "only", "options", "order", "sort"] + ) + nullable_fields = set(["allow_fallbacks", "ignore", "only", "order", "sort"]) + 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 + + +try: + ImageGenerationProviderPreferencesOptions.model_rebuild() +except NameError: + pass diff --git a/src/openrouter/components/imagegenerationrequest.py b/src/openrouter/components/imagegenerationrequest.py index 5d2a7e6..9f5f9ca 100644 --- a/src/openrouter/components/imagegenerationrequest.py +++ b/src/openrouter/components/imagegenerationrequest.py @@ -2,11 +2,14 @@ from __future__ import annotations from .contentpartimage import ContentPartImage, ContentPartImageTypedDict -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr -import pydantic +from .imagegenerationproviderpreferences import ( + ImageGenerationProviderPreferences, + ImageGenerationProviderPreferencesTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr from pydantic import model_serializer -from typing import Any, Dict, List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypedDict +from typing import List, Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict ImageGenerationRequestAspectRatio = Union[ @@ -62,590 +65,6 @@ ImageGenerationRequestOutputFormat = Union[ r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.""" -class ImageGenerationRequestOptionsTypedDict(TypedDict): - r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" - - oneai: NotRequired[Dict[str, Nullable[Any]]] - ai21: NotRequired[Dict[str, Nullable[Any]]] - aion_labs: NotRequired[Dict[str, Nullable[Any]]] - akashml: NotRequired[Dict[str, Nullable[Any]]] - alibaba: NotRequired[Dict[str, Nullable[Any]]] - amazon_bedrock: NotRequired[Dict[str, Nullable[Any]]] - amazon_nova: NotRequired[Dict[str, Nullable[Any]]] - ambient: NotRequired[Dict[str, Nullable[Any]]] - anthropic: NotRequired[Dict[str, Nullable[Any]]] - anyscale: NotRequired[Dict[str, Nullable[Any]]] - arcee_ai: NotRequired[Dict[str, Nullable[Any]]] - atlas_cloud: NotRequired[Dict[str, Nullable[Any]]] - atoma: NotRequired[Dict[str, Nullable[Any]]] - avian: NotRequired[Dict[str, Nullable[Any]]] - azure: NotRequired[Dict[str, Nullable[Any]]] - baidu: NotRequired[Dict[str, Nullable[Any]]] - baseten: NotRequired[Dict[str, Nullable[Any]]] - black_forest_labs: NotRequired[Dict[str, Nullable[Any]]] - byteplus: NotRequired[Dict[str, Nullable[Any]]] - centml: NotRequired[Dict[str, Nullable[Any]]] - cerebras: NotRequired[Dict[str, Nullable[Any]]] - chutes: NotRequired[Dict[str, Nullable[Any]]] - cirrascale: NotRequired[Dict[str, Nullable[Any]]] - clarifai: NotRequired[Dict[str, Nullable[Any]]] - cloudflare: NotRequired[Dict[str, Nullable[Any]]] - cohere: NotRequired[Dict[str, Nullable[Any]]] - crofai: NotRequired[Dict[str, Nullable[Any]]] - crucible: NotRequired[Dict[str, Nullable[Any]]] - crusoe: NotRequired[Dict[str, Nullable[Any]]] - darkbloom: NotRequired[Dict[str, Nullable[Any]]] - decart: NotRequired[Dict[str, Nullable[Any]]] - deepinfra: NotRequired[Dict[str, Nullable[Any]]] - deepseek: NotRequired[Dict[str, Nullable[Any]]] - dekallm: NotRequired[Dict[str, Nullable[Any]]] - digitalocean: NotRequired[Dict[str, Nullable[Any]]] - enfer: NotRequired[Dict[str, Nullable[Any]]] - fake_provider: NotRequired[Dict[str, Nullable[Any]]] - featherless: NotRequired[Dict[str, Nullable[Any]]] - fireworks: NotRequired[Dict[str, Nullable[Any]]] - friendli: NotRequired[Dict[str, Nullable[Any]]] - gmicloud: NotRequired[Dict[str, Nullable[Any]]] - google_ai_studio: NotRequired[Dict[str, Nullable[Any]]] - google_vertex: NotRequired[Dict[str, Nullable[Any]]] - gopomelo: NotRequired[Dict[str, Nullable[Any]]] - groq: NotRequired[Dict[str, Nullable[Any]]] - heygen: NotRequired[Dict[str, Nullable[Any]]] - huggingface: NotRequired[Dict[str, Nullable[Any]]] - hyperbolic: NotRequired[Dict[str, Nullable[Any]]] - hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]] - inception: NotRequired[Dict[str, Nullable[Any]]] - inceptron: NotRequired[Dict[str, Nullable[Any]]] - inferact_vllm: NotRequired[Dict[str, Nullable[Any]]] - inference_net: NotRequired[Dict[str, Nullable[Any]]] - infermatic: NotRequired[Dict[str, Nullable[Any]]] - inflection: NotRequired[Dict[str, Nullable[Any]]] - inocloud: NotRequired[Dict[str, Nullable[Any]]] - io_net: NotRequired[Dict[str, Nullable[Any]]] - ionstream: NotRequired[Dict[str, Nullable[Any]]] - klusterai: NotRequired[Dict[str, Nullable[Any]]] - lambda_: NotRequired[Dict[str, Nullable[Any]]] - lepton: NotRequired[Dict[str, Nullable[Any]]] - liquid: NotRequired[Dict[str, Nullable[Any]]] - lynn: NotRequired[Dict[str, Nullable[Any]]] - lynn_private: NotRequired[Dict[str, Nullable[Any]]] - mancer: NotRequired[Dict[str, Nullable[Any]]] - mancer_old: NotRequired[Dict[str, Nullable[Any]]] - mara: NotRequired[Dict[str, Nullable[Any]]] - meta: NotRequired[Dict[str, Nullable[Any]]] - minimax: NotRequired[Dict[str, Nullable[Any]]] - mistral: NotRequired[Dict[str, Nullable[Any]]] - modal: NotRequired[Dict[str, Nullable[Any]]] - modelrun: NotRequired[Dict[str, Nullable[Any]]] - modular: NotRequired[Dict[str, Nullable[Any]]] - moonshotai: NotRequired[Dict[str, Nullable[Any]]] - morph: NotRequired[Dict[str, Nullable[Any]]] - ncompass: NotRequired[Dict[str, Nullable[Any]]] - nebius: NotRequired[Dict[str, Nullable[Any]]] - nex_agi: NotRequired[Dict[str, Nullable[Any]]] - nextbit: NotRequired[Dict[str, Nullable[Any]]] - nineteen: NotRequired[Dict[str, Nullable[Any]]] - novita: NotRequired[Dict[str, Nullable[Any]]] - nvidia: NotRequired[Dict[str, Nullable[Any]]] - octoai: NotRequired[Dict[str, Nullable[Any]]] - open_inference: NotRequired[Dict[str, Nullable[Any]]] - openai: NotRequired[Dict[str, Nullable[Any]]] - parasail: NotRequired[Dict[str, Nullable[Any]]] - perceptron: NotRequired[Dict[str, Nullable[Any]]] - perplexity: NotRequired[Dict[str, Nullable[Any]]] - phala: NotRequired[Dict[str, Nullable[Any]]] - poolside: NotRequired[Dict[str, Nullable[Any]]] - quiver: NotRequired[Dict[str, Nullable[Any]]] - recraft: NotRequired[Dict[str, Nullable[Any]]] - recursal: NotRequired[Dict[str, Nullable[Any]]] - reflection: NotRequired[Dict[str, Nullable[Any]]] - reka: NotRequired[Dict[str, Nullable[Any]]] - relace: NotRequired[Dict[str, Nullable[Any]]] - replicate: NotRequired[Dict[str, Nullable[Any]]] - sakana_ai: NotRequired[Dict[str, Nullable[Any]]] - sambanova: NotRequired[Dict[str, Nullable[Any]]] - sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]] - seed: NotRequired[Dict[str, Nullable[Any]]] - sf_compute: NotRequired[Dict[str, Nullable[Any]]] - siliconflow: NotRequired[Dict[str, Nullable[Any]]] - sourceful: NotRequired[Dict[str, Nullable[Any]]] - stealth: NotRequired[Dict[str, Nullable[Any]]] - stepfun: NotRequired[Dict[str, Nullable[Any]]] - streamlake: NotRequired[Dict[str, Nullable[Any]]] - switchpoint: NotRequired[Dict[str, Nullable[Any]]] - targon: NotRequired[Dict[str, Nullable[Any]]] - tenstorrent: NotRequired[Dict[str, Nullable[Any]]] - together: NotRequired[Dict[str, Nullable[Any]]] - together_lite: NotRequired[Dict[str, Nullable[Any]]] - ubicloud: NotRequired[Dict[str, Nullable[Any]]] - upstage: NotRequired[Dict[str, Nullable[Any]]] - venice: NotRequired[Dict[str, Nullable[Any]]] - wafer: NotRequired[Dict[str, Nullable[Any]]] - wandb: NotRequired[Dict[str, Nullable[Any]]] - xai: NotRequired[Dict[str, Nullable[Any]]] - xiaomi: NotRequired[Dict[str, Nullable[Any]]] - z_ai: NotRequired[Dict[str, Nullable[Any]]] - - -class ImageGenerationRequestOptions(BaseModel): - r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.""" - - oneai: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="01ai") - ] = None - - ai21: Optional[Dict[str, Nullable[Any]]] = None - - aion_labs: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="aion-labs") - ] = None - - akashml: Optional[Dict[str, Nullable[Any]]] = None - - alibaba: Optional[Dict[str, Nullable[Any]]] = None - - amazon_bedrock: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-bedrock") - ] = None - - amazon_nova: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-nova") - ] = None - - ambient: Optional[Dict[str, Nullable[Any]]] = None - - anthropic: Optional[Dict[str, Nullable[Any]]] = None - - anyscale: Optional[Dict[str, Nullable[Any]]] = None - - arcee_ai: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="arcee-ai") - ] = None - - atlas_cloud: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="atlas-cloud") - ] = None - - atoma: Optional[Dict[str, Nullable[Any]]] = None - - avian: Optional[Dict[str, Nullable[Any]]] = None - - azure: Optional[Dict[str, Nullable[Any]]] = None - - baidu: Optional[Dict[str, Nullable[Any]]] = None - - baseten: Optional[Dict[str, Nullable[Any]]] = None - - black_forest_labs: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="black-forest-labs") - ] = None - - byteplus: Optional[Dict[str, Nullable[Any]]] = None - - centml: Optional[Dict[str, Nullable[Any]]] = None - - cerebras: Optional[Dict[str, Nullable[Any]]] = None - - chutes: Optional[Dict[str, Nullable[Any]]] = None - - cirrascale: Optional[Dict[str, Nullable[Any]]] = None - - clarifai: Optional[Dict[str, Nullable[Any]]] = None - - cloudflare: Optional[Dict[str, Nullable[Any]]] = None - - cohere: Optional[Dict[str, Nullable[Any]]] = None - - crofai: Optional[Dict[str, Nullable[Any]]] = None - - crucible: Optional[Dict[str, Nullable[Any]]] = None - - crusoe: Optional[Dict[str, Nullable[Any]]] = None - - darkbloom: Optional[Dict[str, Nullable[Any]]] = None - - decart: Optional[Dict[str, Nullable[Any]]] = None - - deepinfra: Optional[Dict[str, Nullable[Any]]] = None - - deepseek: Optional[Dict[str, Nullable[Any]]] = None - - dekallm: Optional[Dict[str, Nullable[Any]]] = None - - digitalocean: Optional[Dict[str, Nullable[Any]]] = None - - enfer: Optional[Dict[str, Nullable[Any]]] = None - - fake_provider: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="fake-provider") - ] = None - - featherless: Optional[Dict[str, Nullable[Any]]] = None - - fireworks: Optional[Dict[str, Nullable[Any]]] = None - - friendli: Optional[Dict[str, Nullable[Any]]] = None - - gmicloud: Optional[Dict[str, Nullable[Any]]] = None - - google_ai_studio: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-ai-studio") - ] = None - - google_vertex: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-vertex") - ] = None - - gopomelo: Optional[Dict[str, Nullable[Any]]] = None - - groq: Optional[Dict[str, Nullable[Any]]] = None - - heygen: Optional[Dict[str, Nullable[Any]]] = None - - huggingface: Optional[Dict[str, Nullable[Any]]] = None - - hyperbolic: Optional[Dict[str, Nullable[Any]]] = None - - hyperbolic_quantized: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="hyperbolic-quantized") - ] = None - - inception: Optional[Dict[str, Nullable[Any]]] = None - - inceptron: Optional[Dict[str, Nullable[Any]]] = None - - inferact_vllm: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inferact-vllm") - ] = None - - inference_net: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net") - ] = None - - infermatic: Optional[Dict[str, Nullable[Any]]] = None - - inflection: Optional[Dict[str, Nullable[Any]]] = None - - inocloud: Optional[Dict[str, Nullable[Any]]] = None - - io_net: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="io-net") - ] = None - - ionstream: Optional[Dict[str, Nullable[Any]]] = None - - klusterai: Optional[Dict[str, Nullable[Any]]] = None - - lambda_: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lambda") - ] = None - - lepton: Optional[Dict[str, Nullable[Any]]] = None - - liquid: Optional[Dict[str, Nullable[Any]]] = None - - lynn: Optional[Dict[str, Nullable[Any]]] = None - - lynn_private: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lynn-private") - ] = None - - mancer: Optional[Dict[str, Nullable[Any]]] = None - - mancer_old: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="mancer-old") - ] = None - - mara: Optional[Dict[str, Nullable[Any]]] = None - - meta: Optional[Dict[str, Nullable[Any]]] = None - - minimax: Optional[Dict[str, Nullable[Any]]] = None - - mistral: Optional[Dict[str, Nullable[Any]]] = None - - modal: Optional[Dict[str, Nullable[Any]]] = None - - modelrun: Optional[Dict[str, Nullable[Any]]] = None - - modular: Optional[Dict[str, Nullable[Any]]] = None - - moonshotai: Optional[Dict[str, Nullable[Any]]] = None - - morph: Optional[Dict[str, Nullable[Any]]] = None - - ncompass: Optional[Dict[str, Nullable[Any]]] = None - - nebius: Optional[Dict[str, Nullable[Any]]] = None - - nex_agi: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="nex-agi") - ] = None - - nextbit: Optional[Dict[str, Nullable[Any]]] = None - - nineteen: Optional[Dict[str, Nullable[Any]]] = None - - novita: Optional[Dict[str, Nullable[Any]]] = None - - nvidia: Optional[Dict[str, Nullable[Any]]] = None - - octoai: Optional[Dict[str, Nullable[Any]]] = None - - open_inference: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="open-inference") - ] = None - - openai: Optional[Dict[str, Nullable[Any]]] = None - - parasail: Optional[Dict[str, Nullable[Any]]] = None - - perceptron: Optional[Dict[str, Nullable[Any]]] = None - - perplexity: Optional[Dict[str, Nullable[Any]]] = None - - phala: Optional[Dict[str, Nullable[Any]]] = None - - poolside: Optional[Dict[str, Nullable[Any]]] = None - - quiver: Optional[Dict[str, Nullable[Any]]] = None - - recraft: Optional[Dict[str, Nullable[Any]]] = None - - recursal: Optional[Dict[str, Nullable[Any]]] = None - - reflection: Optional[Dict[str, Nullable[Any]]] = None - - reka: Optional[Dict[str, Nullable[Any]]] = None - - relace: Optional[Dict[str, Nullable[Any]]] = None - - replicate: Optional[Dict[str, Nullable[Any]]] = None - - sakana_ai: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sakana-ai") - ] = None - - sambanova: Optional[Dict[str, Nullable[Any]]] = None - - sambanova_cloaked: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sambanova-cloaked") - ] = None - - seed: Optional[Dict[str, Nullable[Any]]] = None - - sf_compute: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sf-compute") - ] = None - - siliconflow: Optional[Dict[str, Nullable[Any]]] = None - - sourceful: Optional[Dict[str, Nullable[Any]]] = None - - stealth: Optional[Dict[str, Nullable[Any]]] = None - - stepfun: Optional[Dict[str, Nullable[Any]]] = None - - streamlake: Optional[Dict[str, Nullable[Any]]] = None - - switchpoint: Optional[Dict[str, Nullable[Any]]] = None - - targon: Optional[Dict[str, Nullable[Any]]] = None - - tenstorrent: Optional[Dict[str, Nullable[Any]]] = None - - together: Optional[Dict[str, Nullable[Any]]] = None - - together_lite: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="together-lite") - ] = None - - ubicloud: Optional[Dict[str, Nullable[Any]]] = None - - upstage: Optional[Dict[str, Nullable[Any]]] = None - - venice: Optional[Dict[str, Nullable[Any]]] = None - - wafer: Optional[Dict[str, Nullable[Any]]] = None - - wandb: Optional[Dict[str, Nullable[Any]]] = None - - xai: Optional[Dict[str, Nullable[Any]]] = None - - xiaomi: Optional[Dict[str, Nullable[Any]]] = None - - z_ai: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="z-ai") - ] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "01ai", - "ai21", - "aion-labs", - "akashml", - "alibaba", - "amazon-bedrock", - "amazon-nova", - "ambient", - "anthropic", - "anyscale", - "arcee-ai", - "atlas-cloud", - "atoma", - "avian", - "azure", - "baidu", - "baseten", - "black-forest-labs", - "byteplus", - "centml", - "cerebras", - "chutes", - "cirrascale", - "clarifai", - "cloudflare", - "cohere", - "crofai", - "crucible", - "crusoe", - "darkbloom", - "decart", - "deepinfra", - "deepseek", - "dekallm", - "digitalocean", - "enfer", - "fake-provider", - "featherless", - "fireworks", - "friendli", - "gmicloud", - "google-ai-studio", - "google-vertex", - "gopomelo", - "groq", - "heygen", - "huggingface", - "hyperbolic", - "hyperbolic-quantized", - "inception", - "inceptron", - "inferact-vllm", - "inference-net", - "infermatic", - "inflection", - "inocloud", - "io-net", - "ionstream", - "klusterai", - "lambda", - "lepton", - "liquid", - "lynn", - "lynn-private", - "mancer", - "mancer-old", - "mara", - "meta", - "minimax", - "mistral", - "modal", - "modelrun", - "modular", - "moonshotai", - "morph", - "ncompass", - "nebius", - "nex-agi", - "nextbit", - "nineteen", - "novita", - "nvidia", - "octoai", - "open-inference", - "openai", - "parasail", - "perceptron", - "perplexity", - "phala", - "poolside", - "quiver", - "recraft", - "recursal", - "reflection", - "reka", - "relace", - "replicate", - "sakana-ai", - "sambanova", - "sambanova-cloaked", - "seed", - "sf-compute", - "siliconflow", - "sourceful", - "stealth", - "stepfun", - "streamlake", - "switchpoint", - "targon", - "tenstorrent", - "together", - "together-lite", - "ubicloud", - "upstage", - "venice", - "wafer", - "wandb", - "xai", - "xiaomi", - "z-ai", - ] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class ImageGenerationRequestProviderTypedDict(TypedDict): - r"""Provider-specific passthrough configuration""" - - options: NotRequired[ImageGenerationRequestOptionsTypedDict] - - -class ImageGenerationRequestProvider(BaseModel): - r"""Provider-specific passthrough configuration""" - - options: Optional[ImageGenerationRequestOptions] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["options"]) - 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 - - ImageGenerationRequestQuality = Union[ Literal[ "auto", @@ -689,8 +108,8 @@ class ImageGenerationRequestTypedDict(TypedDict): r"""Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.""" output_format: NotRequired[ImageGenerationRequestOutputFormat] r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.""" - provider: NotRequired[ImageGenerationRequestProviderTypedDict] - r"""Provider-specific passthrough configuration""" + provider: NotRequired[ImageGenerationProviderPreferencesTypedDict] + r"""Provider routing preferences and provider-specific passthrough configuration.""" quality: NotRequired[ImageGenerationRequestQuality] r"""Rendering quality. Providers without a quality knob ignore this.""" resolution: NotRequired[ImageGenerationRequestResolution] @@ -698,7 +117,7 @@ class ImageGenerationRequestTypedDict(TypedDict): seed: NotRequired[int] r"""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.""" size: NotRequired[str] - r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.""" + r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.""" stream: NotRequired[bool] r"""If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.""" @@ -730,8 +149,8 @@ class ImageGenerationRequest(BaseModel): output_format: Optional[ImageGenerationRequestOutputFormat] = None r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.""" - provider: Optional[ImageGenerationRequestProvider] = None - r"""Provider-specific passthrough configuration""" + provider: Optional[ImageGenerationProviderPreferences] = None + r"""Provider routing preferences and provider-specific passthrough configuration.""" quality: Optional[ImageGenerationRequestQuality] = None r"""Rendering quality. Providers without a quality knob ignore this.""" @@ -743,7 +162,7 @@ class ImageGenerationRequest(BaseModel): r"""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.""" size: Optional[str] = None - r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.""" + r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.""" stream: Optional[bool] = None r"""If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.""" @@ -778,9 +197,3 @@ class ImageGenerationRequest(BaseModel): m[k] = val return m - - -try: - ImageGenerationRequestOptions.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/imagegenerationresponse.py b/src/openrouter/components/imagegenerationresponse.py index 7eddf64..687008d 100644 --- a/src/openrouter/components/imagegenerationresponse.py +++ b/src/openrouter/components/imagegenerationresponse.py @@ -12,7 +12,7 @@ class ImageGenerationResponseDataTypedDict(TypedDict): b64_json: str r"""Base64-encoded image bytes""" media_type: NotRequired[str] - r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`).""" + r"""Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.""" class ImageGenerationResponseData(BaseModel): @@ -20,7 +20,7 @@ class ImageGenerationResponseData(BaseModel): r"""Base64-encoded image bytes""" media_type: Optional[str] = None - r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`).""" + r"""Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/components/imagegenerationservertool.py b/src/openrouter/components/imagegenerationservertool.py index 6e4cf9a..bdf825f 100644 --- a/src/openrouter/components/imagegenerationservertool.py +++ b/src/openrouter/components/imagegenerationservertool.py @@ -60,15 +60,6 @@ class InputImageMask(BaseModel): return m -ModelEnum = Union[ - Literal[ - "gpt-image-1", - "gpt-image-1-mini", - ], - UnrecognizedStr, -] - - Moderation = Union[ Literal[ "auto", @@ -99,17 +90,6 @@ ImageGenerationServerToolQuality = Union[ ] -Size = Union[ - Literal[ - "1024x1024", - "1024x1536", - "1536x1024", - "auto", - ], - UnrecognizedStr, -] - - ImageGenerationServerToolType = Literal["image_generation",] @@ -120,13 +100,13 @@ class ImageGenerationServerToolTypedDict(TypedDict): background: NotRequired[ImageGenerationServerToolBackground] input_fidelity: NotRequired[Nullable[InputFidelity]] input_image_mask: NotRequired[InputImageMaskTypedDict] - model: NotRequired[ModelEnum] + model: NotRequired[str] moderation: NotRequired[Moderation] output_compression: NotRequired[int] output_format: NotRequired[ImageGenerationServerToolOutputFormat] partial_images: NotRequired[int] quality: NotRequired[ImageGenerationServerToolQuality] - size: NotRequired[Size] + size: NotRequired[str] class ImageGenerationServerTool(BaseModel): @@ -140,7 +120,7 @@ class ImageGenerationServerTool(BaseModel): input_image_mask: Optional[InputImageMask] = None - model: Optional[ModelEnum] = None + model: Optional[str] = None moderation: Optional[Moderation] = None @@ -152,10 +132,10 @@ class ImageGenerationServerTool(BaseModel): quality: Optional[ImageGenerationServerToolQuality] = None - size: Optional[Size] = None + size: Optional[str] = None @model_serializer(mode="wrap") - def _serialize_model(self, handler): + def serialize_model(self, handler): optional_fields = set( [ "background", diff --git a/src/openrouter/components/imagegenerationusage.py b/src/openrouter/components/imagegenerationusage.py index 83ae9b1..089d12e 100644 --- a/src/openrouter/components/imagegenerationusage.py +++ b/src/openrouter/components/imagegenerationusage.py @@ -1,6 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .anthropiccachecreation import ( + AnthropicCacheCreation, + AnthropicCacheCreationTypedDict, +) from .anthropicspeed import AnthropicSpeed from .anthropicusageiteration import ( AnthropicUsageIteration, @@ -201,6 +205,7 @@ class ImageGenerationUsageTypedDict(TypedDict): r"""Including images, input audio, and tools if any""" total_tokens: int r"""Sum of the above two fields""" + cache_creation: NotRequired[Nullable[AnthropicCacheCreationTypedDict]] completion_tokens_details: NotRequired[ Nullable[ImageGenerationUsageCompletionTokensDetailsTypedDict] ] @@ -234,6 +239,8 @@ class ImageGenerationUsage(BaseModel): total_tokens: int r"""Sum of the above two fields""" + cache_creation: OptionalNullable[AnthropicCacheCreation] = UNSET + completion_tokens_details: OptionalNullable[ ImageGenerationUsageCompletionTokensDetails ] = UNSET @@ -266,6 +273,7 @@ class ImageGenerationUsage(BaseModel): def serialize_model(self, handler): optional_fields = set( [ + "cache_creation", "completion_tokens_details", "cost", "cost_details", @@ -279,6 +287,7 @@ class ImageGenerationUsage(BaseModel): ) nullable_fields = set( [ + "cache_creation", "completion_tokens_details", "cost", "cost_details", diff --git a/src/openrouter/components/imagegentextchunkevent.py b/src/openrouter/components/imagegentextchunkevent.py new file mode 100644 index 0000000..d433cea --- /dev/null +++ b/src/openrouter/components/imagegentextchunkevent.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from typing import Literal, Union +from typing_extensions import TypedDict + + +ImageGenTextChunkEventPhase = Union[ + Literal[ + "content", + "reasoning", + "draft", + ], + UnrecognizedStr, +] +r"""The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases.""" + + +ImageGenTextChunkEventType = Literal["image_generation.text_chunk",] +r"""The event type""" + + +class ImageGenTextChunkEventTypedDict(TypedDict): + r"""Emitted when a text chunk becomes available during streaming generation of text-based formats (e.g. SVG)""" + + phase: ImageGenTextChunkEventPhase + r"""The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases.""" + text: str + r"""A text fragment of the image being generated (e.g. partial SVG markup)""" + type: ImageGenTextChunkEventType + r"""The event type""" + + +class ImageGenTextChunkEvent(BaseModel): + r"""Emitted when a text chunk becomes available during streaming generation of text-based formats (e.g. SVG)""" + + phase: ImageGenTextChunkEventPhase + r"""The generation phase this chunk belongs to. `content` is the renderable output; `reasoning` and `draft` are intermediate provider phases.""" + + text: str + r"""A text fragment of the image being generated (e.g. partial SVG markup)""" + + type: ImageGenTextChunkEventType + r"""The event type""" diff --git a/src/openrouter/components/imageinputmodality.py b/src/openrouter/components/imageinputmodality.py new file mode 100644 index 0000000..bfe11c6 --- /dev/null +++ b/src/openrouter/components/imageinputmodality.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ImageInputModality = Union[ + Literal[ + "text", + "image", + "file", + "audio", + "video", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/imagemodelarchitecture.py b/src/openrouter/components/imagemodelarchitecture.py index 01f0cb5..0a870e4 100644 --- a/src/openrouter/components/imagemodelarchitecture.py +++ b/src/openrouter/components/imagemodelarchitecture.py @@ -1,22 +1,22 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .imageinputmodality import ImageInputModality from .imageoutputmodality import ImageOutputModality -from .inputmodality import InputModality from openrouter.types import BaseModel from typing import List from typing_extensions import TypedDict class ImageModelArchitectureTypedDict(TypedDict): - input_modalities: List[InputModality] + input_modalities: List[ImageInputModality] r"""Supported input modalities""" output_modalities: List[ImageOutputModality] r"""Supported output modalities""" class ImageModelArchitecture(BaseModel): - input_modalities: List[InputModality] + input_modalities: List[ImageInputModality] r"""Supported input modalities""" output_modalities: List[ImageOutputModality] diff --git a/src/openrouter/components/imagestreamingresponse.py b/src/openrouter/components/imagestreamingresponse.py index 877d198..d8a39f6 100644 --- a/src/openrouter/components/imagestreamingresponse.py +++ b/src/openrouter/components/imagestreamingresponse.py @@ -13,6 +13,10 @@ from .imagegenstreamerrorevent import ( ImageGenStreamErrorEvent, ImageGenStreamErrorEventTypedDict, ) +from .imagegentextchunkevent import ( + ImageGenTextChunkEvent, + ImageGenTextChunkEventTypedDict, +) from functools import partial from openrouter.types import BaseModel from openrouter.utils.unions import parse_open_union @@ -27,6 +31,7 @@ ImageStreamingResponseDataTypedDict = TypeAliasType( Union[ ImageGenStreamErrorEventTypedDict, ImageGenPartialImageEventTypedDict, + ImageGenTextChunkEventTypedDict, ImageGenCompletedEventTypedDict, ], ) @@ -44,6 +49,7 @@ class UnknownImageStreamingResponseData(BaseModel): _IMAGE_STREAMING_RESPONSE_DATA_VARIANTS: dict[str, Any] = { "image_generation.partial_image": ImageGenPartialImageEvent, + "image_generation.text_chunk": ImageGenTextChunkEvent, "image_generation.completed": ImageGenCompletedEvent, "error": ImageGenStreamErrorEvent, } @@ -52,6 +58,7 @@ _IMAGE_STREAMING_RESPONSE_DATA_VARIANTS: dict[str, Any] = { ImageStreamingResponseData = Annotated[ Union[ ImageGenPartialImageEvent, + ImageGenTextChunkEvent, ImageGenCompletedEvent, ImageGenStreamErrorEvent, UnknownImageStreamingResponseData, diff --git a/src/openrouter/components/inputmessageitem.py b/src/openrouter/components/inputmessageitem.py index 654f642..e633288 100644 --- a/src/openrouter/components/inputmessageitem.py +++ b/src/openrouter/components/inputmessageitem.py @@ -79,9 +79,9 @@ class InputMessageItemContentInputImage(BaseModel): InputMessageItemContentUnionTypedDict = TypeAliasType( "InputMessageItemContentUnionTypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputVideoTypedDict, + InputTextTypedDict, InputMessageItemContentInputImageTypedDict, InputFileTypedDict, ], diff --git a/src/openrouter/components/inputs_union.py b/src/openrouter/components/inputs_union.py index 1371934..39681f4 100644 --- a/src/openrouter/components/inputs_union.py +++ b/src/openrouter/components/inputs_union.py @@ -1,12 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .additionaltoolsitem import AdditionalToolsItem, AdditionalToolsItemTypedDict +from .agentmessageitem import AgentMessageItem, AgentMessageItemTypedDict from .applypatchcallitem import ApplyPatchCallItem, ApplyPatchCallItemTypedDict from .applypatchcalloutputitem import ( ApplyPatchCallOutputItem, ApplyPatchCallOutputItemTypedDict, ) from .compactionitem import CompactionItem, CompactionItemTypedDict +from .contextcompactionitem import ContextCompactionItem, ContextCompactionItemTypedDict from .customtoolcallitem import CustomToolCallItem, CustomToolCallItemTypedDict from .customtoolcalloutputitem import ( CustomToolCallOutputItem, @@ -375,49 +378,52 @@ InputsUnion1TypedDict = TypeAliasType( Union[ ItemReferenceItemTypedDict, CompactionItemTypedDict, - OutputFileSearchCallItemTypedDict, - EasyInputMessageTypedDict, InputMessageItemTypedDict, + AdditionalToolsItemTypedDict, + EasyInputMessageTypedDict, + ContextCompactionItemTypedDict, + OutputWebSearchServerToolItemTypedDict, + CustomToolCallOutputItemTypedDict, LocalShellCallOutputItemTypedDict, OutputToolSearchServerToolItemTypedDict, OutputFileSearchServerToolItemTypedDict, - OutputWebSearchServerToolItemTypedDict, - CustomToolCallOutputItemTypedDict, - OutputImageGenerationCallItemTypedDict, OutputWebSearchCallItemTypedDict, + OutputFileSearchCallItemTypedDict, + OutputImageGenerationCallItemTypedDict, + OutputApplyPatchServerToolItemTypedDict, + McpApprovalRequestItemTypedDict, OutputDatetimeItemTypedDict, - OutputMcpServerToolItemTypedDict, FunctionCallOutputItemTypedDict, - OutputSearchModelsServerToolItemTypedDict, - LocalShellCallItemTypedDict, ApplyPatchCallItemTypedDict, - McpListToolsItemTypedDict, ApplyPatchCallOutputItemTypedDict, McpApprovalResponseItemTypedDict, OutputBrowserUseServerToolItemTypedDict, - McpApprovalRequestItemTypedDict, + McpListToolsItemTypedDict, OutputTextEditorServerToolItemTypedDict, - OutputApplyPatchServerToolItemTypedDict, + LocalShellCallItemTypedDict, + OutputSearchModelsServerToolItemTypedDict, + OutputMcpServerToolItemTypedDict, CustomToolCallItemTypedDict, + OutputComputerCallItemTypedDict, + OutputCodeInterpreterCallItemTypedDict, + OutputCustomToolCallItemTypedDict, InputsMessageTypedDict, OutputMemoryServerToolItemTypedDict, - OutputCustomToolCallItemTypedDict, - OutputComputerCallItemTypedDict, - ShellCallOutputItemTypedDict, ShellCallItemTypedDict, - OutputCodeInterpreterCallItemTypedDict, + ShellCallOutputItemTypedDict, OutputBashServerToolItemTypedDict, - OutputImageGenerationServerToolItemTypedDict, McpCallItemTypedDict, OutputFunctionCallItemTypedDict, + AgentMessageItemTypedDict, FunctionCallItemTypedDict, - OutputFilesServerToolItemTypedDict, + OutputImageGenerationServerToolItemTypedDict, OutputSubagentServerToolItemTypedDict, - OutputAdvisorServerToolItemTypedDict, - OutputWebFetchServerToolItemTypedDict, - ReasoningItemTypedDict, - OutputCodeInterpreterServerToolItemTypedDict, InputsReasoningTypedDict, + OutputAdvisorServerToolItemTypedDict, + OutputCodeInterpreterServerToolItemTypedDict, + OutputWebFetchServerToolItemTypedDict, + OutputFilesServerToolItemTypedDict, + ReasoningItemTypedDict, OutputFusionServerToolItemTypedDict, ], ) @@ -428,49 +434,52 @@ InputsUnion1 = TypeAliasType( Union[ ItemReferenceItem, CompactionItem, - OutputFileSearchCallItem, - EasyInputMessage, InputMessageItem, + AdditionalToolsItem, + EasyInputMessage, + ContextCompactionItem, + OutputWebSearchServerToolItem, + CustomToolCallOutputItem, LocalShellCallOutputItem, OutputToolSearchServerToolItem, OutputFileSearchServerToolItem, - OutputWebSearchServerToolItem, - CustomToolCallOutputItem, - OutputImageGenerationCallItem, OutputWebSearchCallItem, + OutputFileSearchCallItem, + OutputImageGenerationCallItem, + OutputApplyPatchServerToolItem, + McpApprovalRequestItem, OutputDatetimeItem, - OutputMcpServerToolItem, FunctionCallOutputItem, - OutputSearchModelsServerToolItem, - LocalShellCallItem, ApplyPatchCallItem, - McpListToolsItem, ApplyPatchCallOutputItem, McpApprovalResponseItem, OutputBrowserUseServerToolItem, - McpApprovalRequestItem, + McpListToolsItem, OutputTextEditorServerToolItem, - OutputApplyPatchServerToolItem, + LocalShellCallItem, + OutputSearchModelsServerToolItem, + OutputMcpServerToolItem, CustomToolCallItem, + OutputComputerCallItem, + OutputCodeInterpreterCallItem, + OutputCustomToolCallItem, InputsMessage, OutputMemoryServerToolItem, - OutputCustomToolCallItem, - OutputComputerCallItem, - ShellCallOutputItem, ShellCallItem, - OutputCodeInterpreterCallItem, + ShellCallOutputItem, OutputBashServerToolItem, - OutputImageGenerationServerToolItem, McpCallItem, OutputFunctionCallItem, + AgentMessageItem, FunctionCallItem, - OutputFilesServerToolItem, + OutputImageGenerationServerToolItem, OutputSubagentServerToolItem, - OutputAdvisorServerToolItem, - OutputWebFetchServerToolItem, - ReasoningItem, - OutputCodeInterpreterServerToolItem, InputsReasoning, + OutputAdvisorServerToolItem, + OutputCodeInterpreterServerToolItem, + OutputWebFetchServerToolItem, + OutputFilesServerToolItem, + ReasoningItem, OutputFusionServerToolItem, ], ) diff --git a/src/openrouter/components/inputtext.py b/src/openrouter/components/inputtext.py index 088b756..81a4151 100644 --- a/src/openrouter/components/inputtext.py +++ b/src/openrouter/components/inputtext.py @@ -1,9 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel +from .promptcachebreakpoint import PromptCacheBreakpoint, PromptCacheBreakpointTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer from typing import Literal -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict InputTextType = Literal["input_text",] @@ -14,6 +22,8 @@ class InputTextTypedDict(TypedDict): text: str type: InputTextType + prompt_cache_breakpoint: NotRequired[Nullable[PromptCacheBreakpointTypedDict]] + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" class InputText(BaseModel): @@ -22,3 +32,31 @@ class InputText(BaseModel): text: str type: InputTextType + + prompt_cache_breakpoint: OptionalNullable[PromptCacheBreakpoint] = UNSET + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["prompt_cache_breakpoint"]) + nullable_fields = set(["prompt_cache_breakpoint"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/legacy_chatcontentvideo.py b/src/openrouter/components/legacy_chatcontentvideo.py index b5dd4d1..38a7bf7 100644 --- a/src/openrouter/components/legacy_chatcontentvideo.py +++ b/src/openrouter/components/legacy_chatcontentvideo.py @@ -1,7 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .chatcontentvideoinput import ChatContentVideoInput, ChatContentVideoInputTypedDict +from .legacy_chatcontentvideoinput import ( + LegacyChatContentVideoInput, + LegacyChatContentVideoInputTypedDict, +) from openrouter.types import BaseModel from typing import Literal from typing_extensions import TypedDict, deprecated @@ -17,7 +20,7 @@ class LegacyChatContentVideoTypedDict(TypedDict): r"""Video input content part (legacy format - deprecated)""" type: LegacyChatContentVideoType - video_url: ChatContentVideoInputTypedDict + video_url: LegacyChatContentVideoInputTypedDict r"""Video input object""" @@ -29,5 +32,5 @@ class LegacyChatContentVideo(BaseModel): type: LegacyChatContentVideoType - video_url: ChatContentVideoInput + video_url: LegacyChatContentVideoInput r"""Video input object""" diff --git a/src/openrouter/components/legacy_chatcontentvideoinput.py b/src/openrouter/components/legacy_chatcontentvideoinput.py new file mode 100644 index 0000000..0fe43c1 --- /dev/null +++ b/src/openrouter/components/legacy_chatcontentvideoinput.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class LegacyChatContentVideoInputTypedDict(TypedDict): + r"""Video input object""" + + url: str + r"""URL of the video (data: URLs supported)""" + + +class LegacyChatContentVideoInput(BaseModel): + r"""Video input object""" + + url: str + r"""URL of the video (data: URLs supported)""" diff --git a/src/openrouter/components/messagesmessageparam.py b/src/openrouter/components/messagesmessageparam.py index 8a9738b..e556cb0 100644 --- a/src/openrouter/components/messagesmessageparam.py +++ b/src/openrouter/components/messagesmessageparam.py @@ -50,7 +50,7 @@ class ContentCompactionTypedDict(TypedDict): content: Nullable[str] type: MessagesMessageParamTypeCompaction cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" class ContentCompaction(BaseModel): @@ -59,7 +59,7 @@ class ContentCompaction(BaseModel): type: MessagesMessageParamTypeCompaction cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -136,7 +136,7 @@ class ContentWebSearchToolResultTypedDict(TypedDict): tool_use_id: str type: TypeWebSearchToolResult cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" class ContentWebSearchToolResult(BaseModel): @@ -147,7 +147,7 @@ class ContentWebSearchToolResult(BaseModel): type: TypeWebSearchToolResult cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -174,7 +174,7 @@ class ContentServerToolUseTypedDict(TypedDict): name: str type: TypeServerToolUse cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" input: NotRequired[Nullable[Any]] @@ -186,7 +186,7 @@ class ContentServerToolUse(BaseModel): type: TypeServerToolUse cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" input: OptionalNullable[Any] = UNSET @@ -304,7 +304,7 @@ class ContentToolResultTypedDict(TypedDict): tool_use_id: str type: TypeToolResult cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" content: NotRequired[MessagesMessageParamContentUnion2TypedDict] is_error: NotRequired[bool] @@ -315,7 +315,7 @@ class ContentToolResult(BaseModel): type: TypeToolResult cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" content: Optional[MessagesMessageParamContentUnion2] = None @@ -346,7 +346,7 @@ class ContentToolUseTypedDict(TypedDict): name: str type: TypeToolUse cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" input: NotRequired[Nullable[Any]] @@ -358,7 +358,7 @@ class ContentToolUse(BaseModel): type: TypeToolUse cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" input: OptionalNullable[Any] = UNSET diff --git a/src/openrouter/components/messagesrequest.py b/src/openrouter/components/messagesrequest.py index e87ddbd..b4d8f65 100644 --- a/src/openrouter/components/messagesrequest.py +++ b/src/openrouter/components/messagesrequest.py @@ -35,10 +35,6 @@ from .anthropicwebsearchtooluserlocation import ( ) from .autorouterplugin import AutoRouterPlugin, AutoRouterPluginTypedDict from .bashservertool import BashServerTool, BashServerToolTypedDict -from .chatsearchmodelsservertool import ( - ChatSearchModelsServerTool, - ChatSearchModelsServerToolTypedDict, -) from .contextcompressionplugin import ( ContextCompressionPlugin, ContextCompressionPluginTypedDict, @@ -53,6 +49,10 @@ from .imagegenerationservertool_openrouter import ( from .messagesfallbackparam import MessagesFallbackParam, MessagesFallbackParamTypedDict from .messagesmessageparam import MessagesMessageParam, MessagesMessageParamTypedDict from .messagesoutputconfig import MessagesOutputConfig, MessagesOutputConfigTypedDict +from .messagessearchmodelsservertool import ( + MessagesSearchModelsServerTool, + MessagesSearchModelsServerToolTypedDict, +) from .moderationplugin import ModerationPlugin, ModerationPluginTypedDict from .openrouterwebsearchservertool import ( OpenRouterWebSearchServerTool, @@ -355,8 +355,8 @@ MessagesRequestPluginTypedDict = TypeAliasType( ResponseHealingPluginTypedDict, FileParserPluginTypedDict, ContextCompressionPluginTypedDict, - ParetoRouterPluginTypedDict, AutoRouterPluginTypedDict, + ParetoRouterPluginTypedDict, WebFetchPluginTypedDict, FusionPluginTypedDict, WebSearchPluginTypedDict, @@ -659,14 +659,14 @@ ToolTypeEphemeral = Literal["ephemeral",] class CachingTypedDict(TypedDict): - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" type: ToolTypeEphemeral ttl: NotRequired[AnthropicCacheControlTTL] class Caching(BaseModel): - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" type: ToolTypeEphemeral @@ -701,7 +701,7 @@ class ToolAdvisor20260301TypedDict(TypedDict): type: TypeAdvisor20260301 allowed_callers: NotRequired[List[AnthropicAllowedCallers]] cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" caching: NotRequired[Nullable[CachingTypedDict]] defer_loading: NotRequired[bool] max_uses: NotRequired[int] @@ -717,7 +717,7 @@ class ToolAdvisor20260301(BaseModel): allowed_callers: Optional[List[AnthropicAllowedCallers]] = None cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" caching: OptionalNullable[Caching] = UNSET @@ -766,7 +766,7 @@ class ToolWebSearch20260209TypedDict(TypedDict): allowed_domains: NotRequired[Nullable[List[str]]] blocked_domains: NotRequired[Nullable[List[str]]] cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" max_uses: NotRequired[Nullable[int]] user_location: NotRequired[Nullable[AnthropicWebSearchToolUserLocationTypedDict]] @@ -783,7 +783,7 @@ class ToolWebSearch20260209(BaseModel): blocked_domains: OptionalNullable[List[str]] = UNSET cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" max_uses: OptionalNullable[int] = UNSET @@ -838,7 +838,7 @@ class ToolWebSearch20250305TypedDict(TypedDict): allowed_domains: NotRequired[Nullable[List[str]]] blocked_domains: NotRequired[Nullable[List[str]]] cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" max_uses: NotRequired[Nullable[int]] user_location: NotRequired[Nullable[AnthropicWebSearchToolUserLocationTypedDict]] @@ -853,7 +853,7 @@ class ToolWebSearch20250305(BaseModel): blocked_domains: OptionalNullable[List[str]] = UNSET cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" max_uses: OptionalNullable[int] = UNSET @@ -905,7 +905,7 @@ class ToolTextEditor20250124TypedDict(TypedDict): name: NameStrReplaceEditor type: TypeTextEditor20250124 cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" class ToolTextEditor20250124(BaseModel): @@ -914,7 +914,7 @@ class ToolTextEditor20250124(BaseModel): type: TypeTextEditor20250124 cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -943,7 +943,7 @@ class ToolBash20250124TypedDict(TypedDict): name: NameBash type: TypeBash20250124 cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" class ToolBash20250124(BaseModel): @@ -952,7 +952,7 @@ class ToolBash20250124(BaseModel): type: TypeBash20250124 cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -1033,7 +1033,7 @@ class ToolCustomTypedDict(TypedDict): input_schema: InputSchemaTypedDict name: str cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" description: NotRequired[str] type: NotRequired[ToolTypeCustom] @@ -1044,7 +1044,7 @@ class ToolCustom(BaseModel): name: str cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" description: Optional[str] = None @@ -1070,7 +1070,7 @@ class ToolCustom(BaseModel): MessagesRequestToolUnionTypedDict = TypeAliasType( "MessagesRequestToolUnionTypedDict", Union[ - ChatSearchModelsServerToolTypedDict, + MessagesSearchModelsServerToolTypedDict, BashServerToolTypedDict, DatetimeServerToolTypedDict, ImageGenerationServerToolOpenRouterTypedDict, @@ -1090,7 +1090,7 @@ MessagesRequestToolUnionTypedDict = TypeAliasType( MessagesRequestToolUnion = TypeAliasType( "MessagesRequestToolUnion", Union[ - ChatSearchModelsServerTool, + MessagesSearchModelsServerTool, BashServerTool, DatetimeServerTool, ImageGenerationServerToolOpenRouter, @@ -1113,7 +1113,7 @@ class MessagesRequestTypedDict(TypedDict): messages: Nullable[List[MessagesMessageParamTypedDict]] model: str cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" context_management: NotRequired[Nullable[ContextManagementTypedDict]] fallbacks: NotRequired[Nullable[List[MessagesFallbackParamTypedDict]]] r"""Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries.""" @@ -1155,7 +1155,7 @@ class MessagesRequest(BaseModel): model: str cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" context_management: OptionalNullable[ContextManagement] = UNSET diff --git a/src/openrouter/components/messagessearchmodelsservertool.py b/src/openrouter/components/messagessearchmodelsservertool.py new file mode 100644 index 0000000..d101995 --- /dev/null +++ b/src/openrouter/components/messagessearchmodelsservertool.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .searchmodelsservertoolconfig import ( + SearchModelsServerToolConfig, + SearchModelsServerToolConfigTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +MessagesSearchModelsServerToolType = Literal["openrouter:experimental__search_models",] + + +class MessagesSearchModelsServerToolTypedDict(TypedDict): + r"""OpenRouter built-in server tool: searches and filters AI models available on OpenRouter""" + + type: MessagesSearchModelsServerToolType + parameters: NotRequired[SearchModelsServerToolConfigTypedDict] + r"""Configuration for the openrouter:experimental__search_models server tool""" + + +class MessagesSearchModelsServerTool(BaseModel): + r"""OpenRouter built-in server tool: searches and filters AI models available on OpenRouter""" + + type: MessagesSearchModelsServerToolType + + parameters: Optional[SearchModelsServerToolConfig] = None + r"""Configuration for the openrouter:experimental__search_models server tool""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parameters"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/modelarchitecture.py b/src/openrouter/components/modelarchitecture.py index 1fb1dbc..b1fb080 100644 --- a/src/openrouter/components/modelarchitecture.py +++ b/src/openrouter/components/modelarchitecture.py @@ -2,6 +2,7 @@ from __future__ import annotations from .inputmodality import InputModality +from .instructtype import InstructType from .modelgroup import ModelGroup from .outputmodality import OutputModality from openrouter.types import ( @@ -10,43 +11,12 @@ from openrouter.types import ( OptionalNullable, UNSET, UNSET_SENTINEL, - UnrecognizedStr, ) from pydantic import model_serializer -from typing import List, Literal, Optional, Union +from typing import List, Optional from typing_extensions import NotRequired, TypedDict -ModelArchitectureInstructType = Union[ - Literal[ - "none", - "airoboros", - "alpaca", - "alpaca-modif", - "chatml", - "claude", - "code-llama", - "gemma", - "llama2", - "llama3", - "mistral", - "nemotron", - "neural", - "openchat", - "phi3", - "rwkv", - "vicuna", - "zephyr", - "deepseek-r1", - "deepseek-v3.1", - "qwq", - "qwen3", - ], - UnrecognizedStr, -] -r"""Instruction format type""" - - class ModelArchitectureTypedDict(TypedDict): r"""Model architecture information""" @@ -56,7 +26,7 @@ class ModelArchitectureTypedDict(TypedDict): r"""Primary modality of the model""" output_modalities: List[OutputModality] r"""Supported output modalities""" - instruct_type: NotRequired[Nullable[ModelArchitectureInstructType]] + instruct_type: NotRequired[Nullable[InstructType]] r"""Instruction format type""" tokenizer: NotRequired[ModelGroup] r"""Tokenizer type used by the model""" @@ -74,7 +44,7 @@ class ModelArchitecture(BaseModel): output_modalities: List[OutputModality] r"""Supported output modalities""" - instruct_type: OptionalNullable[ModelArchitectureInstructType] = UNSET + instruct_type: OptionalNullable[InstructType] = UNSET r"""Instruction format type""" tokenizer: Optional[ModelGroup] = None diff --git a/src/openrouter/components/modelslistresponse.py b/src/openrouter/components/modelslistresponse.py index 8497c58..a1cd85a 100644 --- a/src/openrouter/components/modelslistresponse.py +++ b/src/openrouter/components/modelslistresponse.py @@ -2,16 +2,49 @@ from __future__ import annotations from .model import Model, ModelTypedDict -from openrouter.types import BaseModel +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer from typing import List from typing_extensions import TypedDict +class LinksTypedDict(TypedDict): + r"""Pagination links""" + + next: Nullable[str] + r"""URL for the next page of results, or null if this is the last page""" + + +class Links(BaseModel): + r"""Pagination links""" + + next: Nullable[str] + r"""URL for the next page of results, or null if this is the last page""" + + @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 ModelsListResponseTypedDict(TypedDict): r"""List of available models""" data: List[ModelTypedDict] r"""List of available models""" + links: LinksTypedDict + r"""Pagination links""" + total_count: int + r"""Total number of models matching the query""" class ModelsListResponse(BaseModel): @@ -19,3 +52,9 @@ class ModelsListResponse(BaseModel): data: List[Model] r"""List of available models""" + + links: Links + r"""Pagination links""" + + total_count: int + r"""Total number of models matching the query""" diff --git a/src/openrouter/components/observabilityfilterrulegroup.py b/src/openrouter/components/observabilityfilterrulegroup.py new file mode 100644 index 0000000..576d6a3 --- /dev/null +++ b/src/openrouter/components/observabilityfilterrulegroup.py @@ -0,0 +1,122 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +Logic = Union[ + Literal[ + "and", + "or", + ], + UnrecognizedStr, +] + + +FieldT = Union[ + Literal[ + "model", + "provider", + "session_id", + "user_id", + "api_key_name", + "finish_reason", + "input", + "output", + "total_cost", + "total_tokens", + "prompt_tokens", + "completion_tokens", + ], + UnrecognizedStr, +] + + +Operator = Union[ + Literal[ + "equals", + "not_equals", + "contains", + "not_contains", + "regex", + "starts_with", + "ends_with", + "gt", + "lt", + "gte", + "lte", + "exists", + "not_exists", + ], + UnrecognizedStr, +] + + +ObservabilityFilterRuleGroupValueTypedDict = TypeAliasType( + "ObservabilityFilterRuleGroupValueTypedDict", Union[str, float] +) + + +ObservabilityFilterRuleGroupValue = TypeAliasType( + "ObservabilityFilterRuleGroupValue", Union[str, float] +) + + +class RuleTypedDict(TypedDict): + field: FieldT + operator: Operator + value: NotRequired[ObservabilityFilterRuleGroupValueTypedDict] + + +class Rule(BaseModel): + field: FieldT + + operator: Operator + + value: Optional[ObservabilityFilterRuleGroupValue] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["value"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class ObservabilityFilterRuleGroupTypedDict(TypedDict): + rules: List[RuleTypedDict] + logic: NotRequired[Logic] + + +class ObservabilityFilterRuleGroup(BaseModel): + rules: List[Rule] + + logic: Optional[Logic] = "and" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["logic"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/observabilityfilterrulesconfig.py b/src/openrouter/components/observabilityfilterrulesconfig.py index 76f042e..6f5536a 100644 --- a/src/openrouter/components/observabilityfilterrulesconfig.py +++ b/src/openrouter/components/observabilityfilterrulesconfig.py @@ -1,138 +1,27 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from .observabilityfilterrulegroup import ( + ObservabilityFilterRuleGroup, + ObservabilityFilterRuleGroupTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -Logic = Union[ - Literal[ - "and", - "or", - ], - UnrecognizedStr, -] - - -FieldT = Union[ - Literal[ - "model", - "provider", - "session_id", - "user_id", - "api_key_name", - "finish_reason", - "input", - "output", - "total_cost", - "total_tokens", - "prompt_tokens", - "completion_tokens", - ], - UnrecognizedStr, -] - - -Operator = Union[ - Literal[ - "equals", - "not_equals", - "contains", - "not_contains", - "regex", - "starts_with", - "ends_with", - "gt", - "lt", - "gte", - "lte", - "exists", - "not_exists", - ], - UnrecognizedStr, -] - - -ObservabilityFilterRulesConfigValueTypedDict = TypeAliasType( - "ObservabilityFilterRulesConfigValueTypedDict", Union[str, float] -) - - -ObservabilityFilterRulesConfigValue = TypeAliasType( - "ObservabilityFilterRulesConfigValue", Union[str, float] -) - - -class RuleTypedDict(TypedDict): - field: FieldT - operator: Operator - value: NotRequired[ObservabilityFilterRulesConfigValueTypedDict] - - -class Rule(BaseModel): - field: FieldT - - operator: Operator - - value: Optional[ObservabilityFilterRulesConfigValue] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["value"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class GroupTypedDict(TypedDict): - rules: List[RuleTypedDict] - logic: NotRequired[Logic] - - -class Group(BaseModel): - rules: List[Rule] - - logic: Optional[Logic] = "and" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["logic"]) - 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 +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict class ObservabilityFilterRulesConfigTypedDict(TypedDict): r"""Optional structured filter rules controlling which events are forwarded.""" - groups: List[GroupTypedDict] + groups: List[ObservabilityFilterRuleGroupTypedDict] enabled: NotRequired[bool] class ObservabilityFilterRulesConfig(BaseModel): r"""Optional structured filter rules controlling which events are forwarded.""" - groups: List[Group] + groups: List[ObservabilityFilterRuleGroup] enabled: Optional[bool] = True diff --git a/src/openrouter/components/observabilityfilterrulesconfignullable.py b/src/openrouter/components/observabilityfilterrulesconfignullable.py new file mode 100644 index 0000000..80ac61f --- /dev/null +++ b/src/openrouter/components/observabilityfilterrulesconfignullable.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .observabilityfilterrulegroup import ( + ObservabilityFilterRuleGroup, + ObservabilityFilterRuleGroupTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class ObservabilityFilterRulesConfigNullableTypedDict(TypedDict): + r"""Optional structured filter rules controlling which events are forwarded.""" + + groups: List[ObservabilityFilterRuleGroupTypedDict] + enabled: NotRequired[bool] + + +class ObservabilityFilterRulesConfigNullable(BaseModel): + r"""Optional structured filter rules controlling which events are forwarded.""" + + groups: List[ObservabilityFilterRuleGroup] + + enabled: Optional[bool] = True + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["enabled"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/openairesponseinputmessageitem.py b/src/openrouter/components/openairesponseinputmessageitem.py index 3dedde3..d96f095 100644 --- a/src/openrouter/components/openairesponseinputmessageitem.py +++ b/src/openrouter/components/openairesponseinputmessageitem.py @@ -17,7 +17,7 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict OpenAIResponseInputMessageItemContentTypedDict = TypeAliasType( "OpenAIResponseInputMessageItemContentTypedDict", Union[ - InputTextTypedDict, InputAudioTypedDict, InputImageTypedDict, InputFileTypedDict + InputAudioTypedDict, InputTextTypedDict, InputImageTypedDict, InputFileTypedDict ], ) diff --git a/src/openrouter/components/paretorouterplugin.py b/src/openrouter/components/paretorouterplugin.py index f010e7d..68114ef 100644 --- a/src/openrouter/components/paretorouterplugin.py +++ b/src/openrouter/components/paretorouterplugin.py @@ -1,21 +1,33 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr from pydantic import model_serializer -from typing import Literal, Optional +from typing import Literal, Optional, Union from typing_extensions import NotRequired, TypedDict ParetoRouterPluginID = Literal["pareto-router",] +PriceSource = Union[ + Literal[ + "prompt", + "weighted_avg", + ], + UnrecognizedStr, +] +r"""Price source for the Pareto frontier cost axis. \"prompt\" uses catalog list price (endpoint.pricing.prompt). \"weighted_avg\" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to \"prompt\".""" + + class ParetoRouterPluginTypedDict(TypedDict): id: ParetoRouterPluginID enabled: NotRequired[bool] r"""Set to false to disable the pareto-router plugin for this request. Defaults to true.""" min_coding_score: NotRequired[float] - r"""Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier.""" + r"""Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66).""" + price_source: NotRequired[PriceSource] + r"""Price source for the Pareto frontier cost axis. \"prompt\" uses catalog list price (endpoint.pricing.prompt). \"weighted_avg\" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to \"prompt\".""" class ParetoRouterPlugin(BaseModel): @@ -25,11 +37,14 @@ class ParetoRouterPlugin(BaseModel): r"""Set to false to disable the pareto-router plugin for this request. Defaults to true.""" min_coding_score: Optional[float] = None - r"""Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier.""" + r"""Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66).""" + + price_source: Optional[PriceSource] = None + r"""Price source for the Pareto frontier cost axis. \"prompt\" uses catalog list price (endpoint.pricing.prompt). \"weighted_avg\" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to \"prompt\".""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["enabled", "min_coding_score"]) + optional_fields = set(["enabled", "min_coding_score", "price_source"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/pricingoverride.py b/src/openrouter/components/pricingoverride.py new file mode 100644 index 0000000..a7c4599 --- /dev/null +++ b/src/openrouter/components/pricingoverride.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PricingOverrideTypedDict(TypedDict): + r"""A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.""" + + audio: NotRequired[str] + r"""Overridden price in USD per audio input token""" + completion: NotRequired[str] + r"""Overridden price in USD per token for completion (output) generation""" + input_audio_cache: NotRequired[str] + r"""Overridden price in USD per cached audio input token""" + input_cache_read: NotRequired[str] + r"""Overridden price in USD per cached input token (read)""" + input_cache_write: NotRequired[str] + r"""Overridden price in USD per cache-write token""" + input_cache_write_1h: NotRequired[str] + r"""Overridden price in USD per 1-hour cache-write token""" + min_prompt_tokens: NotRequired[float] + r"""Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold""" + prompt: NotRequired[str] + r"""Overridden price in USD per token for prompt (input) processing""" + utc_end: NotRequired[float] + r"""Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)""" + utc_start: NotRequired[float] + r"""Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end).""" + + +class PricingOverride(BaseModel): + r"""A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.""" + + audio: Optional[str] = None + r"""Overridden price in USD per audio input token""" + + completion: Optional[str] = None + r"""Overridden price in USD per token for completion (output) generation""" + + input_audio_cache: Optional[str] = None + r"""Overridden price in USD per cached audio input token""" + + input_cache_read: Optional[str] = None + r"""Overridden price in USD per cached input token (read)""" + + input_cache_write: Optional[str] = None + r"""Overridden price in USD per cache-write token""" + + input_cache_write_1h: Optional[str] = None + r"""Overridden price in USD per 1-hour cache-write token""" + + min_prompt_tokens: Optional[float] = None + r"""Condition: the entry applies when the total prompt tokens of a request are strictly greater than this threshold""" + + prompt: Optional[str] = None + r"""Overridden price in USD per token for prompt (input) processing""" + + utc_end: Optional[float] = None + r"""Condition: exclusive end of a daily UTC time window as an HHMM clock number (e.g. 400 = 04:00)""" + + utc_start: Optional[float] = None + r"""Condition: inclusive start of a daily UTC time window as an HHMM clock number (e.g. 100 = 01:00, 1030 = 10:30). The entry applies while the current UTC time is inside the half-open window [utc_start, utc_end), which may wrap past midnight (utc_start > utc_end).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "audio", + "completion", + "input_audio_cache", + "input_cache_read", + "input_cache_write", + "input_cache_write_1h", + "min_prompt_tokens", + "prompt", + "utc_end", + "utc_start", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/promptcachebreakpoint.py b/src/openrouter/components/promptcachebreakpoint.py new file mode 100644 index 0000000..13fbce2 --- /dev/null +++ b/src/openrouter/components/promptcachebreakpoint.py @@ -0,0 +1,21 @@ +"""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 + + +PromptCacheBreakpointMode = Literal["explicit",] + + +class PromptCacheBreakpointTypedDict(TypedDict): + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + + mode: PromptCacheBreakpointMode + + +class PromptCacheBreakpoint(BaseModel): + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + + mode: PromptCacheBreakpointMode diff --git a/src/openrouter/components/promptcacheoptions.py b/src/openrouter/components/promptcacheoptions.py new file mode 100644 index 0000000..9d35862 --- /dev/null +++ b/src/openrouter/components/promptcacheoptions.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal +from typing_extensions import NotRequired, TypedDict + + +PromptCacheOptionsMode = Literal["explicit",] + + +class PromptCacheOptionsTypedDict(TypedDict): + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + + mode: PromptCacheOptionsMode + ttl: NotRequired[Nullable[str]] + + +class PromptCacheOptions(BaseModel): + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + + mode: PromptCacheOptionsMode + + ttl: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ttl"]) + nullable_fields = set(["ttl"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/providername.py b/src/openrouter/components/providername.py index 009c140..86245cd 100644 --- a/src/openrouter/components/providername.py +++ b/src/openrouter/components/providername.py @@ -7,6 +7,7 @@ from typing import Literal, Union ProviderName = Union[ Literal[ + "Meta", "AkashML", "AI21", "AionLabs", @@ -33,6 +34,7 @@ ProviderName = Union[ "Crusoe", "Darkbloom", "Decart", + "Deepgram", "DeepInfra", "DeepSeek", "DekaLLM", @@ -78,6 +80,7 @@ ProviderName = Union[ "Recraft", "Reka", "Relace", + "Sail Research", "Sakana AI", "SambaNova", "Seed", diff --git a/src/openrouter/components/provideroptions.py b/src/openrouter/components/provideroptions.py index d84b93d..f465173 100644 --- a/src/openrouter/components/provideroptions.py +++ b/src/openrouter/components/provideroptions.py @@ -42,6 +42,7 @@ class ProviderOptionsTypedDict(TypedDict): crusoe: NotRequired[Dict[str, Nullable[Any]]] darkbloom: NotRequired[Dict[str, Nullable[Any]]] decart: NotRequired[Dict[str, Nullable[Any]]] + deepgram: NotRequired[Dict[str, Nullable[Any]]] deepinfra: NotRequired[Dict[str, Nullable[Any]]] deepseek: NotRequired[Dict[str, Nullable[Any]]] dekallm: NotRequired[Dict[str, Nullable[Any]]] @@ -108,7 +109,8 @@ class ProviderOptionsTypedDict(TypedDict): reka: NotRequired[Dict[str, Nullable[Any]]] relace: NotRequired[Dict[str, Nullable[Any]]] replicate: NotRequired[Dict[str, Nullable[Any]]] - sakana_ai: NotRequired[Dict[str, Nullable[Any]]] + sail_research: NotRequired[Dict[str, Nullable[Any]]] + sakana: NotRequired[Dict[str, Nullable[Any]]] sambanova: NotRequired[Dict[str, Nullable[Any]]] sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]] seed: NotRequired[Dict[str, Nullable[Any]]] @@ -212,6 +214,8 @@ class ProviderOptions(BaseModel): decart: Optional[Dict[str, Nullable[Any]]] = None + deepgram: Optional[Dict[str, Nullable[Any]]] = None + deepinfra: Optional[Dict[str, Nullable[Any]]] = None deepseek: Optional[Dict[str, Nullable[Any]]] = None @@ -368,10 +372,12 @@ class ProviderOptions(BaseModel): replicate: Optional[Dict[str, Nullable[Any]]] = None - sakana_ai: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sakana-ai") + sail_research: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sail-research") ] = None + sakana: Optional[Dict[str, Nullable[Any]]] = None + sambanova: Optional[Dict[str, Nullable[Any]]] = None sambanova_cloaked: Annotated[ @@ -459,6 +465,7 @@ class ProviderOptions(BaseModel): "crusoe", "darkbloom", "decart", + "deepgram", "deepinfra", "deepseek", "dekallm", @@ -525,7 +532,8 @@ class ProviderOptions(BaseModel): "reka", "relace", "replicate", - "sakana-ai", + "sail-research", + "sakana", "sambanova", "sambanova-cloaked", "seed", diff --git a/src/openrouter/components/providerpreferences.py b/src/openrouter/components/providerpreferences.py index abbb3cb..2d44eab 100644 --- a/src/openrouter/components/providerpreferences.py +++ b/src/openrouter/components/providerpreferences.py @@ -37,10 +37,14 @@ r"""Data collection setting. If no available model provider meets the requiremen """ -IgnoreTypedDict = TypeAliasType("IgnoreTypedDict", Union[ProviderName, str]) +ProviderPreferencesIgnoreTypedDict = TypeAliasType( + "ProviderPreferencesIgnoreTypedDict", Union[ProviderName, str] +) -Ignore = TypeAliasType("Ignore", Union[ProviderName, str]) +ProviderPreferencesIgnore = TypeAliasType( + "ProviderPreferencesIgnore", Union[ProviderName, str] +) class MaxPriceTypedDict(TypedDict): @@ -93,25 +97,36 @@ class MaxPrice(BaseModel): return m -OnlyTypedDict = TypeAliasType("OnlyTypedDict", Union[ProviderName, str]) +ProviderPreferencesOnlyTypedDict = TypeAliasType( + "ProviderPreferencesOnlyTypedDict", Union[ProviderName, str] +) -Only = TypeAliasType("Only", Union[ProviderName, str]) +ProviderPreferencesOnly = TypeAliasType( + "ProviderPreferencesOnly", Union[ProviderName, str] +) -OrderTypedDict = TypeAliasType("OrderTypedDict", Union[ProviderName, str]) +ProviderPreferencesOrderTypedDict = TypeAliasType( + "ProviderPreferencesOrderTypedDict", Union[ProviderName, str] +) -Order = TypeAliasType("Order", Union[ProviderName, str]) +ProviderPreferencesOrder = TypeAliasType( + "ProviderPreferencesOrder", Union[ProviderName, str] +) -SortTypedDict = TypeAliasType( - "SortTypedDict", Union[ProviderSortConfigTypedDict, ProviderSort, Any] +ProviderPreferencesSortTypedDict = TypeAliasType( + "ProviderPreferencesSortTypedDict", + Union[ProviderSortConfigTypedDict, ProviderSort, Any], ) r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" -Sort = TypeAliasType("Sort", Union[ProviderSortConfig, ProviderSort, Any]) +ProviderPreferencesSort = TypeAliasType( + "ProviderPreferencesSort", Union[ProviderSortConfig, ProviderSort, Any] +) r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" @@ -132,13 +147,13 @@ class ProviderPreferencesTypedDict(TypedDict): """ enforce_distillable_text: NotRequired[Nullable[bool]] r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" - ignore: NotRequired[Nullable[List[IgnoreTypedDict]]] + ignore: NotRequired[Nullable[List[ProviderPreferencesIgnoreTypedDict]]] r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" max_price: NotRequired[MaxPriceTypedDict] r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - only: NotRequired[Nullable[List[OnlyTypedDict]]] + only: NotRequired[Nullable[List[ProviderPreferencesOnlyTypedDict]]] r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" - order: NotRequired[Nullable[List[OrderTypedDict]]] + order: NotRequired[Nullable[List[ProviderPreferencesOrderTypedDict]]] 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.""" preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]] r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" @@ -148,7 +163,7 @@ class ProviderPreferencesTypedDict(TypedDict): r"""A list of quantization levels to filter the provider by.""" require_parameters: NotRequired[Nullable[bool]] r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.""" - sort: NotRequired[Nullable[SortTypedDict]] + sort: NotRequired[Nullable[ProviderPreferencesSortTypedDict]] r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" zdr: NotRequired[Nullable[bool]] r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.""" @@ -174,16 +189,16 @@ class ProviderPreferences(BaseModel): enforce_distillable_text: OptionalNullable[bool] = UNSET r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" - ignore: OptionalNullable[List[Ignore]] = UNSET + ignore: OptionalNullable[List[ProviderPreferencesIgnore]] = UNSET r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" max_price: Optional[MaxPrice] = None r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - only: OptionalNullable[List[Only]] = UNSET + only: OptionalNullable[List[ProviderPreferencesOnly]] = UNSET r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" - order: OptionalNullable[List[Order]] = UNSET + order: OptionalNullable[List[ProviderPreferencesOrder]] = 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.""" preferred_max_latency: OptionalNullable[PreferredMaxLatency] = UNSET @@ -198,7 +213,7 @@ class ProviderPreferences(BaseModel): require_parameters: OptionalNullable[bool] = UNSET r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.""" - sort: OptionalNullable[Sort] = UNSET + sort: OptionalNullable[ProviderPreferencesSort] = UNSET r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" zdr: OptionalNullable[bool] = UNSET diff --git a/src/openrouter/components/providerresponse.py b/src/openrouter/components/providerresponse.py index 757907b..9ef2d5d 100644 --- a/src/openrouter/components/providerresponse.py +++ b/src/openrouter/components/providerresponse.py @@ -64,6 +64,7 @@ ProviderResponseProviderName = Union[ "Crusoe", "Darkbloom", "Decart", + "Deepgram", "DeepInfra", "DeepSeek", "DekaLLM", @@ -109,6 +110,7 @@ ProviderResponseProviderName = Union[ "Recraft", "Reka", "Relace", + "Sail Research", "Sakana AI", "SambaNova", "Seed", @@ -135,6 +137,16 @@ ProviderResponseProviderName = Union[ r"""Name of the provider""" +RoutedServiceTier = Union[ + Literal[ + "flex", + "priority", + ], + UnrecognizedStr, +] +r"""The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ.""" + + class ProviderResponseTypedDict(TypedDict): r"""Details of a provider response for a generation attempt""" @@ -152,6 +164,8 @@ class ProviderResponseTypedDict(TypedDict): r"""Canonical model slug""" provider_name: NotRequired[ProviderResponseProviderName] r"""Name of the provider""" + routed_service_tier: NotRequired[RoutedServiceTier] + r"""The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ.""" class ProviderResponse(BaseModel): @@ -178,6 +192,9 @@ class ProviderResponse(BaseModel): provider_name: Optional[ProviderResponseProviderName] = None r"""Name of the provider""" + routed_service_tier: Optional[RoutedServiceTier] = None + r"""The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -188,6 +205,7 @@ class ProviderResponse(BaseModel): "latency", "model_permaslug", "provider_name", + "routed_service_tier", ] ) nullable_fields = set(["status"]) diff --git a/src/openrouter/components/publicendpoint.py b/src/openrouter/components/publicendpoint.py index 270a46d..f91d6ae 100644 --- a/src/openrouter/components/publicendpoint.py +++ b/src/openrouter/components/publicendpoint.py @@ -4,6 +4,7 @@ from __future__ import annotations from .endpointstatus import EndpointStatus from .parameter import Parameter from .percentilestats import PercentileStats, PercentileStatsTypedDict +from .pricingoverride import PricingOverride, PricingOverrideTypedDict from .providername import ProviderName from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr from pydantic import model_serializer @@ -38,6 +39,8 @@ class PricingTypedDict(TypedDict): r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.""" internal_reasoning: NotRequired[str] r"""Price in USD per internal reasoning token""" + overrides: NotRequired[List[PricingOverrideTypedDict]] + r"""Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.""" request: NotRequired[str] r"""Price in USD per request""" web_search: NotRequired[str] @@ -84,6 +87,9 @@ class Pricing(BaseModel): internal_reasoning: Optional[str] = None r"""Price in USD per internal reasoning token""" + overrides: Optional[List[PricingOverride]] = None + r"""Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.""" + request: Optional[str] = None r"""Price in USD per request""" @@ -105,6 +111,7 @@ class Pricing(BaseModel): "input_cache_write", "input_cache_write_1h", "internal_reasoning", + "overrides", "request", "web_search", ] diff --git a/src/openrouter/components/publicpricing.py b/src/openrouter/components/publicpricing.py index fc3f2cd..34b9d18 100644 --- a/src/openrouter/components/publicpricing.py +++ b/src/openrouter/components/publicpricing.py @@ -1,9 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .pricingoverride import PricingOverride, PricingOverrideTypedDict from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer -from typing import Optional +from typing import List, Optional from typing_extensions import NotRequired, TypedDict @@ -36,6 +37,8 @@ class PublicPricingTypedDict(TypedDict): r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.""" internal_reasoning: NotRequired[str] r"""Price in USD per internal reasoning token""" + overrides: NotRequired[List[PricingOverrideTypedDict]] + r"""Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.""" request: NotRequired[str] r"""Price in USD per request""" web_search: NotRequired[str] @@ -84,6 +87,9 @@ class PublicPricing(BaseModel): internal_reasoning: Optional[str] = None r"""Price in USD per internal reasoning token""" + overrides: Optional[List[PricingOverride]] = None + r"""Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.""" + request: Optional[str] = None r"""Price in USD per request""" @@ -105,6 +111,7 @@ class PublicPricing(BaseModel): "input_cache_write", "input_cache_write_1h", "internal_reasoning", + "overrides", "request", "web_search", ] diff --git a/src/openrouter/components/reasoningconfig.py b/src/openrouter/components/reasoningconfig.py index 7e37f18..fc8b0fb 100644 --- a/src/openrouter/components/reasoningconfig.py +++ b/src/openrouter/components/reasoningconfig.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .reasoningcontext import ReasoningContext from .reasoningeffort import ReasoningEffort +from .reasoningmode import ReasoningMode from .reasoningsummaryverbosity import ReasoningSummaryVerbosity from openrouter.types import ( BaseModel, @@ -17,7 +19,11 @@ from typing_extensions import NotRequired, TypedDict class ReasoningConfigTypedDict(TypedDict): r"""Configuration for reasoning mode in the response""" + context: NotRequired[Nullable[ReasoningContext]] + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" effort: NotRequired[Nullable[ReasoningEffort]] + mode: NotRequired[Nullable[ReasoningMode]] + r"""Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.""" summary: NotRequired[Nullable[ReasoningSummaryVerbosity]] enabled: NotRequired[Nullable[bool]] max_tokens: NotRequired[Nullable[int]] @@ -26,8 +32,14 @@ class ReasoningConfigTypedDict(TypedDict): class ReasoningConfig(BaseModel): r"""Configuration for reasoning mode in the response""" + context: OptionalNullable[ReasoningContext] = UNSET + r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" + effort: OptionalNullable[ReasoningEffort] = UNSET + mode: OptionalNullable[ReasoningMode] = UNSET + r"""Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.""" + summary: OptionalNullable[ReasoningSummaryVerbosity] = UNSET enabled: OptionalNullable[bool] = UNSET @@ -36,8 +48,12 @@ class ReasoningConfig(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["effort", "summary", "enabled", "max_tokens"]) - nullable_fields = set(["effort", "summary", "enabled", "max_tokens"]) + optional_fields = set( + ["context", "effort", "mode", "summary", "enabled", "max_tokens"] + ) + nullable_fields = set( + ["context", "effort", "mode", "summary", "enabled", "max_tokens"] + ) serialized = handler(self) m = {} diff --git a/src/openrouter/components/reasoningcontext.py b/src/openrouter/components/reasoningcontext.py new file mode 100644 index 0000000..79fc4af --- /dev/null +++ b/src/openrouter/components/reasoningcontext.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ReasoningContext = Union[ + Literal[ + "auto", + "all_turns", + "current_turn", + ], + UnrecognizedStr, +] +r"""Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.""" diff --git a/src/openrouter/components/reasoningdetailservertoolcall.py b/src/openrouter/components/reasoningdetailservertoolcall.py new file mode 100644 index 0000000..4487eb0 --- /dev/null +++ b/src/openrouter/components/reasoningdetailservertoolcall.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .reasoningformat import ReasoningFormat +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +ReasoningDetailServerToolCallType = Literal["reasoning.server_tool_call",] + + +class ReasoningDetailServerToolCallTypedDict(TypedDict): + r"""Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation.""" + + arguments: str + result: str + tool_name: str + type: ReasoningDetailServerToolCallType + format_: NotRequired[Nullable[ReasoningFormat]] + id: NotRequired[Nullable[str]] + index: NotRequired[int] + tool_call_id: NotRequired[Nullable[str]] + + +class ReasoningDetailServerToolCall(BaseModel): + r"""Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation.""" + + arguments: str + + result: str + + tool_name: str + + type: ReasoningDetailServerToolCallType + + format_: Annotated[ + OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") + ] = UNSET + + id: OptionalNullable[str] = UNSET + + index: Optional[int] = None + + tool_call_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["format", "id", "index", "tool_call_id"]) + nullable_fields = set(["format", "id", "tool_call_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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 + + +try: + ReasoningDetailServerToolCall.model_rebuild() +except NameError: + pass diff --git a/src/openrouter/components/reasoningdetailunion.py b/src/openrouter/components/reasoningdetailunion.py index 78e5924..17b2534 100644 --- a/src/openrouter/components/reasoningdetailunion.py +++ b/src/openrouter/components/reasoningdetailunion.py @@ -5,6 +5,10 @@ from .reasoningdetailencrypted import ( ReasoningDetailEncrypted, ReasoningDetailEncryptedTypedDict, ) +from .reasoningdetailservertoolcall import ( + ReasoningDetailServerToolCall, + ReasoningDetailServerToolCallTypedDict, +) from .reasoningdetailsummary import ( ReasoningDetailSummary, ReasoningDetailSummaryTypedDict, @@ -25,6 +29,7 @@ ReasoningDetailUnionTypedDict = TypeAliasType( ReasoningDetailSummaryTypedDict, ReasoningDetailEncryptedTypedDict, ReasoningDetailTextTypedDict, + ReasoningDetailServerToolCallTypedDict, ], ) r"""Reasoning detail union schema""" @@ -42,6 +47,7 @@ class UnknownReasoningDetailUnion(BaseModel): _REASONING_DETAIL_UNION_VARIANTS: dict[str, Any] = { "reasoning.encrypted": ReasoningDetailEncrypted, + "reasoning.server_tool_call": ReasoningDetailServerToolCall, "reasoning.summary": ReasoningDetailSummary, "reasoning.text": ReasoningDetailText, } @@ -50,6 +56,7 @@ _REASONING_DETAIL_UNION_VARIANTS: dict[str, Any] = { ReasoningDetailUnion = Annotated[ Union[ ReasoningDetailEncrypted, + ReasoningDetailServerToolCall, ReasoningDetailSummary, ReasoningDetailText, UnknownReasoningDetailUnion, diff --git a/src/openrouter/components/reasoningmode.py b/src/openrouter/components/reasoningmode.py new file mode 100644 index 0000000..b0b5cbd --- /dev/null +++ b/src/openrouter/components/reasoningmode.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ReasoningMode = Union[ + Literal[ + "standard", + "pro", + ], + UnrecognizedStr, +] +r"""Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.""" diff --git a/src/openrouter/components/responseserrorfield.py b/src/openrouter/components/responseserrorfield.py index 1c7f8a0..f38c8ed 100644 --- a/src/openrouter/components/responseserrorfield.py +++ b/src/openrouter/components/responseserrorfield.py @@ -26,6 +26,7 @@ Code = Union[ "empty_image_file", "failed_to_download_image", "image_file_not_found", + "bio_policy", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/responsesrequest.py b/src/openrouter/components/responsesrequest.py index 53cacf2..92873ed 100644 --- a/src/openrouter/components/responsesrequest.py +++ b/src/openrouter/components/responsesrequest.py @@ -17,10 +17,6 @@ from .applypatchservertool_openrouter import ( from .autorouterplugin import AutoRouterPlugin, AutoRouterPluginTypedDict from .bashservertool import BashServerTool, BashServerToolTypedDict from .chatdebugoptions import ChatDebugOptions, ChatDebugOptionsTypedDict -from .chatsearchmodelsservertool import ( - ChatSearchModelsServerTool, - ChatSearchModelsServerToolTypedDict, -) from .codeinterpreterservertool import ( CodeInterpreterServerTool, CodeInterpreterServerToolTypedDict, @@ -72,10 +68,15 @@ from .preview_websearchservertool import ( PreviewWebSearchServerTool, PreviewWebSearchServerToolTypedDict, ) +from .promptcacheoptions import PromptCacheOptions, PromptCacheOptionsTypedDict from .providerpreferences import ProviderPreferences, ProviderPreferencesTypedDict from .reasoningconfig import ReasoningConfig, ReasoningConfigTypedDict from .responsehealingplugin import ResponseHealingPlugin, ResponseHealingPluginTypedDict from .responseincludesenum import ResponseIncludesEnum +from .searchmodelsservertool_openrouter import ( + SearchModelsServerToolOpenRouter, + SearchModelsServerToolOpenRouterTypedDict, +) from .shellservertool import ShellServerTool, ShellServerToolTypedDict from .shellservertool_openrouter import ( ShellServerToolOpenRouter, @@ -123,8 +124,8 @@ ResponsesRequestPluginTypedDict = TypeAliasType( ResponseHealingPluginTypedDict, FileParserPluginTypedDict, ContextCompressionPluginTypedDict, - ParetoRouterPluginTypedDict, AutoRouterPluginTypedDict, + ParetoRouterPluginTypedDict, WebFetchPluginTypedDict, FusionPluginTypedDict, WebSearchPluginTypedDict, @@ -226,7 +227,7 @@ ResponsesRequestToolUnionTypedDict = TypeAliasType( ApplyPatchServerToolOpenRouterTypedDict, WebSearchServerToolOpenRouterTypedDict, WebFetchServerToolTypedDict, - ChatSearchModelsServerToolTypedDict, + SearchModelsServerToolOpenRouterTypedDict, FilesServerToolTypedDict, DatetimeServerToolTypedDict, AdvisorServerToolOpenRouterTypedDict, @@ -272,7 +273,8 @@ ResponsesRequestToolUnion = Annotated[ ImageGenerationServerToolOpenRouter, Tag("openrouter:image_generation") ], Annotated[ - ChatSearchModelsServerTool, Tag("openrouter:experimental__search_models") + SearchModelsServerToolOpenRouter, + Tag("openrouter:experimental__search_models"), ], Annotated[WebFetchServerTool, Tag("openrouter:web_fetch")], Annotated[WebSearchServerToolOpenRouter, Tag("openrouter:web_search")], @@ -289,7 +291,7 @@ class ResponsesRequestTypedDict(TypedDict): background: NotRequired[Nullable[bool]] cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict] - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" debug: NotRequired[ChatDebugOptionsTypedDict] r"""Debug options for inspecting request transformations (streaming only)""" frequency_penalty: NotRequired[Nullable[float]] @@ -314,6 +316,8 @@ class ResponsesRequestTypedDict(TypedDict): previous_response_id: NotRequired[Nullable[str]] prompt: NotRequired[Nullable[StoredPromptTemplateTypedDict]] prompt_cache_key: NotRequired[Nullable[str]] + prompt_cache_options: NotRequired[Nullable[PromptCacheOptionsTypedDict]] + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" provider: NotRequired[Nullable[ProviderPreferencesTypedDict]] r"""When multiple model providers are available, optionally indicate your routing preference.""" reasoning: NotRequired[Nullable[ReasoningConfigTypedDict]] @@ -347,7 +351,7 @@ class ResponsesRequest(BaseModel): background: OptionalNullable[bool] = UNSET cache_control: Optional[AnthropicCacheControlDirective] = None - r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.""" + r"""Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.""" debug: Optional[ChatDebugOptions] = None r"""Debug options for inspecting request transformations (streaming only)""" @@ -391,6 +395,9 @@ class ResponsesRequest(BaseModel): prompt_cache_key: OptionalNullable[str] = UNSET + prompt_cache_options: OptionalNullable[PromptCacheOptions] = UNSET + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + provider: OptionalNullable[ProviderPreferences] = UNSET r"""When multiple model providers are available, optionally indicate your routing preference.""" @@ -461,6 +468,7 @@ class ResponsesRequest(BaseModel): "previous_response_id", "prompt", "prompt_cache_key", + "prompt_cache_options", "provider", "reasoning", "safety_identifier", @@ -495,6 +503,7 @@ class ResponsesRequest(BaseModel): "previous_response_id", "prompt", "prompt_cache_key", + "prompt_cache_options", "provider", "reasoning", "safety_identifier", diff --git a/src/openrouter/components/searchmodelsservertool_openrouter.py b/src/openrouter/components/searchmodelsservertool_openrouter.py new file mode 100644 index 0000000..158d0a1 --- /dev/null +++ b/src/openrouter/components/searchmodelsservertool_openrouter.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .searchmodelsservertoolconfig import ( + SearchModelsServerToolConfig, + SearchModelsServerToolConfigTypedDict, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +SearchModelsServerToolOpenRouterType = Literal[ + "openrouter:experimental__search_models", +] + + +class SearchModelsServerToolOpenRouterTypedDict(TypedDict): + r"""OpenRouter built-in server tool: searches and filters AI models available on OpenRouter""" + + type: SearchModelsServerToolOpenRouterType + parameters: NotRequired[SearchModelsServerToolConfigTypedDict] + r"""Configuration for the openrouter:experimental__search_models server tool""" + + +class SearchModelsServerToolOpenRouter(BaseModel): + r"""OpenRouter built-in server tool: searches and filters AI models available on OpenRouter""" + + type: SearchModelsServerToolOpenRouterType + + parameters: Optional[SearchModelsServerToolConfig] = None + r"""Configuration for the openrouter:experimental__search_models server tool""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parameters"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/servertoolusedetails.py b/src/openrouter/components/servertoolusedetails.py new file mode 100644 index 0000000..16ca66e --- /dev/null +++ b/src/openrouter/components/servertoolusedetails.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ServerToolUseDetailsTypedDict(TypedDict): + r"""Usage for server-side tool execution (e.g., web search)""" + + tool_calls_executed: NotRequired[Nullable[int]] + r"""Number of OpenRouter server tool calls that executed and produced a result.""" + tool_calls_requested: NotRequired[Nullable[int]] + r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" + web_search_requests: NotRequired[Nullable[int]] + r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" + + +class ServerToolUseDetails(BaseModel): + r"""Usage for server-side tool execution (e.g., web search)""" + + tool_calls_executed: OptionalNullable[int] = UNSET + r"""Number of OpenRouter server tool calls that executed and produced a result.""" + + tool_calls_requested: OptionalNullable[int] = UNSET + r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.""" + + web_search_requests: OptionalNullable[int] = UNSET + r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["tool_calls_executed", "tool_calls_requested", "web_search_requests"] + ) + nullable_fields = set( + ["tool_calls_executed", "tool_calls_requested", "web_search_requests"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/speechrequest.py b/src/openrouter/components/speechrequest.py index cb7e1b2..f903339 100644 --- a/src/openrouter/components/speechrequest.py +++ b/src/openrouter/components/speechrequest.py @@ -38,7 +38,7 @@ class SpeechRequestProvider(BaseModel): return m -ResponseFormatEnum = Union[ +SpeechRequestResponseFormat = Union[ Literal[ "mp3", "pcm", @@ -59,7 +59,7 @@ class SpeechRequestTypedDict(TypedDict): r"""Voice identifier (provider-specific).""" provider: NotRequired[SpeechRequestProviderTypedDict] r"""Provider-specific passthrough configuration""" - response_format: NotRequired[ResponseFormatEnum] + response_format: NotRequired[SpeechRequestResponseFormat] r"""Audio output format""" speed: NotRequired[float] r"""Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.""" @@ -80,7 +80,7 @@ class SpeechRequest(BaseModel): provider: Optional[SpeechRequestProvider] = None r"""Provider-specific passthrough configuration""" - response_format: Optional[ResponseFormatEnum] = "pcm" + response_format: Optional[SpeechRequestResponseFormat] = "pcm" r"""Audio output format""" speed: Optional[float] = None diff --git a/src/openrouter/components/sttrequest.py b/src/openrouter/components/sttrequest.py index d5497b9..ce7ba25 100644 --- a/src/openrouter/components/sttrequest.py +++ b/src/openrouter/components/sttrequest.py @@ -3,9 +3,10 @@ from __future__ import annotations from .provideroptions import ProviderOptions, ProviderOptionsTypedDict from .sttinputaudio import STTInputAudio, STTInputAudioTypedDict -from openrouter.types import BaseModel, UNSET_SENTINEL +from .stttimestampgranularity import STTTimestampGranularity +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr from pydantic import model_serializer -from typing import Optional +from typing import List, Literal, Optional, Union from typing_extensions import NotRequired, TypedDict @@ -39,6 +40,16 @@ class STTRequestProvider(BaseModel): return m +STTRequestResponseFormat = Union[ + Literal[ + "json", + "verbose_json", + ], + UnrecognizedStr, +] +r"""Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.""" + + class STTRequestTypedDict(TypedDict): r"""Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio.""" @@ -50,8 +61,12 @@ class STTRequestTypedDict(TypedDict): r"""ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted.""" provider: NotRequired[STTRequestProviderTypedDict] r"""Provider-specific passthrough configuration""" + response_format: NotRequired[STTRequestResponseFormat] + r"""Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.""" temperature: NotRequired[float] r"""Sampling temperature for transcription""" + timestamp_granularities: NotRequired[List[STTTimestampGranularity]] + r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"segment\" returns segment-level timestamps; \"word\" additionally returns word-level timestamps in the words array. Ignored unless response_format is \"verbose_json\".""" class STTRequest(BaseModel): @@ -69,12 +84,26 @@ class STTRequest(BaseModel): provider: Optional[STTRequestProvider] = None r"""Provider-specific passthrough configuration""" + response_format: Optional[STTRequestResponseFormat] = None + r"""Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.""" + temperature: Optional[float] = None r"""Sampling temperature for transcription""" + timestamp_granularities: Optional[List[STTTimestampGranularity]] = None + r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"segment\" returns segment-level timestamps; \"word\" additionally returns word-level timestamps in the words array. Ignored unless response_format is \"verbose_json\".""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["language", "provider", "temperature"]) + optional_fields = set( + [ + "language", + "provider", + "response_format", + "temperature", + "timestamp_granularities", + ] + ) serialized = handler(self) m = {} diff --git a/src/openrouter/components/sttresponse.py b/src/openrouter/components/sttresponse.py index 19ff065..61daeb2 100644 --- a/src/openrouter/components/sttresponse.py +++ b/src/openrouter/components/sttresponse.py @@ -1,10 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .sttsegment import STTSegment, STTSegmentTypedDict from .sttusage import STTUsage, STTUsageTypedDict +from .sttword import STTWord, STTWordTypedDict from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer -from typing import Optional +from typing import List, Optional from typing_extensions import NotRequired, TypedDict @@ -13,8 +15,18 @@ class STTResponseTypedDict(TypedDict): text: str r"""The transcribed text""" + duration: NotRequired[float] + r"""Duration of the input audio in seconds, present when response_format is verbose_json""" + language: NotRequired[str] + r"""Detected or forced language, present when response_format is verbose_json""" + segments: NotRequired[List[STTSegmentTypedDict]] + r"""Timestamped transcript segments, present when response_format is verbose_json""" + task: NotRequired[str] + r"""The task performed, present when response_format is verbose_json""" usage: NotRequired[STTUsageTypedDict] r"""Aggregated usage statistics for the request""" + words: NotRequired[List[STTWordTypedDict]] + r"""Timestamped words, present when the provider returns word-level timestamps""" class STTResponse(BaseModel): @@ -23,12 +35,29 @@ class STTResponse(BaseModel): text: str r"""The transcribed text""" + duration: Optional[float] = None + r"""Duration of the input audio in seconds, present when response_format is verbose_json""" + + language: Optional[str] = None + r"""Detected or forced language, present when response_format is verbose_json""" + + segments: Optional[List[STTSegment]] = None + r"""Timestamped transcript segments, present when response_format is verbose_json""" + + task: Optional[str] = None + r"""The task performed, present when response_format is verbose_json""" + usage: Optional[STTUsage] = None r"""Aggregated usage statistics for the request""" + words: Optional[List[STTWord]] = None + r"""Timestamped words, present when the provider returns word-level timestamps""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["usage"]) + optional_fields = set( + ["duration", "language", "segments", "task", "usage", "words"] + ) serialized = handler(self) m = {} diff --git a/src/openrouter/components/sttsegment.py b/src/openrouter/components/sttsegment.py new file mode 100644 index 0000000..471a080 --- /dev/null +++ b/src/openrouter/components/sttsegment.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class STTSegmentTypedDict(TypedDict): + r"""A timestamped transcript segment, returned when response_format is verbose_json""" + + end: float + r"""Segment end time in seconds""" + id: int + r"""Segment index within the transcript""" + start: float + r"""Segment start time in seconds""" + text: str + r"""Transcribed text of the segment""" + avg_logprob: NotRequired[float] + r"""Average log probability of the segment""" + compression_ratio: NotRequired[float] + r"""Compression ratio of the segment""" + no_speech_prob: NotRequired[float] + r"""Probability the segment contains no speech""" + seek: NotRequired[int] + r"""Seek offset of the segment""" + temperature: NotRequired[float] + r"""Temperature used for the segment""" + tokens: NotRequired[List[int]] + r"""Token IDs of the segment""" + + +class STTSegment(BaseModel): + r"""A timestamped transcript segment, returned when response_format is verbose_json""" + + end: float + r"""Segment end time in seconds""" + + id: int + r"""Segment index within the transcript""" + + start: float + r"""Segment start time in seconds""" + + text: str + r"""Transcribed text of the segment""" + + avg_logprob: Optional[float] = None + r"""Average log probability of the segment""" + + compression_ratio: Optional[float] = None + r"""Compression ratio of the segment""" + + no_speech_prob: Optional[float] = None + r"""Probability the segment contains no speech""" + + seek: Optional[int] = None + r"""Seek offset of the segment""" + + temperature: Optional[float] = None + r"""Temperature used for the segment""" + + tokens: Optional[List[int]] = None + r"""Token IDs of the segment""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "avg_logprob", + "compression_ratio", + "no_speech_prob", + "seek", + "temperature", + "tokens", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/stttimestampgranularity.py b/src/openrouter/components/stttimestampgranularity.py new file mode 100644 index 0000000..30edd2f --- /dev/null +++ b/src/openrouter/components/stttimestampgranularity.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +STTTimestampGranularity = Union[ + Literal[ + "word", + "segment", + ], + UnrecognizedStr, +] +r"""A timestamp detail level for verbose_json transcription responses.""" diff --git a/src/openrouter/components/sttword.py b/src/openrouter/components/sttword.py new file mode 100644 index 0000000..020dd01 --- /dev/null +++ b/src/openrouter/components/sttword.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class STTWordTypedDict(TypedDict): + r"""A timestamped word, returned when the provider includes word-level timestamps""" + + end: float + r"""Word end time in seconds""" + start: float + r"""Word start time in seconds""" + word: str + r"""The transcribed word""" + + +class STTWord(BaseModel): + r"""A timestamped word, returned when the provider includes word-level timestamps""" + + end: float + r"""Word end time in seconds""" + + start: float + r"""Word start time in seconds""" + + word: str + r"""The transcribed word""" diff --git a/src/openrouter/components/submitgenerationfeedbackrequest.py b/src/openrouter/components/submitgenerationfeedbackrequest.py new file mode 100644 index 0000000..c73cccc --- /dev/null +++ b/src/openrouter/components/submitgenerationfeedbackrequest.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +Category = Union[ + Literal[ + "latency", + "incoherence", + "incorrect_response", + "formatting", + "billing", + "api_error", + "other", + ], + UnrecognizedStr, +] +r"""The category of feedback being reported""" + + +class SubmitGenerationFeedbackRequestTypedDict(TypedDict): + r"""Structured feedback about a specific generation""" + + category: Category + r"""The category of feedback being reported""" + generation_id: str + r"""The generation to submit feedback on""" + comment: NotRequired[str] + r"""An optional free-text comment describing the feedback""" + + +class SubmitGenerationFeedbackRequest(BaseModel): + r"""Structured feedback about a specific generation""" + + category: Category + r"""The category of feedback being reported""" + + generation_id: str + r"""The generation to submit feedback on""" + + comment: Optional[str] = None + r"""An optional free-text comment describing the feedback""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["comment"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/components/submitgenerationfeedbackresponse.py b/src/openrouter/components/submitgenerationfeedbackresponse.py new file mode 100644 index 0000000..139b0fc --- /dev/null +++ b/src/openrouter/components/submitgenerationfeedbackresponse.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class SubmitGenerationFeedbackResponseDataTypedDict(TypedDict): + success: Literal[True] + r"""Whether the feedback was recorded""" + + +class SubmitGenerationFeedbackResponseData(BaseModel): + SUCCESS: Annotated[ + Annotated[Literal[True], AfterValidator(validate_const(True))], + pydantic.Field(alias="success"), + ] = True + r"""Whether the feedback was recorded""" + + +class SubmitGenerationFeedbackResponseTypedDict(TypedDict): + r"""Confirmation that the feedback was recorded""" + + data: SubmitGenerationFeedbackResponseDataTypedDict + + +class SubmitGenerationFeedbackResponse(BaseModel): + r"""Confirmation that the feedback was recorded""" + + data: SubmitGenerationFeedbackResponseData + + +try: + SubmitGenerationFeedbackResponseData.model_rebuild() +except NameError: + pass diff --git a/src/openrouter/components/updateguardrailrequest.py b/src/openrouter/components/updateguardrailrequest.py index d80389a..22e9f13 100644 --- a/src/openrouter/components/updateguardrailrequest.py +++ b/src/openrouter/components/updateguardrailrequest.py @@ -34,7 +34,7 @@ class UpdateGuardrailRequestTypedDict(TypedDict): description: NotRequired[Nullable[str]] r"""New description for the guardrail""" enforce_zdr: NotRequired[Nullable[bool]] - r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" + r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" enforce_zdr_anthropic: NotRequired[Nullable[bool]] r"""Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.""" enforce_zdr_google: NotRequired[Nullable[bool]] @@ -42,7 +42,9 @@ class UpdateGuardrailRequestTypedDict(TypedDict): enforce_zdr_openai: NotRequired[Nullable[bool]] r"""Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.""" enforce_zdr_other: NotRequired[Nullable[bool]] - r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.""" + r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.""" + enforce_zdr_xai: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.""" ignored_models: NotRequired[Nullable[List[str]]] r"""Array of model identifiers to exclude from routing (slug or canonical_slug accepted)""" ignored_providers: NotRequired[Nullable[List[str]]] @@ -79,7 +81,7 @@ class UpdateGuardrailRequest(BaseModel): deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." ), ] = UNSET - r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" + r"""Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.""" enforce_zdr_anthropic: OptionalNullable[bool] = UNSET r"""Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.""" @@ -91,7 +93,10 @@ class UpdateGuardrailRequest(BaseModel): r"""Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.""" enforce_zdr_other: OptionalNullable[bool] = UNSET - r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.""" + r"""Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.""" + + enforce_zdr_xai: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.""" ignored_models: OptionalNullable[List[str]] = UNSET r"""Array of model identifiers to exclude from routing (slug or canonical_slug accepted)""" @@ -122,6 +127,7 @@ class UpdateGuardrailRequest(BaseModel): "enforce_zdr_google", "enforce_zdr_openai", "enforce_zdr_other", + "enforce_zdr_xai", "ignored_models", "ignored_providers", "limit_usd", @@ -141,6 +147,7 @@ class UpdateGuardrailRequest(BaseModel): "enforce_zdr_google", "enforce_zdr_openai", "enforce_zdr_other", + "enforce_zdr_xai", "ignored_models", "ignored_providers", "limit_usd", diff --git a/src/openrouter/components/updateobservabilitydestinationrequest.py b/src/openrouter/components/updateobservabilitydestinationrequest.py index a344284..e0d3f99 100644 --- a/src/openrouter/components/updateobservabilitydestinationrequest.py +++ b/src/openrouter/components/updateobservabilitydestinationrequest.py @@ -1,9 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .observabilityfilterrulesconfig import ( - ObservabilityFilterRulesConfig, - ObservabilityFilterRulesConfigTypedDict, +from .observabilityfilterrulesconfignullable import ( + ObservabilityFilterRulesConfigNullable, + ObservabilityFilterRulesConfigNullableTypedDict, ) from openrouter.types import ( BaseModel, @@ -24,7 +24,7 @@ class UpdateObservabilityDestinationRequestTypedDict(TypedDict): r"""Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value.""" enabled: NotRequired[bool] r"""Whether the destination is enabled.""" - filter_rules: NotRequired[Nullable[ObservabilityFilterRulesConfigTypedDict]] + filter_rules: NotRequired[Nullable[ObservabilityFilterRulesConfigNullableTypedDict]] name: NotRequired[str] r"""Human-readable name for the destination.""" privacy_mode: NotRequired[bool] @@ -43,7 +43,7 @@ class UpdateObservabilityDestinationRequest(BaseModel): enabled: Optional[bool] = None r"""Whether the destination is enabled.""" - filter_rules: OptionalNullable[ObservabilityFilterRulesConfig] = UNSET + filter_rules: OptionalNullable[ObservabilityFilterRulesConfigNullable] = UNSET name: Optional[str] = None r"""Human-readable name for the destination.""" diff --git a/src/openrouter/components/usage.py b/src/openrouter/components/usage.py index 62c5e14..09f7248 100644 --- a/src/openrouter/components/usage.py +++ b/src/openrouter/components/usage.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .servertoolusedetails import ServerToolUseDetails, ServerToolUseDetailsTypedDict from openrouter.types import ( BaseModel, Nullable, @@ -15,11 +16,39 @@ from typing_extensions import NotRequired, TypedDict class InputTokensDetailsTypedDict(TypedDict): cached_tokens: int + cache_write_tokens: NotRequired[Nullable[int]] class InputTokensDetails(BaseModel): cached_tokens: int + cache_write_tokens: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["cache_write_tokens"]) + nullable_fields = set(["cache_write_tokens"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + class OutputTokensDetailsTypedDict(TypedDict): reasoning_tokens: int @@ -81,6 +110,8 @@ class UsageTypedDict(TypedDict): cost_details: NotRequired[UsageCostDetailsTypedDict] is_byok: NotRequired[bool] r"""Whether a request was made using a Bring Your Own Key configuration""" + server_tool_use_details: NotRequired[Nullable[ServerToolUseDetailsTypedDict]] + r"""Usage for server-side tool execution (e.g., web search)""" class Usage(BaseModel): @@ -104,10 +135,15 @@ class Usage(BaseModel): is_byok: Optional[bool] = None r"""Whether a request was made using a Bring Your Own Key configuration""" + server_tool_use_details: OptionalNullable[ServerToolUseDetails] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["cost", "cost_details", "is_byok"]) - nullable_fields = set(["cost"]) + optional_fields = set( + ["cost", "cost_details", "is_byok", "server_tool_use_details"] + ) + nullable_fields = set(["cost", "server_tool_use_details"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/videogenerationrequest.py b/src/openrouter/components/videogenerationrequest.py index 1f383a9..d6ea468 100644 --- a/src/openrouter/components/videogenerationrequest.py +++ b/src/openrouter/components/videogenerationrequest.py @@ -61,6 +61,7 @@ class VideoGenerationRequestOptionsTypedDict(TypedDict): crusoe: NotRequired[Dict[str, Nullable[Any]]] darkbloom: NotRequired[Dict[str, Nullable[Any]]] decart: NotRequired[Dict[str, Nullable[Any]]] + deepgram: NotRequired[Dict[str, Nullable[Any]]] deepinfra: NotRequired[Dict[str, Nullable[Any]]] deepseek: NotRequired[Dict[str, Nullable[Any]]] dekallm: NotRequired[Dict[str, Nullable[Any]]] @@ -127,7 +128,8 @@ class VideoGenerationRequestOptionsTypedDict(TypedDict): reka: NotRequired[Dict[str, Nullable[Any]]] relace: NotRequired[Dict[str, Nullable[Any]]] replicate: NotRequired[Dict[str, Nullable[Any]]] - sakana_ai: NotRequired[Dict[str, Nullable[Any]]] + sail_research: NotRequired[Dict[str, Nullable[Any]]] + sakana: NotRequired[Dict[str, Nullable[Any]]] sambanova: NotRequired[Dict[str, Nullable[Any]]] sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]] seed: NotRequired[Dict[str, Nullable[Any]]] @@ -231,6 +233,8 @@ class VideoGenerationRequestOptions(BaseModel): decart: Optional[Dict[str, Nullable[Any]]] = None + deepgram: Optional[Dict[str, Nullable[Any]]] = None + deepinfra: Optional[Dict[str, Nullable[Any]]] = None deepseek: Optional[Dict[str, Nullable[Any]]] = None @@ -387,10 +391,12 @@ class VideoGenerationRequestOptions(BaseModel): replicate: Optional[Dict[str, Nullable[Any]]] = None - sakana_ai: Annotated[ - Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sakana-ai") + sail_research: Annotated[ + Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sail-research") ] = None + sakana: Optional[Dict[str, Nullable[Any]]] = None + sambanova: Optional[Dict[str, Nullable[Any]]] = None sambanova_cloaked: Annotated[ @@ -478,6 +484,7 @@ class VideoGenerationRequestOptions(BaseModel): "crusoe", "darkbloom", "decart", + "deepgram", "deepinfra", "deepseek", "dekallm", @@ -544,7 +551,8 @@ class VideoGenerationRequestOptions(BaseModel): "reka", "relace", "replicate", - "sakana-ai", + "sail-research", + "sakana", "sambanova", "sambanova-cloaked", "seed", diff --git a/src/openrouter/datasets.py b/src/openrouter/datasets.py index 0420058..3d9437c 100644 --- a/src/openrouter/datasets.py +++ b/src/openrouter/datasets.py @@ -444,6 +444,11 @@ class Datasets(BaseSDK): x_open_router_categories: Optional[str] = None, start_date: Optional[str] = None, end_date: Optional[str] = None, + period: Optional[operations.Period] = None, + modality: Optional[operations.Modality] = None, + context_bucket: Optional[operations.ContextBucket] = None, + category: Optional[operations.GetRankingsDailyCategory] = None, + language_type: Optional[operations.LanguageType] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -460,6 +465,13 @@ class Datasets(BaseSDK): reserved permaslug `other` and is always returned last within its date, so callers can compute `top-50 traffic / total daily traffic` without a second request. + Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time + grain. `modality` and `context_bucket` narrow the exact dataset by output/input + modality (or tool-calling activity) and request context length. `category` and + `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are + weekly-grain estimates — they cannot be combined with each other or with the exact + filters, and reject `period=day` with a 400. + Authenticate with any valid OpenRouter API key (same key used for inference). Rate-limited to 30 requests/minute per key and 500 requests/day per account. @@ -480,6 +492,11 @@ class Datasets(BaseSDK): :param start_date: Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. :param end_date: End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + :param period: Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + :param modality: Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + :param context_bucket: Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + :param category: Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + :param language_type: Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. :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 @@ -501,6 +518,11 @@ class Datasets(BaseSDK): x_open_router_categories=x_open_router_categories, start_date=start_date, end_date=end_date, + period=period, + modality=modality, + context_bucket=context_bucket, + category=category, + language_type=language_type, ) req = self._build_request( @@ -598,6 +620,11 @@ class Datasets(BaseSDK): x_open_router_categories: Optional[str] = None, start_date: Optional[str] = None, end_date: Optional[str] = None, + period: Optional[operations.Period] = None, + modality: Optional[operations.Modality] = None, + context_bucket: Optional[operations.ContextBucket] = None, + category: Optional[operations.GetRankingsDailyCategory] = None, + language_type: Optional[operations.LanguageType] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -614,6 +641,13 @@ class Datasets(BaseSDK): reserved permaslug `other` and is always returned last within its date, so callers can compute `top-50 traffic / total daily traffic` without a second request. + Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time + grain. `modality` and `context_bucket` narrow the exact dataset by output/input + modality (or tool-calling activity) and request context length. `category` and + `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are + weekly-grain estimates — they cannot be combined with each other or with the exact + filters, and reject `period=day` with a 400. + Authenticate with any valid OpenRouter API key (same key used for inference). Rate-limited to 30 requests/minute per key and 500 requests/day per account. @@ -634,6 +668,11 @@ class Datasets(BaseSDK): :param start_date: Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. :param end_date: End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + :param period: Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + :param modality: Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + :param context_bucket: Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + :param category: Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + :param language_type: Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. :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 @@ -655,6 +694,11 @@ class Datasets(BaseSDK): x_open_router_categories=x_open_router_categories, start_date=start_date, end_date=end_date, + period=period, + modality=modality, + context_bucket=context_bucket, + category=category, + language_type=language_type, ) req = self._build_request_async( diff --git a/src/openrouter/embeddings.py b/src/openrouter/embeddings.py index 9f0b5ce..906426a 100644 --- a/src/openrouter/embeddings.py +++ b/src/openrouter/embeddings.py @@ -2,12 +2,13 @@ from .basesdk import BaseSDK from enum import Enum +from jsonpath import JSONPath from openrouter import components, errors, operations, utils from openrouter._hooks import HookContext from openrouter.types import OptionalNullable, UNSET from openrouter.utils import get_security_from_env from openrouter.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union +from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union class GenerateAcceptEnum(str, Enum): @@ -432,11 +433,13 @@ class Embeddings(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 500, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ModelsListResponse: + ) -> Optional[operations.ListEmbeddingsModelsResponse]: r"""List all embeddings models Returns a list of all available embeddings models and their properties @@ -448,6 +451,8 @@ class Embeddings(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :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 @@ -467,6 +472,8 @@ class Embeddings(BaseSDK): http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, + offset=offset, + limit=limit, ) req = self._build_request( @@ -520,9 +527,39 @@ class Embeddings(BaseSDK): retry_config=retry_config, ) + def next_func() -> Optional[operations.ListEmbeddingsModelsResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + offset = request.offset if isinstance(request.offset, int) else 0 + + if not http_res.text: + return None + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit_ = request.limit if isinstance(request.limit, int) else 500 + if len(results[0]) < limit_: + return None + next_offset = offset + len(results[0]) + + return self.list_models( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + offset=next_offset, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.ModelsListResponse, http_res) + return operations.ListEmbeddingsModelsResponse( + result=unmarshal_json_response(components.ModelsListResponse, http_res), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): response_data = unmarshal_json_response( errors.BadRequestResponseErrorData, http_res @@ -552,11 +589,13 @@ class Embeddings(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 500, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ModelsListResponse: + ) -> Optional[operations.ListEmbeddingsModelsResponse]: r"""List all embeddings models Returns a list of all available embeddings models and their properties @@ -568,6 +607,8 @@ class Embeddings(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :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 @@ -587,6 +628,8 @@ class Embeddings(BaseSDK): http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, + offset=offset, + limit=limit, ) req = self._build_request_async( @@ -640,9 +683,42 @@ class Embeddings(BaseSDK): retry_config=retry_config, ) + def next_func() -> Awaitable[Optional[operations.ListEmbeddingsModelsResponse]]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + async def empty_result(): + return None + + offset = request.offset if isinstance(request.offset, int) else 0 + + if not http_res.text: + return empty_result() + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return empty_result() + limit_ = request.limit if isinstance(request.limit, int) else 500 + if len(results[0]) < limit_: + return empty_result() + next_offset = offset + len(results[0]) + + return self.list_models_async( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + offset=next_offset, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.ModelsListResponse, http_res) + return operations.ListEmbeddingsModelsResponse( + result=unmarshal_json_response(components.ModelsListResponse, http_res), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): response_data = unmarshal_json_response( errors.BadRequestResponseErrorData, http_res diff --git a/src/openrouter/files.py b/src/openrouter/files.py index 0c46d08..1c20e7d 100644 --- a/src/openrouter/files.py +++ b/src/openrouter/files.py @@ -360,7 +360,7 @@ class Files(BaseSDK): def upload( self, *, - file: Union[operations.File, operations.FileTypedDict], + file: Union[operations.UploadFileFile, operations.UploadFileFileTypedDict], http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -404,7 +404,7 @@ class Files(BaseSDK): x_open_router_categories=x_open_router_categories, workspace_id=workspace_id, request_body=operations.UploadFileRequestBody( - file=utils.get_pydantic_model(file, operations.File), + file=utils.get_pydantic_model(file, operations.UploadFileFile), ), ) @@ -515,7 +515,7 @@ class Files(BaseSDK): async def upload_async( self, *, - file: Union[operations.File, operations.FileTypedDict], + file: Union[operations.UploadFileFile, operations.UploadFileFileTypedDict], http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, @@ -559,7 +559,7 @@ class Files(BaseSDK): x_open_router_categories=x_open_router_categories, workspace_id=workspace_id, request_body=operations.UploadFileRequestBody( - file=utils.get_pydantic_model(file, operations.File), + file=utils.get_pydantic_model(file, operations.UploadFileFile), ), ) diff --git a/src/openrouter/generations.py b/src/openrouter/generations.py index cecdd21..f6dbf54 100644 --- a/src/openrouter/generations.py +++ b/src/openrouter/generations.py @@ -619,3 +619,313 @@ class Generations(BaseSDK): ) raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def submit_feedback( + self, + *, + category: components.Category, + generation_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + comment: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.SubmitGenerationFeedbackResponse: + r"""Submit feedback for a generation + + Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param category: The category of feedback being reported + :param generation_id: The generation to submit feedback on + :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 comment: An optional free-text comment describing the feedback + :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.SubmitGenerationFeedbackRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + submit_generation_feedback_request=components.SubmitGenerationFeedbackRequest( + category=category, + comment=comment, + generation_id=generation_id, + ), + ) + + req = self._build_request( + method="POST", + path="/generation/feedback", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.SubmitGenerationFeedbackGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.submit_generation_feedback_request, + False, + False, + "json", + components.SubmitGenerationFeedbackRequest, + ), + 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="submitGenerationFeedback", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Generations"], + 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.SubmitGenerationFeedbackResponse, 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, "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 submit_feedback_async( + self, + *, + category: components.Category, + generation_id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + comment: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.SubmitGenerationFeedbackResponse: + r"""Submit feedback for a generation + + Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required. + + :param category: The category of feedback being reported + :param generation_id: The generation to submit feedback on + :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 comment: An optional free-text comment describing the feedback + :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.SubmitGenerationFeedbackRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + submit_generation_feedback_request=components.SubmitGenerationFeedbackRequest( + category=category, + comment=comment, + generation_id=generation_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/generation/feedback", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.SubmitGenerationFeedbackGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.submit_generation_feedback_request, + False, + False, + "json", + components.SubmitGenerationFeedbackRequest, + ), + 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="submitGenerationFeedback", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Generations"], + 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.SubmitGenerationFeedbackResponse, 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, "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/guardrails.py b/src/openrouter/guardrails.py index 4add1c7..b9fa125 100644 --- a/src/openrouter/guardrails.py +++ b/src/openrouter/guardrails.py @@ -19,8 +19,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -126,7 +126,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -181,8 +181,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -291,7 +291,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -367,6 +367,7 @@ class Guardrails(BaseSDK): enforce_zdr_google: OptionalNullable[bool] = UNSET, enforce_zdr_openai: OptionalNullable[bool] = UNSET, enforce_zdr_other: OptionalNullable[bool] = UNSET, + enforce_zdr_xai: OptionalNullable[bool] = UNSET, ignored_models: OptionalNullable[Iterable[str]] = UNSET, ignored_providers: OptionalNullable[Iterable[str]] = UNSET, limit_usd: OptionalNullable[float] = UNSET, @@ -394,11 +395,12 @@ class Guardrails(BaseSDK): :param content_filter_builtins: Builtin content filters to apply. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. :param content_filters: Custom regex content filters to apply to request messages :param description: Description of the guardrail - :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. :param enforce_zdr_anthropic: Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. :param enforce_zdr_google: Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. :param enforce_zdr_openai: Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. - :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. + :param enforce_zdr_xai: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. :param ignored_models: Array of model identifiers to exclude from routing (slug or canonical_slug accepted) :param ignored_providers: List of provider IDs to exclude from routing :param limit_usd: Spending limit in USD @@ -444,6 +446,7 @@ class Guardrails(BaseSDK): enforce_zdr_google=enforce_zdr_google, enforce_zdr_openai=enforce_zdr_openai, enforce_zdr_other=enforce_zdr_other, + enforce_zdr_xai=enforce_zdr_xai, ignored_models=utils.unmarshal( ignored_models, OptionalNullable[List[str]] ), @@ -578,6 +581,7 @@ class Guardrails(BaseSDK): enforce_zdr_google: OptionalNullable[bool] = UNSET, enforce_zdr_openai: OptionalNullable[bool] = UNSET, enforce_zdr_other: OptionalNullable[bool] = UNSET, + enforce_zdr_xai: OptionalNullable[bool] = UNSET, ignored_models: OptionalNullable[Iterable[str]] = UNSET, ignored_providers: OptionalNullable[Iterable[str]] = UNSET, limit_usd: OptionalNullable[float] = UNSET, @@ -605,11 +609,12 @@ class Guardrails(BaseSDK): :param content_filter_builtins: Builtin content filters to apply. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. :param content_filters: Custom regex content filters to apply to request messages :param description: Description of the guardrail - :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. :param enforce_zdr_anthropic: Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. :param enforce_zdr_google: Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. :param enforce_zdr_openai: Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. - :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. + :param enforce_zdr_xai: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. :param ignored_models: Array of model identifiers to exclude from routing (slug or canonical_slug accepted) :param ignored_providers: List of provider IDs to exclude from routing :param limit_usd: Spending limit in USD @@ -655,6 +660,7 @@ class Guardrails(BaseSDK): enforce_zdr_google=enforce_zdr_google, enforce_zdr_openai=enforce_zdr_openai, enforce_zdr_other=enforce_zdr_other, + enforce_zdr_xai=enforce_zdr_xai, ignored_models=utils.unmarshal( ignored_models, OptionalNullable[List[str]] ), @@ -1301,6 +1307,7 @@ class Guardrails(BaseSDK): enforce_zdr_google: OptionalNullable[bool] = UNSET, enforce_zdr_openai: OptionalNullable[bool] = UNSET, enforce_zdr_other: OptionalNullable[bool] = UNSET, + enforce_zdr_xai: OptionalNullable[bool] = UNSET, ignored_models: OptionalNullable[Iterable[str]] = UNSET, ignored_providers: OptionalNullable[Iterable[str]] = UNSET, limit_usd: OptionalNullable[float] = UNSET, @@ -1328,11 +1335,12 @@ class Guardrails(BaseSDK): :param content_filter_builtins: Builtin content filters to apply. Set to null to remove. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. :param content_filters: Custom regex content filters to apply. Set to null to remove. :param description: New description for the guardrail - :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. :param enforce_zdr_anthropic: Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. :param enforce_zdr_google: Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. :param enforce_zdr_openai: Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. - :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. + :param enforce_zdr_xai: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. :param ignored_models: Array of model identifiers to exclude from routing (slug or canonical_slug accepted) :param ignored_providers: List of provider IDs to exclude from routing :param limit_usd: New spending limit in USD @@ -1379,6 +1387,7 @@ class Guardrails(BaseSDK): enforce_zdr_google=enforce_zdr_google, enforce_zdr_openai=enforce_zdr_openai, enforce_zdr_other=enforce_zdr_other, + enforce_zdr_xai=enforce_zdr_xai, ignored_models=utils.unmarshal( ignored_models, OptionalNullable[List[str]] ), @@ -1512,6 +1521,7 @@ class Guardrails(BaseSDK): enforce_zdr_google: OptionalNullable[bool] = UNSET, enforce_zdr_openai: OptionalNullable[bool] = UNSET, enforce_zdr_other: OptionalNullable[bool] = UNSET, + enforce_zdr_xai: OptionalNullable[bool] = UNSET, ignored_models: OptionalNullable[Iterable[str]] = UNSET, ignored_providers: OptionalNullable[Iterable[str]] = UNSET, limit_usd: OptionalNullable[float] = UNSET, @@ -1539,11 +1549,12 @@ class Guardrails(BaseSDK): :param content_filter_builtins: Builtin content filters to apply. Set to null to remove. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. :param content_filters: Custom regex content filters to apply. Set to null to remove. :param description: New description for the guardrail - :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. :param enforce_zdr_anthropic: Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. :param enforce_zdr_google: Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. :param enforce_zdr_openai: Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. - :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + :param enforce_zdr_other: Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. + :param enforce_zdr_xai: Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. :param ignored_models: Array of model identifiers to exclude from routing (slug or canonical_slug accepted) :param ignored_providers: List of provider IDs to exclude from routing :param limit_usd: New spending limit in USD @@ -1590,6 +1601,7 @@ class Guardrails(BaseSDK): enforce_zdr_google=enforce_zdr_google, enforce_zdr_openai=enforce_zdr_openai, enforce_zdr_other=enforce_zdr_other, + enforce_zdr_xai=enforce_zdr_xai, ignored_models=utils.unmarshal( ignored_models, OptionalNullable[List[str]] ), @@ -1703,8 +1715,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1809,7 +1821,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -1870,8 +1882,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1981,7 +1993,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -2626,8 +2638,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2732,7 +2744,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -2793,8 +2805,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2904,7 +2916,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -3552,8 +3564,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3656,7 +3668,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -3710,8 +3722,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3817,7 +3829,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -3871,8 +3883,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3975,7 +3987,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -4029,8 +4041,8 @@ class Guardrails(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -4138,7 +4150,7 @@ class Guardrails(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) diff --git a/src/openrouter/images.py b/src/openrouter/images.py index ebdec2d..8a3080f 100644 --- a/src/openrouter/images.py +++ b/src/openrouter/images.py @@ -34,8 +34,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -67,11 +67,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -101,8 +101,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -134,11 +134,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -168,8 +168,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -204,11 +204,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -237,8 +237,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -273,11 +273,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -310,7 +310,7 @@ class Images(BaseSDK): output_format=output_format, prompt=prompt, provider=utils.get_pydantic_model( - provider, Optional[components.ImageGenerationRequestProvider] + provider, Optional[components.ImageGenerationProviderPreferences] ), quality=quality, resolution=resolution, @@ -430,6 +430,14 @@ class Images(BaseSDK): errors.NotFoundResponseErrorData, http_res, http_res_text ) raise errors.NotFoundResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "413", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res, http_res_text + ) + raise errors.PayloadTooLargeResponseError( + response_data, http_res, http_res_text + ) if utils.match_response(http_res, "429", "application/json"): http_res_text = utils.stream_to_text(http_res) response_data = unmarshal_json_response( @@ -506,8 +514,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -539,11 +547,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -573,8 +581,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -606,11 +614,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -640,8 +648,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -676,11 +684,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -709,8 +717,8 @@ class Images(BaseSDK): output_format: Optional[components.ImageGenerationRequestOutputFormat] = None, provider: Optional[ Union[ - components.ImageGenerationRequestProvider, - components.ImageGenerationRequestProviderTypedDict, + components.ImageGenerationProviderPreferences, + components.ImageGenerationProviderPreferencesTypedDict, ] ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, @@ -745,11 +753,11 @@ class Images(BaseSDK): :param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. :param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. - :param provider: Provider-specific passthrough configuration + :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. :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 size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. :param stream: If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -782,7 +790,7 @@ class Images(BaseSDK): output_format=output_format, prompt=prompt, provider=utils.get_pydantic_model( - provider, Optional[components.ImageGenerationRequestProvider] + provider, Optional[components.ImageGenerationProviderPreferences] ), quality=quality, resolution=resolution, @@ -902,6 +910,14 @@ class Images(BaseSDK): errors.NotFoundResponseErrorData, http_res, http_res_text ) raise errors.NotFoundResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "413", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res, http_res_text + ) + raise errors.PayloadTooLargeResponseError( + response_data, http_res, http_res_text + ) if utils.match_response(http_res, "429", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) response_data = unmarshal_json_response( diff --git a/src/openrouter/models_.py b/src/openrouter/models_.py index 02dd1c2..1a85e99 100644 --- a/src/openrouter/models_.py +++ b/src/openrouter/models_.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK +from jsonpath import JSONPath from openrouter import components, errors, operations, utils from openrouter._hooks import HookContext from openrouter.types import OptionalNullable, UNSET from openrouter.utils import get_security_from_env from openrouter.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union +from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union class Models(BaseSDK): @@ -270,6 +271,8 @@ class Models(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 500, category: Optional[operations.GetModelsCategory] = None, supported_parameters: Optional[str] = None, output_modalities: Optional[str] = None, @@ -285,11 +288,23 @@ class Models(BaseSDK): distillable: Optional[operations.Distillable] = None, zdr: Optional[operations.Zdr] = None, region: Optional[operations.Region] = None, + min_output_price: OptionalNullable[float] = UNSET, + max_output_price: OptionalNullable[float] = UNSET, + min_age_days: OptionalNullable[int] = UNSET, + max_age_days: OptionalNullable[int] = UNSET, + min_intelligence_index: OptionalNullable[float] = UNSET, + max_intelligence_index: OptionalNullable[float] = UNSET, + min_coding_index: OptionalNullable[float] = UNSET, + max_coding_index: OptionalNullable[float] = UNSET, + min_agentic_index: OptionalNullable[float] = UNSET, + max_agentic_index: OptionalNullable[float] = UNSET, + min_tool_success_rate: OptionalNullable[float] = UNSET, + max_tool_success_rate: OptionalNullable[float] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ModelsListResponse: + ) -> Optional[operations.GetModelsResponse]: r"""List all models and their properties :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -299,10 +314,12 @@ class Models(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :param category: Filter models by use case category :param supported_parameters: Filter models by supported parameter (comma-separated) :param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". - :param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. + :param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. :param q: Free-text search by model name or slug. :param input_modalities: Filter models by input modality. Comma-separated list of: text, image, audio, file. :param context: Minimum context length (tokens). Models with smaller context are excluded. @@ -314,6 +331,18 @@ class Models(BaseSDK): :param distillable: Filter by distillation capability. \"true\" returns only distillable models, \"false\" excludes them. :param zdr: When set to \"true\", return only models with zero data retention endpoints. :param region: Filter to models with endpoints in the given data region. Currently only \"eu\" is supported. + :param min_output_price: Minimum completion (output) price in $/M tokens. + :param max_output_price: Maximum completion (output) price in $/M tokens. + :param min_age_days: Minimum model age in days since its creation date. + :param max_age_days: Maximum model age in days since its creation date. + :param min_intelligence_index: Minimum Artificial Analysis intelligence index. + :param max_intelligence_index: Maximum Artificial Analysis intelligence index. + :param min_coding_index: Minimum Artificial Analysis coding index. + :param max_coding_index: Maximum Artificial Analysis coding index. + :param min_agentic_index: Minimum Artificial Analysis agentic index. + :param max_agentic_index: Maximum Artificial Analysis agentic index. + :param min_tool_success_rate: Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason). + :param max_tool_success_rate: Maximum tool-calling success rate, as a fraction in [0, 1]. :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 @@ -333,6 +362,8 @@ class Models(BaseSDK): http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, + offset=offset, + limit=limit, category=category, supported_parameters=supported_parameters, output_modalities=output_modalities, @@ -348,6 +379,18 @@ class Models(BaseSDK): distillable=distillable, zdr=zdr, region=region, + min_output_price=min_output_price, + max_output_price=max_output_price, + min_age_days=min_age_days, + max_age_days=max_age_days, + min_intelligence_index=min_intelligence_index, + max_intelligence_index=max_intelligence_index, + min_coding_index=min_coding_index, + max_coding_index=max_coding_index, + min_agentic_index=min_agentic_index, + max_agentic_index=max_agentic_index, + min_tool_success_rate=min_tool_success_rate, + max_tool_success_rate=max_tool_success_rate, ) req = self._build_request( @@ -401,9 +444,66 @@ class Models(BaseSDK): retry_config=retry_config, ) + def next_func() -> Optional[operations.GetModelsResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + offset = request.offset if isinstance(request.offset, int) else 0 + + if not http_res.text: + return None + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit_ = request.limit if isinstance(request.limit, int) else 500 + if len(results[0]) < limit_: + return None + next_offset = offset + len(results[0]) + + return self.list( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + offset=next_offset, + limit=limit, + category=category, + supported_parameters=supported_parameters, + output_modalities=output_modalities, + sort=sort, + q=q, + input_modalities=input_modalities, + context=context, + min_price=min_price, + max_price=max_price, + arch=arch, + model_authors=model_authors, + providers=providers, + distillable=distillable, + zdr=zdr, + region=region, + min_output_price=min_output_price, + max_output_price=max_output_price, + min_age_days=min_age_days, + max_age_days=max_age_days, + min_intelligence_index=min_intelligence_index, + max_intelligence_index=max_intelligence_index, + min_coding_index=min_coding_index, + max_coding_index=max_coding_index, + min_agentic_index=min_agentic_index, + max_agentic_index=max_agentic_index, + min_tool_success_rate=min_tool_success_rate, + max_tool_success_rate=max_tool_success_rate, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.ModelsListResponse, http_res) + return operations.GetModelsResponse( + result=unmarshal_json_response(components.ModelsListResponse, http_res), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): response_data = unmarshal_json_response( errors.BadRequestResponseErrorData, http_res @@ -433,6 +533,8 @@ class Models(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 500, category: Optional[operations.GetModelsCategory] = None, supported_parameters: Optional[str] = None, output_modalities: Optional[str] = None, @@ -448,11 +550,23 @@ class Models(BaseSDK): distillable: Optional[operations.Distillable] = None, zdr: Optional[operations.Zdr] = None, region: Optional[operations.Region] = None, + min_output_price: OptionalNullable[float] = UNSET, + max_output_price: OptionalNullable[float] = UNSET, + min_age_days: OptionalNullable[int] = UNSET, + max_age_days: OptionalNullable[int] = UNSET, + min_intelligence_index: OptionalNullable[float] = UNSET, + max_intelligence_index: OptionalNullable[float] = UNSET, + min_coding_index: OptionalNullable[float] = UNSET, + max_coding_index: OptionalNullable[float] = UNSET, + min_agentic_index: OptionalNullable[float] = UNSET, + max_agentic_index: OptionalNullable[float] = UNSET, + min_tool_success_rate: OptionalNullable[float] = UNSET, + max_tool_success_rate: OptionalNullable[float] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ModelsListResponse: + ) -> Optional[operations.GetModelsResponse]: r"""List all models and their properties :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -462,10 +576,12 @@ class Models(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :param category: Filter models by use case category :param supported_parameters: Filter models by supported parameter (comma-separated) :param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". - :param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. + :param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. :param q: Free-text search by model name or slug. :param input_modalities: Filter models by input modality. Comma-separated list of: text, image, audio, file. :param context: Minimum context length (tokens). Models with smaller context are excluded. @@ -477,6 +593,18 @@ class Models(BaseSDK): :param distillable: Filter by distillation capability. \"true\" returns only distillable models, \"false\" excludes them. :param zdr: When set to \"true\", return only models with zero data retention endpoints. :param region: Filter to models with endpoints in the given data region. Currently only \"eu\" is supported. + :param min_output_price: Minimum completion (output) price in $/M tokens. + :param max_output_price: Maximum completion (output) price in $/M tokens. + :param min_age_days: Minimum model age in days since its creation date. + :param max_age_days: Maximum model age in days since its creation date. + :param min_intelligence_index: Minimum Artificial Analysis intelligence index. + :param max_intelligence_index: Maximum Artificial Analysis intelligence index. + :param min_coding_index: Minimum Artificial Analysis coding index. + :param max_coding_index: Maximum Artificial Analysis coding index. + :param min_agentic_index: Minimum Artificial Analysis agentic index. + :param max_agentic_index: Maximum Artificial Analysis agentic index. + :param min_tool_success_rate: Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason). + :param max_tool_success_rate: Maximum tool-calling success rate, as a fraction in [0, 1]. :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 @@ -496,6 +624,8 @@ class Models(BaseSDK): http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, + offset=offset, + limit=limit, category=category, supported_parameters=supported_parameters, output_modalities=output_modalities, @@ -511,6 +641,18 @@ class Models(BaseSDK): distillable=distillable, zdr=zdr, region=region, + min_output_price=min_output_price, + max_output_price=max_output_price, + min_age_days=min_age_days, + max_age_days=max_age_days, + min_intelligence_index=min_intelligence_index, + max_intelligence_index=max_intelligence_index, + min_coding_index=min_coding_index, + max_coding_index=max_coding_index, + min_agentic_index=min_agentic_index, + max_agentic_index=max_agentic_index, + min_tool_success_rate=min_tool_success_rate, + max_tool_success_rate=max_tool_success_rate, ) req = self._build_request_async( @@ -564,9 +706,69 @@ class Models(BaseSDK): retry_config=retry_config, ) + def next_func() -> Awaitable[Optional[operations.GetModelsResponse]]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + async def empty_result(): + return None + + offset = request.offset if isinstance(request.offset, int) else 0 + + if not http_res.text: + return empty_result() + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return empty_result() + limit_ = request.limit if isinstance(request.limit, int) else 500 + if len(results[0]) < limit_: + return empty_result() + next_offset = offset + len(results[0]) + + return self.list_async( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + offset=next_offset, + limit=limit, + category=category, + supported_parameters=supported_parameters, + output_modalities=output_modalities, + sort=sort, + q=q, + input_modalities=input_modalities, + context=context, + min_price=min_price, + max_price=max_price, + arch=arch, + model_authors=model_authors, + providers=providers, + distillable=distillable, + zdr=zdr, + region=region, + min_output_price=min_output_price, + max_output_price=max_output_price, + min_age_days=min_age_days, + max_age_days=max_age_days, + min_intelligence_index=min_intelligence_index, + max_intelligence_index=max_intelligence_index, + min_coding_index=min_coding_index, + max_coding_index=max_coding_index, + min_agentic_index=min_agentic_index, + max_agentic_index=max_agentic_index, + min_tool_success_rate=min_tool_success_rate, + max_tool_success_rate=max_tool_success_rate, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.ModelsListResponse, http_res) + return operations.GetModelsResponse( + result=unmarshal_json_response(components.ModelsListResponse, http_res), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): response_data = unmarshal_json_response( errors.BadRequestResponseErrorData, http_res @@ -842,11 +1044,13 @@ class Models(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 500, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ModelsListResponse: + ) -> Optional[operations.ListModelsUserResponse]: r"""List models filtered by user provider preferences, privacy settings, and guardrails List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing). @@ -859,6 +1063,8 @@ class Models(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :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 @@ -878,6 +1084,8 @@ class Models(BaseSDK): http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, + offset=offset, + limit=limit, ) req = self._build_request( @@ -931,9 +1139,40 @@ class Models(BaseSDK): retry_config=retry_config, ) + def next_func() -> Optional[operations.ListModelsUserResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + offset = request.offset if isinstance(request.offset, int) else 0 + + if not http_res.text: + return None + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit_ = request.limit if isinstance(request.limit, int) else 500 + if len(results[0]) < limit_: + return None + next_offset = offset + len(results[0]) + + return self.list_for_user( + security=security, + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + offset=next_offset, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.ModelsListResponse, http_res) + return operations.ListModelsUserResponse( + result=unmarshal_json_response(components.ModelsListResponse, http_res), + next=next_func, + ) if utils.match_response(http_res, "401", "application/json"): response_data = unmarshal_json_response( errors.UnauthorizedResponseErrorData, http_res @@ -972,11 +1211,13 @@ class Models(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 500, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ModelsListResponse: + ) -> Optional[operations.ListModelsUserResponse]: r"""List models filtered by user provider preferences, privacy settings, and guardrails List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing). @@ -989,6 +1230,8 @@ class Models(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned + :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :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 @@ -1008,6 +1251,8 @@ class Models(BaseSDK): http_referer=http_referer, x_open_router_title=x_open_router_title, x_open_router_categories=x_open_router_categories, + offset=offset, + limit=limit, ) req = self._build_request_async( @@ -1061,9 +1306,43 @@ class Models(BaseSDK): retry_config=retry_config, ) + def next_func() -> Awaitable[Optional[operations.ListModelsUserResponse]]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + async def empty_result(): + return None + + offset = request.offset if isinstance(request.offset, int) else 0 + + if not http_res.text: + return empty_result() + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return empty_result() + limit_ = request.limit if isinstance(request.limit, int) else 500 + if len(results[0]) < limit_: + return empty_result() + next_offset = offset + len(results[0]) + + return self.list_for_user_async( + security=security, + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + offset=next_offset, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.ModelsListResponse, http_res) + return operations.ListModelsUserResponse( + result=unmarshal_json_response(components.ModelsListResponse, http_res), + next=next_func, + ) if utils.match_response(http_res, "401", "application/json"): response_data = unmarshal_json_response( errors.UnauthorizedResponseErrorData, http_res diff --git a/src/openrouter/observability.py b/src/openrouter/observability.py index a1dea9b..67318c7 100644 --- a/src/openrouter/observability.py +++ b/src/openrouter/observability.py @@ -19,8 +19,8 @@ class Observability(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -126,7 +126,7 @@ class Observability(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -181,8 +181,8 @@ class Observability(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, workspace_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -293,7 +293,7 @@ class Observability(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -355,8 +355,8 @@ class Observability(BaseSDK): enabled: Optional[bool] = True, filter_rules: OptionalNullable[ Union[ - components.ObservabilityFilterRulesConfig, - components.ObservabilityFilterRulesConfigTypedDict, + components.ObservabilityFilterRulesConfigNullable, + components.ObservabilityFilterRulesConfigNullableTypedDict, ] ] = UNSET, privacy_mode: Optional[bool] = False, @@ -414,7 +414,7 @@ class Observability(BaseSDK): enabled=enabled, filter_rules=utils.get_pydantic_model( filter_rules, - OptionalNullable[components.ObservabilityFilterRulesConfig], + OptionalNullable[components.ObservabilityFilterRulesConfigNullable], ), name=name, privacy_mode=privacy_mode, @@ -538,8 +538,8 @@ class Observability(BaseSDK): enabled: Optional[bool] = True, filter_rules: OptionalNullable[ Union[ - components.ObservabilityFilterRulesConfig, - components.ObservabilityFilterRulesConfigTypedDict, + components.ObservabilityFilterRulesConfigNullable, + components.ObservabilityFilterRulesConfigNullableTypedDict, ] ] = UNSET, privacy_mode: Optional[bool] = False, @@ -597,7 +597,7 @@ class Observability(BaseSDK): enabled=enabled, filter_rules=utils.get_pydantic_model( filter_rules, - OptionalNullable[components.ObservabilityFilterRulesConfig], + OptionalNullable[components.ObservabilityFilterRulesConfigNullable], ), name=name, privacy_mode=privacy_mode, @@ -1240,8 +1240,8 @@ class Observability(BaseSDK): enabled: Optional[bool] = None, filter_rules: OptionalNullable[ Union[ - components.ObservabilityFilterRulesConfig, - components.ObservabilityFilterRulesConfigTypedDict, + components.ObservabilityFilterRulesConfigNullable, + components.ObservabilityFilterRulesConfigNullableTypedDict, ] ] = UNSET, name: Optional[str] = None, @@ -1299,7 +1299,7 @@ class Observability(BaseSDK): enabled=enabled, filter_rules=utils.get_pydantic_model( filter_rules, - OptionalNullable[components.ObservabilityFilterRulesConfig], + OptionalNullable[components.ObservabilityFilterRulesConfigNullable], ), name=name, privacy_mode=privacy_mode, @@ -1420,8 +1420,8 @@ class Observability(BaseSDK): enabled: Optional[bool] = None, filter_rules: OptionalNullable[ Union[ - components.ObservabilityFilterRulesConfig, - components.ObservabilityFilterRulesConfigTypedDict, + components.ObservabilityFilterRulesConfigNullable, + components.ObservabilityFilterRulesConfigNullableTypedDict, ] ] = UNSET, name: Optional[str] = None, @@ -1479,7 +1479,7 @@ class Observability(BaseSDK): enabled=enabled, filter_rules=utils.get_pydantic_model( filter_rules, - OptionalNullable[components.ObservabilityFilterRulesConfig], + OptionalNullable[components.ObservabilityFilterRulesConfigNullable], ), name=name, privacy_mode=privacy_mode, diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index fc51690..95999d2 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -53,6 +53,18 @@ if TYPE_CHECKING: CreateAudioTranscriptionsRequest, CreateAudioTranscriptionsRequestTypedDict, ) + from .createaudiotranscriptions_multipart import ( + CreateAudioTranscriptionsMultipartFile, + CreateAudioTranscriptionsMultipartFileTypedDict, + CreateAudioTranscriptionsMultipartGlobals, + CreateAudioTranscriptionsMultipartGlobalsTypedDict, + CreateAudioTranscriptionsMultipartRequest, + CreateAudioTranscriptionsMultipartRequestBody, + CreateAudioTranscriptionsMultipartRequestBodyTypedDict, + CreateAudioTranscriptionsMultipartRequestTypedDict, + ResponseFormat, + TimestampGranularities, + ) from .createauthkeyscode import ( CreateAuthKeysCodeCodeChallengeMethod, CreateAuthKeysCodeData, @@ -80,8 +92,6 @@ if TYPE_CHECKING: ContentText, ContentTextTypedDict, ContentTypedDict, - CostDetails, - CostDetailsTypedDict, CreateEmbeddingsData, CreateEmbeddingsDataTypedDict, CreateEmbeddingsGlobals, @@ -377,6 +387,8 @@ if TYPE_CHECKING: GetModelsGlobalsTypedDict, GetModelsRequest, GetModelsRequestTypedDict, + GetModelsResponse, + GetModelsResponseTypedDict, GetModelsSort, Region, Zdr, @@ -400,10 +412,15 @@ if TYPE_CHECKING: GetPresetVersionRequestTypedDict, ) from .getrankingsdaily import ( + ContextBucket, + GetRankingsDailyCategory, GetRankingsDailyGlobals, GetRankingsDailyGlobalsTypedDict, GetRankingsDailyRequest, GetRankingsDailyRequestTypedDict, + LanguageType, + Modality, + Period, ) from .gettaskclassifications import ( GetTaskClassificationsGlobals, @@ -454,6 +471,8 @@ if TYPE_CHECKING: ListEmbeddingsModelsGlobalsTypedDict, ListEmbeddingsModelsRequest, ListEmbeddingsModelsRequestTypedDict, + ListEmbeddingsModelsResponse, + ListEmbeddingsModelsResponseTypedDict, ) from .listendpoints import ( ListEndpointsGlobals, @@ -548,6 +567,8 @@ if TYPE_CHECKING: ListModelsUserGlobalsTypedDict, ListModelsUserRequest, ListModelsUserRequestTypedDict, + ListModelsUserResponse, + ListModelsUserResponseTypedDict, ListModelsUserSecurity, ListModelsUserSecurityTypedDict, ) @@ -635,6 +656,14 @@ if TYPE_CHECKING: ListWorkspacesResponseTypedDict, ) from .queryanalytics import ( + ClassifierDimensions, + ClassifierDimensionsTypedDict, + ClassifierFilters, + ClassifierFiltersFilter, + ClassifierFiltersFilterTypedDict, + ClassifierFiltersTypedDict, + ClassifierFiltersValue, + ClassifierFiltersValueTypedDict, Direction, Filter, FilterTypedDict, @@ -660,6 +689,8 @@ if TYPE_CHECKING: Value1TypedDict, Value2, Value2TypedDict, + ValueClassifierFilters, + ValueClassifierFiltersTypedDict, ) from .sendchatcompletionrequest import ( SendChatCompletionRequestGlobals, @@ -669,6 +700,12 @@ if TYPE_CHECKING: SendChatCompletionRequestResponse, SendChatCompletionRequestResponseTypedDict, ) + from .submitgenerationfeedback import ( + SubmitGenerationFeedbackGlobals, + SubmitGenerationFeedbackGlobalsTypedDict, + SubmitGenerationFeedbackRequest, + SubmitGenerationFeedbackRequestTypedDict, + ) from .updatebyokkey import ( UpdateBYOKKeyGlobals, UpdateBYOKKeyGlobalsTypedDict, @@ -707,8 +744,8 @@ if TYPE_CHECKING: UpdateWorkspaceRequestTypedDict, ) from .uploadfile import ( - File, - FileTypedDict, + UploadFileFile, + UploadFileFileTypedDict, UploadFileGlobals, UploadFileGlobalsTypedDict, UploadFileRequest, @@ -749,20 +786,35 @@ __all__ = [ "BulkUnassignMembersFromGuardrailGlobalsTypedDict", "BulkUnassignMembersFromGuardrailRequest", "BulkUnassignMembersFromGuardrailRequestTypedDict", + "ClassifierDimensions", + "ClassifierDimensionsTypedDict", + "ClassifierFilters", + "ClassifierFiltersFilter", + "ClassifierFiltersFilterTypedDict", + "ClassifierFiltersTypedDict", + "ClassifierFiltersValue", + "ClassifierFiltersValueTypedDict", "Content", "ContentImageURL", "ContentImageURLTypedDict", "ContentText", "ContentTextTypedDict", "ContentTypedDict", - "CostDetails", - "CostDetailsTypedDict", + "ContextBucket", "CreateAudioSpeechGlobals", "CreateAudioSpeechGlobalsTypedDict", "CreateAudioSpeechRequest", "CreateAudioSpeechRequestTypedDict", "CreateAudioTranscriptionsGlobals", "CreateAudioTranscriptionsGlobalsTypedDict", + "CreateAudioTranscriptionsMultipartFile", + "CreateAudioTranscriptionsMultipartFileTypedDict", + "CreateAudioTranscriptionsMultipartGlobals", + "CreateAudioTranscriptionsMultipartGlobalsTypedDict", + "CreateAudioTranscriptionsMultipartRequest", + "CreateAudioTranscriptionsMultipartRequestBody", + "CreateAudioTranscriptionsMultipartRequestBodyTypedDict", + "CreateAudioTranscriptionsMultipartRequestTypedDict", "CreateAudioTranscriptionsRequest", "CreateAudioTranscriptionsRequestTypedDict", "CreateAuthKeysCodeCodeChallengeMethod", @@ -915,8 +967,6 @@ __all__ = [ "ExchangeAuthCodeForAPIKeyRequestTypedDict", "ExchangeAuthCodeForAPIKeyResponse", "ExchangeAuthCodeForAPIKeyResponseTypedDict", - "File", - "FileTypedDict", "Filter", "FilterTypedDict", "GetAnalyticsMetaData", @@ -988,6 +1038,8 @@ __all__ = [ "GetModelsGlobalsTypedDict", "GetModelsRequest", "GetModelsRequestTypedDict", + "GetModelsResponse", + "GetModelsResponseTypedDict", "GetModelsSort", "GetObservabilityDestinationGlobals", "GetObservabilityDestinationGlobalsTypedDict", @@ -1001,6 +1053,7 @@ __all__ = [ "GetPresetVersionGlobalsTypedDict", "GetPresetVersionRequest", "GetPresetVersionRequestTypedDict", + "GetRankingsDailyCategory", "GetRankingsDailyGlobals", "GetRankingsDailyGlobalsTypedDict", "GetRankingsDailyRequest", @@ -1031,6 +1084,7 @@ __all__ = [ "InputTypedDict", "InputUnion", "InputUnionTypedDict", + "LanguageType", "ListBYOKKeysGlobals", "ListBYOKKeysGlobalsTypedDict", "ListBYOKKeysRequest", @@ -1043,6 +1097,8 @@ __all__ = [ "ListEmbeddingsModelsGlobalsTypedDict", "ListEmbeddingsModelsRequest", "ListEmbeddingsModelsRequestTypedDict", + "ListEmbeddingsModelsResponse", + "ListEmbeddingsModelsResponseTypedDict", "ListEndpointsGlobals", "ListEndpointsGlobalsTypedDict", "ListEndpointsRequest", @@ -1113,6 +1169,8 @@ __all__ = [ "ListModelsUserGlobalsTypedDict", "ListModelsUserRequest", "ListModelsUserRequestTypedDict", + "ListModelsUserResponse", + "ListModelsUserResponseTypedDict", "ListModelsUserSecurity", "ListModelsUserSecurityTypedDict", "ListObservabilityDestinationsGlobals", @@ -1183,6 +1241,7 @@ __all__ = [ "MetadataTypedDict", "Metric", "MetricTypedDict", + "Modality", "Object", "ObjectEmbedding", "Operator", @@ -1190,6 +1249,7 @@ __all__ = [ "OperatorTypedDict", "OrderBy", "OrderByTypedDict", + "Period", "PromptTokensDetails", "PromptTokensDetailsTypedDict", "Provider", @@ -1208,6 +1268,7 @@ __all__ = [ "RateLimit", "RateLimitTypedDict", "Region", + "ResponseFormat", "Result", "ResultTypedDict", "Role", @@ -1219,9 +1280,14 @@ __all__ = [ "SendChatCompletionRequestResponseTypedDict", "Source", "Subcategory", + "SubmitGenerationFeedbackGlobals", + "SubmitGenerationFeedbackGlobalsTypedDict", + "SubmitGenerationFeedbackRequest", + "SubmitGenerationFeedbackRequestTypedDict", "TaskType", "TimeRange", "TimeRangeTypedDict", + "TimestampGranularities", "TypeImageURL", "TypeText", "UpdateBYOKKeyGlobals", @@ -1251,6 +1317,8 @@ __all__ = [ "UpdateWorkspaceGlobalsTypedDict", "UpdateWorkspaceRequest", "UpdateWorkspaceRequestTypedDict", + "UploadFileFile", + "UploadFileFileTypedDict", "UploadFileGlobals", "UploadFileGlobalsTypedDict", "UploadFileRequest", @@ -1266,6 +1334,8 @@ __all__ = [ "Value1TypedDict", "Value2", "Value2TypedDict", + "ValueClassifierFilters", + "ValueClassifierFiltersTypedDict", "ValueType", "Window", "Zdr", @@ -1304,6 +1374,16 @@ _dynamic_imports: dict[str, str] = { "CreateAudioTranscriptionsGlobalsTypedDict": ".createaudiotranscriptions", "CreateAudioTranscriptionsRequest": ".createaudiotranscriptions", "CreateAudioTranscriptionsRequestTypedDict": ".createaudiotranscriptions", + "CreateAudioTranscriptionsMultipartFile": ".createaudiotranscriptions_multipart", + "CreateAudioTranscriptionsMultipartFileTypedDict": ".createaudiotranscriptions_multipart", + "CreateAudioTranscriptionsMultipartGlobals": ".createaudiotranscriptions_multipart", + "CreateAudioTranscriptionsMultipartGlobalsTypedDict": ".createaudiotranscriptions_multipart", + "CreateAudioTranscriptionsMultipartRequest": ".createaudiotranscriptions_multipart", + "CreateAudioTranscriptionsMultipartRequestBody": ".createaudiotranscriptions_multipart", + "CreateAudioTranscriptionsMultipartRequestBodyTypedDict": ".createaudiotranscriptions_multipart", + "CreateAudioTranscriptionsMultipartRequestTypedDict": ".createaudiotranscriptions_multipart", + "ResponseFormat": ".createaudiotranscriptions_multipart", + "TimestampGranularities": ".createaudiotranscriptions_multipart", "CreateAuthKeysCodeCodeChallengeMethod": ".createauthkeyscode", "CreateAuthKeysCodeData": ".createauthkeyscode", "CreateAuthKeysCodeDataTypedDict": ".createauthkeyscode", @@ -1326,8 +1406,6 @@ _dynamic_imports: dict[str, str] = { "ContentText": ".createembeddings", "ContentTextTypedDict": ".createembeddings", "ContentTypedDict": ".createembeddings", - "CostDetails": ".createembeddings", - "CostDetailsTypedDict": ".createembeddings", "CreateEmbeddingsData": ".createembeddings", "CreateEmbeddingsDataTypedDict": ".createembeddings", "CreateEmbeddingsGlobals": ".createembeddings", @@ -1559,6 +1637,8 @@ _dynamic_imports: dict[str, str] = { "GetModelsGlobalsTypedDict": ".getmodels", "GetModelsRequest": ".getmodels", "GetModelsRequestTypedDict": ".getmodels", + "GetModelsResponse": ".getmodels", + "GetModelsResponseTypedDict": ".getmodels", "GetModelsSort": ".getmodels", "Region": ".getmodels", "Zdr": ".getmodels", @@ -1574,10 +1654,15 @@ _dynamic_imports: dict[str, str] = { "GetPresetVersionGlobalsTypedDict": ".getpresetversion", "GetPresetVersionRequest": ".getpresetversion", "GetPresetVersionRequestTypedDict": ".getpresetversion", + "ContextBucket": ".getrankingsdaily", + "GetRankingsDailyCategory": ".getrankingsdaily", "GetRankingsDailyGlobals": ".getrankingsdaily", "GetRankingsDailyGlobalsTypedDict": ".getrankingsdaily", "GetRankingsDailyRequest": ".getrankingsdaily", "GetRankingsDailyRequestTypedDict": ".getrankingsdaily", + "LanguageType": ".getrankingsdaily", + "Modality": ".getrankingsdaily", + "Period": ".getrankingsdaily", "GetTaskClassificationsGlobals": ".gettaskclassifications", "GetTaskClassificationsGlobalsTypedDict": ".gettaskclassifications", "GetTaskClassificationsRequest": ".gettaskclassifications", @@ -1614,6 +1699,8 @@ _dynamic_imports: dict[str, str] = { "ListEmbeddingsModelsGlobalsTypedDict": ".listembeddingsmodels", "ListEmbeddingsModelsRequest": ".listembeddingsmodels", "ListEmbeddingsModelsRequestTypedDict": ".listembeddingsmodels", + "ListEmbeddingsModelsResponse": ".listembeddingsmodels", + "ListEmbeddingsModelsResponseTypedDict": ".listembeddingsmodels", "ListEndpointsGlobals": ".listendpoints", "ListEndpointsGlobalsTypedDict": ".listendpoints", "ListEndpointsRequest": ".listendpoints", @@ -1682,6 +1769,8 @@ _dynamic_imports: dict[str, str] = { "ListModelsUserGlobalsTypedDict": ".listmodelsuser", "ListModelsUserRequest": ".listmodelsuser", "ListModelsUserRequestTypedDict": ".listmodelsuser", + "ListModelsUserResponse": ".listmodelsuser", + "ListModelsUserResponseTypedDict": ".listmodelsuser", "ListModelsUserSecurity": ".listmodelsuser", "ListModelsUserSecurityTypedDict": ".listmodelsuser", "ListObservabilityDestinationsGlobals": ".listobservabilitydestinations", @@ -1747,6 +1836,14 @@ _dynamic_imports: dict[str, str] = { "ListWorkspacesRequestTypedDict": ".listworkspaces", "ListWorkspacesResponse": ".listworkspaces", "ListWorkspacesResponseTypedDict": ".listworkspaces", + "ClassifierDimensions": ".queryanalytics", + "ClassifierDimensionsTypedDict": ".queryanalytics", + "ClassifierFilters": ".queryanalytics", + "ClassifierFiltersFilter": ".queryanalytics", + "ClassifierFiltersFilterTypedDict": ".queryanalytics", + "ClassifierFiltersTypedDict": ".queryanalytics", + "ClassifierFiltersValue": ".queryanalytics", + "ClassifierFiltersValueTypedDict": ".queryanalytics", "Direction": ".queryanalytics", "Filter": ".queryanalytics", "FilterTypedDict": ".queryanalytics", @@ -1772,12 +1869,18 @@ _dynamic_imports: dict[str, str] = { "Value1TypedDict": ".queryanalytics", "Value2": ".queryanalytics", "Value2TypedDict": ".queryanalytics", + "ValueClassifierFilters": ".queryanalytics", + "ValueClassifierFiltersTypedDict": ".queryanalytics", "SendChatCompletionRequestGlobals": ".sendchatcompletionrequest", "SendChatCompletionRequestGlobalsTypedDict": ".sendchatcompletionrequest", "SendChatCompletionRequestRequest": ".sendchatcompletionrequest", "SendChatCompletionRequestRequestTypedDict": ".sendchatcompletionrequest", "SendChatCompletionRequestResponse": ".sendchatcompletionrequest", "SendChatCompletionRequestResponseTypedDict": ".sendchatcompletionrequest", + "SubmitGenerationFeedbackGlobals": ".submitgenerationfeedback", + "SubmitGenerationFeedbackGlobalsTypedDict": ".submitgenerationfeedback", + "SubmitGenerationFeedbackRequest": ".submitgenerationfeedback", + "SubmitGenerationFeedbackRequestTypedDict": ".submitgenerationfeedback", "UpdateBYOKKeyGlobals": ".updatebyokkey", "UpdateBYOKKeyGlobalsTypedDict": ".updatebyokkey", "UpdateBYOKKeyRequest": ".updatebyokkey", @@ -1805,8 +1908,8 @@ _dynamic_imports: dict[str, str] = { "UpdateWorkspaceGlobalsTypedDict": ".updateworkspace", "UpdateWorkspaceRequest": ".updateworkspace", "UpdateWorkspaceRequestTypedDict": ".updateworkspace", - "File": ".uploadfile", - "FileTypedDict": ".uploadfile", + "UploadFileFile": ".uploadfile", + "UploadFileFileTypedDict": ".uploadfile", "UploadFileGlobals": ".uploadfile", "UploadFileGlobalsTypedDict": ".uploadfile", "UploadFileRequest": ".uploadfile", diff --git a/src/openrouter/operations/createaudiotranscriptions_multipart.py b/src/openrouter/operations/createaudiotranscriptions_multipart.py new file mode 100644 index 0000000..ff5459e --- /dev/null +++ b/src/openrouter/operations/createaudiotranscriptions_multipart.py @@ -0,0 +1,270 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import io +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + MultipartFormMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import IO, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateAudioTranscriptionsMultipartGlobalsTypedDict(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 CreateAudioTranscriptionsMultipartGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class CreateAudioTranscriptionsMultipartFileTypedDict(TypedDict): + file_name: str + content: Union[bytes, IO[bytes], io.IOBase] + content_type: NotRequired[str] + + +class CreateAudioTranscriptionsMultipartFile(BaseModel): + file_name: Annotated[ + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) + ] + + content: Annotated[ + Union[bytes, IO[bytes], io.IOBase], + pydantic.Field(alias=""), + FieldMetadata(multipart=MultipartFormMetadata(content=True)), + ] + + content_type: Annotated[ + Optional[str], + pydantic.Field(alias="Content-Type"), + FieldMetadata(multipart=True), + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["contentType"]) + 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 + + +ResponseFormat = Union[ + Literal[ + "json", + "verbose_json", + ], + UnrecognizedStr, +] +r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).""" + + +TimestampGranularities = Union[ + Literal[ + "word", + "segment", + ], + UnrecognizedStr, +] + + +class CreateAudioTranscriptionsMultipartRequestBodyTypedDict(TypedDict): + file: CreateAudioTranscriptionsMultipartFileTypedDict + r"""The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio.""" + model: str + r"""The model to use for transcription.""" + language: NotRequired[str] + r"""The language of the input audio (ISO-639-1).""" + response_format: NotRequired[ResponseFormat] + r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).""" + temperature: NotRequired[float] + r"""The sampling temperature.""" + timestamp_granularities: NotRequired[List[TimestampGranularities]] + r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array.""" + + +class CreateAudioTranscriptionsMultipartRequestBody(BaseModel): + file: Annotated[ + CreateAudioTranscriptionsMultipartFile, + FieldMetadata(multipart=MultipartFormMetadata(file=True)), + ] + r"""The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio.""" + + model: Annotated[str, FieldMetadata(multipart=True)] + r"""The model to use for transcription.""" + + language: Annotated[Optional[str], FieldMetadata(multipart=True)] = None + r"""The language of the input audio (ISO-639-1).""" + + response_format: Annotated[ + Optional[ResponseFormat], FieldMetadata(multipart=True) + ] = None + r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).""" + + temperature: Annotated[Optional[float], FieldMetadata(multipart=True)] = None + r"""The sampling temperature.""" + + timestamp_granularities: Annotated[ + Optional[List[TimestampGranularities]], + pydantic.Field(alias="timestamp_granularities[]"), + FieldMetadata(multipart=True), + ] = None + r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["language", "response_format", "temperature", "timestamp_granularities[]"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class CreateAudioTranscriptionsMultipartRequestTypedDict(TypedDict): + request_body: CreateAudioTranscriptionsMultipartRequestBodyTypedDict + 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 CreateAudioTranscriptionsMultipartRequest(BaseModel): + request_body: Annotated[ + CreateAudioTranscriptionsMultipartRequestBody, + FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/createembeddings.py b/src/openrouter/operations/createembeddings.py index 699e986..a7fed8e 100644 --- a/src/openrouter/operations/createembeddings.py +++ b/src/openrouter/operations/createembeddings.py @@ -5,6 +5,7 @@ from openrouter.components import ( contentpartinputaudio as components_contentpartinputaudio, contentpartinputfile as components_contentpartinputfile, contentpartinputvideo as components_contentpartinputvideo, + costdetails as components_costdetails, providerpreferences as components_providerpreferences, ) from openrouter.types import ( @@ -383,49 +384,6 @@ class CreateEmbeddingsData(BaseModel): Object = Literal["list",] -class CostDetailsTypedDict(TypedDict): - r"""Breakdown of upstream inference costs""" - - upstream_inference_completions_cost: float - upstream_inference_prompt_cost: float - upstream_inference_cost: NotRequired[Nullable[float]] - - -class CostDetails(BaseModel): - r"""Breakdown of upstream inference costs""" - - upstream_inference_completions_cost: float - - upstream_inference_prompt_cost: float - - upstream_inference_cost: OptionalNullable[float] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["upstream_inference_cost"]) - nullable_fields = set(["upstream_inference_cost"]) - 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 PromptTokensDetailsTypedDict(TypedDict): r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.""" @@ -493,7 +451,7 @@ class CreateEmbeddingsUsageTypedDict(TypedDict): r"""Total number of tokens used""" cost: NotRequired[float] r"""Cost of the request in credits""" - cost_details: NotRequired[Nullable[CostDetailsTypedDict]] + cost_details: NotRequired[Nullable[components_costdetails.CostDetailsTypedDict]] r"""Breakdown of upstream inference costs""" is_byok: NotRequired[bool] r"""Whether a request was made using a Bring Your Own Key configuration""" @@ -513,7 +471,7 @@ class CreateEmbeddingsUsage(BaseModel): cost: Optional[float] = None r"""Cost of the request in credits""" - cost_details: OptionalNullable[CostDetails] = UNSET + cost_details: OptionalNullable[components_costdetails.CostDetails] = UNSET r"""Breakdown of upstream inference costs""" is_byok: Optional[bool] = None diff --git a/src/openrouter/operations/getmodels.py b/src/openrouter/operations/getmodels.py index af887b9..de85546 100644 --- a/src/openrouter/operations/getmodels.py +++ b/src/openrouter/operations/getmodels.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from openrouter.components import modelslistresponse as components_modelslistresponse from openrouter.types import ( BaseModel, Nullable, @@ -12,7 +13,7 @@ from openrouter.types import ( from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Literal, Optional, Union +from typing import Awaitable, Callable, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -111,11 +112,13 @@ GetModelsSort = Union[ "throughput-high-to-low", "latency-low-to-high", "intelligence-high-to-low", + "coding-high-to-low", + "agentic-high-to-low", "design-arena-elo-high-to-low", ], UnrecognizedStr, ] -r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" +r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" Distillable = Union[ @@ -150,6 +153,10 @@ class GetModelsRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + offset: NotRequired[int] + r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" + limit: NotRequired[int] + r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" category: NotRequired[GetModelsCategory] r"""Filter models by use case category""" supported_parameters: NotRequired[str] @@ -157,7 +164,7 @@ class GetModelsRequestTypedDict(TypedDict): output_modalities: NotRequired[str] r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".""" sort: NotRequired[GetModelsSort] - r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" + r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" q: NotRequired[str] r"""Free-text search by model name or slug.""" input_modalities: NotRequired[str] @@ -180,6 +187,30 @@ class GetModelsRequestTypedDict(TypedDict): r"""When set to \"true\", return only models with zero data retention endpoints.""" region: NotRequired[Region] r"""Filter to models with endpoints in the given data region. Currently only \"eu\" is supported.""" + min_output_price: NotRequired[Nullable[float]] + r"""Minimum completion (output) price in $/M tokens.""" + max_output_price: NotRequired[Nullable[float]] + r"""Maximum completion (output) price in $/M tokens.""" + min_age_days: NotRequired[Nullable[int]] + r"""Minimum model age in days since its creation date.""" + max_age_days: NotRequired[Nullable[int]] + r"""Maximum model age in days since its creation date.""" + min_intelligence_index: NotRequired[Nullable[float]] + r"""Minimum Artificial Analysis intelligence index.""" + max_intelligence_index: NotRequired[Nullable[float]] + r"""Maximum Artificial Analysis intelligence index.""" + min_coding_index: NotRequired[Nullable[float]] + r"""Minimum Artificial Analysis coding index.""" + max_coding_index: NotRequired[Nullable[float]] + r"""Maximum Artificial Analysis coding index.""" + min_agentic_index: NotRequired[Nullable[float]] + r"""Minimum Artificial Analysis agentic index.""" + max_agentic_index: NotRequired[Nullable[float]] + r"""Maximum Artificial Analysis agentic index.""" + min_tool_success_rate: NotRequired[Nullable[float]] + r"""Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason).""" + max_tool_success_rate: NotRequired[Nullable[float]] + r"""Maximum tool-calling success rate, as a fraction in [0, 1].""" class GetModelsRequest(BaseModel): @@ -211,6 +242,18 @@ class GetModelsRequest(BaseModel): """ + offset: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 500 + r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" + category: Annotated[ Optional[GetModelsCategory], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -233,7 +276,7 @@ class GetModelsRequest(BaseModel): Optional[GetModelsSort], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" + r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" q: Annotated[ Optional[str], @@ -301,6 +344,78 @@ class GetModelsRequest(BaseModel): ] = None r"""Filter to models with endpoints in the given data region. Currently only \"eu\" is supported.""" + min_output_price: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Minimum completion (output) price in $/M tokens.""" + + max_output_price: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Maximum completion (output) price in $/M tokens.""" + + min_age_days: Annotated[ + OptionalNullable[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Minimum model age in days since its creation date.""" + + max_age_days: Annotated[ + OptionalNullable[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Maximum model age in days since its creation date.""" + + min_intelligence_index: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Minimum Artificial Analysis intelligence index.""" + + max_intelligence_index: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Maximum Artificial Analysis intelligence index.""" + + min_coding_index: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Minimum Artificial Analysis coding index.""" + + max_coding_index: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Maximum Artificial Analysis coding index.""" + + min_agentic_index: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Minimum Artificial Analysis agentic index.""" + + max_agentic_index: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Maximum Artificial Analysis agentic index.""" + + min_tool_success_rate: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason).""" + + max_tool_success_rate: Annotated[ + OptionalNullable[float], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Maximum tool-calling success rate, as a fraction in [0, 1].""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -308,6 +423,8 @@ class GetModelsRequest(BaseModel): "HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories", + "offset", + "limit", "category", "supported_parameters", "output_modalities", @@ -323,9 +440,38 @@ class GetModelsRequest(BaseModel): "distillable", "zdr", "region", + "min_output_price", + "max_output_price", + "min_age_days", + "max_age_days", + "min_intelligence_index", + "max_intelligence_index", + "min_coding_index", + "max_coding_index", + "min_agentic_index", + "max_agentic_index", + "min_tool_success_rate", + "max_tool_success_rate", + ] + ) + nullable_fields = set( + [ + "min_price", + "max_price", + "min_output_price", + "max_output_price", + "min_age_days", + "max_age_days", + "min_intelligence_index", + "max_intelligence_index", + "min_coding_index", + "max_coding_index", + "min_agentic_index", + "max_agentic_index", + "min_tool_success_rate", + "max_tool_success_rate", ] ) - nullable_fields = set(["min_price", "max_price"]) serialized = handler(self) m = {} @@ -346,3 +492,16 @@ class GetModelsRequest(BaseModel): m[k] = val return m + + +class GetModelsResponseTypedDict(TypedDict): + result: components_modelslistresponse.ModelsListResponseTypedDict + + +class GetModelsResponse(BaseModel): + next: Union[ + Callable[[], Optional[GetModelsResponse]], + Callable[[], Awaitable[Optional[GetModelsResponse]]], + ] + + result: components_modelslistresponse.ModelsListResponse diff --git a/src/openrouter/operations/getrankingsdaily.py b/src/openrouter/operations/getrankingsdaily.py index efa494f..fb9267c 100644 --- a/src/openrouter/operations/getrankingsdaily.py +++ b/src/openrouter/operations/getrankingsdaily.py @@ -1,11 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional +from typing import Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -73,6 +73,73 @@ class GetRankingsDailyGlobals(BaseModel): return m +Period = Union[ + Literal[ + "day", + "week", + "month", + ], + UnrecognizedStr, +] +r"""Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.""" + + +Modality = Union[ + Literal[ + "text", + "image", + "image_output", + "audio", + "tool_calling", + ], + UnrecognizedStr, +] +r"""Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.""" + + +ContextBucket = Union[ + Literal[ + "1K", + "10K", + "100K", + "1M", + "10M", + ], + UnrecognizedStr, +] +r"""Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.""" + + +GetRankingsDailyCategory = Union[ + Literal[ + "programming", + "roleplay", + "marketing", + "marketing/seo", + "technology", + "science", + "translation", + "legal", + "finance", + "health", + "trivia", + "academia", + ], + UnrecognizedStr, +] +r"""Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.""" + + +LanguageType = Union[ + Literal[ + "natural", + "programming", + ], + UnrecognizedStr, +] +r"""Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.""" + + class GetRankingsDailyRequestTypedDict(TypedDict): http_referer: NotRequired[str] r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -91,6 +158,16 @@ class GetRankingsDailyRequestTypedDict(TypedDict): r"""Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.""" end_date: NotRequired[str] r"""End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.""" + period: NotRequired[Period] + r"""Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.""" + modality: NotRequired[Modality] + r"""Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.""" + context_bucket: NotRequired[ContextBucket] + r"""Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.""" + category: NotRequired[GetRankingsDailyCategory] + r"""Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.""" + language_type: NotRequired[LanguageType] + r"""Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.""" class GetRankingsDailyRequest(BaseModel): @@ -134,6 +211,36 @@ class GetRankingsDailyRequest(BaseModel): ] = None r"""End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.""" + period: Annotated[ + Optional[Period], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.""" + + modality: Annotated[ + Optional[Modality], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.""" + + context_bucket: Annotated[ + Optional[ContextBucket], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.""" + + category: Annotated[ + Optional[GetRankingsDailyCategory], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.""" + + language_type: Annotated[ + Optional[LanguageType], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -143,6 +250,11 @@ class GetRankingsDailyRequest(BaseModel): "X-OpenRouter-Categories", "start_date", "end_date", + "period", + "modality", + "context_bucket", + "category", + "language_type", ] ) serialized = handler(self) diff --git a/src/openrouter/operations/listbyokkeys.py b/src/openrouter/operations/listbyokkeys.py index 2ec0772..c7d75c7 100644 --- a/src/openrouter/operations/listbyokkeys.py +++ b/src/openrouter/operations/listbyokkeys.py @@ -103,6 +103,7 @@ Provider = Union[ "crusoe", "darkbloom", "decart", + "deepgram", "deepinfra", "deepseek", "dekallm", @@ -126,6 +127,7 @@ Provider = Union[ "liquid", "mancer", "mara", + "meta", "minimax", "mistral", "modelrun", @@ -149,7 +151,8 @@ Provider = Union[ "recraft", "reka", "relace", - "sakana-ai", + "sail-research", + "sakana", "sambanova", "seed", "siliconflow", @@ -228,13 +231,13 @@ class ListBYOKKeysRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" workspace_id: Annotated[ diff --git a/src/openrouter/operations/listembeddingsmodels.py b/src/openrouter/operations/listembeddingsmodels.py index a019232..016f0b9 100644 --- a/src/openrouter/operations/listembeddingsmodels.py +++ b/src/openrouter/operations/listembeddingsmodels.py @@ -1,11 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from openrouter.components import modelslistresponse as components_modelslistresponse from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata +from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional +from typing import Awaitable, Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -87,6 +88,10 @@ class ListEmbeddingsModelsRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + offset: NotRequired[int] + r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" + limit: NotRequired[int] + r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" class ListEmbeddingsModelsRequest(BaseModel): @@ -118,10 +123,28 @@ class ListEmbeddingsModelsRequest(BaseModel): """ + offset: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 500 + r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "offset", + "limit", + ] ) serialized = handler(self) m = {} @@ -135,3 +158,16 @@ class ListEmbeddingsModelsRequest(BaseModel): m[k] = val return m + + +class ListEmbeddingsModelsResponseTypedDict(TypedDict): + result: components_modelslistresponse.ModelsListResponseTypedDict + + +class ListEmbeddingsModelsResponse(BaseModel): + next: Union[ + Callable[[], Optional[ListEmbeddingsModelsResponse]], + Callable[[], Awaitable[Optional[ListEmbeddingsModelsResponse]]], + ] + + result: components_modelslistresponse.ModelsListResponse diff --git a/src/openrouter/operations/listguardrailkeyassignments.py b/src/openrouter/operations/listguardrailkeyassignments.py index e7a2c31..90f2672 100644 --- a/src/openrouter/operations/listguardrailkeyassignments.py +++ b/src/openrouter/operations/listguardrailkeyassignments.py @@ -140,13 +140,13 @@ class ListGuardrailKeyAssignmentsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listguardrailmemberassignments.py b/src/openrouter/operations/listguardrailmemberassignments.py index 84076b7..4ff5780 100644 --- a/src/openrouter/operations/listguardrailmemberassignments.py +++ b/src/openrouter/operations/listguardrailmemberassignments.py @@ -140,13 +140,13 @@ class ListGuardrailMemberAssignmentsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listguardrails.py b/src/openrouter/operations/listguardrails.py index 461e691..1e36035 100644 --- a/src/openrouter/operations/listguardrails.py +++ b/src/openrouter/operations/listguardrails.py @@ -130,13 +130,13 @@ class ListGuardrailsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" workspace_id: Annotated[ diff --git a/src/openrouter/operations/listkeyassignments.py b/src/openrouter/operations/listkeyassignments.py index 2aee3fc..f9ccb3d 100644 --- a/src/openrouter/operations/listkeyassignments.py +++ b/src/openrouter/operations/listkeyassignments.py @@ -128,13 +128,13 @@ class ListKeyAssignmentsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listmemberassignments.py b/src/openrouter/operations/listmemberassignments.py index f8e0b65..60c04be 100644 --- a/src/openrouter/operations/listmemberassignments.py +++ b/src/openrouter/operations/listmemberassignments.py @@ -128,13 +128,13 @@ class ListMemberAssignmentsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listmodelsuser.py b/src/openrouter/operations/listmodelsuser.py index 6070772..d2a24e4 100644 --- a/src/openrouter/operations/listmodelsuser.py +++ b/src/openrouter/operations/listmodelsuser.py @@ -1,11 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from openrouter.components import modelslistresponse as components_modelslistresponse from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, SecurityMetadata +from openrouter.utils import ( + FieldMetadata, + HeaderMetadata, + QueryParamMetadata, + SecurityMetadata, +) import pydantic from pydantic import model_serializer -from typing import Optional +from typing import Awaitable, Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -105,6 +111,10 @@ class ListModelsUserRequestTypedDict(TypedDict): r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. """ + offset: NotRequired[int] + r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" + limit: NotRequired[int] + r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" class ListModelsUserRequest(BaseModel): @@ -136,10 +146,28 @@ class ListModelsUserRequest(BaseModel): """ + offset: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 500 + r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "offset", + "limit", + ] ) serialized = handler(self) m = {} @@ -153,3 +181,16 @@ class ListModelsUserRequest(BaseModel): m[k] = val return m + + +class ListModelsUserResponseTypedDict(TypedDict): + result: components_modelslistresponse.ModelsListResponseTypedDict + + +class ListModelsUserResponse(BaseModel): + next: Union[ + Callable[[], Optional[ListModelsUserResponse]], + Callable[[], Awaitable[Optional[ListModelsUserResponse]]], + ] + + result: components_modelslistresponse.ModelsListResponse diff --git a/src/openrouter/operations/listobservabilitydestinations.py b/src/openrouter/operations/listobservabilitydestinations.py index 465e357..818784f 100644 --- a/src/openrouter/operations/listobservabilitydestinations.py +++ b/src/openrouter/operations/listobservabilitydestinations.py @@ -130,13 +130,13 @@ class ListObservabilityDestinationsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" workspace_id: Annotated[ diff --git a/src/openrouter/operations/listorganizationmembers.py b/src/openrouter/operations/listorganizationmembers.py index 15662f4..06825ee 100644 --- a/src/openrouter/operations/listorganizationmembers.py +++ b/src/openrouter/operations/listorganizationmembers.py @@ -125,13 +125,13 @@ class ListOrganizationMembersRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listpresets.py b/src/openrouter/operations/listpresets.py index bf21a24..23c66e8 100644 --- a/src/openrouter/operations/listpresets.py +++ b/src/openrouter/operations/listpresets.py @@ -126,13 +126,13 @@ class ListPresetsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listpresetversions.py b/src/openrouter/operations/listpresetversions.py index 36052fb..1224fee 100644 --- a/src/openrouter/operations/listpresetversions.py +++ b/src/openrouter/operations/listpresetversions.py @@ -140,13 +140,13 @@ class ListPresetVersionsRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listworkspacemembers.py b/src/openrouter/operations/listworkspacemembers.py index 9a8706f..ff41be4 100644 --- a/src/openrouter/operations/listworkspacemembers.py +++ b/src/openrouter/operations/listworkspacemembers.py @@ -140,13 +140,13 @@ class ListWorkspaceMembersRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/listworkspaces.py b/src/openrouter/operations/listworkspaces.py index a242ff3..59f628e 100644 --- a/src/openrouter/operations/listworkspaces.py +++ b/src/openrouter/operations/listworkspaces.py @@ -128,13 +128,13 @@ class ListWorkspacesRequest(BaseModel): offset: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 0 r"""Number of records to skip for pagination""" limit: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None + ] = 50 r"""Maximum number of records to return (max 100)""" @model_serializer(mode="wrap") diff --git a/src/openrouter/operations/queryanalytics.py b/src/openrouter/operations/queryanalytics.py index 705a3ea..23f2f93 100644 --- a/src/openrouter/operations/queryanalytics.py +++ b/src/openrouter/operations/queryanalytics.py @@ -74,6 +74,102 @@ class QueryAnalyticsGlobals(BaseModel): return m +class ClassifierDimensionsTypedDict(TypedDict): + r"""Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.""" + + classifier_id: str + r"""UUID of the classifier whose tags to group by.""" + dimension_names: NotRequired[List[str]] + include_nulls: NotRequired[bool] + r"""When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations.""" + + +class ClassifierDimensions(BaseModel): + r"""Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.""" + + classifier_id: str + r"""UUID of the classifier whose tags to group by.""" + + dimension_names: Optional[List[str]] = None + + include_nulls: Optional[bool] = None + r"""When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["dimension_names", "include_nulls"]) + 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 + + +ValueClassifierFiltersTypedDict = TypeAliasType( + "ValueClassifierFiltersTypedDict", Union[str, float] +) + + +ValueClassifierFilters = TypeAliasType("ValueClassifierFilters", Union[str, float]) + + +ClassifierFiltersValueTypedDict = TypeAliasType( + "ClassifierFiltersValueTypedDict", + Union[str, float, List[ValueClassifierFiltersTypedDict]], +) +r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" + + +ClassifierFiltersValue = TypeAliasType( + "ClassifierFiltersValue", Union[str, float, List[ValueClassifierFilters]] +) +r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" + + +class ClassifierFiltersFilterTypedDict(TypedDict): + field: str + r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" + operator: str + r"""Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.""" + value: ClassifierFiltersValueTypedDict + r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" + + +class ClassifierFiltersFilter(BaseModel): + field: str + r"""Classifier dimension name to filter on (snake_case identifier, e.g. \"department\", \"work_type\").""" + + operator: str + r"""Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.""" + + value: ClassifierFiltersValue + r"""Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.""" + + +class ClassifierFiltersTypedDict(TypedDict): + r"""Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.""" + + classifier_id: str + r"""UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.""" + filters: List[ClassifierFiltersFilterTypedDict] + + +class ClassifierFilters(BaseModel): + r"""Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.""" + + classifier_id: str + r"""UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.""" + + filters: List[ClassifierFiltersFilter] + + Value2TypedDict = TypeAliasType("Value2TypedDict", Union[str, float]) @@ -145,6 +241,10 @@ class TimeRange(BaseModel): class QueryAnalyticsRequestBodyTypedDict(TypedDict): metrics: List[str] + classifier_dimensions: NotRequired[ClassifierDimensionsTypedDict] + r"""Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.""" + classifier_filters: NotRequired[ClassifierFiltersTypedDict] + r"""Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.""" dimensions: NotRequired[List[str]] filters: NotRequired[List[FilterTypedDict]] granularity: NotRequired[str] @@ -160,6 +260,12 @@ class QueryAnalyticsRequestBodyTypedDict(TypedDict): class QueryAnalyticsRequestBody(BaseModel): metrics: List[str] + classifier_dimensions: Optional[ClassifierDimensions] = None + r"""Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.""" + + classifier_filters: Optional[ClassifierFilters] = None + r"""Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.""" + dimensions: Optional[List[str]] = None filters: Optional[List[Filter]] = None @@ -181,6 +287,8 @@ class QueryAnalyticsRequestBody(BaseModel): def serialize_model(self, handler): optional_fields = set( [ + "classifier_dimensions", + "classifier_filters", "dimensions", "filters", "granularity", diff --git a/src/openrouter/operations/submitgenerationfeedback.py b/src/openrouter/operations/submitgenerationfeedback.py new file mode 100644 index 0000000..878e3ec --- /dev/null +++ b/src/openrouter/operations/submitgenerationfeedback.py @@ -0,0 +1,146 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + submitgenerationfeedbackrequest as components_submitgenerationfeedbackrequest, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, RequestMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SubmitGenerationFeedbackGlobalsTypedDict(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 SubmitGenerationFeedbackGlobals(BaseModel): + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class SubmitGenerationFeedbackRequestTypedDict(TypedDict): + submit_generation_feedback_request: components_submitgenerationfeedbackrequest.SubmitGenerationFeedbackRequestTypedDict + 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 SubmitGenerationFeedbackRequest(BaseModel): + submit_generation_feedback_request: Annotated[ + components_submitgenerationfeedbackrequest.SubmitGenerationFeedbackRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/uploadfile.py b/src/openrouter/operations/uploadfile.py index 29a37b9..fa8f926 100644 --- a/src/openrouter/operations/uploadfile.py +++ b/src/openrouter/operations/uploadfile.py @@ -80,13 +80,13 @@ class UploadFileGlobals(BaseModel): return m -class FileTypedDict(TypedDict): +class UploadFileFileTypedDict(TypedDict): file_name: str content: Union[bytes, IO[bytes], io.IOBase] content_type: NotRequired[str] -class File(BaseModel): +class UploadFileFile(BaseModel): file_name: Annotated[ str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) ] @@ -121,11 +121,13 @@ class File(BaseModel): class UploadFileRequestBodyTypedDict(TypedDict): - file: FileTypedDict + file: UploadFileFileTypedDict class UploadFileRequestBody(BaseModel): - file: Annotated[File, FieldMetadata(multipart=MultipartFormMetadata(file=True))] + file: Annotated[ + UploadFileFile, FieldMetadata(multipart=MultipartFormMetadata(file=True)) + ] class UploadFileRequestTypedDict(TypedDict): diff --git a/src/openrouter/organization.py b/src/openrouter/organization.py index d24bfa8..31c74ed 100644 --- a/src/openrouter/organization.py +++ b/src/openrouter/organization.py @@ -19,8 +19,8 @@ class Organization(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -123,7 +123,7 @@ class Organization(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -182,8 +182,8 @@ class Organization(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -291,7 +291,7 @@ class Organization(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) diff --git a/src/openrouter/presets.py b/src/openrouter/presets.py index 83085f6..8326894 100644 --- a/src/openrouter/presets.py +++ b/src/openrouter/presets.py @@ -19,8 +19,8 @@ class Presets(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -126,7 +126,7 @@ class Presets(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -185,8 +185,8 @@ class Presets(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -295,7 +295,7 @@ class Presets(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -664,6 +664,10 @@ class Presets(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -736,7 +740,7 @@ class Presets(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -752,6 +756,8 @@ class Presets(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -825,6 +831,11 @@ class Presets(BaseSDK): plugins, Optional[List[components.ChatRequestPlugin]] ), presence_penalty=presence_penalty, + prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -1011,6 +1022,10 @@ class Presets(BaseSDK): ] ] = None, presence_penalty: OptionalNullable[float] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1083,7 +1098,7 @@ class Presets(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: Frequency penalty (-2.0 to 2.0) :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1099,6 +1114,8 @@ class Presets(BaseSDK): :param parallel_tool_calls: Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. :param plugins: Plugins you want to enable for this request, including their settings. :param presence_penalty: Presence penalty (-2.0 to 2.0) + :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1172,6 +1189,11 @@ class Presets(BaseSDK): plugins, Optional[List[components.ChatRequestPlugin]] ), presence_penalty=presence_penalty, + prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -1420,7 +1442,7 @@ class Presets(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param context_management: :param fallbacks: Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. :param max_tokens: @@ -1732,7 +1754,7 @@ class Presets(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param context_management: :param fallbacks: Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. :param max_tokens: @@ -1989,6 +2011,9 @@ class Presets(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -2051,7 +2076,7 @@ class Presets(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -2070,6 +2095,7 @@ class Presets(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -2142,6 +2168,10 @@ class Presets(BaseSDK): prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -2333,6 +2363,9 @@ class Presets(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -2395,7 +2428,7 @@ class Presets(BaseSDK): :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -2414,6 +2447,7 @@ class Presets(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -2486,6 +2520,10 @@ class Presets(BaseSDK): prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -2633,8 +2671,8 @@ class Presets(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2742,7 +2780,7 @@ class Presets(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -2808,8 +2846,8 @@ class Presets(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2920,7 +2958,7 @@ class Presets(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) diff --git a/src/openrouter/responses.py b/src/openrouter/responses.py index 28b31f4..74419ce 100644 --- a/src/openrouter/responses.py +++ b/src/openrouter/responses.py @@ -74,6 +74,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -134,7 +137,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -153,6 +156,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -228,6 +232,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -288,7 +295,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -307,6 +314,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -382,6 +390,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -445,7 +456,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -464,6 +475,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -538,6 +550,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -601,7 +616,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -620,6 +635,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -692,6 +708,10 @@ class Responses(BaseSDK): prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), @@ -973,6 +993,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1033,7 +1056,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1052,6 +1075,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1127,6 +1151,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1187,7 +1214,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1206,6 +1233,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1281,6 +1309,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1344,7 +1375,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1363,6 +1394,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1437,6 +1469,9 @@ class Responses(BaseSDK): ] ] = UNSET, prompt_cache_key: OptionalNullable[str] = UNSET, + prompt_cache_options: OptionalNullable[ + Union[components.PromptCacheOptions, components.PromptCacheOptionsTypedDict] + ] = UNSET, provider: OptionalNullable[ Union[ components.ProviderPreferences, components.ProviderPreferencesTypedDict @@ -1500,7 +1535,7 @@ class Responses(BaseSDK): :param x_open_router_metadata: Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. :param background: - :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + :param cache_control: Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. :param debug: Debug options for inspecting request transformations (streaming only) :param frequency_penalty: :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. @@ -1519,6 +1554,7 @@ class Responses(BaseSDK): :param previous_response_id: :param prompt: :param prompt_cache_key: + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: @@ -1591,6 +1627,10 @@ class Responses(BaseSDK): prompt, OptionalNullable[components.StoredPromptTemplate] ), prompt_cache_key=prompt_cache_key, + prompt_cache_options=utils.get_pydantic_model( + prompt_cache_options, + OptionalNullable[components.PromptCacheOptions], + ), provider=utils.get_pydantic_model( provider, OptionalNullable[components.ProviderPreferences] ), diff --git a/src/openrouter/stt.py b/src/openrouter/stt.py index a5f03a7..4bcc6d0 100644 --- a/src/openrouter/stt.py +++ b/src/openrouter/stt.py @@ -6,7 +6,7 @@ from openrouter._hooks import HookContext from openrouter.types import OptionalNullable, UNSET from openrouter.utils import get_security_from_env from openrouter.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union +from typing import Any, Iterable, List, Mapping, Optional, Union class Stt(BaseSDK): @@ -24,7 +24,11 @@ class Stt(BaseSDK): provider: Optional[ Union[components.STTRequestProvider, components.STTRequestProviderTypedDict] ] = None, + response_format: Optional[components.STTRequestResponseFormat] = None, temperature: Optional[float] = None, + timestamp_granularities: Optional[ + Iterable[components.STTTimestampGranularity] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -32,7 +36,7 @@ class Stt(BaseSDK): ) -> components.STTResponse: r"""Create transcription - Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. + Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text. :param input_audio: Base64-encoded audio to transcribe :param model: STT model identifier @@ -45,7 +49,9 @@ class Stt(BaseSDK): :param language: ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted. :param provider: Provider-specific passthrough configuration + :param response_format: Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. :param temperature: Sampling temperature for transcription + :param timestamp_granularities: Timestamp detail levels to include when response_format is \"verbose_json\". \"segment\" returns segment-level timestamps; \"word\" additionally returns word-level timestamps in the words array. Ignored unless response_format is \"verbose_json\". :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 @@ -74,7 +80,12 @@ class Stt(BaseSDK): provider=utils.get_pydantic_model( provider, Optional[components.STTRequestProvider] ), + response_format=response_format, temperature=temperature, + timestamp_granularities=utils.unmarshal( + timestamp_granularities, + Optional[List[components.STTTimestampGranularity]], + ), ), ) @@ -210,7 +221,11 @@ class Stt(BaseSDK): provider: Optional[ Union[components.STTRequestProvider, components.STTRequestProviderTypedDict] ] = None, + response_format: Optional[components.STTRequestResponseFormat] = None, temperature: Optional[float] = None, + timestamp_granularities: Optional[ + Iterable[components.STTTimestampGranularity] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -218,7 +233,7 @@ class Stt(BaseSDK): ) -> components.STTResponse: r"""Create transcription - Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. + Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text. :param input_audio: Base64-encoded audio to transcribe :param model: STT model identifier @@ -231,7 +246,9 @@ class Stt(BaseSDK): :param language: ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted. :param provider: Provider-specific passthrough configuration + :param response_format: Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. :param temperature: Sampling temperature for transcription + :param timestamp_granularities: Timestamp detail levels to include when response_format is \"verbose_json\". \"segment\" returns segment-level timestamps; \"word\" additionally returns word-level timestamps in the words array. Ignored unless response_format is \"verbose_json\". :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 @@ -260,7 +277,12 @@ class Stt(BaseSDK): provider=utils.get_pydantic_model( provider, Optional[components.STTRequestProvider] ), + response_format=response_format, temperature=temperature, + timestamp_granularities=utils.unmarshal( + timestamp_granularities, + Optional[List[components.STTTimestampGranularity]], + ), ), ) @@ -383,3 +405,397 @@ class Stt(BaseSDK): ) raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def create_transcription_multipart( + self, + *, + file: Union[ + operations.CreateAudioTranscriptionsMultipartFile, + operations.CreateAudioTranscriptionsMultipartFileTypedDict, + ], + model: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + language: Optional[str] = None, + response_format: Optional[operations.ResponseFormat] = None, + temperature: Optional[float] = None, + timestamp_granularities: Optional[ + Iterable[operations.TimestampGranularities] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.STTResponse: + r"""Create transcription + + Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text. + + :param file: The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. + :param model: The model to use for transcription. + :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 language: The language of the input audio (ISO-639-1). + :param response_format: The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). + :param temperature: The sampling temperature. + :param timestamp_granularities: Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array. + :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.CreateAudioTranscriptionsMultipartRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + request_body=operations.CreateAudioTranscriptionsMultipartRequestBody( + file=utils.get_pydantic_model( + file, operations.CreateAudioTranscriptionsMultipartFile + ), + language=language, + model=model, + response_format=response_format, + temperature=temperature, + timestamp_granularities=utils.unmarshal( + timestamp_granularities, + Optional[List[operations.TimestampGranularities]], + ), + ), + ) + + req = self._build_request( + method="POST", + path="/audio/transcriptions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CreateAudioTranscriptionsMultipartGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "multipart", + operations.CreateAudioTranscriptionsMultipartRequestBody, + ), + 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="createAudioTranscriptions_multipart", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["STT"], + 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.STTResponse, 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, "402", "application/json"): + response_data = unmarshal_json_response( + errors.PaymentRequiredResponseErrorData, http_res + ) + raise errors.PaymentRequiredResponseError(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, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "524", "application/json"): + response_data = unmarshal_json_response( + errors.EdgeNetworkTimeoutResponseErrorData, http_res + ) + raise errors.EdgeNetworkTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "529", "application/json"): + response_data = unmarshal_json_response( + errors.ProviderOverloadedResponseErrorData, http_res + ) + raise errors.ProviderOverloadedResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def create_transcription_multipart_async( + self, + *, + file: Union[ + operations.CreateAudioTranscriptionsMultipartFile, + operations.CreateAudioTranscriptionsMultipartFileTypedDict, + ], + model: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + language: Optional[str] = None, + response_format: Optional[operations.ResponseFormat] = None, + temperature: Optional[float] = None, + timestamp_granularities: Optional[ + Iterable[operations.TimestampGranularities] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.STTResponse: + r"""Create transcription + + Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text. + + :param file: The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. + :param model: The model to use for transcription. + :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 language: The language of the input audio (ISO-639-1). + :param response_format: The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). + :param temperature: The sampling temperature. + :param timestamp_granularities: Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array. + :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.CreateAudioTranscriptionsMultipartRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + request_body=operations.CreateAudioTranscriptionsMultipartRequestBody( + file=utils.get_pydantic_model( + file, operations.CreateAudioTranscriptionsMultipartFile + ), + language=language, + model=model, + response_format=response_format, + temperature=temperature, + timestamp_granularities=utils.unmarshal( + timestamp_granularities, + Optional[List[operations.TimestampGranularities]], + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/audio/transcriptions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.CreateAudioTranscriptionsMultipartGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "multipart", + operations.CreateAudioTranscriptionsMultipartRequestBody, + ), + 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="createAudioTranscriptions_multipart", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["STT"], + 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.STTResponse, 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, "402", "application/json"): + response_data = unmarshal_json_response( + errors.PaymentRequiredResponseErrorData, http_res + ) + raise errors.PaymentRequiredResponseError(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, "502", "application/json"): + response_data = unmarshal_json_response( + errors.BadGatewayResponseErrorData, http_res + ) + raise errors.BadGatewayResponseError(response_data, http_res) + if utils.match_response(http_res, "503", "application/json"): + response_data = unmarshal_json_response( + errors.ServiceUnavailableResponseErrorData, http_res + ) + raise errors.ServiceUnavailableResponseError(response_data, http_res) + if utils.match_response(http_res, "524", "application/json"): + response_data = unmarshal_json_response( + errors.EdgeNetworkTimeoutResponseErrorData, http_res + ) + raise errors.EdgeNetworkTimeoutResponseError(response_data, http_res) + if utils.match_response(http_res, "529", "application/json"): + response_data = unmarshal_json_response( + errors.ProviderOverloadedResponseErrorData, http_res + ) + raise errors.ProviderOverloadedResponseError(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/tts.py b/src/openrouter/tts.py index 68ae54d..5ccc4b9 100644 --- a/src/openrouter/tts.py +++ b/src/openrouter/tts.py @@ -28,7 +28,7 @@ class Tts(BaseSDK): components.SpeechRequestProviderTypedDict, ] ] = None, - response_format: Optional[components.ResponseFormatEnum] = "pcm", + response_format: Optional[components.SpeechRequestResponseFormat] = "pcm", speed: Optional[float] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -246,7 +246,7 @@ class Tts(BaseSDK): components.SpeechRequestProviderTypedDict, ] ] = None, - response_format: Optional[components.ResponseFormatEnum] = "pcm", + response_format: Optional[components.SpeechRequestResponseFormat] = "pcm", speed: Optional[float] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, diff --git a/src/openrouter/workspaces.py b/src/openrouter/workspaces.py index f3cf390..0e31f05 100644 --- a/src/openrouter/workspaces.py +++ b/src/openrouter/workspaces.py @@ -19,8 +19,8 @@ class Workspaces(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -123,7 +123,7 @@ class Workspaces(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -177,8 +177,8 @@ class Workspaces(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -284,7 +284,7 @@ class Workspaces(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -2409,8 +2409,8 @@ class Workspaces(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2515,7 +2515,7 @@ class Workspaces(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return None - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return None next_offset = offset + len(results[0]) @@ -2581,8 +2581,8 @@ class Workspaces(BaseSDK): http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, x_open_router_categories: Optional[str] = None, - offset: Optional[int] = None, - limit: Optional[int] = None, + offset: Optional[int] = 0, + limit: Optional[int] = 50, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2690,7 +2690,7 @@ class Workspaces(BaseSDK): results = JSONPath("$.data").parse(body) if len(results) == 0 or len(results[0]) == 0: return empty_result() - limit_ = request.limit if isinstance(request.limit, int) else 0 + limit_ = request.limit if isinstance(request.limit, int) else 50 if len(results[0]) < limit_: return empty_result() next_offset = offset + len(results[0]) @@ -3068,7 +3068,7 @@ class Workspaces(BaseSDK): ) -> components.BulkRemoveWorkspaceMembersResponse: r"""Bulk remove members from a workspace - Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The workspace ID (UUID) or slug :param user_ids: List of user IDs to remove from the workspace @@ -3220,7 +3220,7 @@ class Workspaces(BaseSDK): ) -> components.BulkRemoveWorkspaceMembersResponse: r"""Bulk remove members from a workspace - Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The workspace ID (UUID) or slug :param user_ids: List of user IDs to remove from the workspace diff --git a/uv.lock b/uv.lock index 9f421ae..93ea12c 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "0.11.3" +version = "0.11.33" source = { editable = "." } dependencies = [ { name = "httpcore" },