diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e6a97b36..bb5f92cc 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: aaa7d4a75666f6d910431ccff64692b5 + docChecksum: b9eccc20975f2d78c4f6db89903814f4 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.2.28 - configChecksum: 79af06c5b64804f84ca14bbeb1a2b789 + releaseVersion: 1.2.29 + configChecksum: 6369337a9b0173b9862defa437569867 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: c2e564a7-f9f9-4620-b18c-32f209645c9b - pristine_commit_hash: 4994453781c2d4211c9d4aa1c668ff05ae6fda99 - pristine_tree_hash: ab24309cad6866631f246b0bd6ee01d6c62020e8 + generation_id: f1c72740-3df8-4af1-b2bd-e31457a36cf6 + pristine_commit_hash: f7158adcd9a4fcecb96882daa00b468de85142cb + pristine_tree_hash: 18db3a50e0ec57a54a9e53131ceb5290f336d1ae features: python: acceptHeaders: 3.0.0 @@ -201,6 +201,10 @@ trackedFiles: id: 349d3a763e1d last_write_checksum: sha1:1e1169e637c785565ecf0646c29f812b9c6b3551 pristine_git_object: 539af0bb96a6b31c2c04f449aa9951c6066f2d15 + docs/components/annotation.mdx: + id: e494ef314124 + last_write_checksum: sha1:c2d1aa4a57a1c0a83fbe18d7355d8d7d68a16b8b + pristine_git_object: a91fc0f17d0ff23280837e5ec4998f23202b3b25 docs/components/annotationaddedevent.mdx: id: 772ab3c03c65 last_write_checksum: sha1:25c44358075e5dd94e1b8229e684203216b07ed0 @@ -209,6 +213,30 @@ trackedFiles: id: 14f2eb561997 last_write_checksum: sha1:c2d3663907d09f4bd8248d715384f3c45e18e241 pristine_git_object: ad9a606318c037d4fce78642297cd490ddd64878 + docs/components/annotationcontentunion.mdx: + id: 0621a5f17826 + last_write_checksum: sha1:8e3f36eb417989b9a00b67abf98628a699d55745 + pristine_git_object: 9c590a1b3bdde8d487747bc13f292af3c4e2d762 + docs/components/annotationfile.mdx: + id: 69244c07430e + last_write_checksum: sha1:8e1030ad9ebc777af79670572828b932fdf17a5e + pristine_git_object: 50ae7e89580e13c32cc9b5a68e9fbeb2dcd71798 + docs/components/annotationtypefile.mdx: + id: d537307e5be5 + last_write_checksum: sha1:3d59bebdc887e893cdc98c55ae9d9a92191d2b89 + pristine_git_object: 8f6888ad80a1a241ef2a2301c4e9d48f6370fdf3 + docs/components/annotationtypeurlcitation.mdx: + id: 08b3b4126f05 + last_write_checksum: sha1:7bc8ea6f0c479f8878bd2d1daa7258e97aa25e37 + pristine_git_object: a859249f51cc6669419d2a69f7bfe8c63b240b9a + docs/components/annotationurlcitation.mdx: + id: 80e5c4a3d4ab + last_write_checksum: sha1:668a49dd774c4e020dc1b3e0dbd560649c4dffc5 + pristine_git_object: 871c61915b39394ce7afe603ffa2b8d8c2073edf + docs/components/annotationwebsearchcitation.mdx: + id: 3548da377e76 + last_write_checksum: sha1:2e889ca1daaac386757555856e2373741c7054ec + pristine_git_object: a349dfd1f9dbd073892e08bf1fec641b131e2b72 docs/components/answers.mdx: id: 82e99c991e20 last_write_checksum: sha1:66dd9e45903fcdb94b3303437662e481c0106c5b @@ -221,6 +249,14 @@ trackedFiles: id: 3543a7aa7c29 last_write_checksum: sha1:d8888c96d3e548802b7d71d262fcb2221375a669 pristine_git_object: c13a23d75f73da4651f7b5927f1d1cf4293601fe + docs/components/anthropicadvisortoolresult.mdx: + id: 6b58159d829e + last_write_checksum: sha1:05becd5cfc326f4e7f6b5b7307a8674d25247fdf + pristine_git_object: 6511ee4854aa3d9dee1b81582cdb85ebe69d2b37 + docs/components/anthropicadvisortoolresulttype.mdx: + id: 8bb896458691 + last_write_checksum: sha1:59e088807257717fc5738a132b9113fdbc8d978f + pristine_git_object: e48ed3e660979911330d69efea2b81020b7b5c60 docs/components/anthropicallowedcallers.mdx: id: ab91fc216815 last_write_checksum: sha1:6f70b8ecad86a2769552cff8bb791483a89ce7cb @@ -245,6 +281,46 @@ trackedFiles: id: 1c0b189eb6e4 last_write_checksum: sha1:cef0696d19df555ac5934ae55f4230571699f8a0 pristine_git_object: 44deb61a813fde8473d34e0a14ccaef643467e0d + docs/components/anthropicbashcodeexecutioncontent.mdx: + id: 8dfd86c48aca + last_write_checksum: sha1:89e8fb9dc856d22afa619189b012a4a5f1be0cf7 + pristine_git_object: b06e1ee77ec4188e5e30da7de0d3780600c3f65b + docs/components/anthropicbashcodeexecutionoutput.mdx: + id: 9b6baf11291e + last_write_checksum: sha1:1661914ea19fbe1a66f7635c86284af8d4988fcd + pristine_git_object: dc3f6e0ff7074f0916134c6ce245e2ffab67326a + docs/components/anthropicbashcodeexecutionoutputtype.mdx: + id: 8b9c66cd32c2 + last_write_checksum: sha1:a6c06753e37977f5d03c5181ee9c577c7b885300 + pristine_git_object: d4823482c9c28c54ba575949b1676c9a319297a8 + docs/components/anthropicbashcodeexecutionresult.mdx: + id: f8d446f2162f + last_write_checksum: sha1:a1e5a47a4f9b93af2e7e971bc33d1a47e1aa639e + pristine_git_object: a48a5058a7ba1358cb9b0fd4da447e5b0b3954e1 + docs/components/anthropicbashcodeexecutionresulttype.mdx: + id: 3fc3fb9e83ff + last_write_checksum: sha1:5f43b1fcbb447094a2f5eb26d974a95db5a7d86d + pristine_git_object: 281efa3c96b33c5817a324373ddfa5bfd683f074 + docs/components/anthropicbashcodeexecutiontoolresult.mdx: + id: 1de21672770e + last_write_checksum: sha1:9e5cc933e1e98a782a8f61d26bc2e58dacdb1f90 + pristine_git_object: 339bf784ddb492852a769f11afa0c328ab636dff + docs/components/anthropicbashcodeexecutiontoolresulterror.mdx: + id: a25d169d04d8 + last_write_checksum: sha1:ebd3aa84db89582889789715d75f6e9eca59abf5 + pristine_git_object: ad9c88d126db3ea68bd9b2491f41ef6e263efc74 + docs/components/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx: + id: 28d51892d935 + last_write_checksum: sha1:13bdd8189baea659f154feda3011b85f87cab08c + pristine_git_object: ab7ee48f02eb50fb843e490f896340b949a147fa + docs/components/anthropicbashcodeexecutiontoolresulterrortype.mdx: + id: 45e44342e6dc + last_write_checksum: sha1:44ea66aa5254aece77f0d4cbcc1ac9cbbd12efd3 + pristine_git_object: 954e7691cd6a5251cc1e0b3732104db00216a947 + docs/components/anthropicbashcodeexecutiontoolresulttype.mdx: + id: a9d92374865d + last_write_checksum: sha1:56a225c8f545c2bc5d8dfac3bb237b9abfd5f3cf + pristine_git_object: 02e1d2e81425cef1c009ec781eafd2f31b272378 docs/components/anthropiccachecontroldirective.mdx: id: 5671704f9917 last_write_checksum: sha1:a31ffcd83295557f5a070d96873408214676a2ea @@ -261,6 +337,14 @@ trackedFiles: id: 76d410a5e73e last_write_checksum: sha1:3b9e3d49c378acbdada5129434dc5e469ff0137f pristine_git_object: c9562a64e41c396aee705ef025650900df0b43e4 + docs/components/anthropiccaller.mdx: + id: 1a97d57b999e + last_write_checksum: sha1:2131df5b51fb0a47caf63d9781aff81432732822 + pristine_git_object: 18cfeeb9f053b33aee321a56792e8ba40b0bd623 + docs/components/anthropiccitationcharlocation.mdx: + id: 7b39655eeea9 + last_write_checksum: sha1:c77856f73fc074d3c183bfd965d7e036148bf466 + pristine_git_object: 9a79e2d263aea58f0e10fca08dfaa3c2fa2ef99a docs/components/anthropiccitationcharlocationparam.mdx: id: c40e539e0fb1 last_write_checksum: sha1:bf7cb3fdf2b38b00e4b026e7c0304d9e308cbb75 @@ -269,6 +353,14 @@ trackedFiles: id: fb368c51e96e last_write_checksum: sha1:0e987851554c13b9066772aabc5b7866a4edcaea pristine_git_object: b4a606b53f264451f413f43d357d847d0999e6cb + docs/components/anthropiccitationcharlocationtype.mdx: + id: 29c0cf37af0e + last_write_checksum: sha1:6be0c17050817f6059fd3c218b25cbe27c6448d5 + pristine_git_object: bbab522742d57dd2f19f7254a25260ef39a1d1cc + docs/components/anthropiccitationcontentblocklocation.mdx: + id: 766237d7a0f2 + last_write_checksum: sha1:9dc8ad97a13a5f3c7d8d34b86513ae28d5cb5fbe + pristine_git_object: ae50edb4e8a799ba65b5f357a9dbd2fcf1af36a0 docs/components/anthropiccitationcontentblocklocationparam.mdx: id: f4549718f116 last_write_checksum: sha1:3169c74fc108e980f8b2f47dbc2ba13b95c74065 @@ -277,6 +369,14 @@ trackedFiles: id: 70b1c02579ed last_write_checksum: sha1:8de858319539ca2a1a66e59d74d60cd380ccad10 pristine_git_object: 7c3d03d2357b9bdee42d24ff0d85725ab107635f + docs/components/anthropiccitationcontentblocklocationtype.mdx: + id: 8f5f7b12c0f5 + last_write_checksum: sha1:309d72334e58131e4be1e2895d507082b12a9124 + pristine_git_object: ba61935e3030c2020cc5588ebd717224ace4feb2 + docs/components/anthropiccitationpagelocation.mdx: + id: 36a19f276cb0 + last_write_checksum: sha1:0cbbbc8d299bf99a2a5fe984fe99c4f2d5f274cd + pristine_git_object: d9cb06aebb3e0835c9a8bb3467f63f960b21b67d docs/components/anthropiccitationpagelocationparam.mdx: id: 78b8f9392f6f last_write_checksum: sha1:7e14d2b9ced1ccdbc493a0c2d61630018ebdd85c @@ -285,6 +385,18 @@ trackedFiles: id: 600fbeec8753 last_write_checksum: sha1:dcc72105e3f4c5f50ff39092ad82dc511d65e73b pristine_git_object: ebe0335b3a26503e24ffa142fb1c3907c5e23600 + docs/components/anthropiccitationpagelocationtype.mdx: + id: 19bf49b8341e + last_write_checksum: sha1:53cdf4e25270881ed179b4839414699d89d4bfe3 + pristine_git_object: fab850f3adb8e5b75a6eebc4978cd50b79d33e75 + docs/components/anthropiccitationsconfig.mdx: + id: 2cecd98c0dd4 + last_write_checksum: sha1:84823d14fd107b082ad9bc8d5cd76cd24187d23a + pristine_git_object: de669423c2247fe255a46237f0bd1e389b9021b6 + docs/components/anthropiccitationsearchresultlocation.mdx: + id: 40f569d8ec6e + last_write_checksum: sha1:503cabd5f211da0e9681f802b63e6a242069e3eb + pristine_git_object: 4766fcaadfbff64d65a1b3fbffd3ae95cf8fe435 docs/components/anthropiccitationsearchresultlocationparam.mdx: id: 9ae72ccb3e72 last_write_checksum: sha1:32fca32b7cee91aa9a77edfc5cd8fea9225c0863 @@ -293,6 +405,14 @@ trackedFiles: id: aaf65427c659 last_write_checksum: sha1:1c244ccc9dc3e9786157f7b79f0eae68b02a2895 pristine_git_object: 36ba3e46039d4a40008345c0939a33f95bb36b8e + 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/anthropiccitationwebsearchresultlocationparam.mdx: id: e8b10b5b40f7 last_write_checksum: sha1:3078918f99892b68eae36856265f870675ef7604 @@ -301,6 +421,70 @@ trackedFiles: id: 584f4fda6d05 last_write_checksum: sha1:5529e2c7a6402f204c3dcf7ed18522aefaeb73f4 pristine_git_object: 4bc0197a7fdc78781b645d2c8f4b32bb0b71b571 + docs/components/anthropiccitationwebsearchresultlocationtype.mdx: + id: 1d41c18eef52 + last_write_checksum: sha1:a18a6f783fc84d86afb56b21cf08ca9d74297b0a + pristine_git_object: 9cb6d29da30e11fd653a9bb5a06c6f7592ea56c8 + docs/components/anthropiccodeexecution20250825caller.mdx: + id: fba6fea1175f + last_write_checksum: sha1:19ae6ea0f1aef930189e2d2e0426de14535a9bff + pristine_git_object: 78b363bf47792c98dcfcce3271a8ef2b5cf38b74 + docs/components/anthropiccodeexecution20250825callertype.mdx: + id: ab06cf682ee0 + last_write_checksum: sha1:8cc4f63578c2e8ebd3cd971fa0638c6902e6cff1 + pristine_git_object: 63181a5a015c66ead286af01bb46a0fa2a1e67a2 + docs/components/anthropiccodeexecution20260120caller.mdx: + id: 27da4a1c8946 + last_write_checksum: sha1:d163b5eb9088cdf2d470e0802b4452637b72adad + pristine_git_object: 6c863ec8ca70e09d6144839a137d8b7f80c5b45e + docs/components/anthropiccodeexecution20260120callertype.mdx: + id: ba33a3c2dadf + last_write_checksum: sha1:bbd171760aa12ef237314d4294f2c9561dcb8cea + pristine_git_object: 1cbc51d82a848fb94e342ae2221a495502bdc548 + docs/components/anthropiccodeexecutioncontent.mdx: + id: 2153f6e7fcf1 + last_write_checksum: sha1:65ea1da9e91375eefddb9ff377aa8001a3d5b645 + pristine_git_object: b14a45ffd8fb36031ba6563311c3fee965f32730 + docs/components/anthropiccodeexecutionoutput.mdx: + id: 79f302f4b96e + last_write_checksum: sha1:ecf1df4229a8e388d486871a44f760c149bc7524 + pristine_git_object: 12529bc3ca19d9798a8b668fa28583f42d2b6262 + docs/components/anthropiccodeexecutionoutputtype.mdx: + id: 9238e8329083 + last_write_checksum: sha1:88e11b79e80ac13323bf0e82e3b050e2a933c7cb + pristine_git_object: 1fd91054c7c972d0d6054ba0382fd1851bf91e8b + docs/components/anthropiccodeexecutionresult.mdx: + id: f5c6dced3ad5 + last_write_checksum: sha1:b7a61908792f8692c64aa2314cdddbc876e9f9ad + pristine_git_object: c1e3a98c9f0307fab38d4a1db9a22b585ff73441 + docs/components/anthropiccodeexecutionresulttype.mdx: + id: f4c8db1457fc + last_write_checksum: sha1:f8b80a986b7c7c1e95f7612fa698718af9028fa1 + pristine_git_object: 0b936aa95148388073d9024ca431b0bb1a911ab1 + docs/components/anthropiccodeexecutiontoolresult.mdx: + id: 66565ed3c3db + last_write_checksum: sha1:b43cb77d717fcbe12368f757c58205f370e2c6a8 + pristine_git_object: fa5095cd66b794474288b28fc8e08a8be02e55a4 + docs/components/anthropiccodeexecutiontoolresulterror.mdx: + id: 7d843244068b + last_write_checksum: sha1:9a9b8ab493df2222c305e416eb5c75c34ed1dc63 + pristine_git_object: 200c14d0a07b0c1d18bd2e2ba3bb85d034f4d00b + docs/components/anthropiccodeexecutiontoolresulterrortype.mdx: + id: d0f9368f24fa + last_write_checksum: sha1:92851513a02f598515c568549382b946ba018cb8 + pristine_git_object: de815842f7bd990fcd4fb5a60e897a41e09eea0b + docs/components/anthropiccodeexecutiontoolresulttype.mdx: + id: afd05b50d9bc + last_write_checksum: sha1:6a84e079bf0029743cb284c64d43df1a7cd118fe + pristine_git_object: 722956792987225f4ea3e84215c82b25bd5e66c2 + docs/components/anthropiccompactionblock.mdx: + id: d52cdb05d5e0 + last_write_checksum: sha1:dcccf28ed51a61741a6bba4017dda0778a3298a3 + pristine_git_object: 95ab206ecca4ac7eb6ecab4b4c32a7b68b949e89 + docs/components/anthropiccompactionblocktype.mdx: + id: aea2f4b9108d + last_write_checksum: sha1:a3ba36bdf53f9969501e2393fe78e7b94fead87d + pristine_git_object: 017cf712403461dd61cf2b2537dc540dfee38ea4 docs/components/anthropiccompactionusageiteration.mdx: id: 9bcca00fbe93 last_write_checksum: sha1:7d79a2bda26c860d3da4882bf4c8b4e044d2ed56 @@ -309,10 +493,42 @@ trackedFiles: id: 9a374fa59115 last_write_checksum: sha1:9227f0a88d72dba58bf45a6b6458ed460f790680 pristine_git_object: 2b04c2483fceacf8300bb872ea0eed600970d160 + docs/components/anthropiccontainer.mdx: + id: d3f3da5841ee + last_write_checksum: sha1:1047fa891f34aba015c90518b6061b9633660623 + pristine_git_object: 620f427512f632357faa66b4e2ba32ab0776bc49 + docs/components/anthropiccontainerskill.mdx: + id: 7ae22f0a1083 + last_write_checksum: sha1:e9e0ea76da684a5ef353ea68f39542729ec38186 + pristine_git_object: 06aea602895869340cf21a8d66a6fb7ad8001b46 + docs/components/anthropiccontainerskilltype.mdx: + id: 1d80c69866b4 + last_write_checksum: sha1:9676f714823205d97af75e76c6d44283d76cb721 + pristine_git_object: 83805e4b7d87e493a576f305b597c0986558ed93 + docs/components/anthropiccontainerupload.mdx: + id: 8816d0e6a415 + last_write_checksum: sha1:edc7a5d2c865df93f381298c94d7090ea2dd2358 + pristine_git_object: cc5c98f8004c27036a84aa4ee1402d4e91def7a1 + docs/components/anthropiccontaineruploadtype.mdx: + id: 19afad52dc7d + last_write_checksum: sha1:3bb95e237cbda8f026ea7d7ed5d9db22a344e7f1 + pristine_git_object: ea8f01cb32d8dc6b20df68117f1f98f05285b90e + docs/components/anthropicdirectcaller.mdx: + id: c00c99c99ed8 + last_write_checksum: sha1:faeec5acc05cd8791f183d8e1a6d5e97f8abfe14 + pristine_git_object: 970780a2cc7c6092ee0c7af0ce1db16b1aa95feb + docs/components/anthropicdirectcallertype.mdx: + id: a393c6a1c6e2 + last_write_checksum: sha1:a3fd5b197a6cd61471dcdb732d00b988a29eb254 + pristine_git_object: d8b9635472b4d2aac87b6b7d3c911ff66b424e15 + docs/components/anthropicdocumentblock.mdx: + id: 264e8ec1379a + last_write_checksum: sha1:ab0ae63ea44831944b58422b7016dcccd4227808 + pristine_git_object: 6d9011ff65788da3d45c7b4f282acb9d13e621b1 docs/components/anthropicdocumentblockparam.mdx: id: ece98dcf04f6 - last_write_checksum: sha1:42f908ffe281fd4272a24d7eb874f76fbee47da9 - pristine_git_object: 1ed7b7cd83e412bdc9945f00a875bc681e0c96ee + last_write_checksum: sha1:1caa5f5eb55dc608777002006f27ca9f28d22111 + pristine_git_object: f49b66264eed9674b03f657e78d4eca1ecd9eff5 docs/components/anthropicdocumentblockparamcitations.mdx: id: 474518ae0167 last_write_checksum: sha1:798372e77425fd7127a318c75247ce44e6f1dbfd @@ -329,6 +545,26 @@ trackedFiles: id: 0fe41665501a last_write_checksum: sha1:b986c4111210ece695b40750d8006f103caf5735 pristine_git_object: 644c8db7053f3a75bf33bb2430c53183bfca2e22 + docs/components/anthropicdocumentblockparamtypedocument.mdx: + id: 53de7da13724 + last_write_checksum: sha1:7d7bceff1360c40f5a063e2cac65c0c107189b59 + pristine_git_object: baa0ea0adba88bb456ed775fe5b604c92a784874 + docs/components/anthropicdocumentblocksource.mdx: + id: 4f79f8d4e0b2 + last_write_checksum: sha1:1741eb55271cd5d8d859c42b962d266bed9dcb74 + pristine_git_object: bc195ec721db975115b6c655702eae4a27a492aa + docs/components/anthropicdocumentblocktype.mdx: + id: 79d7b75ae5ad + last_write_checksum: sha1:cf8dca163394202a8d0a6bd68b8e3ed46c065be0 + pristine_git_object: 970df2bcb4cfb69403cfc664eb4a172466cc7675 + docs/components/anthropicencryptedcodeexecutionresult.mdx: + id: 38f8886a9a1e + last_write_checksum: sha1:a1522775807336f4352f173f0aec2c9b70cc6459 + pristine_git_object: 2f992ca409c266107fd5ecf1a9bb90ac572b8bf3 + docs/components/anthropicencryptedcodeexecutionresulttype.mdx: + id: caaf6f85585a + last_write_checksum: sha1:237c8ea905b37547428abd42a2120958b41074e2 + pristine_git_object: 368125c1e7ea3d72288ef97f8672a2e3a3279915 docs/components/anthropicfile.mdx: id: 8bb5aaf1161f last_write_checksum: sha1:51e452a4c1ea01174be02723e7a09a3ddc4d23f2 @@ -401,6 +637,10 @@ trackedFiles: id: d4de58548475 last_write_checksum: sha1:c371f8d3fdadcc84fe2a6451e3dce096a71448b3 pristine_git_object: 2b0b01f8e3cad9bbe847881844feee8f0ac1347b + docs/components/anthropicinputtransformation.mdx: + id: 5d0202530b65 + last_write_checksum: sha1:2b704c29cfd694fd624ebb9bb80712af56f8b1e8 + pristine_git_object: 5eadea1363b782021ff8fa7255147e7b7cacbe8a docs/components/anthropiciterationcachecreation.mdx: id: 3d219e812746 last_write_checksum: sha1:604cefcc9984ff6aee5c889c0e7054830753a0fd @@ -421,6 +661,10 @@ trackedFiles: id: 1b3111ee32fd last_write_checksum: sha1:a40805e9cc023fb5382513f114e0d0b167c65dda pristine_git_object: 1eeaeb4abbd3ce733431cdd26a04ca0e97efdbf5 + docs/components/anthropicoutputtokensdetails.mdx: + id: c88c3b7577c2 + last_write_checksum: sha1:49d4efa8c31160bc612ffb765259c9b22485ae00 + pristine_git_object: 5e53170810c3a602bc7034135eb6191b6075f557 docs/components/anthropicplaintextsource.mdx: id: fab547d404e1 last_write_checksum: sha1:31f76997c99405badc149bbb4ed51ebb6ac4a4b0 @@ -433,6 +677,26 @@ trackedFiles: id: 6e7d778bbb64 last_write_checksum: sha1:7bc64373f6ef127247b59329f49d3718db308f94 pristine_git_object: a538343b4f3fca39a44d3f208e702c482978c4f8 + docs/components/anthropicredactedthinkingblock.mdx: + id: 791dc27bf47a + last_write_checksum: sha1:dcc1d02ffe3e0f629192ea58ddcecb5433fc7893 + pristine_git_object: df0aaeaae13244847c2f85578add3b147b169c50 + docs/components/anthropicredactedthinkingblocktype.mdx: + id: 81f2290062ad + last_write_checksum: sha1:194567737bf7a383a4fef756122744e240d9744a + pristine_git_object: 09c048fb85fe08b8161dcf93b56d14440959dfc5 + docs/components/anthropicrefusalstopdetails.mdx: + id: 289b3cf4a296 + last_write_checksum: sha1:99203d956a7a63ca6540ac55c3f8ffa80a859aa9 + pristine_git_object: 0b310ef75ba9123c16e4a563a4eba64a2d8369b2 + docs/components/anthropicrefusalstopdetailscategory.mdx: + id: 8f80e870efc4 + last_write_checksum: sha1:ce770d7d13e4f89adf141787b4ab8c39963fd0c8 + pristine_git_object: e8fa541dbb5072d905a27107a95424cccc20e224 + docs/components/anthropicrefusalstopdetailstype.mdx: + id: 096f50096eea + last_write_checksum: sha1:64d3b6b350de69a3dcd7862232c9346f3bb57bdf + pristine_git_object: 4b9b057f264cf55fcb5ab936201de3642235ec5d docs/components/anthropicsafeguard.mdx: id: 04d5a44fa933 last_write_checksum: sha1:9a6630599e8ab797618710ef7ab860e4e99e086d @@ -449,6 +713,18 @@ trackedFiles: id: 06be14681704 last_write_checksum: sha1:8371b32dcf174d3381f46d198aef3445bb22c8b5 pristine_git_object: 302faea5f574d9bfe746ee1241d03ddf9d39bce1 + docs/components/anthropicservertoolerrorcode.mdx: + id: 47317eda347c + last_write_checksum: sha1:174906e9f926c5918f870bf46b4c557e1902466f + pristine_git_object: 043523bd96ea7b806e72c0af5457b93bba34aeb7 + docs/components/anthropicservertoolusage.mdx: + id: f71da18a547b + last_write_checksum: sha1:e58aeeb67a8ecd7bfaaf36591110ad5b3d77bdca + pristine_git_object: c3f95be74f8389deec4527ba4bb53ba60d735c9f + docs/components/anthropicservicetier.mdx: + id: a11c4a30fb6d + last_write_checksum: sha1:eaf18ce06737f19fc04c150fc48f2d7b20e67357 + pristine_git_object: 7cf6ee646c2b6a2cd313b2e06b481b9513df2977 docs/components/anthropicspeed.mdx: id: 1227dfabccec last_write_checksum: sha1:0ba0013465693c68ce5820446a42525416df92cc @@ -457,6 +733,10 @@ trackedFiles: id: 02e08e8b03f3 last_write_checksum: sha1:218693075e1fbef7a5771edf41cd93ee7eb430d4 pristine_git_object: 5634634926c7a09342c219cd0d865234c262baa5 + docs/components/anthropictextblock.mdx: + id: 2f5893b28e56 + last_write_checksum: sha1:44814eeb40e18957aa931fb06fcb34d4b1fe04b6 + pristine_git_object: ac26f79de959d081b03e8a937e18dbe2bd9252fb docs/components/anthropictextblockparam.mdx: id: bded5d409e91 last_write_checksum: sha1:ab2ebb14dd5e54bbadf4db4aa919d1b380b844b5 @@ -465,10 +745,74 @@ trackedFiles: id: 7f03a13234b7 last_write_checksum: sha1:12c7718c5c0da4561914ed95dd6853873568bd05 pristine_git_object: b6b0d6f9022f2046c713d768125927e22ecc9431 + docs/components/anthropictextblocktype.mdx: + id: 920c88f88dd1 + last_write_checksum: sha1:8433340a1c557bfa868f2bec1bc51a27dee2e37f + pristine_git_object: 95be2eb73e9555939c004e6daab07aa4949e03c9 + docs/components/anthropictextcitation.mdx: + id: 7f9cad7250e5 + last_write_checksum: sha1:656dd7de91bbac089f1135f32186439518c07211 + pristine_git_object: 3e6e66faf841583689ee6a8295fc5dcfcb350706 + docs/components/anthropictexteditorcodeexecutioncontent.mdx: + id: 6110a78882cc + last_write_checksum: sha1:1bc221df37a028cdebcb0531ddc97b3f882c748b + pristine_git_object: c4c1b8b81578c8f9029061465a778523924a22c2 + docs/components/anthropictexteditorcodeexecutioncreateresult.mdx: + id: 57c175b40bcf + last_write_checksum: sha1:2bb8d48f0a5be803470e05d932eed00dcce301ff + pristine_git_object: 7e94b8f763bf0b7f797baa28c2e08e7ff5504045 + docs/components/anthropictexteditorcodeexecutioncreateresulttype.mdx: + id: 1d9b03445541 + last_write_checksum: sha1:cc0dc3a182e7300289a8c95a62af1ca41377d2bc + pristine_git_object: 415ae0dfec3c8e1149b383021ac188850ad963d8 + docs/components/anthropictexteditorcodeexecutionstrreplaceresult.mdx: + id: bfd737c89ea7 + last_write_checksum: sha1:f7aa4416502b881899abb995a4fa4a117c032994 + pristine_git_object: cd8b9eeff2010e1828f4c1209439957b99268f92 + docs/components/anthropictexteditorcodeexecutionstrreplaceresulttype.mdx: + id: 2088f9cce5ce + last_write_checksum: sha1:565334478453febdc8e43d5d70cf45dfaa5501e8 + pristine_git_object: 46b9ec2249c9283bce0bd28d6f0fe5babcb9ed93 + docs/components/anthropictexteditorcodeexecutiontoolresult.mdx: + id: 3afc7495abe6 + last_write_checksum: sha1:d8d1d085c8f166936f0ac8207a1f9c8050d5beaf + pristine_git_object: 9c05b4427e61a18011b1bdc28feec02dd93f2a56 + docs/components/anthropictexteditorcodeexecutiontoolresulterror.mdx: + id: 2e40327a4bd4 + last_write_checksum: sha1:016d93f0b2f24a901fb8ebd5f0c22a1a60945d35 + pristine_git_object: c818a4b4c00e0b5fba43afca1f9114208c7a2d9a + docs/components/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx: + id: c41016f833a4 + last_write_checksum: sha1:d0fdfb5a5ddc3bd3dc2a12bac760f70c5a07b52f + pristine_git_object: b264470332db0a7920081cee365ff4fd55dd3c0e + docs/components/anthropictexteditorcodeexecutiontoolresulterrortype.mdx: + id: a1b954d94720 + last_write_checksum: sha1:641c2b79b6c00dc4b762efa06e53e8656681ae5d + pristine_git_object: 2303b7651640b09ae8763b5b5f21b19019ae57d4 + docs/components/anthropictexteditorcodeexecutiontoolresulttype.mdx: + id: 8395b8729328 + last_write_checksum: sha1:f06551e06dcab10a9a008d9c887204ca44ca28d8 + pristine_git_object: 4db2eb262f07509415c213ba021cebbd46954df5 + docs/components/anthropictexteditorcodeexecutionviewresult.mdx: + id: 57e6cf0dc451 + last_write_checksum: sha1:3fa15f31e6988948ac0d93ce416b838921552b86 + pristine_git_object: f1fe04cac95fdeb5b24d1994fb8d4d4a2bf6450e + docs/components/anthropictexteditorcodeexecutionviewresulttype.mdx: + id: b9de357058c3 + last_write_checksum: sha1:c880122f630b805911d2468113a466a677915cb6 + pristine_git_object: a5d4be4be91e0a25b0b897642e8c1d18c5737ed5 + docs/components/anthropicthinkingblock.mdx: + id: dad210ed2d44 + last_write_checksum: sha1:a7d2ae66e6d5434ba935567c9ad95748099fdb42 + pristine_git_object: 7ca58e1c07dafaa9699827b271dfe0344b1da036 docs/components/anthropicthinkingblockbinding.mdx: id: a1c1acf8200e last_write_checksum: sha1:cbb0e04bd04b81cf3982f01b1ca26aabc14c3c48 pristine_git_object: cc9f8e6a2e50fe7a992d713d9b991fb24df3ea3c + docs/components/anthropicthinkingblocktype.mdx: + id: 75dd296a8d23 + last_write_checksum: sha1:33e0febb3f788624622862b392e1f3f72f21cecd + pristine_git_object: db7ecee5a10e0b35b6156d9fa23ff038b91d2d66 docs/components/anthropicthinkingdisplay.mdx: id: e068ddf6374f last_write_checksum: sha1:49fd044eb4759b0f447964cc276b0681ff73a3ec @@ -481,6 +825,34 @@ trackedFiles: id: 58b7f8554e4d last_write_checksum: sha1:6193e98647de03e888bdfedec1c18a2c36de8a07 pristine_git_object: c1034a4153765eb307c650c27e85b0832263b934 + docs/components/anthropictoolreference.mdx: + id: 9b73d6793d51 + last_write_checksum: sha1:89ceead20f0ffdb05e67c2a441b6f0f58d9ab6d6 + pristine_git_object: ee8d6b2784f4fd8e40bb384bbf89757cb37e8bcf + docs/components/anthropictoolreferencetype.mdx: + id: 1482ea261d7b + last_write_checksum: sha1:e48fda00baa2b6b553926a1bd1cb9234d17882aa + pristine_git_object: fc9557dad9149e712e9a431c0d6746f956349957 + docs/components/anthropictoolsearchcontent.mdx: + id: 173dc055b231 + last_write_checksum: sha1:9614fea798909ef1194ad41c2ca89bad37803db6 + pristine_git_object: 73aba99a6255d73ef7612a02e15bf541c27e64fa + docs/components/anthropictoolsearchresult.mdx: + id: eeee9abb9f70 + last_write_checksum: sha1:09b574ca5e27bec9e53cab8e1ef3113d8ccf833b + pristine_git_object: 69a738d24d2626a76bd8f8cba997264e3b907456 + docs/components/anthropictoolsearchresulterror.mdx: + id: 0a80e72741e2 + last_write_checksum: sha1:e7f4b58d224e5aec697d4aa7637b6c1bc9b2402e + pristine_git_object: 1e624f1185d1256b18776f730062fc579cee1fd0 + docs/components/anthropictoolsearchresulterrortype.mdx: + id: c5c7fdc63245 + last_write_checksum: sha1:0c96fd3150626807fd9d3860d8a13d4c1c1e2819 + pristine_git_object: 11db20aec065a2ec4b8b1d7f5e717c632210485a + docs/components/anthropictoolsearchresulttype.mdx: + id: aaf5a3cdb268 + last_write_checksum: sha1:6435d9f1392002a9b027c9c8ea83f732cff7f3b2 + pristine_git_object: 761dcd93806bc47bedf09a1de8d6f5c640767fa0 docs/components/anthropictoolsearchtoolbm25.mdx: id: 767f0313dd5f last_write_checksum: sha1:6c7e2868a73de5fcd7d5ca031e7f74e71589c0ab @@ -505,6 +877,22 @@ trackedFiles: id: a8577c3c6e08 last_write_checksum: sha1:79f92c2e30bb9ab1d9b46358313c89870599a1ef pristine_git_object: b5b5eb68bd65f9473a45d4da3461a56acf63419f + docs/components/anthropictoolsearchtoolresult.mdx: + id: 6cb9e0a881ec + last_write_checksum: sha1:d5f89c56206f187f750acef375906695b04e3563 + pristine_git_object: 191c13c221678007db0e583516e5f09457ea3f32 + docs/components/anthropictoolsearchtoolresulttype.mdx: + id: a88929093ec7 + last_write_checksum: sha1:ceb005f67bee30def5d9d56599bd96f49d628c71 + pristine_git_object: 0f0d20d3d4e7c3ca82573985906c86a793d8cb57 + docs/components/anthropictooluseblock.mdx: + id: e9af90edd76f + last_write_checksum: sha1:2d902832d1a46da7939c2e7cd059cf0ae4e71964 + pristine_git_object: 51bc60d205498f603ce6a297a93c838b8bf4bffa + docs/components/anthropictooluseblocktype.mdx: + id: 3e4f6ceeb196 + last_write_checksum: sha1:900ba7fb29e5f50be11c95bf4e53789772b4b0aa + pristine_git_object: a6cd369f552d3a38760d1da04ad6d972a8a3b265 docs/components/anthropictooluseskeep.mdx: id: a80174ecc369 last_write_checksum: sha1:b05b93553bbb32cef5150f79e1c2f0ca55298e5f @@ -545,6 +933,42 @@ trackedFiles: id: 3310bf2eed94 last_write_checksum: sha1:f3faaf7624149614de715e245ea4c667e433ecb9 pristine_git_object: 0ae331c1d87201007d6f2da04cb03d911004e0e6 + docs/components/anthropicwebfetchblock.mdx: + id: 2bbdb93c9198 + last_write_checksum: sha1:f188f3db8aa8f8c5270b2ecf01e3a2ba4a4b44e1 + pristine_git_object: e130a5784a6832e6ef8ade9c5e0cd9193324857c + docs/components/anthropicwebfetchblocktype.mdx: + id: d2774c2adaae + last_write_checksum: sha1:b2748e2695b3deecdf414b6b36e3f66fcf8cd0a8 + pristine_git_object: 266ddbb52f7a6cb35eb1dc1b4424c52ed65d8c21 + docs/components/anthropicwebfetchcontent.mdx: + id: 06f5604874ce + last_write_checksum: sha1:202519d9541b7267f76fcfd21c8ecc1e5390403d + pristine_git_object: b3ec99cc2971cddf0776338ed0f31af895056aec + docs/components/anthropicwebfetchtoolresult.mdx: + id: 19fb3cf537fa + last_write_checksum: sha1:54f6d566b0dcbb585947da726a4a390f51598b4b + pristine_git_object: d33f72fbf79c6a65b9af9552efadd3df860a3563 + docs/components/anthropicwebfetchtoolresulterror.mdx: + id: c054f984afad + last_write_checksum: sha1:0eda8f53521c6f9c71a5fb2dfb5ee7488ec0e54f + pristine_git_object: 3b9150ee761d23f96f2ff4949c1aea29b42f9bce + docs/components/anthropicwebfetchtoolresulterrorerrorcode.mdx: + id: 4a7e2fb63acb + last_write_checksum: sha1:c50db315821815cc2fc1ec311d030630f07babfa + pristine_git_object: 6fe9c5d34660ba486e4bd9ffe646d2e0288048d4 + docs/components/anthropicwebfetchtoolresulterrortype.mdx: + id: 951939fcaedd + last_write_checksum: sha1:4cbe77993e0f18cb30cbc963c5b49667f9cd3fe4 + pristine_git_object: 8b015442c0ef7d658a89e901b33640a66cbd1d08 + docs/components/anthropicwebfetchtoolresulttype.mdx: + id: c209d4514beb + last_write_checksum: sha1:a3a99520296006bdc96f28940eb29863ed2a0d88 + pristine_git_object: 8155ccbca1fabb22ffbd8dac835e607b371a98b5 + docs/components/anthropicwebsearchresult.mdx: + id: a3583d3e1aa9 + last_write_checksum: sha1:215aeed8191e5045a24196489d18901161d9a713 + pristine_git_object: 9f44a31369e7b49e32b3824f0cdd2011b3eb388d docs/components/anthropicwebsearchresultblockparam.mdx: id: 0eec50f08630 last_write_checksum: sha1:51ff39d85073da0fa458f6f4b6e837c4298aa0d3 @@ -553,6 +977,34 @@ trackedFiles: id: c0b4c6f50ed5 last_write_checksum: sha1:0f6fb484091a5915b19a4b6f4223619219e67bb2 pristine_git_object: ed07bc52c2409eeb97f0ea548ca0dc0e15e1c2a6 + docs/components/anthropicwebsearchresulttype.mdx: + id: 6645174d74f2 + last_write_checksum: sha1:feda003be89c12a61bf0c287fd417d9e4a2d9c1f + pristine_git_object: fa7a557ac5d651e49efb6ce75bf8b275bb213563 + docs/components/anthropicwebsearchtoolresult.mdx: + id: e7b0efe4fb90 + last_write_checksum: sha1:deca57640b3f10119d2cb925fdb7916a65303c02 + pristine_git_object: 52ae78a271aa9d5a1648ae5f35260ffb8f4138bc + docs/components/anthropicwebsearchtoolresultcontent.mdx: + id: d517f0df11d4 + last_write_checksum: sha1:f0a5fcbea816190406ec87070c07aed5ed568b5f + pristine_git_object: c6f194c6e4e3dda771f034ca64ca583fb9fac438 + docs/components/anthropicwebsearchtoolresulterror.mdx: + id: 0c9eea9b6b6c + last_write_checksum: sha1:04f5873cff750c4894712afe09d75ed0bfa4ed5d + pristine_git_object: 7b7cb1372697b94bacb8299addb0a9425896735d + docs/components/anthropicwebsearchtoolresulterrorerrorcode.mdx: + id: 7c8809f923d5 + last_write_checksum: sha1:2b15faf08d51a907c5e714a1140d5eeaddd74c3d + pristine_git_object: d45012372229bbe07914c17acf4bebe8ceb44553 + docs/components/anthropicwebsearchtoolresulterrortype.mdx: + id: 86404fb8edc4 + last_write_checksum: sha1:5521f092059c7b5c634239cf337193198dfeb3a7 + pristine_git_object: fec3efb48cd5fb36d57a75878dcf24ca1c02507b + docs/components/anthropicwebsearchtoolresulttype.mdx: + id: bd79249793b7 + last_write_checksum: sha1:c7c9fb811c239f7df5fd5ba8694361f7e3674ed0 + pristine_git_object: 2dc56e0d5569f15286a19a840ce5e4f3452dee03 docs/components/anthropicwebsearchtooluserlocation.mdx: id: bca2587d7144 last_write_checksum: sha1:0e366c190891756a9f4c21e01ab348f686d8c94b @@ -789,10 +1241,278 @@ trackedFiles: id: 73f42e4bc945 last_write_checksum: sha1:599705c7ef520285d8da9e5510109846aa7fd332 pristine_git_object: 539a7c32200bef803260226e81f3225e9529688e + docs/components/batchdeletedobject.mdx: + id: 30752c2f2a11 + last_write_checksum: sha1:3977c68fa4fdd9ae1d71afd088752e662109439f + pristine_git_object: 9c7da3ad2ca7fdac3ba7ce50bcd359e6792b67e0 + docs/components/batchdeletedobjectobject.mdx: + id: 848faf9c1714 + last_write_checksum: sha1:e4f6e5101443e8b79d3c6b8349e91b7743537805 + pristine_git_object: fcf8a53f4b961e603b5e714bbe2ef6df50fde869 + docs/components/batchdeletionoutcome.mdx: + id: 037b41c206dc + last_write_checksum: sha1:3c5ddf66faf768d3addd5533bf5a525788c77a4a + pristine_git_object: 946b5aec21dde1ae41c30d1deaa6f959ba16e602 + docs/components/batchdeletiontargets.mdx: + id: 65707b290286 + last_write_checksum: sha1:98929af1a711968bb8bab0793dec7b21971f52c0 + pristine_git_object: 70b3c642c337c19aa63def9b7d1b73ca5857c41a + docs/components/batcherrorresponseerror.mdx: + id: 2f458adb351e + last_write_checksum: sha1:52155b5e33301ad1c301104116746d4d3f7420aa + pristine_git_object: 230a7c61aad3eb32d5d9b18c50a85fbd5a67184a + docs/components/batchlistitem.mdx: + id: 78998bff3044 + last_write_checksum: sha1:0b005cf344280b1dbaab2361ad7b757d810bc1f2 + pristine_git_object: 7a39aba9b04d31e64cbc53829c839c27729a5fe5 + docs/components/batchlistitemcompletiontokensdetails.mdx: + id: 70f3adf88e68 + last_write_checksum: sha1:f0b504c975a9109b8e127399aecaee36fc4f09b2 + pristine_git_object: 769284c9d6e82204a33f80ca77d2008c8b4b8f05 + docs/components/batchlistitemcompletionwindow.mdx: + id: 91f0029be401 + last_write_checksum: sha1:8baa2a1aaa6cfbe46ad4b8fc97ca539a6ce5fe55 + pristine_git_object: cf1f7458c9550afb3f0532acda22786555f1736d + docs/components/batchlistitemerror.mdx: + id: 846e6a6251ae + last_write_checksum: sha1:bb7125faa60271270a2c581a35c96d1aba3c5a60 + pristine_git_object: 1891de192c1559ae7221c387d7af5a7eb423b4fa + docs/components/batchlistitemobject.mdx: + id: 4486bfc020c9 + last_write_checksum: sha1:6e25c1a60ed48abbe0d139c537cf48c7fb22a73e + pristine_git_object: 66dd9916e46e1ea17f2c304de279414a6c48c7be + docs/components/batchlistitemprompttokensdetails.mdx: + id: edbfcc145733 + last_write_checksum: sha1:84f7856dcee4fb528b183d24b422de642188e6ef + pristine_git_object: 6da3113eacb91ca586d9b42a718576f41a195a66 + docs/components/batchlistitemrequestcounts.mdx: + id: 8702b5010554 + last_write_checksum: sha1:a3a776679fd8105ec7ab7f5646f9e7b2fd94e5e0 + pristine_git_object: 695a4266bed1e8c71b1f0ca580dc2735415f4c42 + docs/components/batchlistitemservertooluse.mdx: + id: e53ef3bd6392 + last_write_checksum: sha1:1d34b90deaf81da1a99e18fb263717fe0af48877 + pristine_git_object: becd27892408e2baf991ea80caa93d62077398de + docs/components/batchlistitemstatus.mdx: + id: f342a5431a90 + last_write_checksum: sha1:ac1091d92a674b3faeabb91d3eb24845d2f8ed9d + pristine_git_object: 44586cdbf0ec33e56c740326a06b142d91af1a92 + docs/components/batchlistitemusage.mdx: + id: bc3fc57b97c3 + last_write_checksum: sha1:a671b6deea4f355ded7ee3b8f071a7d27173ce16 + pristine_git_object: 770b735736c4d1a514427525bae33ccc6379281d + docs/components/batchlistresponse.mdx: + id: bb75cb095158 + last_write_checksum: sha1:5d1a61ea0faeb70aea71f96e07f8fa16c77fc3d3 + pristine_git_object: 31a10bfb78b4bbb667254347692698526bdef930 + docs/components/batchlistresponseobject.mdx: + id: 876c3085d823 + last_write_checksum: sha1:fa93aba53eea0fc512f6b4261b9c936f8baf8edf + pristine_git_object: e283e5413bc95b091d6afc827eef343c5250a549 + docs/components/batchliststatus.mdx: + id: 0c78358e7327 + last_write_checksum: sha1:9dca3fc376f489abca5afad719a9a204cfdd7cb1 + pristine_git_object: c7629b16bb3a2df3eb7a2c784a30953e137f6d60 + docs/components/batchlisttimestamp.mdx: + id: be1220f5d235 + last_write_checksum: sha1:07149c18414e00640dfc87fe3c68f40085b336b3 + pristine_git_object: 8040fd187819ab7df349c22e35ae7b68701b8b6b + docs/components/batchobject.mdx: + id: 58b4e759b75f + last_write_checksum: sha1:f98e38969c6f4ef91f18faef8aaaf0ee06086b07 + pristine_git_object: cec2c6ae6f0da6f831ffc7f7175f636de72bfa07 + docs/components/batchobjectcompletiontokensdetails.mdx: + id: a27cfa43c4a8 + last_write_checksum: sha1:fcad3adc9e01db0c559aa5a89ba054f0d93c8dc3 + pristine_git_object: e9374e7082abe7c0c52f3a2300cd3c839a670027 + docs/components/batchobjectcompletionwindow.mdx: + id: 22682f41616d + last_write_checksum: sha1:e41112cfea7fc9222edb80327f7c1724a1d5e864 + pristine_git_object: e2fc9fd2368fefc0ba33224fdb58809596869d06 + docs/components/batchobjectdata.mdx: + id: ffbd6c621d43 + last_write_checksum: sha1:4ca50b3cb9dd1f18dfc6431f6e1ea4c86b0fc96f + pristine_git_object: 9fab2e05383f3dc51c102b04b2d8b59434b7eb56 + docs/components/batchobjectdebug.mdx: + id: d1b46e566034 + last_write_checksum: sha1:51c9d9af01aee33aae06e11018cc6a2ef2187b56 + pristine_git_object: 2c534c626362d989cc36cf94d3afee173480e8ca + docs/components/batchobjecterror.mdx: + id: 9ad5df04589b + last_write_checksum: sha1:d9007f3a0fa254330fa2372bd469cb52b429a4de + pristine_git_object: ae47da322d2ca58997c3520e0af089fea6506f5f + docs/components/batchobjectevent.mdx: + id: 7a56a13b69a3 + last_write_checksum: sha1:3fff91c322650a91e8ae53a31e18d1d0c8a2f9d9 + pristine_git_object: fd15fa8794617c7649cc5c3d042c71ee433c4b70 + docs/components/batchobjectfile.mdx: + id: e33ab9d77832 + last_write_checksum: sha1:934de77b4cdbaa4832e9f3b908a3d4eca3a67802 + pristine_git_object: 497b24366b5deeada6fc67d748eed8c62c8b2e25 + docs/components/batchobjectfunction.mdx: + id: d93e178d8bbd + last_write_checksum: sha1:a38ccebff5a11e5a6f8c8d6189d1ad18b83f66c4 + pristine_git_object: 0a854d9901ab7afdc233d4eeeaea80594ad711da + docs/components/batchobjectimageurl.mdx: + id: 1e761df563db + last_write_checksum: sha1:ebd75d3deefc20006aa87e283983816960ff4abb + pristine_git_object: 70172ed5a137a3092a82f0a2b97a0c27638a515e + docs/components/batchobjectobjectbatch.mdx: + id: e9afccaf72ba + last_write_checksum: sha1:ae3f066aa565dd2d9a7e45d5c7b91c979ded52f1 + pristine_git_object: 0f98fc84391760097c9d77d63b6fffdb90c733e0 + docs/components/batchobjectprompttokensdetails.mdx: + id: d2ccbe597149 + last_write_checksum: sha1:aa0e2361b24dccf3e91e53e216d75e63414015ff + pristine_git_object: 1bbcffd3a35ed073f140949ec0764d591aa3e82b + docs/components/batchobjectrequestcounts.mdx: + id: a8eb0e004210 + last_write_checksum: sha1:f237b5cbbf193b7c25dea181d25e4455e34c67fe + pristine_git_object: cc180f2e5c4c67bfd4b8819f004b2e15af034688 + docs/components/batchobjectresponse.mdx: + id: 4f09f891e6ca + last_write_checksum: sha1:bfba9fbe2e506f65507b5ffec8389cb78b9a197f + pristine_git_object: 2c8c0304982d0c116c471a5d6fc3307ba747e102 + docs/components/batchobjectrole.mdx: + id: 6f44efc7f138 + last_write_checksum: sha1:d17852c94ad545ac601d09b10f8a1b9f73c53007 + pristine_git_object: 012b7107a9d54b65ef5de806cdf138e55e19d19a + docs/components/batchobjectservertooluse.mdx: + id: 7b24d1f30654 + last_write_checksum: sha1:0fe1ba9ffe0170a0d380c207a941f3d9f0c21a40 + pristine_git_object: 86a2111925cea6ec03e9dd79c531a9dce6b1bffc + docs/components/batchobjectservertoolusedetails.mdx: + id: a0023f2867b7 + last_write_checksum: sha1:59cbefe756832de1297f41127b39e6476d4854f6 + pristine_git_object: 2ba9abb72dad85232159287fdbd1d2166f441fd3 + docs/components/batchobjectstatus.mdx: + id: b06615563d00 + last_write_checksum: sha1:94209ead92a1a300198a2b77585ca1203f002a74 + pristine_git_object: de882a33ad954d22f521d9604f5c65b1692a73e2 + docs/components/batchobjecttimings.mdx: + id: b3d3429e1cf0 + last_write_checksum: sha1:f735ad703dbdd8d2d25040e70c2123b7a59db0ac + pristine_git_object: 528b987df7d627cdb4eb48032bc54d34394ed12f + docs/components/batchobjecttypemessage.mdx: + id: 43c950ac1751 + last_write_checksum: sha1:181ab18f2166bbbb3c47cb8a6382dbb7f74a4a13 + pristine_git_object: 25bd6ec281e6dcf5b48689f2100c7f9d4f56d515 + docs/components/batchobjecturlcitation.mdx: + id: 8caab1acc6ba + last_write_checksum: sha1:dc9ff8a986ff202806c8e6be7fa5de1844f4ea76 + pristine_git_object: 41036e478b98d1d612383af2bfbde22299719509 + docs/components/batchobjectusage.mdx: + id: eb710c8f044a + last_write_checksum: sha1:9b7cbd9959b2eb387cad4e7cc43962bcfed75118 + pristine_git_object: 6fc6121a12edb4bf6024e75d288865e8a8aa24d1 + docs/components/batchpaymentrequiredresponsecompletiontokensdetails.mdx: + id: 5ae2aae74ddc + last_write_checksum: sha1:3efd46df9498f2cb9752d2fb49ea4251aa10c411 + pristine_git_object: 02caac2a1a3b418c2ba9224a2ae9ae6cb4bcead7 + docs/components/batchpaymentrequiredresponsecompletionwindow.mdx: + id: 05c010316fbb + last_write_checksum: sha1:6ab01dfa9abfc1cd052be251016fc983196d59e5 + pristine_git_object: c87441a11b2731b2bc01223684e720d0a52d2902 + docs/components/batchpaymentrequiredresponseerror.mdx: + id: 4e3444981f29 + last_write_checksum: sha1:31a458cefaa8e93d7541f7427c45a210cb5b5447 + pristine_git_object: e07f3accb7043acdeaa4fbebfc1b935532bd9759 + docs/components/batchpaymentrequiredresponseobject.mdx: + id: 75a7ce3d2f69 + last_write_checksum: sha1:3991bbfaee630bd9510d309c837f8bfc5083207f + pristine_git_object: f77e2c65222e6cc97c4733068d15a16d98af61a0 + docs/components/batchpaymentrequiredresponseprompttokensdetails.mdx: + id: 1fc799ee175a + last_write_checksum: sha1:f5fe58b4311faec67f048e7e7dea8e08f08883e8 + pristine_git_object: bc41b3015cce7bde604d581fd715fc4deedabdab + docs/components/batchpaymentrequiredresponserequestcounts.mdx: + id: f57ca0372c97 + last_write_checksum: sha1:ca69846c270c10aa51237299225ed4e1c78e52c2 + pristine_git_object: 66d9b483957fbbebac4958d1130ba988a433630c + docs/components/batchpaymentrequiredresponseservertooluse.mdx: + id: 621a6e2f1e01 + last_write_checksum: sha1:32bef8cec4278659d5c84edd2a9e8516e366c61b + pristine_git_object: 907e466093bce4f2bac25f75ed254d3ee9c26e2b + docs/components/batchpaymentrequiredresponsestatus.mdx: + id: e774639a5d83 + last_write_checksum: sha1:6128bf8c946431a9338c17a8e08dad568bfb4263 + pristine_git_object: 4801c4275e17690d9cccba89b488c6a944c4170b + docs/components/batchpaymentrequiredresponseusage.mdx: + id: 5e0a567bb2ca + last_write_checksum: sha1:c1d0b22a1312d1839c696c76cac554b819e34232 + pristine_git_object: e4b28f4d59a00f427977c37c78719bc1cc93808c + docs/components/batchproviderpreferences.mdx: + id: df0af46e2e5b + last_write_checksum: sha1:1b1a794a78331bbad2e7fe0af1e6f111237c8e7a + pristine_git_object: 541b7dae3623b8cede0dbd1581926a18d9cccece + docs/components/batchproviderpreferencesonly.mdx: + id: 329c99c0e347 + last_write_checksum: sha1:38504173efff3e8585037c39c3c1a14f6dacb63b + pristine_git_object: d25f8767c5f193ee085eca684f5af8c606392c17 + docs/components/batchsubmitbody.mdx: + id: 2102d576a5e0 + last_write_checksum: sha1:eca8ca82b96b0d144a37ace434320b7e0a284d49 + pristine_git_object: 18a8a279799536c4e9d291265c51c21228720e60 + docs/components/batchsubmitbodycompletionwindow.mdx: + id: 71af0bee298c + last_write_checksum: sha1:8fbf3915f9a5f59a214bd5144758f57d7f9d2485 + pristine_git_object: 7c715d4dbe000829114ab92a123cc62edb9891f9 docs/components/billable.mdx: id: b983fa757056 last_write_checksum: sha1:80d142a13e98a8f13da2850753282adf2ff59521 pristine_git_object: a907902b407eac76aae4cbd5ce4814b36168123d + docs/components/body.mdx: + id: fc4484e326cb + last_write_checksum: sha1:8fa1a54b29dfbb8ce28618180f20aee724b340d5 + pristine_git_object: 8871db442a93fb93e245159c6bf52a758e734c28 + docs/components/bodychatcompletion.mdx: + id: e03ae2d0f8d2 + last_write_checksum: sha1:fa14de82912e84de9ccb7787cbb2f217eb53a5b3 + pristine_git_object: 462f8bf0a0ed9557ee50c26b5f5a8b4b7361a061 + docs/components/bodycompletiontokensdetails.mdx: + id: 1509f7a0b29d + last_write_checksum: sha1:e90b07448ffa1edad6115ae6b0055c956840af0f + pristine_git_object: 903c963ca8b0739ba8c5507111725584d0ec984c + docs/components/bodylist.mdx: + id: 6782e3e22759 + last_write_checksum: sha1:b1f376dba7ba5745ad9ad1b8466764aa2dd54008 + pristine_git_object: 2cd0a5e7b603ce3af126ed12a30f46238145b6f0 + docs/components/bodymessage.mdx: + id: 1b60240104a1 + last_write_checksum: sha1:6cd8f5eb0e8d982140b3a8bbee1bc358a9b1f84d + pristine_git_object: 92a8aa8739aa4c008e6ef760ca68b38673c03956 + docs/components/bodyobjectchatcompletion.mdx: + id: 2260d296d47e + last_write_checksum: sha1:ee36f3d63322e350ebb6c4e425f799b4ddc5663d + pristine_git_object: f16cab8d73ed78559deb0bfe157c21cf185a9c7f + docs/components/bodyobjectlist.mdx: + id: b99c4d98d90a + last_write_checksum: sha1:aaeb5af0c7e97c26ac50dd1ba2f066e63adcacd0 + pristine_git_object: c9a4024fbb65314564721db12b718626f1fda56d + docs/components/bodyprompttokensdetails1.mdx: + id: 88f525432ca2 + last_write_checksum: sha1:5b4fe005aa15d904e2a6668bfe635ce13695b103 + pristine_git_object: 29c622415bf969a500da59723f521c61ba4b0331 + docs/components/bodyprompttokensdetails2.mdx: + id: bb868d6b4f81 + last_write_checksum: sha1:15597d40728ac4a89b11632af625782cf6a1f02c + pristine_git_object: 6462670ef47935b4d2d6a798634204fac25b5b46 + docs/components/bodyservertooluse.mdx: + id: 346ee474d959 + last_write_checksum: sha1:ca01ef4c9df128a60776356ce37a854b757bf146 + pristine_git_object: 3e20a38a7fd61f8ae0c82ccce68e3679f6aeceda + docs/components/bodyusage1.mdx: + id: 371f1d9051d1 + last_write_checksum: sha1:5124dc71a02e54c4946e70e7543a6c8ef6a57900 + pristine_git_object: 61f933e347ac7babb62b211cfc6d774034a7847e + docs/components/bodyusage2.mdx: + id: 689051c252ca + last_write_checksum: sha1:f5054e1074faef4dbe8874528716293750564b22 + pristine_git_object: 56c99f9b14a375f3cf5a7e18e8e59c674543d91d + docs/components/bodyusage3.mdx: + id: d1f4fdaef272 + last_write_checksum: sha1:98b8b37260bb6c0651206a16e71cf5bb56a81a93 + pristine_git_object: 9de6b2bf6b40aed0fc8f4c8cf07b2244f00e6490 docs/components/booleancapability.mdx: id: 514674d4ad70 last_write_checksum: sha1:1421e43c3d78989f55da2cccb79fee62d20f87cb @@ -865,10 +1585,6 @@ trackedFiles: 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 @@ -1269,6 +1985,22 @@ trackedFiles: id: ce16c0139963 last_write_checksum: sha1:1637ce5dac9fc9c87df3793d46a4eff33282e0a3 pristine_git_object: 6056c49814eafac5ca7ce25eb0da8413a358c8be + docs/components/choice.mdx: + id: 593327cdb653 + last_write_checksum: sha1:ebde022903727e9a420cb6a2a2170f0ca853262e + pristine_git_object: 09102913c93acf706c458a06d7f8e234da7e167e + docs/components/choicerole.mdx: + id: 06a83503a909 + last_write_checksum: sha1:3471241bd6c563234ac0ba37b3030efe77a02c16 + pristine_git_object: 6640a4c76a7aebbf0a0ee45425982d842af26ff0 + docs/components/choicetypefunction.mdx: + id: 4e1a8142e1fd + last_write_checksum: sha1:bc72e013a2ef2dee52ae0372e542cd949bfa90ce + pristine_git_object: 51945adb924f2dddcbb4f6bb17b818d59e896452 + docs/components/choicetypeimageurl.mdx: + id: 6af5eec726f1 + last_write_checksum: sha1:ba384a9929e4884986ee81a8d2d75297afb308fe + pristine_git_object: 63cbbcf131ae61e4e32bd5133f9da36538353c8c docs/components/citation.mdx: id: 9a5f3d4dc85e last_write_checksum: sha1:caaf7b5e9d578c27e3347b6a74151450df7b979b @@ -1509,6 +2241,14 @@ trackedFiles: id: e5d65035c6cb last_write_checksum: sha1:451e759051c72d90ef986c9b40caa30d1eea6d84 pristine_git_object: c8165e83a8164c1e41179a5a05a38c381de9600a + docs/components/contentimageurl.mdx: + id: 4092a59d86b4 + last_write_checksum: sha1:17ded81f4cb058c57676df59ee542cebaf90affb + pristine_git_object: 41aae9e0e0b098357e5a018782c2498ce3fc8871 + docs/components/contentimageurlimageurl.mdx: + id: 623bd364af6b + last_write_checksum: sha1:63b3c93e67a2e85585afb93679b794dc3ef786b0 + pristine_git_object: dc4af46888885259cd1011228811f05203eebaab docs/components/contentpartaddedevent.mdx: id: 785ea6a90328 last_write_checksum: sha1:4c9ed7cb9761710e111042e03a4faff3cba51767 @@ -1587,16 +2327,20 @@ trackedFiles: pristine_git_object: 24b7dfa708d009a8263c9ee36b97520509d1ecba docs/components/contentredactedthinking.mdx: id: 1807faf0124b - last_write_checksum: sha1:ddfee69368735db2412078f92fec8c0af5a2c58c - pristine_git_object: f9c4eeefa07fcc73839934dd6b3d403fe7539da3 + last_write_checksum: sha1:feb68bbc33a7495853657ccf29f10f78b5c6089d + pristine_git_object: 03ca5bcd37fd5ef4605d8ef9b8cc6cea958f16ba docs/components/contentservertooluse.mdx: id: 7b676db3a465 - last_write_checksum: sha1:2d484e7b41f75605a15c9c438ca6da4e9571b131 - pristine_git_object: 7f97379bb48a31d94534294d5b9eaa0cc50dd7f1 + last_write_checksum: sha1:e69f59e1eeedaaf58468355c27e82c191da5e306 + pristine_git_object: c2377ff20699f875fe336a599b406518bdbb1c1b + docs/components/contenttext.mdx: + id: edb47869c1d1 + last_write_checksum: sha1:699954b078bb96b1342e8cda1b8c435abae39405 + pristine_git_object: cfdd29eea9c778cddaa79648b173cb409fa2149f docs/components/contentthinking.mdx: id: c23024acf25a - last_write_checksum: sha1:f3a989b8eb7a38f2705324263796f49a7e1722b6 - pristine_git_object: 8c9a9246c03beadee004dc71d2519862070cad1a + last_write_checksum: sha1:b7a42b96312c8dcf0615b22fee5ff5c8089aeaf3 + pristine_git_object: a7921fd6a486f25705c21b34c45a5061d5a3a528 docs/components/contenttoolreference.mdx: id: fe1e54c845d9 last_write_checksum: sha1:8fe8f8b82d310463c74d61c1b1cd90f004cfea09 @@ -1607,16 +2351,20 @@ trackedFiles: pristine_git_object: f83588a9c24d3172b8f8fd131cdc5aea073d0088 docs/components/contenttooluse.mdx: id: ad7fb52d642b - last_write_checksum: sha1:904efa673308a420ec0922071619a8dedb4b4fb4 - pristine_git_object: 0f54e811562c5249aa51b8fd6416a7e7029af0a0 + last_write_checksum: sha1:53d8ee54c6e644ac4bbcf2761cc613ee4e0069f6 + pristine_git_object: fcb07253683c36dfce773e9b5c49d8900882bac0 + docs/components/contenttoplogprob.mdx: + id: bf7749720303 + last_write_checksum: sha1:d2831798544b0ba7fee4bb793576be108794b2c8 + pristine_git_object: 5ac97a3d809d78375b31fcf6c8de98b102eedf2c docs/components/contentwebsearchtoolresult.mdx: id: d2401cf2f6b9 - last_write_checksum: sha1:d7ecfe7df3b1e89151edb59cd1525aab997b28b6 - pristine_git_object: 9a9180dcba1e86c7a26c5396f39bc4dafe160e96 + last_write_checksum: sha1:0313410ff97b25162ea709a2310ceb0c8deb8170 + pristine_git_object: 3f3b1c7fe0adb0264e3bccd550d115764dfff509 docs/components/contentwebsearchtoolresulterror.mdx: id: e53d83e87e2b - last_write_checksum: sha1:22dd4ec3f699feb7d8f22abff79623b427292e35 - pristine_git_object: c944724a99b7f7d4a9b5de4dc478f1e15643e20a + last_write_checksum: sha1:baaea90d1c8a581c3924fe201fc2b3ae96284fde + pristine_git_object: ab974796cb463855b41bb4ef133b2e198db5bbf2 docs/components/contextcompactionitem.mdx: id: 4e12480f54d6 last_write_checksum: sha1:3269c5e4d1ff0396f597d27fb4e641f3489584bf @@ -1809,14 +2557,22 @@ trackedFiles: id: 8250df00c843 last_write_checksum: sha1:addf1f380a24cd6f8b36a572d99c5ee28e483fc1 pristine_git_object: 23b3fdfc750fcb578ab751f7726f5fa8ba854b80 - docs/components/debug.mdx: - id: e3700a58e527 - last_write_checksum: sha1:c007eab589acb20b9bbc9f678fa16ba371a6aa14 - pristine_git_object: 15d4e2379683fafc7439117de2f4a72a747b09aa docs/components/debugevent.mdx: id: 6ca5a59f1fa4 - last_write_checksum: sha1:a70e1632f9ce13d2829e41fb60b75dec7ca2043f - pristine_git_object: 1a76e56a4273928dd20e3e46965643234733e3f1 + last_write_checksum: sha1:d1280f0b71a1df226f2f6647e13d6d3cb53bbab8 + pristine_git_object: fb80bd742324bd4b916c6f51e42e209786008ddb + docs/components/debugeventdebug.mdx: + id: 5cad342b79fc + last_write_checksum: sha1:baf023186836db1cee57e942f3b15065fb4b6207 + pristine_git_object: feaaf1f4a5857ac8a10850c9ad3a074470d64831 + docs/components/debugeventevent.mdx: + id: 3e27becf230c + last_write_checksum: sha1:1ca24809ee8f0820cfa3a44bc991536cddf92655 + pristine_git_object: cc98ef71fa9f70f75ee9dd017302376a9ed10644 + docs/components/debugeventtimings.mdx: + id: c979450880a0 + last_write_checksum: sha1:8a90454e3a6f3a0fa144c25289e4cbeea4d9278b + pristine_git_object: 0d5b176d788540a621e36a864f3b027d50a751c9 docs/components/debugeventtype.mdx: id: 8b6b222a5da7 last_write_checksum: sha1:e37576941ec9e2cb4fe176277bb02b9cc86f6f48 @@ -2025,10 +2781,18 @@ trackedFiles: id: eb40c458515d last_write_checksum: sha1:b85ea056036bbdbbcd4e0adea9dcd9a7dc695c51 pristine_git_object: b876816efb61e12af7f25bf72f0447adbfbd810c + docs/components/embedding.mdx: + id: a25fd31569a0 + last_write_checksum: sha1:8c8196e7ea5cf8a0a43a4495d721e4fa19530ffc + pristine_git_object: 166a8bd49cf3baede0bf5b2b6ec21743f8fe00f6 docs/components/embeddings.mdx: id: 71ed622a2f4d last_write_checksum: sha1:df72f6151943cfe8e1299569ab30fbbd3067b468 pristine_git_object: dafa20864dfb01d8b9e3db798aa1dab473331c34 + docs/components/endpoint.mdx: + id: bab712ee633d + last_write_checksum: sha1:77300824d3d0f875c20092c09677ee0d491e5a38 + pristine_git_object: 557833b9d2a6b5c01176c9433f80da832f6367a4 docs/components/endpointinfo.mdx: id: 6dcdfc7379a9 last_write_checksum: sha1:2c5fc2144a44e919bda2929fd9dbb10f64641ced @@ -2053,10 +2817,6 @@ trackedFiles: id: 10d9f9dbcaf3 last_write_checksum: sha1:415cb68d86a5d9bfd2ddb9bfa3ecd2794870721b pristine_git_object: c08a3d8fa9bad83e57d5baa9be9995f30b16a24f - docs/components/errorcode.mdx: - id: 0d3bc0f8a92d - last_write_checksum: sha1:ad3ff0627e50e0b51140afaf8fa9b08531f5e9c4 - pristine_git_object: c177e3075bf9bf8b124fc5bb0c54eff0a2a75ae6 docs/components/errorenum.mdx: id: 722594694be3 last_write_checksum: sha1:2049d2c991cd1fc6b678b44cba040d382eb3b133 @@ -2069,10 +2829,6 @@ trackedFiles: id: b365b7815bf8 last_write_checksum: sha1:65fe2b66aeb7f8e46a4c1a1e6ee826495fc86b71 pristine_git_object: ffc147c8c082c000a355063292275d381b130b42 - docs/components/event.mdx: - id: 83efd2dabaa9 - last_write_checksum: sha1:82c3b4882ab31a90147ffe5c0f5d3011ef6ba3cf - pristine_git_object: 3f077ae59db00c0a92cdaa90ddf24860dcf0c3c4 docs/components/failabletoolcallstatus.mdx: id: 66c801061bd7 last_write_checksum: sha1:3beed4470126b7cc6bf271423ad03db0163d7bd0 @@ -2153,6 +2909,18 @@ trackedFiles: id: 2518fc00979d last_write_checksum: sha1:12e23c87834ede010604d6f4faa85685899cfb74 pristine_git_object: e9d25567d44fbaaa6506ebebe1b75e8bb1a5cffd + docs/components/filetype.mdx: + id: e3c498df2a92 + last_write_checksum: sha1:987e38c9882fbba5aaea6ec69e26fbb8dd8b0f3a + pristine_git_object: fafd3cfa13a7cd302ff5942bd1afce938bed1630 + docs/components/filetypeimageurl.mdx: + id: 065dfbb39aca + last_write_checksum: sha1:07161138f2ec3aa090c1d545f59ce5ac7df1594c + pristine_git_object: f9f1f323b073e89f408770e94111ee1a2ed39e0b + docs/components/filetypetext.mdx: + id: 80a5415c1336 + last_write_checksum: sha1:98b061b2d33ce279c3fdeac14b5c2360fe910ccc + pristine_git_object: 87fc5863dd67cc33d4fa20e6c3ebb011fe1a235d docs/components/filters.mdx: id: eb61c97e25a7 last_write_checksum: sha1:4e20881809ca6f0e0ecc3d572919f96f7ba4088d @@ -2167,8 +2935,8 @@ trackedFiles: pristine_git_object: 89d1920451399329c5059da274654c41633e53fe docs/components/finishreason.mdx: id: 7a4d8a4b94f1 - last_write_checksum: sha1:aa34896bb38e1d7274a1a4c8987e2589b3f22a10 - pristine_git_object: 0693755f024fda70cc099c4df7731d293ddbc1ca + last_write_checksum: sha1:13d19799a1c74aa2a4305c0b5a61c0c822ed1b21 + pristine_git_object: 4cc750a30c3012f004715c8df2b7afc021902218 docs/components/forbiddenresponseerrordata.mdx: id: "760721125246" last_write_checksum: sha1:0fe4b361de356d50554272941fd52c8c256ce2a0 @@ -2505,6 +3273,10 @@ trackedFiles: id: ccedea0ab250 last_write_checksum: sha1:08342a9cceb4f7a5dc0b574a429d46af9d9a13f4 pristine_git_object: 9e0a058e6a19b68f470eb0938670dff51b47f4b5 + docs/components/image.mdx: + id: fcfab5677d29 + last_write_checksum: sha1:5d184152b5cfdb57d8120b8308b2cebf871f039b + pristine_git_object: 36a2381e71365c556baa3cfdaf2804cb76be11ad docs/components/imageconfig.mdx: id: 455a9f530ea8 last_write_checksum: sha1:b163b8b8e90a6011cc0d64a26febb459045f6019 @@ -2655,8 +3427,8 @@ trackedFiles: pristine_git_object: cabf0cccfa7d7bee9faa823d66650bc395220966 docs/components/imagegenerationusage.mdx: id: 0f8faafc5148 - last_write_checksum: sha1:7662a98019e0fb829b124d14f938ee07f5ef5519 - pristine_git_object: cb01cf31c16ba5f1caea0be6b376e83ee0d82b59 + last_write_checksum: sha1:3f588aea2da09f64b4369514c8f2b551b497916d + pristine_git_object: fa7df815c676cb935da4e81d02de4d019554b369 docs/components/imagegenerationusagecompletiontokensdetails.mdx: id: 71ecb25e164d last_write_checksum: sha1:f0843acffd7d7540b07bb384f299557e7309950d @@ -2665,6 +3437,10 @@ trackedFiles: id: cb55411b0067 last_write_checksum: sha1:38b7a082d8c225351211a7b4473291d662ebbb66 pristine_git_object: a00b1254724080c9b26012b397bffeb4885fb67b + docs/components/imagegenerationusageservertooluse.mdx: + id: 41c2cbb3625b + last_write_checksum: sha1:62b564a4141b39b8ee6bcadb956b1ad561f78ca7 + pristine_git_object: 427cf8d0f33f933a6efb0e07f76ae8ea99bc2045 docs/components/imagegenpartialimageevent.mdx: id: 865cadc17d8c last_write_checksum: sha1:9d921f6dda0f0aa406ac9589b024211d666e1b9f @@ -2975,8 +3751,12 @@ trackedFiles: pristine_git_object: caef6da66201fc69d119282fa86bd54c5674d57b docs/components/internchatchoice.mdx: id: 5ef48232ae77 - last_write_checksum: sha1:cfd8789928dc8860a4c518d0db9e4f66291b7cb0 - pristine_git_object: 78a4f7f400f84c2e1f494530afa2066633443b9f + last_write_checksum: sha1:eb3636810c988d0a9f731829ca0ed664b3bf8285 + pristine_git_object: 7d0bdde08f818dfa0d53daa326b4605bf963fe2f + docs/components/internchatchoicefinishreason.mdx: + id: 8c0d6f9d5d37 + last_write_checksum: sha1:4e4ad36194a1b650bbc181933e596172b3e496d5 + pristine_git_object: ebcb8202e58b8c700f2a6e9d562ea50c9502833d docs/components/internchatcompletionchunk.mdx: id: 4f5dc2924625 last_write_checksum: sha1:7576fe0d255e706ec04cbfa93ad21536adc5dc4a @@ -3285,6 +4065,14 @@ trackedFiles: id: c2e49761789d last_write_checksum: sha1:7461a6ed2ebd7d111f3a6c2ed9051310643a6962 pristine_git_object: 6345da5c5881bd02c31a53afacce924bab7dede4 + docs/components/logprobs.mdx: + id: eec4f2764ea7 + last_write_checksum: sha1:f93a9f9c568dd43c4493749578f7222f9c28cb8c + pristine_git_object: c0b2da9f76a9c354d1c71b93f5ec98ec88246346 + docs/components/logprobscontent.mdx: + id: 235a699032ea + last_write_checksum: sha1:40352038f0f4b5f813b106b63ef2a790372788d7 + pristine_git_object: 0645e0cddf32a6cfda57cc7554808c61b99ee039 docs/components/maxprice.mdx: id: 4c021ec1bf65 last_write_checksum: sha1:3d6adde1002316d1880a95f5015889f052eb217a @@ -3369,6 +4157,10 @@ trackedFiles: id: 9265ef3d0f1a last_write_checksum: sha1:19580835f051bd4a97d1d272d3a6dbc882e016f2 pristine_git_object: 11421f055f1c2312710b637f72378d63e9df1d8b + docs/components/message.mdx: + id: ff609a40a5fb + last_write_checksum: sha1:90b84a26a3653cde2c850357dccb5a96220da6f4 + pristine_git_object: 293ccd909a8830488170956fbd453947c4746788 docs/components/messagesadvisortoolresultblock.mdx: id: 5a07a5b7964a last_write_checksum: sha1:c85152d6893ab94e48be57d50390aa0d5524b996 @@ -3379,8 +4171,8 @@ trackedFiles: pristine_git_object: e15e5c95e01572a3fc7d59ff16dc4bcc5d695447 docs/components/messagesbashtoolresultblock.mdx: id: da1ca4f7868f - last_write_checksum: sha1:e89d8964fde12e1686313d307fafaad3c3efdb41 - pristine_git_object: 34a24b71ecab7ab0d7d57d625e2bbb335fddbf1f + last_write_checksum: sha1:48bb1eadbc9fe8debf89cee1450c1104d32cac16 + pristine_git_object: cf49493d947418227545c9c885577267db33b652 docs/components/messagesbashtoolresultblockfile.mdx: id: 64a09154d386 last_write_checksum: sha1:6dcd5e97efd97cd39b13daff665d4d7a380322a9 @@ -3389,6 +4181,10 @@ trackedFiles: id: 8251757b7bd9 last_write_checksum: sha1:ea4a33f0c080cfd10bcfa15c417ee9d4eb700868 pristine_git_object: a02ac9087f8a079ec7f8a7a3f47ac9fda295ebe7 + docs/components/messagesbashtoolresultblocktypeopenrouterbashtoolresult.mdx: + id: 658df7e0263c + last_write_checksum: sha1:8388cbacc5aae202c8329d75849311055c45b3aa + pristine_git_object: 97ad4d6cd231c023f072c21709195d3627683efb docs/components/messagesfallbackparam.mdx: id: d7e026fed5f2 last_write_checksum: sha1:3f1e346696d37529787d1d9f85a1efc8e7162bea @@ -3417,6 +4213,10 @@ trackedFiles: id: 103a9b1bc479 last_write_checksum: sha1:8082efc20a4cb6d09750ac74b4db5a4f224d7032 pristine_git_object: f7bb2cc53c8b844fe5f28f7cfa6c864f94994ddd + docs/components/messagesmessageparamerrorcode.mdx: + id: c0bbfb0a5e1c + last_write_checksum: sha1:c8640eefa9eb3ac018129665de90c4009b269003 + pristine_git_object: b93c6f8f643808eed719fbeb9aa2df317a58f0e6 docs/components/messagesmessageparamrole.mdx: id: cb1721b92cd6 last_write_checksum: sha1:3f5c7431c6635c667b17e7b176b7dd4ba6f6777d @@ -3425,10 +4225,34 @@ trackedFiles: id: 5194bb4cd379 last_write_checksum: sha1:817f941770a847e3683c28fcb2a6237321bd2561 pristine_git_object: 371458c5cbce70c0ff25e7da7703feeef8482d34 + docs/components/messagesmessageparamtyperedactedthinking.mdx: + id: ee7236c16c4d + last_write_checksum: sha1:ede69df3dbe08e358ccbbda6dc5047101aed6ed6 + pristine_git_object: 0f6a22b14e57d7b6e4752546386fe2fa09114ca1 + docs/components/messagesmessageparamtypeservertooluse.mdx: + id: c601d89b7a2b + last_write_checksum: sha1:042f6fd06465bd25cf2124202ceb1adc5a6aa419 + pristine_git_object: 00176a27a231b75574bde19411037a0f2bfb1aa5 + docs/components/messagesmessageparamtypethinking.mdx: + id: 0d5f4d8491a7 + last_write_checksum: sha1:f7a7d6deec6ee851ee8c1a57230c3c565ec53419 + pristine_git_object: 204db3759fb6633711924f3c5e8b01b84978f9a8 docs/components/messagesmessageparamtypetoolreference.mdx: id: 014debbefcdd last_write_checksum: sha1:4322666e790a2a05c2a344f835fd98995070ed7c pristine_git_object: 3556e0a170fc8b56f77ee0afa995f5d6514e5379 + docs/components/messagesmessageparamtypetooluse.mdx: + id: 9e709ab6d908 + last_write_checksum: sha1:969c4f21adee3b0b265d2775d5a78841391b2571 + pristine_git_object: f9c15cdb21e4d03cb148b32df3fb6ad2e2717083 + docs/components/messagesmessageparamtypewebsearchtoolresult.mdx: + id: 3e12d806a5c1 + last_write_checksum: sha1:1535161074ddeab805ec1952eebdd626e93fb2f4 + pristine_git_object: eacc1a82e70658dca34cdea927c92a198cbfabb8 + docs/components/messagesmessageparamtypewebsearchtoolresulterror.mdx: + id: e9c26b2d943f + last_write_checksum: sha1:b4e44a1c052ba70a0249e2eab93ee65fd7f01b5a + pristine_git_object: 5b9020f736f733fa0e1827ec92b9edaeeabece81 docs/components/messagesoutputconfig.mdx: id: 4f36aa4862b1 last_write_checksum: sha1:f5ce07d1d0cccb54cd23587265a28960a918b46d @@ -3475,8 +4299,8 @@ trackedFiles: pristine_git_object: 52ce907478e961eb90e709fca118e6d0631883d2 docs/components/messagesshelltoolresultblock.mdx: id: 0a41992a115c - last_write_checksum: sha1:bfab01b3dcc371e80b822306ee94948a999359c7 - pristine_git_object: 7c48f8d3ca7545e66aa868c1d3df4e96efd6a195 + last_write_checksum: sha1:29bf324afbb64e24b96fbf808c480393b41418ee + pristine_git_object: c078c4b3b1db5ea4b96568c9885aeb7cd2fa6703 docs/components/messagesshelltoolresultblockfile.mdx: id: f5636e687109 last_write_checksum: sha1:bfa340819f542b081f14cdbf99f05ba6f0ce3c0b @@ -3485,6 +4309,10 @@ trackedFiles: id: c7d3ab58bb30 last_write_checksum: sha1:cc1ad66544846224014149467b47165d781e73a3 pristine_git_object: 9c83ecd83a7ad435aac6486e39a9f0a4cdc3d16d + docs/components/messagesshelltoolresultblocktypeopenroutershelltoolresult.mdx: + id: 52f945efc44e + last_write_checksum: sha1:ef1c50eef66081ec925803b4b0f1b1e58cc3e11d + pristine_git_object: dea5b508c1b3cbae6eaf880a0ae183ac18a0c30b docs/components/messagestooladditionblock.mdx: id: ee6e08ccc2ae last_write_checksum: sha1:b56dd3ae6d6e105c57162a705794a799ffd65533 @@ -3689,6 +4517,10 @@ trackedFiles: id: 95e16bc8c6fb last_write_checksum: sha1:81307bc7bf42460514498c8dd4f1aee87886cda7 pristine_git_object: 463ee9cd6a8eb9089700e17d1e6166d5bfb2078d + docs/components/objectembedding.mdx: + id: b79fc83c75ad + last_write_checksum: sha1:22b80618d6e977507d67d37c69b643234fc49f4b + pristine_git_object: 58159d4109cdee7a9ca06930e92692492f106eab docs/components/observabilityarizedestination.mdx: id: 8ab5c92ec9b5 last_write_checksum: sha1:c7d998de9b145c0c4e6fdd86c0c81f0b48dfed5e @@ -4149,6 +4981,10 @@ trackedFiles: id: 59f334d128a7 last_write_checksum: sha1:c74e9c086d4911223620a11dcd45c5eb9b9160fb pristine_git_object: 6ef2ae2c930d1279df1f2f68348c8bf3583c2a7c + docs/components/openrouter.mdx: + id: 108e47070243 + last_write_checksum: sha1:62b795cb3e85b7afd8c1a9223de73226fdad9048 + pristine_git_object: 995c9165f966dad09ada62edb466494388b433e8 docs/components/openrouterfile.mdx: id: 190a66b8ac85 last_write_checksum: sha1:55e54ca3ef094ac4061e2d7322c9b8e5393d3d48 @@ -4197,6 +5033,58 @@ trackedFiles: id: f88a0ae3ee7d last_write_checksum: sha1:196dfc00e44fa232c6e4f0f496f265a163ffe66b pristine_git_object: b4df5fb4757522576e8452d88f22499cee204278 + docs/components/oranthropicbashtoolresult.mdx: + id: 3f208e7cd614 + last_write_checksum: sha1:b7781453c59bd00952b792ff1686ce5888e7d262 + pristine_git_object: 4428fcec160ffcfa87b9ac99e1e529e8a4b7fc25 + docs/components/oranthropicbashtoolresultfile.mdx: + id: 51d2b6bbeae5 + last_write_checksum: sha1:78bf03fdbc91b5de57191fa6792d854a308e77ef + pristine_git_object: 350d2e7614e726e5e72fb328169163c236185891 + docs/components/oranthropicbashtoolresulttypecontainerfilecitation.mdx: + id: 68c272de959f + last_write_checksum: sha1:7441a252b17a165b2ae6c9b731ed2d0d87bddde0 + pristine_git_object: b8a438c68576803914c74f0eea2e54e14b81b5a2 + docs/components/oranthropicbashtoolresulttypeopenrouterbashtoolresult.mdx: + id: 09214d12e230 + last_write_checksum: sha1:072abb1e48963466d89fab78f72be7afbfe23e59 + pristine_git_object: 81e1641c3fa5f86ec7dffa26f1e17ca6268b4a43 + docs/components/oranthropiccontentblock.mdx: + id: 62845c8cbfa4 + last_write_checksum: sha1:98f0bc9816f800f5243a358d1d2e0f0738388f77 + pristine_git_object: 9dae5680318eccef762729974de9527fc8e02de0 + docs/components/oranthropicnullablecaller.mdx: + id: 163ca32be097 + last_write_checksum: sha1:54cbb4fdca84a000288b7413f3b41416e0a6260c + pristine_git_object: 2468ce4998e2e2608d43d29e13c0fb8581bb2fe8 + docs/components/oranthropicservertooluseblock.mdx: + id: 83e7243ef12a + last_write_checksum: sha1:27dbec2fc885fe67bd2c3f099d838d0a2ab41fa7 + pristine_git_object: f88678aca5254edeb8b73c3966da76066913fb75 + docs/components/oranthropicservertooluseblocktype.mdx: + id: 0b85ae66b382 + last_write_checksum: sha1:af3c1d6a9775ff864d2e38acd47e2df7c94519ff + pristine_git_object: 71e0efccb9504df82e5e43e4464aa3bfecabfb4e + docs/components/oranthropicshelltoolresult.mdx: + id: aa3635dcbf7c + last_write_checksum: sha1:8739e5584bcaa7e71af0fcb39869c80518048103 + pristine_git_object: 4ac936c443fd98b4206ad181dd0bae4abd9c83a0 + docs/components/oranthropicshelltoolresultfile.mdx: + id: 7ddfbf17b8d1 + last_write_checksum: sha1:fd881992243df8bdaa48b6bb5622741f77a4ea33 + pristine_git_object: 8ffa1419ee04a586087bc91cc2ad29091d261c0c + docs/components/oranthropicshelltoolresulttypecontainerfilecitation.mdx: + id: cecf28a31b8b + last_write_checksum: sha1:40a7fe01d91d3faf5911072ce0367a8f22b750ac + pristine_git_object: 4d45fb35f441c7191ad54272b3872313850894aa + docs/components/oranthropicshelltoolresulttypeopenroutershelltoolresult.mdx: + id: 4f7c5db833b1 + last_write_checksum: sha1:754dc602c5f20176590c358722d51801c8323da6 + pristine_git_object: fb293351d27fa278ad5dd65564c9c78af4ab6252 + docs/components/oranthropicstopreason.mdx: + id: 54ab277028fe + last_write_checksum: sha1:1c20272fe0252aab107a38c0f62291ed841cafce + pristine_git_object: d04c1aa336e48c7deedb31e9acca1b3e929eba22 docs/components/outcome.mdx: id: dc555505ef36 last_write_checksum: sha1:5e99185f9d49f3f404ca4e54ef84d0cdbf31546c @@ -4259,8 +5147,8 @@ trackedFiles: pristine_git_object: 4e1ac848efae9e52849329f14d2b9ff2f14933bd docs/components/outputcodeinterpretercallitem.mdx: id: 167ec714574b - last_write_checksum: sha1:a8b6ab633681cf91080dcb3d841f34f4fd8cb6d0 - pristine_git_object: bd9643534d23c3894917597de1717b9d01c7a34d + last_write_checksum: sha1:3813476c9401844dcc092fc81d1497f63f69b247 + pristine_git_object: 2998f9693005446aa2e0d18da3e51cc15b386810 docs/components/outputcodeinterpretercallitemoutput.mdx: id: 8df225976a5f last_write_checksum: sha1:079c039cc1c074c7405776ac03022c6945c80627 @@ -4367,8 +5255,12 @@ trackedFiles: pristine_git_object: 700af387aa2f0f827ef4775f69fbb3900b075899 docs/components/outputfusionservertoolitem.mdx: id: bc7c73cc3100 - last_write_checksum: sha1:f5d2d410c6684611ca06578f1ee6f60d7db209d9 - pristine_git_object: 0d66d4e053416b08402e08f11c7dcde2b2b9497c + last_write_checksum: sha1:9b88e62a0ba25f9b363bb6c5c3af0694e99cecfb + pristine_git_object: dfc07a5cb78407601b08853e3fcd20cb0f54850e + docs/components/outputfusionservertoolitemresponse.mdx: + id: 14601c3ba47d + last_write_checksum: sha1:22e35b0495f01161f7a44aa7117bdb8f80924bfd + pristine_git_object: f7862f7dc6a59ea210d2c1c65ee9cffc7b794eea docs/components/outputfusionservertoolitemtype.mdx: id: d5337e29a21f last_write_checksum: sha1:133446222202e08ffceaa5944185842c21078830 @@ -4631,8 +5523,8 @@ trackedFiles: pristine_git_object: 909b5a9d76aa8d35d543c6d26b297a4fcf1b44e1 docs/components/outputwebsearchcallitem.mdx: id: c79fb1d179e3 - last_write_checksum: sha1:89bdc1fc7bae81cab11649a8b0333ee6ad4b4c7d - pristine_git_object: 746838c8ddcc727399d8274b7aaa6f1c5cbed366 + last_write_checksum: sha1:107c563ca8dbc097413af744d477bc70c791aa23 + pristine_git_object: cd7081d3c6b3727ff84727ba670401d96f342cd5 docs/components/outputwebsearchcallitemactionsearch.mdx: id: 68b8fca747ab last_write_checksum: sha1:98a76009fb8bc87c3b2f20dcf56af177cdff2826 @@ -4985,6 +5877,10 @@ trackedFiles: id: 96184b7986c3 last_write_checksum: sha1:b7d150d28d29a72074c4a094a8bcaed7c1c80909 pristine_git_object: 6c358d0e153e45a3deb9468d715f876561598a8c + docs/components/reasoningdetail.mdx: + id: 50029a564f00 + last_write_checksum: sha1:4c4771a3979ccd17d511d4875c0d014a4d5ff441 + pristine_git_object: 476708cc18a819c093e18a87bf3da5cb44ec9705 docs/components/reasoningdetailencrypted.mdx: id: 7bf862724f88 last_write_checksum: sha1:23b0b825b177db6d7ee539cba858f2de2e1a7740 @@ -5117,6 +6013,10 @@ trackedFiles: id: 889d0f7c9bbf last_write_checksum: sha1:1091eddb7370abadf0cb898eb82439ea67932b82 pristine_git_object: 9724b529b0c42063dd25638672fbe19249b4520a + docs/components/refusal.mdx: + id: a8fdf8720280 + last_write_checksum: sha1:104c91d40de5a42f01e187f7751fe765697b9f02 + pristine_git_object: 2d1c89c3427a8aba6b30813f3ae49f45cd4eebba docs/components/refusaldeltaevent.mdx: id: 2e54cae49929 last_write_checksum: sha1:0992fb070f815f9fb16bcc9eef69ee1a6e78fb74 @@ -5133,10 +6033,18 @@ trackedFiles: id: 4f8136a055a8 last_write_checksum: sha1:d205c02bb074a52f492a81ba76b3568670fc1334 pristine_git_object: a6e370bd6787ea1a068791e331b4c894666dabe3 + docs/components/refusaltoplogprob.mdx: + id: 08b73cf19c13 + last_write_checksum: sha1:96930cd9b2fa6ff93533248841b3aa6baf556613 + pristine_git_object: fa0f7cb0abaae1e54547b911d4cc05ea4d001218 docs/components/region.mdx: id: f2abab6453b6 last_write_checksum: sha1:9db11174ef8a40a144f94ec1d18cb4500fc66871 pristine_git_object: 51b26cc819421478797a67e192f2c8952cab45a4 + docs/components/request.mdx: + id: 040880b5cc44 + last_write_checksum: sha1:8ba21faa64db0cc79366502d8620f817fc90f3b2 + pristine_git_object: 3ae4bc94d9114f8db09f5b796d5e4e1faf8a1f21 docs/components/requestedtokentype.mdx: id: b9ec16a07b4f last_write_checksum: sha1:4dc1c7aaac97bca551c291d8e8ff8444de911f5d @@ -5169,10 +6077,6 @@ trackedFiles: id: ef4f6969df8e last_write_checksum: sha1:e47284974689070a1dd9c82195e4588fe9ffe17c pristine_git_object: a22e20430c548554994bd3e8371b19cf8027784d - docs/components/response.mdx: - id: 08f49f31e8ab - last_write_checksum: sha1:13b3e031d4aab706503a23ff99528813ec14698d - pristine_git_object: f12a0a04d9dc4430ca6180c8507360d9bc7494cd docs/components/responseformat.mdx: id: 9b8deacad550 last_write_checksum: sha1:fab329e55c5d5be71c187de6a2ca592d7c1c3e68 @@ -5233,6 +6137,14 @@ trackedFiles: id: 5eefe41f1850 last_write_checksum: sha1:5bf57ab774a603b3602b049675a50e7cb4f22fa5 pristine_git_object: 2d97adfb5bb7dbf37bc14c01411221c05d9540f3 + docs/components/result.mdx: + id: c76c321807c9 + last_write_checksum: sha1:b00723af9fe69d7fec032937d30a1dd17565783d + pristine_git_object: 77ee4848318b65158bfb04b9975a1f1d39eef2b5 + docs/components/resulterror.mdx: + id: 4ad56b7d7d1a + last_write_checksum: sha1:0ee81f3831154c344605a72f2924167f220f402b + pristine_git_object: 2609a9af043ce5570970252f3ebd5df12d693be3 docs/components/routedservicetier.mdx: id: 1ecc7cdd925e last_write_checksum: sha1:538e8fc60dab1d88f2b735682161cc8ab6101d5d @@ -5305,10 +6217,6 @@ trackedFiles: id: 126e702b7c97 last_write_checksum: sha1:3fbb5c3145b96472437de6e6384ae222b0ae5210 pristine_git_object: 185abbfd59b8369f9e7475ab4cd7acdfc58962a3 - docs/components/servertooluse.mdx: - id: 0431e1259d43 - last_write_checksum: sha1:79bb35b65254a9df9804ccdc89a84ceadc72a811 - pristine_git_object: a90fbbefe76853f92638f4ae7ad63cf67951efc4 docs/components/servertoolusedetails.mdx: id: 5a7d75562dec last_write_checksum: sha1:c2a156aba0f34118e3c681561f817d8deb4a06ac @@ -5639,8 +6547,12 @@ trackedFiles: pristine_git_object: 3e6f988ecc0a7b7857963ebec2be310ab7d6a8d2 docs/components/submitgenerationfeedbackrequest.mdx: id: fba2401919b4 - last_write_checksum: sha1:0c574d3011a3b5c9183697be0484a019188b5ec0 - pristine_git_object: 9e56152e2335fe11da9245816c8d1e97cd86948f + last_write_checksum: sha1:bd6018a06cbfff4a70523df033ae5eb5263bbd83 + pristine_git_object: 4ac73ca3e948c6d782fb7eba240f38889029544c + docs/components/submitgenerationfeedbackrequestcategory.mdx: + id: 03b1de1975fd + last_write_checksum: sha1:3505b8c9f74bd5a264dd3a035bd40401bdfec4e0 + pristine_git_object: 59087549356cf8c753fe64e3c59d9414249752cc docs/components/submitgenerationfeedbackresponse.mdx: id: 965ad9f0e7d8 last_write_checksum: sha1:7451bf17e40384dd0c719af06afd429f305da84d @@ -5753,10 +6665,6 @@ trackedFiles: id: 9f8561d6342c last_write_checksum: sha1:6226a4ff5f99a852e34cd5053851a507cb3a9e7c pristine_git_object: 834297f4c2167ee22b57bd3cfb126b37662cd1ae - docs/components/timings.mdx: - id: f8f7eb6e6313 - last_write_checksum: sha1:4061554783746bdb572dc5eb4ae678a677fc6c5e - pristine_git_object: 8d52bfaecf3fa301b6e9466ed356adb0b9202085 docs/components/tokenexchangerequest.mdx: id: c1564eb38361 last_write_checksum: sha1:e91d2e5d15beff1038a83015adf13f3feb075819 @@ -5777,6 +6685,10 @@ trackedFiles: id: acc36fba0c55 last_write_checksum: sha1:b899d22b5559c09fcaa14c5cd3ff18f914ad34d2 pristine_git_object: d3a3ea6cfbc5118b9adad9c1a8e543e02fd2870f + docs/components/toolcall.mdx: + id: fa42aff5b218 + last_write_checksum: sha1:d525714d89ba4ac83127dc5a86aa30412d20fe48 + pristine_git_object: c5f4d3277b91270ddf75f49f49c2a30d0653904a docs/components/toolcallstatus.mdx: id: e79e5ffbe798 last_write_checksum: sha1:338789050d562f0ac596d6a94783307e27a634b2 @@ -5937,10 +6849,6 @@ trackedFiles: id: 6afc200110eb last_write_checksum: sha1:67b122fb7d678523303b419575d85075c6cf260a pristine_git_object: 8c90b7c0c4ccd514fd2b06a1e10c9879298978ef - docs/components/typedocument.mdx: - id: fa9ad2eb2436 - last_write_checksum: sha1:fe8fa4d17512f8263bea11e1e294e6079c223312 - pristine_git_object: 328ae7fcb9399517ec9cdaebdb94c435649922e2 docs/components/typeenabled.mdx: id: 2107f66972cb last_write_checksum: sha1:47c1d819d31519b3d19a87f3389786d5c23206d4 @@ -5977,30 +6885,10 @@ trackedFiles: id: 89a2b0de24a1 last_write_checksum: sha1:1cc4fa33245f661d60f3f84b69fd7e520efc916f pristine_git_object: e7e1d470ec3543c8c3a962bf9067d0b2f9e95f7f - docs/components/typeopenrouterbashtoolresult.mdx: - id: 25eff7c126c4 - last_write_checksum: sha1:c831674fcf9df1c4d4096f3ecf5a0fc7e6072e56 - pristine_git_object: ea0d4fae2a60839ea493078431a2d2c92b1eb0db - docs/components/typeopenroutershelltoolresult.mdx: - id: 6d0414416b3a - last_write_checksum: sha1:d7c3c5b17390ee75e36c9902c922f0f8121276a7 - pristine_git_object: 76a4069957faaf646163d761bd0616a51145a744 - docs/components/typeredactedthinking.mdx: - id: 04adae6db206 - last_write_checksum: sha1:3cbe8cf0cc55f1f67b552fa99c959e6d8b3ef577 - pristine_git_object: c02fa818a7b8c748126d1979eaf46d9f579b6a33 - docs/components/typeservertooluse.mdx: - id: 1247ec91e13e - last_write_checksum: sha1:426dc2920239071f856910e2e9b69493dd968f7a - pristine_git_object: 9c498fcc2aec9396db450b8ccf4296ac036af0a0 docs/components/typetexteditor20250124.mdx: id: 6104a1c13bf2 last_write_checksum: sha1:041007e5b9c7d4ef048d0c380cdadedad4c6066e pristine_git_object: 21cc14ae46b99547e0304a43c3f8b0333ed624f5 - docs/components/typethinking.mdx: - id: f2c53e514069 - last_write_checksum: sha1:aa074bdf3a3338e784c15b0315b124b360e9c05a - pristine_git_object: d2a690369a1e99d208acfd286221e27af361f382 docs/components/typetimeout.mdx: id: 719dbf6b334c last_write_checksum: sha1:97c8ec16454e0abc9eb1e4dc271e8f4736bef54c @@ -6025,10 +6913,6 @@ trackedFiles: id: 07ae3f30e4a2 last_write_checksum: sha1:aa2931bc195ddc15bd18d9fac6948f8f24bfbe08 pristine_git_object: e7702ba4121c757b4f57d552a4f608bd4636e7b5 - docs/components/typetooluse.mdx: - id: fd677e8ed9eb - last_write_checksum: sha1:4ca40aedbae56b068f0b2e4b06a9f885c0411a6e - pristine_git_object: 6e4df39fe15fe8783509a79bae43d19783689ca3 docs/components/typewebsearch20250305.mdx: id: c5cd64905a32 last_write_checksum: sha1:70d29a41edfb246a4e50bf98bfca9df61809d075 @@ -6041,14 +6925,10 @@ trackedFiles: id: f106073e7ccc last_write_checksum: sha1:49a2fbfc2f23e1b0d5a0b06c3c83c1814faa4edf pristine_git_object: 981349ba4f68bd68106c5604de599506315b3bdd - docs/components/typewebsearchtoolresult.mdx: - id: b8f83f24a5df - last_write_checksum: sha1:b8f03e26067f1299b775d15600559f6654733f3f - pristine_git_object: 1d9df7e9f1be8b0821a6e14f789438f9f89faed3 - docs/components/typewebsearchtoolresulterror.mdx: - id: 13d925cf7789 - last_write_checksum: sha1:5e9992e7fee86890fe8e1033f0b6bbbfc93e5776 - pristine_git_object: ff44734cf33cb8a24c20bbfb96dec9ef2ac504e9 + docs/components/typewebsearchcitation.mdx: + id: bb828f6f1c61 + last_write_checksum: sha1:0adc7248631ed70de2b4c6533afa1216a96d22c7 + pristine_git_object: 98eb3478a0498518dfd0996d34538980139bfb6b docs/components/unauthorizedresponseerrordata.mdx: id: 74e10dac821b last_write_checksum: sha1:01dbc5e3adede05f48949cfd626dd467f5367310 @@ -6201,6 +7081,10 @@ trackedFiles: id: c06f43776223 last_write_checksum: sha1:70a902eabc908f65375a5eb6327da22010f7850c pristine_git_object: 20e9f498c59878d34de3257cb3183c4a5bfe0b33 + docs/components/upstream.mdx: + id: 25d71bf9e791 + last_write_checksum: sha1:48bee47dd5110a752294cd33f2f95b7461a36d07 + pristine_git_object: 961a0770445a25b17367a1dce234e9de08fe84e4 docs/components/urlcitation.mdx: id: 30f4b4a19fd8 last_write_checksum: sha1:bb9b6ff886f2ec6e039985276dcd724c08e19ac3 @@ -6357,6 +7241,10 @@ trackedFiles: id: 378b44d122d4 last_write_checksum: sha1:4aa0acca402e507e0f5b53f700b19e8440b7c4b3 pristine_git_object: 6453f10f1843521ab57609e00cea4459984d565b + docs/components/websearchcitation.mdx: + id: bbec5a5603e0 + last_write_checksum: sha1:d96af472fa3a25030b28a908931261936026a9d9 + pristine_git_object: c9531635346e9818cdbba19a2dcbaae44fec6672 docs/components/websearchconfig.mdx: id: 6d343d63543d last_write_checksum: sha1:bf33fc169d688cb8b561706bb96199447d5ea76d @@ -6469,6 +7357,14 @@ trackedFiles: id: d595cba2d9a9 last_write_checksum: sha1:bad7d766ee81f14d911697b80bff4687e90a1fbf pristine_git_object: 68e67bcf878f4851e6df41b2e3ba50ccb5560e7b + docs/errors/batcherrorresponse.mdx: + id: 97f324539aa2 + last_write_checksum: sha1:d36aa545c648326501e081d838ea2a25a150794c + pristine_git_object: 6b8ce49bb4980ccb3d7092f2decf69b1f76bf225 + docs/errors/batchpaymentrequiredresponseerror.mdx: + id: 7621fe876155 + last_write_checksum: sha1:4a2ff7fde01d9c212a4c36ebdf1cf42267b7cb48 + pristine_git_object: 9c093bb2bec3aa9ad2263bda351053853d109733 docs/errors/conflictresponseerror.mdx: id: 130bd0076f35 last_write_checksum: sha1:7e864ef86f3fc50e28bb4e9b1ae06fa88a46efe5 @@ -6713,6 +7609,14 @@ trackedFiles: id: e1f782dea5e9 last_write_checksum: sha1:42377b77453fdc76d20455839f520abee7107556 pristine_git_object: 5044f5777fcbceaac89ea96adc0ea769a9efc274 + docs/operations/createbatchesglobals.mdx: + id: 14cfd92c3cdc + last_write_checksum: sha1:a550a4b82b4efde92dfec2363404094b37a2b5ed + pristine_git_object: 3fc8554f3b3c85f11a9bc20efd0e0160f9a510d7 + docs/operations/createbatchesrequest.mdx: + id: 116d6b57d04f + last_write_checksum: sha1:0ff2064d078ed4b123474fceb122300e1176111b + pristine_git_object: a809455bb86d4a9aa72bb0c177415c16fd9152b0 docs/operations/createbyokkeyglobals.mdx: id: e631e8e4e0fb last_write_checksum: sha1:7cac52a36f1682f8fdcbe9c0425b0bd07a1a6375 @@ -6941,6 +7845,14 @@ trackedFiles: id: bf5ee96a37bd last_write_checksum: sha1:c0e9c06f8a484108aaf5a39fcbf4bc712193bc0c pristine_git_object: 03cecfd4ec0719a6f5a1b8ea3ae2480f76b650aa + docs/operations/deletebatchglobals.mdx: + id: 800f062bda3c + last_write_checksum: sha1:7d0e1e7ad01d7d8ea898cc1eb9f422aee84fd93d + pristine_git_object: ab6c9c87c8de380bbca68d97411b8dbc4f2fd44b + docs/operations/deletebatchrequest.mdx: + id: d6cf424d34cd + last_write_checksum: sha1:3822c8983ebeea092ad207aa5d229994374b97a2 + pristine_git_object: 4733d5e1c46d0aced1e6b7f15e90d5e28f5b88a8 docs/operations/deletebyokkeyglobals.mdx: id: dd77cb8066bd last_write_checksum: sha1:dd56427b351443a57a82eb5dbca947ff14252645 @@ -7149,6 +8061,14 @@ trackedFiles: id: 4d4c5fa80b4c last_write_checksum: sha1:f32d425d8631ebfeb88abcb8f7e3a80e2559e51e pristine_git_object: a9d72a3e2348b96a287c4ab584d317f565b9b831 + docs/operations/getbatchesglobals.mdx: + id: 0aa912ef28a9 + last_write_checksum: sha1:e8399871549afdb3f5cdcb67d00978445fdf3467 + pristine_git_object: 0f082c13190d63d0f7cbcef9f4c24fced9677646 + docs/operations/getbatchesrequest.mdx: + id: fbedfcc0a82a + last_write_checksum: sha1:ce1219bcfb37e484f3227774bbac177e192b27e0 + pristine_git_object: 522a7e42ac5d9fc40aa645adc07e3f59f24681de docs/operations/getbenchmarksglobals.mdx: id: 8fcba55e06c3 last_write_checksum: sha1:4336ce3b6aef620bad35ec56f076d3550243df73 @@ -7445,6 +8365,18 @@ trackedFiles: id: fe52912b0ea7 last_write_checksum: sha1:85897c7620d5c3725f610a496f4ceb485b9f5063 pristine_git_object: 0d94d66d51eee4f9fc8d18fb42a32c91fb9c89ec + docs/operations/listbatchesglobals.mdx: + id: dbed29868962 + last_write_checksum: sha1:0c55cd16e1da6cba2cf9250198348c03fce2dda8 + pristine_git_object: 62c0e67f6862ea0c26f76e7a395eb6d3fa5dfdec + docs/operations/listbatchesrequest.mdx: + id: 88c9c0599281 + last_write_checksum: sha1:6ddeeeb25e137dd7620d3f6b6d31f2ab07d54e73 + pristine_git_object: fd00d5a79c4bcde4ab12305038b55833e3893c94 + docs/operations/listbatchesresponse.mdx: + id: dccadaeb9c73 + last_write_checksum: sha1:57e1647c59e77ec8bc75f20e1baa21e67726da52 + pristine_git_object: 9a218bcdf381138e9047071484c407758b59608f docs/operations/listbyokkeysglobals.mdx: id: b77dfe46caab last_write_checksum: sha1:203cef2704a0493a98ae74994baf54dd7789b998 @@ -8137,6 +9069,10 @@ trackedFiles: id: 27fcaae1c346 last_write_checksum: sha1:3b8ddf3e038f2dc75d60c4936f270543950020a2 pristine_git_object: 05cb8497207bd506ac4d84c53a5977e110114806 + docs/sdks/batch/README.mdx: + id: e367aa4f4295 + last_write_checksum: sha1:0860a61fc1089791f8bc3b741a4230ff87e473c1 + pristine_git_object: 9a0bdf21a7f61fe9936d6bb8b562130ba12c4819 docs/sdks/benchmarks/README.mdx: id: 5b483a6770ba last_write_checksum: sha1:885b70fcbd2be60f51a2f58e133fd6452eb21600 @@ -8187,8 +9123,8 @@ trackedFiles: pristine_git_object: d9aef34c11d538fe9d54a41f27a913181cc4f1f5 docs/sdks/generations/README.mdx: id: a754fecc8514 - last_write_checksum: sha1:f6c55504d8c3e5e44420db68d7864fbbae4d999a - pristine_git_object: 064751ea194bff6b8111575603f804362960b886 + last_write_checksum: sha1:a2a58bf659333ca8715d08271ce6510c831609d4 + pristine_git_object: a3866532ac76cdf8a492e1bdb9c2a16d4496f6db docs/sdks/guardrails/README.mdx: id: a0cd4218b8fa last_write_checksum: sha1:5d726806705c8c06aa1df8ecbebfa04a0214d8d4 @@ -8267,8 +9203,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:a1f5febefe9ab41f16f33ee654083f9643575ebf - pristine_git_object: 08d4dd47159e38b401c96d12fcbb9ab119899f26 + last_write_checksum: sha1:512be0c2ea776d4a2da4799dc97649a321dabafd + pristine_git_object: 4c30db411ff5c737e1b69f93ecaf338c4bfceb7b scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -8295,8 +9231,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:a6f6ff6b2bae032b308a2440d0e07aa418db58f4 - pristine_git_object: 39525f896b5f75a8287a9069e88b5d3a5712b81d + last_write_checksum: sha1:90bcfb627d2358e9a9e17e8f132d11f4e8d1f4ff + pristine_git_object: 85ff223340c8a21b688ec3a7664ce1ae0bff7c19 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -8313,6 +9249,10 @@ trackedFiles: id: c5733c5a1e12 last_write_checksum: sha1:65769ff2cb5473f85b364c6213a0ddc8c68644ea pristine_git_object: 7a562e21c7e66c9db666ead83748b73adefe4278 + src/openrouter/batch.py: + id: 148f61e34d5b + last_write_checksum: sha1:09ec1303708144530085fa2349289c58a184e207 + pristine_git_object: be2ba7c053c7cbf59ce9a0f08b1a5b86ddba6489 src/openrouter/benchmarks.py: id: 178d2ad8d706 last_write_checksum: sha1:15b8a7ea05a7550032afb15981958aa73b756881 @@ -8339,8 +9279,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:0fe14e50afa7072a2c6c47dbfdbfad4967d06f62 - pristine_git_object: 471fad91d8163a89e5a53d074eff798df191ef83 + last_write_checksum: sha1:a9859af57f85f48c6176e886483059c26bfb8a3c + pristine_git_object: 531740682a56707b21b173942a4ec7ae010813ee src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -8381,6 +9321,10 @@ trackedFiles: id: 121ee5a5d831 last_write_checksum: sha1:3c5f92c130f9ce8d291bb69116c822b64f6d50c4 pristine_git_object: 7b83b750e97a5dc510e7b174473ab778578ba6fa + src/openrouter/components/anthropicadvisortoolresult.py: + id: 7f78d63d10dd + last_write_checksum: sha1:4483b443ab5bd0b9ea207b86b4d9990f067209a7 + pristine_git_object: d3c9dda262ef890205b7b20a835a429ca7560bbd src/openrouter/components/anthropicallowedcallers.py: id: b51c080db25a last_write_checksum: sha1:250ea2824392b7c385c4375a029a256f3d10afb4 @@ -8393,6 +9337,26 @@ trackedFiles: id: a4fa00bbe8ed last_write_checksum: sha1:a7ab626cc971478afac1d68b71c49b497e4b8662 pristine_git_object: 870c2e75705a43762b7aa2797e5b0cde4fe40d87 + src/openrouter/components/anthropicbashcodeexecutioncontent.py: + id: 94749a4085f3 + last_write_checksum: sha1:299bb7d412ba19ec355ef869d0afca10b6c49bdd + pristine_git_object: 29bde3fddde93c09339b0b76489810e9ccce66c2 + src/openrouter/components/anthropicbashcodeexecutionoutput.py: + id: 9ed9817a2a99 + last_write_checksum: sha1:c2d23f068dda3e754d71a007d1771d081c60264f + pristine_git_object: de3979055db893730562297a415c4c88387b1a50 + src/openrouter/components/anthropicbashcodeexecutionresult.py: + id: de6b998b916c + last_write_checksum: sha1:dc9d9a0cc5d99a18459d3178452bb604ebd07588 + pristine_git_object: 518ef1e9634d9e1fa968f50a427142658be6aac3 + src/openrouter/components/anthropicbashcodeexecutiontoolresult.py: + id: 9ebe4a0a7766 + last_write_checksum: sha1:8677b724fbd35b9fe4e33f7c4f15f2cbefc48ce0 + pristine_git_object: 941a8a05f18128fa5e1e4daf83b3ab55dd60ae51 + src/openrouter/components/anthropicbashcodeexecutiontoolresulterror.py: + id: f86d46217483 + last_write_checksum: sha1:6cf19ccbbe6926b4016e07822fde917787fe9adf + pristine_git_object: f390d0d6df26beccca9c4bd578a8ed8d3ff8e37a src/openrouter/components/anthropiccachecontroldirective.py: id: ffa72802cd82 last_write_checksum: sha1:2c92e5081aa549627b961c97cfe0ba8d672a567c @@ -8405,34 +9369,118 @@ trackedFiles: id: 10d4a3bde2d9 last_write_checksum: sha1:5e3b33cda7e69aeb2e683374815796ca76ee2368 pristine_git_object: b08b10ce6b317954ebf7f12d09157d5cc4a19f26 + src/openrouter/components/anthropiccaller.py: + id: bb0eba3c7961 + last_write_checksum: sha1:55ecf7b8c606c550d0d4dfc584f4afb8e9c467f1 + pristine_git_object: c3817a83214472ba73a9c3b6268a37f32ab05e66 + src/openrouter/components/anthropiccitationcharlocation.py: + id: 46be1a168e39 + last_write_checksum: sha1:a80685e8773ecd3ab3bfe087009033b5ee9a7ac8 + pristine_git_object: 6ced15538e95f0f8514b20065cd26ec76c76efd0 src/openrouter/components/anthropiccitationcharlocationparam.py: id: 6f6f0732b22f last_write_checksum: sha1:f06cdcdd405abb4222450f027fd38f29b05efbec pristine_git_object: 4f0862e0351e9c829cc98c7e72037f095712a093 + src/openrouter/components/anthropiccitationcontentblocklocation.py: + id: 25ad4e0c64ce + last_write_checksum: sha1:359513c5549841113797c16f3f368b03f1be73b5 + pristine_git_object: 045e0d652beeaddc177ee526f4863895933dea5b src/openrouter/components/anthropiccitationcontentblocklocationparam.py: id: 057124c0e6c3 last_write_checksum: sha1:d7e044721195f51ef8ce3b63296a83f0b4fc98b6 pristine_git_object: 7bdfee1f4171c8e17b2d9b919bc8486c86fa4db6 + src/openrouter/components/anthropiccitationpagelocation.py: + id: 2fa028d0b812 + last_write_checksum: sha1:20782184d1d0cfd21a591d5bed47578523dd97f9 + pristine_git_object: 42127615d4c37084ba0a7580c685d254f5420759 src/openrouter/components/anthropiccitationpagelocationparam.py: id: "8776686778e3" last_write_checksum: sha1:9a7144f078d7b404bf3d90eac0d3a16a24ba3bba pristine_git_object: cbe0a66bb0fd32915d5f1379990f0b55b1be34e8 + src/openrouter/components/anthropiccitationsconfig.py: + id: 4ac4a40c1b21 + last_write_checksum: sha1:c8916ea25d02c2074c833878e106b2da520e8803 + pristine_git_object: ad09de36caa6d8e85471a28b8e842c86688142a6 + src/openrouter/components/anthropiccitationsearchresultlocation.py: + id: 3bed26599605 + last_write_checksum: sha1:2dd310e399d7957ff933cd7163b7ca9f9fc348f4 + pristine_git_object: 8a90ed4f254de659efca56a8ad691dcca505bf1b src/openrouter/components/anthropiccitationsearchresultlocationparam.py: id: 6610f6ef1f41 last_write_checksum: sha1:8300415c29d0e1ea74e01f9a60e807ab5faec7d2 pristine_git_object: 77b17e50979925c45c350782a3642dbc0496586d + src/openrouter/components/anthropiccitationwebsearchresultlocation.py: + id: 1a120a6f2e0a + last_write_checksum: sha1:e4841838144a600bbc556aed274ecdd56aa2b51e + pristine_git_object: 4d061c61a4c7c6cee32194f7fe3ab9bebf00ec6f src/openrouter/components/anthropiccitationwebsearchresultlocationparam.py: id: e3b53306ee2f last_write_checksum: sha1:ce75e5feff4dbaa43e8633d1c6c5492bff8a457b pristine_git_object: 9be8376389ace420687450d12a94075c59902b18 + src/openrouter/components/anthropiccodeexecution20250825caller.py: + id: d92965848ad3 + last_write_checksum: sha1:580c71a3e492f7fb83cc3c443264c3cb1152ff1e + pristine_git_object: 181666c5eb2e4ac962fadf01ee7df4366bc3c736 + src/openrouter/components/anthropiccodeexecution20260120caller.py: + id: bb91d62492c1 + last_write_checksum: sha1:52e03c329ed31ae739e0bcc18e248ee7ae0015c3 + pristine_git_object: 87b00d06ffe3c6a2125c9a2554b5da0aabb55ddc + src/openrouter/components/anthropiccodeexecutioncontent.py: + id: c5a5429a7507 + last_write_checksum: sha1:bfd1e3ad390c40e4911a51678f80a54eaac75778 + pristine_git_object: e34862f26e7a653262930f402d2bd9ff1f5ed905 + src/openrouter/components/anthropiccodeexecutionoutput.py: + id: 6e3bfe2a23bc + last_write_checksum: sha1:b96b4f21506627ee54b445eaec085ad151b00165 + pristine_git_object: 8f648dcd4990c6aabbd7a2aeebaf61c3739c934d + src/openrouter/components/anthropiccodeexecutionresult.py: + id: efb0edd75892 + last_write_checksum: sha1:a6493f02df3cb777a09a6a59e09d9d1fe7528586 + pristine_git_object: 08b6f1631c8cafcc3162ea9e3b7a46e378b14536 + src/openrouter/components/anthropiccodeexecutiontoolresult.py: + id: 825ba2d53b3e + last_write_checksum: sha1:9e9a77d3ca7a5fa38363501ed07206a46ffb71a0 + pristine_git_object: 047c8b315a7c1a374b707c118b51ce6bfd70563e + src/openrouter/components/anthropiccodeexecutiontoolresulterror.py: + id: 60524f2d6e1b + last_write_checksum: sha1:455b902719d6c7dd76601b5e4103b90f4f142c48 + pristine_git_object: 113e7dc6079305a42d8b1c9273f0f684e8469f9a + src/openrouter/components/anthropiccompactionblock.py: + id: d009f46fe23b + last_write_checksum: sha1:77388b463335349daf63e467ca52598f8dada758 + pristine_git_object: f69cb21d2956a1b7bd0a1b668670b5e8d85a5201 src/openrouter/components/anthropiccompactionusageiteration.py: id: fdfc1ef0420f last_write_checksum: sha1:67b10e83d2fc7777319f6c51d4e5cc7539b9eccc pristine_git_object: 50ad24f32ec87623c006381c477c46f44d84c753 + src/openrouter/components/anthropiccontainer.py: + id: 4fb3a0336d10 + last_write_checksum: sha1:eb11dc2a929764716f44adf40cd9708c31c00161 + pristine_git_object: abfe56b2a2c7eff3228b04b23eb6a538f480ef10 + src/openrouter/components/anthropiccontainerskill.py: + id: f9cdb92857eb + last_write_checksum: sha1:624a299cad6f56896befa82bbc0fc8180d3266ac + pristine_git_object: 3256669c720fd89a2105ee5890e8f1491bac8a92 + src/openrouter/components/anthropiccontainerupload.py: + id: 764740d3cb96 + last_write_checksum: sha1:ecb1ac4649501319ed788f91b88aeda582fd315b + pristine_git_object: aecc5f27a17f5d099f6b50c633ec2826a6cbf80c + src/openrouter/components/anthropicdirectcaller.py: + id: 94e047b1fbe5 + last_write_checksum: sha1:365f1f596b0f2331a161bffab3b37134efa59252 + pristine_git_object: 507daf9c840a6f01405cdba60e2236580bb01252 + src/openrouter/components/anthropicdocumentblock.py: + id: 53e718700c6e + last_write_checksum: sha1:addc1008ce3551e18bf9f5a39d2f5366ec49d001 + pristine_git_object: 44608934ce2f487180692e8e46d5077f65c3597a src/openrouter/components/anthropicdocumentblockparam.py: id: 2c3093530540 - last_write_checksum: sha1:43f9b964f383ea77663e47c9a1e1cd76b7457d2c - pristine_git_object: be2d48fefcffa05ca80bfa647f77fafe60872a7d + last_write_checksum: sha1:4122b186723ea49d9d1411031c63a0f278ca55c8 + pristine_git_object: f89f4b1ba463263ac6cc7a59123b8bebe1faa7bf + src/openrouter/components/anthropicencryptedcodeexecutionresult.py: + id: e7ae65cb2353 + last_write_checksum: sha1:ba226a69a71829a853c025b4c930fd1a48bf8806 + pristine_git_object: 45e7fdcbe19256e83f72b75df3f053d53ca972cd src/openrouter/components/anthropicfile.py: id: 9208bdd187dd last_write_checksum: sha1:9b0879ff204549046e6cf2a7e861a9ca7f592a52 @@ -8465,6 +9513,10 @@ trackedFiles: id: e48f71196f16 last_write_checksum: sha1:92fb29d4e239e0cb361dde42a1e61a8486233a34 pristine_git_object: 8ff4915a203908a5ae986f28357b7211590912d2 + src/openrouter/components/anthropicinputtransformation.py: + id: 32dd1edae040 + last_write_checksum: sha1:83bf150435f39223b3c586b6916ea44c5bdfc3d6 + pristine_git_object: f585c44ee59809b6af5646c404ebc665b120a124 src/openrouter/components/anthropiciterationcachecreation.py: id: d8eff6dbf240 last_write_checksum: sha1:866b822649d4b03cced63686a99ca0d4335a7c4c @@ -8481,10 +9533,22 @@ trackedFiles: id: 1ba41af8b7cd last_write_checksum: sha1:a6d854be0ab9329b4151ce1045b350dad114e57a pristine_git_object: fc4546fc8d9b383f455f0db4476c7d57c22ec1d1 + src/openrouter/components/anthropicoutputtokensdetails.py: + id: 7af6342dc5e8 + last_write_checksum: sha1:acd3f33dd8e93a5d6649f9f38550e0d936589712 + pristine_git_object: 7349f8f91848f434441f043b1500a1de7c4e1dc0 src/openrouter/components/anthropicplaintextsource.py: id: ed38ef79c74b last_write_checksum: sha1:b6584da4f7255412f12de31e02c522fb84d4cfd0 pristine_git_object: d16f6dc9a2449185ef45731cbcd0a78c266745ef + src/openrouter/components/anthropicredactedthinkingblock.py: + id: 721e99ce0efa + last_write_checksum: sha1:e196e29697b5bf9e9144f2784e403d7208d00ccc + pristine_git_object: bd8bc68187d32e9fed6a515f0eef30d152a73855 + src/openrouter/components/anthropicrefusalstopdetails.py: + id: 68649aa33cb3 + last_write_checksum: sha1:c11be7df8a74b14d6d69e01deb25148d4a5b3933 + pristine_git_object: 674698c5fe38a5beee394830dfcf56bf35af3b76 src/openrouter/components/anthropicsafeguard.py: id: 9662137c5446 last_write_checksum: sha1:e82188bb7d0496e4c8b5861056e7c98e5c0d6a15 @@ -8493,6 +9557,18 @@ trackedFiles: id: bccb7c6b3128 last_write_checksum: sha1:8d073fef507a39b53421384ff9a5914fd9438493 pristine_git_object: 14967a292ebe05517a28c98b1e241bd2fd03a572 + src/openrouter/components/anthropicservertoolerrorcode.py: + id: 0c3e66bb361a + last_write_checksum: sha1:4b1680892e5121cf6103d6e0a3a78b8f060adae5 + pristine_git_object: 7eef1af2f06067165e8ec718e37cb32d9b8b31e4 + src/openrouter/components/anthropicservertoolusage.py: + id: 771a4b516d55 + last_write_checksum: sha1:a5408cc7c88f61be521b6485dcfb52135923623c + pristine_git_object: a49ba8b6bebfc236b31df995066b5ab10de0026f + src/openrouter/components/anthropicservicetier.py: + id: 4bbed66f0d16 + last_write_checksum: sha1:2be2c14ef06afc516c87aff18faef80480603194 + pristine_git_object: 12117ebb569e2bb56d2604cf1aac92aefd03ae50 src/openrouter/components/anthropicspeed.py: id: 7e39c29f3d89 last_write_checksum: sha1:19e37bf7ec082d89258f44674405811cc8a010ad @@ -8501,10 +9577,46 @@ trackedFiles: id: 1b0f42791a44 last_write_checksum: sha1:d145b38d9f24946a9b96df823b68dc8d89bca935 pristine_git_object: bbbf46b31d8f513ed5fc5cb1960c0f99e49cbdb2 + src/openrouter/components/anthropictextblock.py: + id: 5dcb0d02f5ff + last_write_checksum: sha1:bf4afe01af8ff63978f1d942d866f1da2cfca40b + pristine_git_object: bd7bf10f2848c52ddfe6bdbbfd9864acc3277cba src/openrouter/components/anthropictextblockparam.py: id: f387daeeb940 last_write_checksum: sha1:d07d4bef39b0f763604a58604da6aa4cb7979590 pristine_git_object: 31a1df2ee27149c8862fb8709f4898ef0535360f + src/openrouter/components/anthropictextcitation.py: + id: b5722b5bfaee + last_write_checksum: sha1:c748f0f4bc2e1df2673a565cc81b738078418bda + pristine_git_object: 8f9d103a7e4d87b98d27059b98b95dad8c8de794 + src/openrouter/components/anthropictexteditorcodeexecutioncontent.py: + id: 9cca2882eb6e + last_write_checksum: sha1:f8d250bd97d6dad30ead615f7c2fcd561e46ed06 + pristine_git_object: bc6d21b40c0561863d23681d6ba65988e273de2b + src/openrouter/components/anthropictexteditorcodeexecutioncreateresult.py: + id: d4c33b56a4a4 + last_write_checksum: sha1:864840f391988132bd624497a24f80d67c83a902 + pristine_git_object: a3443591bcb51e47260e3f12e357532762b154e2 + src/openrouter/components/anthropictexteditorcodeexecutionstrreplaceresult.py: + id: 9391c67e0708 + last_write_checksum: sha1:b3aa640595730cfd8fcc57a07505150282cf537f + pristine_git_object: 20a5dd939b355550e2f759febe28592bb9f0aca3 + src/openrouter/components/anthropictexteditorcodeexecutiontoolresult.py: + id: 03af827b8278 + last_write_checksum: sha1:2dce5c9dff250aba8e8097c97e4bcfa1d56aef12 + pristine_git_object: 32f1e7af8ab94a220e5d0f9c20403b335ff1a018 + src/openrouter/components/anthropictexteditorcodeexecutiontoolresulterror.py: + id: ee953e34e28f + last_write_checksum: sha1:ab4c22b2ea6b769526c5e09ce4143997e08134a9 + pristine_git_object: 10f99a34a9429758adf4668c549b1d9a65300e28 + src/openrouter/components/anthropictexteditorcodeexecutionviewresult.py: + id: ebbad97f6df5 + last_write_checksum: sha1:d2948cdc1ae54cebdbed07a542993160186d4078 + pristine_git_object: c686ddc00df1290615275f1855d848b1f87d9d87 + src/openrouter/components/anthropicthinkingblock.py: + id: fc85c12cfa09 + last_write_checksum: sha1:94af7fcd457dcc99a62d228498c1ef61d262f099 + pristine_git_object: 9681bc67b0c2380ebd48f0c3a110c9ff488db1c8 src/openrouter/components/anthropicthinkingblockbinding.py: id: e3f9c1ae04b6 last_write_checksum: sha1:4e0878084241d4d7295c7579996d41e596eac6c9 @@ -8517,6 +9629,22 @@ trackedFiles: id: 0bd09cb662d3 last_write_checksum: sha1:3b5fa1bc9cf844179b161cf44747727474ae86d7 pristine_git_object: 09137b74c4e5bc2c8c2a172118007121a502565f + src/openrouter/components/anthropictoolreference.py: + id: 2abcc9527278 + last_write_checksum: sha1:11dc74180c5a8de79adeec544b947dab037614a1 + pristine_git_object: e23435f41e826da153ba4094faa36c801dda3f31 + src/openrouter/components/anthropictoolsearchcontent.py: + id: d394e919e0a6 + last_write_checksum: sha1:4fee995879aa8b46090adc31df61f12aa664f499 + pristine_git_object: 626dc44a6cc6ec829d40d63afbb209f1b68f5604 + src/openrouter/components/anthropictoolsearchresult.py: + id: 0b3d4208a48a + last_write_checksum: sha1:5f1ee3a3ffc4ae542f54a72f2fcfc3a84754d089 + pristine_git_object: ea496e6f0a392c84d58e788d00873516f49eb0cb + src/openrouter/components/anthropictoolsearchresulterror.py: + id: b837a55a49a5 + last_write_checksum: sha1:d0345cf4a95533339fd9258b6df61087111a3315 + pristine_git_object: d7612e2c962ab880ebd14b7db350457d5cb5b804 src/openrouter/components/anthropictoolsearchtoolbm25.py: id: 3848a099b0e5 last_write_checksum: sha1:faf5e81da57976b2cad1b8e5f06a28d8bbaf666a @@ -8525,6 +9653,14 @@ trackedFiles: id: baff092ccc1d last_write_checksum: sha1:65c5b746bf69125012cfc4386fbfc04f3dde7565 pristine_git_object: b25d601cd949fd38244689b470960fda2688f030 + src/openrouter/components/anthropictoolsearchtoolresult.py: + id: 365b2b7933ae + last_write_checksum: sha1:b7c343d99fea7b7c3118cf49303f261609ba5ddd + pristine_git_object: 5ea0f0aff5915a807d131bfc8106ad8f81525537 + src/openrouter/components/anthropictooluseblock.py: + id: 830184ebabbb + last_write_checksum: sha1:e739a3556da9dcff36e424a8b6d3a11c40ea30c7 + pristine_git_object: 386e8884d10beeaf02a21d22b26e2a72a0afbbf8 src/openrouter/components/anthropictooluseskeep.py: id: b4a5da2ccae6 last_write_checksum: sha1:b67e3c12aca15c6e969dd2907735c964c610bc2a @@ -8549,10 +9685,38 @@ trackedFiles: id: 5e4d6928bcab last_write_checksum: sha1:bdc2b877ec6d51b9480bd58fb4f2ae0308060ecb pristine_git_object: a984e7a5e0de4d93e4a65582d97b8eb9c3b1a1ab + src/openrouter/components/anthropicwebfetchblock.py: + id: fe329ea9f7a9 + last_write_checksum: sha1:c598c6be7086a7ffa381bc4ccd9fbc148f25c575 + pristine_git_object: 9a8c0f33c12782590a1326cf7f29d20e424bd9eb + src/openrouter/components/anthropicwebfetchcontent.py: + id: bbb8ddd483c1 + last_write_checksum: sha1:3f102eb0f6d5047d37af9eda131b0ec7ba02017d + pristine_git_object: 09f0bf8054daa3429c13e2f9ef594c09e7699f0a + src/openrouter/components/anthropicwebfetchtoolresult.py: + id: 351623d6f488 + last_write_checksum: sha1:390e71895163a71286a8cff3f3a07577a65acd80 + pristine_git_object: c26f5546c2cad2080e3b7a87b863f31e8a05cc7b + src/openrouter/components/anthropicwebfetchtoolresulterror.py: + id: 583a2c91fdd4 + last_write_checksum: sha1:1a55b12b45f78d1361f92ec1821ab76a0031d024 + pristine_git_object: 3bfb959c15cb34dfe1e8c262b8d542281d54f099 + src/openrouter/components/anthropicwebsearchresult.py: + id: 5c8ad6aea18e + last_write_checksum: sha1:64d08e46e4ac5a47cdaf3ebf25361ad7c70727b6 + pristine_git_object: 5f0542f37f7d21f86e405b589538ba26d71367d0 src/openrouter/components/anthropicwebsearchresultblockparam.py: id: 7a85be31694c last_write_checksum: sha1:5a07a65d06ec00547fd81d5d80e79057114911fe pristine_git_object: fbd558eeb550c32dc2bffdd12a5815e8f290fd91 + src/openrouter/components/anthropicwebsearchtoolresult.py: + id: cbb54d154a8b + last_write_checksum: sha1:c7979981b6129107561c59a13d3fd776ad245fbb + pristine_git_object: 8983eeb1f5c8a75ddc087de059a0ca7679228e62 + src/openrouter/components/anthropicwebsearchtoolresulterror.py: + id: d90928618fa8 + last_write_checksum: sha1:ae7fba79603db313eebbc10da33c5f8957d31d0d + pristine_git_object: 0b912b79c6eee166a5f90e0fa32e4a33e916b75a src/openrouter/components/anthropicwebsearchtooluserlocation.py: id: 11ce6e19f6e8 last_write_checksum: sha1:fdd868a707022da7b015d09f9ebda5907939c6f8 @@ -8661,6 +9825,54 @@ trackedFiles: id: 5533c01ab156 last_write_checksum: sha1:0d74bf725e24809c704e0c293d72ea96a897446b pristine_git_object: 0e610680e018be53b3e62759ad61e9f7c416640b + src/openrouter/components/batchdeletedobject.py: + id: b98038d1d8df + last_write_checksum: sha1:c9a69af8bd5807ff77a81810f4eee414d07dfec0 + pristine_git_object: 354ba046335bcf92153300cbb5f01eeac3d072ee + src/openrouter/components/batchdeletionoutcome.py: + id: 943cf7837fe4 + last_write_checksum: sha1:f98f41b03e0eb23268d205b58ea12356b3734d55 + pristine_git_object: f2c295367857080d95dac301a472f97706b798cb + src/openrouter/components/batchdeletiontargets.py: + id: c1b5b39dda2f + last_write_checksum: sha1:36f425c3fb4302ef7ab06d3a78ae30c4b8643d8c + pristine_git_object: b76991ca747af381f18235c56de417cd90e9df81 + src/openrouter/components/batcherrorresponse.py: + id: 393c248e7a90 + last_write_checksum: sha1:fbe6541534d864016398625646c046fa2e5e21df + pristine_git_object: 8c105d9beae361eba8dc0775f17eec450fe35888 + src/openrouter/components/batchlistitem.py: + id: f539fc72cf19 + last_write_checksum: sha1:d38cf01383523d9e15d855742a36065a8913f03e + pristine_git_object: 7fafb9f9b085740061f73850ed142c47522599ad + src/openrouter/components/batchlistresponse.py: + id: 7e0643661b7d + last_write_checksum: sha1:8efc75b2f2300bc7dbe9c3889af79c431ded7d32 + pristine_git_object: baaee7b775429b351178936aef74376c0b40a2d0 + src/openrouter/components/batchliststatus.py: + id: 90dbd14e1019 + last_write_checksum: sha1:f38f40f45c423f47595fa397d72fb79575edd18b + pristine_git_object: 8650957337063ba3aef94341108448ec19bd2945 + src/openrouter/components/batchlisttimestamp.py: + id: 2730315c6f25 + last_write_checksum: sha1:a28e90884bacd55351571db225af7044d91dbe1b + pristine_git_object: 4c81a5f783873a99d67ae90ffacbdda63b61cea6 + src/openrouter/components/batchobject.py: + id: caf1ef2414a3 + last_write_checksum: sha1:ec754ffd0537b25c8c0207e44e854105c95ce8df + pristine_git_object: 25473b53a948a22431ae338f754bd8aaee7bf04d + src/openrouter/components/batchpaymentrequiredresponse_error.py: + id: 29d3620e8858 + last_write_checksum: sha1:c797fbfd8a88561c101aca8a4d556352213b8096 + pristine_git_object: 19b704e42e2a9d76d9b6f394ffa6cec0a8ee17cf + src/openrouter/components/batchproviderpreferences.py: + id: bf5b14d53dfc + last_write_checksum: sha1:2f0df3d3f568e3597a06065403579a14a235227e + pristine_git_object: 527b6983154fadde14e49b75130a4cdbb7f32d07 + src/openrouter/components/batchsubmitbody.py: + id: 26e5100bce4e + last_write_checksum: sha1:9d525743ede017b4ec1f8d20d9c592276e1bb79f + pristine_git_object: a84174b50819fdc9acb2780598c0e59c1d548cb1 src/openrouter/components/booleancapability.py: id: 6009fd660c03 last_write_checksum: sha1:2615f4f9eecdf753ece20adc9897553404c71cc1 @@ -9143,8 +10355,8 @@ trackedFiles: pristine_git_object: 0858da197cbf8f41d4df6688a392eaca783a8700 src/openrouter/components/debugevent.py: id: 5ecad6212326 - last_write_checksum: sha1:e83da36b6ccf9401789c28b8056701b5f0cb6f68 - pristine_git_object: dd463df81262f2fe4b51b33c9dde998e435f03c2 + last_write_checksum: sha1:53ae856232196a956d66c6363cdaedc9f8abfe3a + pristine_git_object: 07e98d54e6a63a4f1e0908b73ce5f8d7e16234f0 src/openrouter/components/decisionschoiceanswer.py: id: 53a9e8cdf870 last_write_checksum: sha1:16380c24282a8d275d96bed268bf5d6410b56f43 @@ -9285,6 +10497,10 @@ trackedFiles: id: 8353a3e97cfc last_write_checksum: sha1:8cbb3c05f6f3304e3f54c0f8bfb8d11a0ac0cdc3 pristine_git_object: bca5442a696e2489662d71d5bd7e26fb4c0eaeaa + src/openrouter/components/finishreason.py: + id: 427351f6ddd1 + last_write_checksum: sha1:71f5cbb61df831a1e9ce63f281ab29b3ed86b039 + pristine_git_object: 3356f85c438c6dea4f36e8d435b9ac33d9cffe3d src/openrouter/components/forbiddenresponseerrordata.py: id: 93ae47a0c337 last_write_checksum: sha1:9774f106ede3b1d9f74fbe301d820f0602a041d9 @@ -9523,8 +10739,8 @@ trackedFiles: pristine_git_object: eb59bfd0d4b89dde72504f8aa57533c689474ced src/openrouter/components/imagegenerationusage.py: id: f51151e8dbfa - last_write_checksum: sha1:7f3f93e29e3b5018e8bf218dc167665794cf1d65 - pristine_git_object: 089d12ed821830575a14bf6b279a750f9737c1a4 + last_write_checksum: sha1:b78ae098488aaafe7d58d941e0fddae760fa7514 + pristine_git_object: 3c064a5176443a1ba474880289454e25603bf1eb src/openrouter/components/imagegenpartialimageevent.py: id: f88cea0c67fc last_write_checksum: sha1:2ee76cbb50b60ebe624bdfe0769a7bbdce047cd0 @@ -9631,8 +10847,8 @@ trackedFiles: pristine_git_object: 208a06d25920d4bfd39bb527b54e78be44adf9f3 src/openrouter/components/internchatchoice.py: id: 9ff5592609ff - last_write_checksum: sha1:485dfd417ca8af7b2be21f8618179db06f598076 - pristine_git_object: 54ccff74a20133907f201284b124727cba7e13cd + last_write_checksum: sha1:d9d406cafa766ff427a6a56bbf656f058a484630 + pristine_git_object: f3851f63985f4fce693bd9774c3db6630a3dae50 src/openrouter/components/internchatcompletionchunk.py: id: 416076befae5 last_write_checksum: sha1:37c104e427698983acda53fd08e4bb6bfb339622 @@ -9863,16 +11079,16 @@ trackedFiles: pristine_git_object: 67ae6d5bdce0be9ac88b3f6295e8947962d9c9e2 src/openrouter/components/messagesbashtoolresultblock.py: id: 7f2f763d5dd7 - last_write_checksum: sha1:8f33e6f3bd83d3bf1c3d8c93dbd3e9aae63a0912 - pristine_git_object: 23d014f0beff7d60807c09537283fddde45bc721 + last_write_checksum: sha1:43b37611ced346b47e9ee5e67da6c4431a8ea717 + pristine_git_object: 7b44e51eb43419ad301eba8dd119eccdffe4e319 src/openrouter/components/messagesfallbackparam.py: id: 53ba6717a4cc last_write_checksum: sha1:e1e75026fb625426f7cd1702cd3136dcf3ccaf79 pristine_git_object: 9026664fa77c678a7a5f2b317b511ad93445cff7 src/openrouter/components/messagesmessageparam.py: id: ed8bbab6720d - last_write_checksum: sha1:7c7d3f23ef7e573709c24b7fd1107ad8e344e7b3 - pristine_git_object: 3c5b5b28a4a00aa89b63eb9067290b790d2fe015 + last_write_checksum: sha1:7c728a1159e94548cac466ef3469d6a60b2ed503 + pristine_git_object: d587cc013b7c9284f320c4649d12ec3378501897 src/openrouter/components/messagesoutputconfig.py: id: 54d1e297f740 last_write_checksum: sha1:478d9f534254d60225ac89bd21ddc49d18329297 @@ -9887,8 +11103,8 @@ trackedFiles: pristine_git_object: d101995fd27b0bccbac266805caba629039c5f93 src/openrouter/components/messagesshelltoolresultblock.py: id: a11af1c6ce03 - last_write_checksum: sha1:dd91c3a9b6c705cb53c036b152b2fa0bba1caa18 - pristine_git_object: d228d7634f1287b060bb5b77bc79c2e2ed39f1ae + last_write_checksum: sha1:414499d74a180c793c6ab860b1ce6d24c6a4ab8c + pristine_git_object: fb9a1ad813b5f664bd96222b5176fdaed652ba8d src/openrouter/components/messagestooladditionblock.py: id: 3fc00d28b82d last_write_checksum: sha1:9d58d3e11b4260f7d00efcf0630fe4186b5d01a1 @@ -10145,6 +11361,30 @@ trackedFiles: id: f5400a5de3cd last_write_checksum: sha1:5b8eab2b521a639688131143ee39e513e6da524a pristine_git_object: 73c09231284a8f982d7770a7a78fca403b374826 + src/openrouter/components/oranthropicbashtoolresult.py: + id: 96aaf647f72b + last_write_checksum: sha1:5936ab54d7660c9c4698422247b225a8f909fb28 + pristine_git_object: 73157d2a8f00e67c1635e34547fee7456f478a7d + src/openrouter/components/oranthropiccontentblock.py: + id: 4cb2b630aa57 + last_write_checksum: sha1:c5c09c02f2a70bb656015d16b48b63dae4bfb7a2 + pristine_git_object: 9eb54176ecef36aedc0a73c74e59de1f78542695 + src/openrouter/components/oranthropicnullablecaller.py: + id: 7cef7b95c04b + last_write_checksum: sha1:e23d7a65a5d6ffad575a972e38ae908b5d5ba510 + pristine_git_object: b6b1da176fb843e66e3ed5c1113b47583fccc966 + src/openrouter/components/oranthropicservertooluseblock.py: + id: b9532f37df9c + last_write_checksum: sha1:011d07a562b9de16788abfd4eb3860e43c4e17be + pristine_git_object: 5d90e19617695a68bca699b9266b0ead4ed1f7a0 + src/openrouter/components/oranthropicshelltoolresult.py: + id: 6ccaee609973 + last_write_checksum: sha1:a518bad5be5b26b71fed00fa2ece03e6dca0814c + pristine_git_object: 6c4099267b52a1573bb20d81822b9c029aae8a06 + src/openrouter/components/oranthropicstopreason.py: + id: 0cf988c233f1 + last_write_checksum: sha1:d588b7d8049a56ad16f3c52280c98b83dae5741f + pristine_git_object: 65f68b1316eae7ee67a5c5cba3819df4c7f0ecd1 src/openrouter/components/outputadvisorservertoolitem.py: id: aa64bddfa26c last_write_checksum: sha1:9d960f059ee0d737693f9e5561de1e8f377a412c @@ -10203,8 +11443,8 @@ trackedFiles: pristine_git_object: 988cda9991d9eee1742ad4287124dd15e2553267 src/openrouter/components/outputfusionservertoolitem.py: id: 1d798a2bb7ae - last_write_checksum: sha1:dba77052202fb6602b18083e7c6fff1e6f2e46c7 - pristine_git_object: 38f428f37e6ffbc7c5e39b831c4d77e2090b50a9 + last_write_checksum: sha1:16ae5c67228c5ded8d3c2c826a2dfcc4d9ae3c96 + pristine_git_object: 6fceee3768e84762e2779347a3f4fa7767d82bae src/openrouter/components/outputimagegenerationcallitem.py: id: 48d20dc00e1c last_write_checksum: sha1:339b1256fd865d8ddb8b3be54a4203ccb6498c3f @@ -10803,8 +12043,8 @@ trackedFiles: pristine_git_object: db9adabfbf06c5e0dd59818abc87974df6330804 src/openrouter/components/submitgenerationfeedbackrequest.py: id: ae68ea802a9c - last_write_checksum: sha1:3d0fb9415d218dfbe5b978791c95bc0f28abb131 - pristine_git_object: c73cccc81298593ce3f4acbf2b25f02956528d8f + last_write_checksum: sha1:553931dea2c998247c3e07ee563a0967d15e947d + pristine_git_object: fbcc171facb97c751ac1371ee4d438d5b7974b40 src/openrouter/components/submitgenerationfeedbackresponse.py: id: 1e1463bcfd03 last_write_checksum: sha1:d7ba55af6eca473c91a3cd09a73068bb8a75ad22 @@ -11155,8 +12395,8 @@ trackedFiles: pristine_git_object: 5c3a48759ba31aa633627707b68885b6cc367ddf src/openrouter/errors/__init__.py: id: 366154d0d60a - last_write_checksum: sha1:3cb158b48e05b02cacc0a7570fad6433fc25a8e9 - pristine_git_object: 21a81e55c4e0f8140973d0123b894760cbb60a55 + last_write_checksum: sha1:fa1cd59f081cdd78e65dc96982436a135c09c52a + pristine_git_object: 736f0a1509b923a539be4e02c824018f0a974d00 src/openrouter/errors/badgatewayresponse_error.py: id: 818c3605ce23 last_write_checksum: sha1:f0307bff4a47f950c514d7d47de5690cac871bbb @@ -11165,6 +12405,14 @@ trackedFiles: id: 562928a0bbcb last_write_checksum: sha1:43fdc266ca265c18a1b4aa7fce7ba971cd7208a2 pristine_git_object: 40bdc064829b215f5f68d0680b627655836cb577 + src/openrouter/errors/batcherrorresponse.py: + id: 2053bf6b72ef + last_write_checksum: sha1:555e6f192806bfa68bc2870641e863510ae6b37f + pristine_git_object: 9ce16f01d0d2525e766ecf20ce17a472b3587bff + src/openrouter/errors/batchpaymentrequiredresponse_error.py: + id: a45e11aec23b + last_write_checksum: sha1:c014c326f2eeecb6501b02157cf5423ec7f18215 + pristine_git_object: 7a1d8bfd8dc7a98a69c729521bba55e4e5bda7b5 src/openrouter/errors/conflictresponse_error.py: id: 2411f691a552 last_write_checksum: sha1:d2e3d6f7128cc321d37ec1397ee5826428764729 @@ -11259,8 +12507,8 @@ trackedFiles: pristine_git_object: 1c30715cccc28393152c3b3152d144e57ca60df1 src/openrouter/generations.py: id: 70e1c21042bc - last_write_checksum: sha1:a8679c263af864e94aa0b33e6a8505e66b4c4047 - pristine_git_object: d5990c4254d4b3c5dae3f548bbec02558adadae1 + last_write_checksum: sha1:87220277fc41836ac3bba33ffc229097c23c3384 + pristine_git_object: c520287c94d48268045fb97a4b06dd1c8d56e041 src/openrouter/guardrails.py: id: 705839f34e66 last_write_checksum: sha1:1551845b6a9776480d99ef0fc1fca61e845f3de2 @@ -11303,8 +12551,8 @@ trackedFiles: pristine_git_object: 8680343bbc90107ae6413bd5686012b1fd75d665 src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:28ec50ab4815a2064bf6c8c3916d479984fc2120 - pristine_git_object: f85216960d4161c6e49e2d3cdf4d9a39fa12d59a + last_write_checksum: sha1:17c8b0aaac2f2d28ff282aa3d6dc162e25a970a3 + pristine_git_object: bfbb96deeafe455604d608c9b2795437044775c8 src/openrouter/operations/bulkaddworkspacemembers.py: id: e0ed56117619 last_write_checksum: sha1:5c44eb0d40fdece3ac084615f6c6082be4cf1d5a @@ -11353,6 +12601,10 @@ trackedFiles: id: 4253a437de22 last_write_checksum: sha1:8f496fd0e965aba76a0882a3af0382649d0f8c4d pristine_git_object: 1531c055f9e5aa9489c2ec5e885466ab1d11b65e + src/openrouter/operations/createbatches.py: + id: 8b0681b22b32 + last_write_checksum: sha1:4271449fca1c83d652bc54ebb9d2fc4528362868 + pristine_git_object: b1bb2048a6530cf43194744f6bb4fa7769c04bf9 src/openrouter/operations/createbyokkey.py: id: eaeefa9fe0c2 last_write_checksum: sha1:7e371b512bf4d80820881e0dc1868cb0861ae2ac @@ -11429,6 +12681,10 @@ trackedFiles: id: 690a809c4592 last_write_checksum: sha1:9fa9c78f3885742f76db1a54deefdfd192fc9c49 pristine_git_object: 15b96d1cdb7b54e4c9d14d443779be0b619b0e4a + src/openrouter/operations/deletebatch.py: + id: d91d01c99021 + last_write_checksum: sha1:a79fb18f42fe2422b5ecca5362fc0c2172469b21 + pristine_git_object: 9edaaae8038739d10a508b42a778447ba7ffc8d2 src/openrouter/operations/deletebyokkey.py: id: b1b2c6b06913 last_write_checksum: sha1:90aad5198d43e289d99c7b2eb66353de7593a68b @@ -11493,6 +12749,10 @@ trackedFiles: id: 5ffd23dafcc1 last_write_checksum: sha1:ab86de57d9c8502a130a61f4405f3ca40c2ff5dc pristine_git_object: a8e00f731e950d64ec8ca7ab10f6fca96884c8e7 + src/openrouter/operations/getbatches.py: + id: e734e28ebe62 + last_write_checksum: sha1:0fd8969d081fd9f1c87bd5562f4ff14f4a1a495b + pristine_git_object: 2e8240578f955bc7d8985533d4f57b81a85bd404 src/openrouter/operations/getbenchmarks.py: id: 5fb88644491e last_write_checksum: sha1:c059365dfa135f5d6d929464c06af3421cf89c62 @@ -11601,6 +12861,10 @@ trackedFiles: id: 3ced31e3804e last_write_checksum: sha1:bfad6d8e4c453367e509f063825899ce72b33449 pristine_git_object: bec5a577e95e905673b68d02fc873b0bb9a3cd8a + src/openrouter/operations/listbatches.py: + id: 9ad1345dc956 + last_write_checksum: sha1:e568e38db37703d3e2d35f460d25421f98da21a1 + pristine_git_object: 6f60496e1a42385ab2253a36dfcd7f3698d5ae7a src/openrouter/operations/listbyokkeys.py: id: b6dd42b3e05f last_write_checksum: sha1:2ea0c425b0d3501c20553b45dad17d0b7751d544 @@ -11827,8 +13091,8 @@ trackedFiles: pristine_git_object: a28df9a26e2dd834e5bc8974c3a61d18609c79c0 src/openrouter/sdk.py: id: ee9846c4c9c5 - last_write_checksum: sha1:524fce02fc013302916d4e533dc358c739f0cbb4 - pristine_git_object: 28ea1b39c429276d1e06268ac0f60652ff15a989 + last_write_checksum: sha1:d726e8a4f02fab14ad4813392f61aa6c09bca675 + pristine_git_object: 8e8741154836b6a417cf0c38c3abe2abe56c1033 src/openrouter/sdkconfiguration.py: id: 55773bb98d7c last_write_checksum: sha1:c01826125c31a8b8bc99d9d679782c8758fae001 @@ -15181,5 +16445,96 @@ examples: application/json: {"error": {"code": 404, "message": "Intern not found"}} "500": application/json: {"error": {"code": 404, "message": "Intern not found"}} + listBatches: + speakeasy-default-list-batches: + responses: + "200": + application/json: {"data": [], "first_id": null, "has_more": false, "last_id": null, "object": "list"} + "400": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + createBatches: + chatCompletions: + requestBody: + application/json: {"completion_window": "24h", "endpoint": "/v1/chat/completions", "model": "openai/gpt-4o", "requests": [{"body": {"messages": [{"content": "Summarize ...", "role": "user"}], "model": "openai/gpt-4o"}, "custom_id": "req-0001"}]} + responses: + "202": + application/json: {"completion_window": "24h", "created_at": 511243, "endpoint": "", "error": {"message": ""}, "finalized_at": 665164, "id": "", "model": "CX-9", "object": "batch", "request_counts": {"completed": 719289, "failed": 238478, "total": 928444}, "results": [{"custom_id": "", "error": {"message": "", "param": "", "type": ""}, "id": "", "response": {"body": {"completed_at": 1704067210, "created_at": 1704067200, "error": null, "frequency_penalty": null, "id": "resp-abc123", "incomplete_details": null, "instructions": null, "metadata": null, "model": "gpt-4", "object": "response", "output": [{"content": [{"text": "Hello! How can I help you today?", "type": "output_text"}], "id": "msg-abc123", "role": "assistant", "type": "message"}], "parallel_tool_calls": true, "presence_penalty": null, "status": "completed", "temperature": null, "tool_choice": "auto", "tools": [], "top_p": null}, "request_id": "", "status_code": 296735}}], "status": "in_progress", "usage": {"completion_tokens": 323461, "prompt_tokens": 784076, "total_tokens": 757531}} + "400": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + messages: + requestBody: + application/json: {"completion_window": "24h", "endpoint": "/v1/messages", "model": "openai/gpt-5-nano", "requests": [{"body": {"max_tokens": 1024, "messages": [{"content": "Summarize ...", "role": "user"}], "model": "openai/gpt-5-nano"}, "custom_id": "req-0001"}]} + responses: + "202": + application/json: {"completion_window": "24h", "created_at": 511243, "endpoint": "", "error": {"message": ""}, "finalized_at": 665164, "id": "", "model": "CX-9", "object": "batch", "request_counts": {"completed": 719289, "failed": 238478, "total": 928444}, "results": [{"custom_id": "", "error": {"message": "", "param": "", "type": ""}, "id": "", "response": {"body": {"completed_at": 1704067210, "created_at": 1704067200, "error": null, "frequency_penalty": null, "id": "resp-abc123", "incomplete_details": null, "instructions": null, "metadata": null, "model": "gpt-4", "object": "response", "output": [{"content": [{"text": "Hello! How can I help you today?", "type": "output_text"}], "id": "msg-abc123", "role": "assistant", "type": "message"}], "parallel_tool_calls": true, "presence_penalty": null, "status": "completed", "temperature": null, "tool_choice": "auto", "tools": [], "top_p": null}, "request_id": "", "status_code": 296735}}], "status": "in_progress", "usage": {"completion_tokens": 323461, "prompt_tokens": 784076, "total_tokens": 757531}} + "400": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + providerPinned: + requestBody: + application/json: {"completion_window": "24h", "endpoint": "/v1/chat/completions", "model": "google/gemini-3.6-flash", "requests": [{"body": {"messages": [{"content": "Summarize ...", "role": "user"}], "model": "google/gemini-3.6-flash"}, "custom_id": "req-0001"}]} + responses: + "202": + application/json: {"completion_window": "24h", "created_at": 511243, "endpoint": "", "error": {"message": ""}, "finalized_at": 665164, "id": "", "model": "CX-9", "object": "batch", "request_counts": {"completed": 719289, "failed": 238478, "total": 928444}, "results": [{"custom_id": "", "error": {"message": "", "param": "", "type": ""}, "id": "", "response": {"body": {"completed_at": 1704067210, "created_at": 1704067200, "error": null, "frequency_penalty": null, "id": "resp-abc123", "incomplete_details": null, "instructions": null, "metadata": null, "model": "gpt-4", "object": "response", "output": [{"content": [{"text": "Hello! How can I help you today?", "type": "output_text"}], "id": "msg-abc123", "role": "assistant", "type": "message"}], "parallel_tool_calls": true, "presence_penalty": null, "status": "completed", "temperature": null, "tool_choice": "auto", "tools": [], "top_p": null}, "request_id": "", "status_code": 296735}}], "status": "in_progress", "usage": {"completion_tokens": 323461, "prompt_tokens": 784076, "total_tokens": 757531}} + "400": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + responses: + requestBody: + application/json: {"completion_window": "24h", "endpoint": "/v1/responses", "model": "openai/gpt-4o", "requests": [{"body": {"input": [{"content": [{"text": "Summarize ...", "type": "input_text"}], "role": "user"}], "model": "openai/gpt-4o"}, "custom_id": "req-0001"}]} + responses: + "202": + application/json: {"completion_window": "24h", "created_at": 511243, "endpoint": "", "error": {"message": ""}, "finalized_at": 665164, "id": "", "model": "CX-9", "object": "batch", "request_counts": {"completed": 719289, "failed": 238478, "total": 928444}, "results": [{"custom_id": "", "error": {"message": "", "param": "", "type": ""}, "id": "", "response": {"body": {"completed_at": 1704067210, "created_at": 1704067200, "error": null, "frequency_penalty": null, "id": "resp-abc123", "incomplete_details": null, "instructions": null, "metadata": null, "model": "gpt-4", "object": "response", "output": [{"content": [{"text": "Hello! How can I help you today?", "type": "output_text"}], "id": "msg-abc123", "role": "assistant", "type": "message"}], "parallel_tool_calls": true, "presence_penalty": null, "status": "completed", "temperature": null, "tool_choice": "auto", "tools": [], "top_p": null}, "request_id": "", "status_code": 296735}}], "status": "in_progress", "usage": {"completion_tokens": 323461, "prompt_tokens": 784076, "total_tokens": 757531}} + "400": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + speakeasy-default-create-batches: + requestBody: + application/json: {"completion_window": "24h", "endpoint": "/v1/responses", "model": "Land Cruiser", "requests": [{"body": {"key": "", "key1": "", "key2": ""}, "custom_id": ""}]} + responses: + "202": + application/json: {"completion_window": "24h", "created_at": 511243, "endpoint": "", "error": {"message": ""}, "finalized_at": 665164, "id": "", "model": "CX-9", "object": "batch", "request_counts": {"completed": 719289, "failed": 238478, "total": 928444}, "results": [{"custom_id": "", "error": {"message": "", "param": "", "type": ""}, "id": "", "response": {"body": {"completed_at": 1704067210, "created_at": 1704067200, "error": null, "frequency_penalty": null, "id": "resp-abc123", "incomplete_details": null, "instructions": null, "metadata": null, "model": "gpt-4", "object": "response", "output": [{"content": [{"text": "Hello! How can I help you today?", "type": "output_text"}], "id": "msg-abc123", "role": "assistant", "type": "message"}], "parallel_tool_calls": true, "presence_penalty": null, "status": "completed", "temperature": null, "tool_choice": "auto", "tools": [], "top_p": null}, "request_id": "", "status_code": 296735}}], "status": "in_progress", "usage": {"completion_tokens": 323461, "prompt_tokens": 784076, "total_tokens": 757531}} + "400": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + deleteBatch: + speakeasy-default-delete-batch: + parameters: + path: + id: "batch_abc123" + responses: + "200": + application/json: {"deletion": {"openrouter": "deleted"}, "id": "batch_abc123", "object": "batch"} + "401": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + getBatches: + speakeasy-default-get-batches: + parameters: + path: + id: "batch_abc123" + responses: + "200": + application/json: {"completion_window": "24h", "created_at": 503378, "endpoint": "", "error": {"message": ""}, "finalized_at": 354647, "id": "", "model": "Challenger", "object": "batch", "request_counts": {"completed": 781860, "failed": 146323, "total": 565365}, "results": null, "status": "failed", "usage": {"completion_tokens": 871340, "prompt_tokens": 424032, "total_tokens": 553781}} + "402": + application/json: {"completion_window": "24h", "created_at": 852840, "endpoint": "", "error": {"code": 991646, "message": ""}, "finalized_at": 879297, "id": "", "model": "Model S", "object": "batch", "request_counts": {"completed": 849535, "failed": 962054, "total": 811028}, "results": "", "status": "validating", "usage": {"completion_tokens": 368503, "prompt_tokens": 726701, "total_tokens": 328573}} + "401": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} + "500": + application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.tts.create_speech()`: \n * `request.input_references[]` **Changed**\n* `open_router.endpoints.list_zdr_endpoints()`: `response.data[]` **Changed**\n* `open_router.endpoints.list()`: `response.data.endpoints[]` **Changed**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.batch.list()`: **Added** + * `open_router.batch.create_batches()`: **Added** + * `open_router.batch.delete()`: **Added** + * `open_router.batch.get_batches()`: **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 57690f43..62172817 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.2.28 + version: 1.2.29 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index f66acf24..f4782c92 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -4407,6 +4407,1493 @@ components: oneOf: - $ref: '#/components/schemas/ContainerAutoEnvironment' - $ref: '#/components/schemas/ContainerReferenceEnvironment' + BatchDeletedObject: + description: 'Confirms a terminal batch was removed from the API and its OpenRouter-held artifacts purged. Deletion is not cancellation and does not erase billing or audit records.' + example: + deletion: + openrouter: 'deleted' + upstream: + provider: 'OpenAI' + status: 'unsupported' + id: 'batch_abc123' + object: 'batch' + properties: + deletion: + $ref: '#/components/schemas/BatchDeletionTargets' + id: + example: 'batch_abc123' + type: 'string' + object: + enum: + - 'batch' + type: 'string' + required: + - 'id' + - 'object' + - 'deletion' + type: 'object' + BatchDeletionOutcome: + description: 'Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).' + enum: + - 'deleted' + - 'unsupported' + - 'not_applicable' + example: 'deleted' + type: 'string' + x-speakeasy-unknown-values: allow + BatchDeletionTargets: + additionalProperties: false + description: 'OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome.' + example: + openrouter: 'deleted' + upstream: + provider: 'Anthropic' + status: 'deleted' + properties: + openrouter: + description: 'OpenRouter-held request and result artifacts were purged.' + enum: + - 'deleted' + type: 'string' + upstream: + additionalProperties: false + description: 'The upstream batch deletion outcome; omitted when no provider was assigned.' + properties: + provider: + description: 'The provider name stored on the batch.' + example: 'OpenAI' + minLength: 1 + type: 'string' + status: + $ref: '#/components/schemas/BatchDeletionOutcome' + required: + - 'provider' + - 'status' + type: 'object' + required: + - 'openrouter' + type: 'object' + BatchErrorResponse: + example: + error: + code: 400 + message: 'custom_id is required on requests[0].' + properties: + error: + properties: + code: + type: 'integer' + message: + type: 'string' + required: + - 'code' + - 'message' + type: 'object' + required: + - 'error' + type: 'object' + BatchListItem: + description: 'Metadata-only batch object. `results` is always `null` in list responses.' + properties: + completion_window: + enum: + - '24h' + type: 'string' + created_at: + type: 'integer' + endpoint: + type: 'string' + error: + properties: + message: + type: 'string' + required: + - 'message' + type: + - 'object' + - 'null' + finalized_at: + type: + - 'integer' + - 'null' + id: + type: 'string' + model: + type: 'string' + object: + enum: + - 'batch' + type: 'string' + request_counts: + properties: + completed: + type: 'integer' + failed: + type: 'integer' + total: + type: 'integer' + required: + - 'total' + - 'completed' + - 'failed' + type: 'object' + results: + description: 'Always null: retrieve the batch with `GET /batches/{id}` to access its results.' + type: 'null' + status: + enum: + - 'validating' + - 'in_progress' + - 'finalizing' + - 'completed' + - 'failed' + - 'expired' + - 'cancelling' + - 'cancelled' + type: 'string' + x-speakeasy-unknown-values: allow + usage: + properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' + completion_tokens: + description: 'The tokens generated' + type: 'integer' + completion_tokens_details: + properties: + audio_tokens: + description: 'Tokens generated by the model for audio output.' + type: + - 'integer' + - 'null' + image_tokens: + description: 'Tokens generated by the model for image output.' + type: + - 'integer' + - 'null' + reasoning_tokens: + description: 'Tokens generated by the model for reasoning.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + cost: + description: 'Cost of the completion' + format: 'double' + type: + - 'number' + - 'null' + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: 'Whether a request was made using a Bring Your Own Key configuration' + type: 'boolean' + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: + - 'array' + - 'null' + prompt_tokens: + description: 'Including images, input audio, and tools if any' + type: 'integer' + prompt_tokens_details: + description: 'Breakdown of tokens used in the prompt.' + properties: + audio_tokens: + description: 'Tokens used for input audio.' + type: + - 'integer' + - 'null' + cache_write_tokens: + description: 'Tokens written to cache. Only returned for models with explicit caching and cache write pricing.' + type: + - 'integer' + - 'null' + cached_tokens: + description: 'Tokens cached by the endpoint.' + type: + - 'integer' + - 'null' + file_tokens: + description: 'Tokens used for input files/documents.' + type: + - 'integer' + - 'null' + video_tokens: + description: 'Tokens used for input video.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + server_tool_use: + description: 'Usage for server-side tool execution (e.g., web search)' + properties: + tool_calls_executed: + description: 'Number of OpenRouter server tool calls that executed and produced a result.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + service_tier: + description: 'The service tier used by the upstream provider for this request' + type: + - 'string' + - 'null' + speed: + $ref: '#/components/schemas/AnthropicSpeed' + total_tokens: + description: 'Sum of the above two fields' + type: 'integer' + required: + - 'prompt_tokens' + - 'completion_tokens' + - 'total_tokens' + type: + - 'object' + - 'null' + required: + - 'id' + - 'object' + - 'endpoint' + - 'model' + - 'completion_window' + - 'status' + - 'created_at' + - 'finalized_at' + - 'request_counts' + - 'usage' + - 'error' + - 'results' + type: 'object' + BatchListResponse: + description: 'A newest-first page of metadata-only batch objects.' + example: + data: [] + first_id: null + has_more: false + last_id: null + object: 'list' + properties: + data: + items: + $ref: '#/components/schemas/BatchListItem' + type: 'array' + first_id: + type: + - 'string' + - 'null' + has_more: + type: 'boolean' + last_id: + type: + - 'string' + - 'null' + object: + enum: + - 'list' + type: 'string' + required: + - 'object' + - 'data' + - 'first_id' + - 'last_id' + - 'has_more' + type: 'object' + BatchListStatus: + description: 'A batch status that is durably represented by the list data source. `finalizing` and `cancelling` are not accepted because stored jobs collapse those phases into `in_progress`.' + enum: + - 'validating' + - 'in_progress' + - 'completed' + - 'failed' + - 'expired' + - 'cancelled' + example: 'completed' + type: 'string' + x-speakeasy-unknown-values: allow + BatchListTimestamp: + anyOf: + - pattern: '^\d+$' + type: 'string' + - anyOf: + - format: 'date' + type: 'string' + - format: 'date-time' + type: 'string' + description: 'Only include batches created strictly after this timestamp.' + example: '2026-08-20T00:00:00Z' + BatchObject: + properties: + completion_window: + enum: + - '24h' + type: 'string' + created_at: + type: 'integer' + endpoint: + type: 'string' + error: + properties: + message: + type: 'string' + required: + - 'message' + type: + - 'object' + - 'null' + finalized_at: + type: + - 'integer' + - 'null' + id: + type: 'string' + model: + type: 'string' + object: + enum: + - 'batch' + type: 'string' + request_counts: + properties: + completed: + type: 'integer' + failed: + type: 'integer' + total: + type: 'integer' + required: + - 'total' + - 'completed' + - 'failed' + type: 'object' + results: + items: + properties: + custom_id: + type: 'string' + error: + properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' + message: + type: 'string' + param: + type: + - 'string' + - 'null' + type: + type: 'string' + required: + - 'type' + - 'message' + - 'param' + type: + - 'object' + - 'null' + id: + type: 'string' + response: + properties: + body: + anyOf: + - properties: + choices: + items: + properties: + finish_reason: + $ref: '#/components/schemas/FinishReason' + index: + type: 'integer' + logprobs: + properties: + content: + items: + properties: + bytes: + items: + type: 'integer' + type: + - 'array' + - 'null' + logprob: + format: 'double' + type: 'number' + token: + type: 'string' + top_logprobs: + items: + properties: + bytes: + items: + type: 'integer' + type: + - 'array' + - 'null' + logprob: + format: 'double' + type: 'number' + token: + type: 'string' + required: + - 'token' + - 'bytes' + - 'logprob' + type: 'object' + type: 'array' + required: + - 'token' + - 'bytes' + - 'logprob' + - 'top_logprobs' + type: 'object' + type: + - 'array' + - 'null' + refusal: + default: null + items: + properties: + bytes: + items: + type: 'integer' + type: + - 'array' + - 'null' + logprob: + format: 'double' + type: 'number' + token: + type: 'string' + top_logprobs: + items: + properties: + bytes: + items: + type: 'integer' + type: + - 'array' + - 'null' + logprob: + format: 'double' + type: 'number' + token: + type: 'string' + required: + - 'token' + - 'bytes' + - 'logprob' + type: 'object' + type: 'array' + required: + - 'token' + - 'bytes' + - 'logprob' + - 'top_logprobs' + type: 'object' + type: + - 'array' + - 'null' + required: + - 'content' + type: + - 'object' + - 'null' + message: + properties: + annotations: + items: + oneOf: + - properties: + file: + properties: + content: + items: + oneOf: + - properties: + text: + type: 'string' + type: + enum: + - 'text' + type: 'string' + required: + - 'type' + - 'text' + type: 'object' + - properties: + image_url: + properties: + url: + type: 'string' + required: + - 'url' + type: 'object' + type: + enum: + - 'image_url' + type: 'string' + required: + - 'type' + - 'image_url' + type: 'object' + type: 'array' + hash: + type: 'string' + name: + type: 'string' + required: + - 'hash' + - 'content' + type: 'object' + type: + enum: + - 'file' + type: 'string' + required: + - 'type' + - 'file' + type: 'object' + - properties: + type: + enum: + - 'url_citation' + type: 'string' + url_citation: + properties: + content: + type: 'string' + end_index: + type: 'integer' + start_index: + type: 'integer' + title: + type: 'string' + url: + type: 'string' + required: + - 'url' + - 'start_index' + - 'end_index' + - 'title' + type: 'object' + required: + - 'type' + - 'url_citation' + type: 'object' + - properties: + type: + enum: + - 'web_search_citation' + type: 'string' + web_search_citation: + properties: + cited_text: + type: 'string' + encrypted_index: + type: 'string' + title: + type: + - 'string' + - 'null' + url: + type: 'string' + required: + - 'url' + - 'title' + type: 'object' + required: + - 'type' + - 'web_search_citation' + type: 'object' + type: 'array' + content: + type: + - 'string' + - 'null' + images: + items: + properties: + image_url: + properties: + url: + minLength: 1 + type: 'string' + required: + - 'url' + type: 'object' + type: + enum: + - 'image_url' + type: 'string' + required: + - 'type' + - 'image_url' + type: 'object' + type: + - 'array' + - 'null' + reasoning: + type: + - 'string' + - 'null' + reasoning_details: + items: + anyOf: + - $ref: '#/components/schemas/ReasoningDetailSummary' + - $ref: '#/components/schemas/ReasoningDetailEncrypted' + - $ref: '#/components/schemas/ReasoningDetailText' + - $ref: '#/components/schemas/ReasoningDetailServerToolCall' + - type: 'null' + - type: 'null' + type: + - 'array' + - 'null' + refusal: + type: + - 'string' + - 'null' + role: + enum: + - 'assistant' + type: 'string' + tool_calls: + items: + properties: + function: + properties: + arguments: + type: 'string' + name: + type: 'string' + required: + - 'name' + - 'arguments' + type: 'object' + id: + type: 'string' + index: + type: 'integer' + type: + enum: + - 'function' + type: 'string' + required: + - 'index' + - 'id' + - 'type' + - 'function' + type: 'object' + type: 'array' + required: + - 'role' + - 'content' + - 'refusal' + type: 'object' + native_finish_reason: + type: + - 'string' + - 'null' + required: + - 'index' + - 'message' + - 'finish_reason' + - 'native_finish_reason' + - 'logprobs' + type: 'object' + type: 'array' + created: + type: 'integer' + debug: + additionalProperties: {} + properties: + echo_upstream_body: + additionalProperties: {} + type: 'object' + timings: + properties: + epoch_ms: + type: 'integer' + event: + enum: + - 'adapter_request' + - 'upstream_headers_received' + - 'first_token_received' + - 'upstream_body_ended' + type: 'string' + x-speakeasy-unknown-values: allow + start_ms: + type: 'integer' + required: + - 'start_ms' + - 'event' + - 'epoch_ms' + type: 'object' + type: 'object' + id: + type: 'string' + model: + type: 'string' + object: + enum: + - 'chat.completion' + type: 'string' + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' + provider: + type: + - 'string' + - 'null' + service_tier: + type: + - 'string' + - 'null' + system_fingerprint: + type: + - 'string' + - 'null' + usage: + properties: + completion_tokens: + description: 'The tokens generated' + type: 'integer' + completion_tokens_details: + properties: + audio_tokens: + description: 'Tokens generated by the model for audio output.' + type: + - 'integer' + - 'null' + image_tokens: + description: 'Tokens generated by the model for image output.' + type: + - 'integer' + - 'null' + reasoning_tokens: + description: 'Tokens generated by the model for reasoning.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + prompt_tokens: + description: 'Including images, input audio, and tools if any' + type: 'integer' + prompt_tokens_details: + description: 'Breakdown of tokens used in the prompt.' + properties: + audio_tokens: + description: 'Tokens used for input audio.' + type: + - 'integer' + - 'null' + cache_write_tokens: + description: 'Tokens written to cache. Only returned for models with explicit caching and cache write pricing.' + type: + - 'integer' + - 'null' + cached_tokens: + description: 'Tokens cached by the endpoint.' + type: + - 'integer' + - 'null' + file_tokens: + description: 'Tokens used for input files/documents.' + type: + - 'integer' + - 'null' + video_tokens: + description: 'Tokens used for input video.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + server_tool_use: + description: 'Usage for server-side tool execution (e.g., web search)' + properties: + tool_calls_executed: + description: 'Number of OpenRouter server tool calls that executed and produced a result.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + server_tool_use_details: + description: 'Usage for server-side tool execution (e.g., web search)' + properties: + tool_calls_executed: + description: 'Number of OpenRouter server tool calls that executed and produced a result.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + total_tokens: + description: 'Sum of the above two fields' + type: 'integer' + required: + - 'prompt_tokens' + - 'completion_tokens' + - 'total_tokens' + type: 'object' + required: + - 'model' + - 'id' + - 'created' + - 'object' + - 'choices' + type: 'object' + - $ref: '#/components/schemas/OpenResponsesResult' + - properties: + container: + $ref: '#/components/schemas/AnthropicContainer' + content: + items: + $ref: '#/components/schemas/ORAnthropicContentBlock' + type: 'array' + id: + type: 'string' + input_transformations: + items: + $ref: '#/components/schemas/AnthropicInputTransformation' + type: + - 'array' + - 'null' + model: + type: 'string' + role: + enum: + - 'assistant' + type: 'string' + stop_details: + $ref: '#/components/schemas/AnthropicRefusalStopDetails' + stop_reason: + $ref: '#/components/schemas/ORAnthropicStopReason' + stop_sequence: + type: + - 'string' + - 'null' + type: + enum: + - 'message' + type: 'string' + usage: + allOf: + - $ref: '#/components/schemas/AnthropicUsage' + - properties: + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: 'array' + speed: + $ref: '#/components/schemas/AnthropicSpeed' + type: 'object' + example: + cache_creation: null + cache_creation_input_tokens: null + cache_read_input_tokens: null + inference_geo: null + input_tokens: 100 + output_tokens: 50 + output_tokens_details: null + server_tool_use: null + service_tier: 'standard' + required: + - 'id' + - 'type' + - 'role' + - 'container' + - 'content' + - 'model' + - 'stop_reason' + - 'stop_details' + - 'stop_sequence' + - 'usage' + type: 'object' + - description: 'Embeddings response containing embedding vectors' + example: + data: + - embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: 'embedding' + model: 'openai/text-embedding-3-small' + object: 'list' + usage: + prompt_tokens: 8 + total_tokens: 8 + properties: + data: + description: 'List of embedding objects' + example: + - embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: 'embedding' + items: + description: 'A single embedding object' + example: + embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: 'embedding' + properties: + embedding: + anyOf: + - items: + type: 'number' + type: 'array' + - type: 'string' + description: 'Embedding vector as an array of floats or a base64 string' + example: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: + description: 'Index of the embedding in the input list' + example: 0 + type: 'integer' + object: + enum: + - 'embedding' + type: 'string' + required: + - 'object' + - 'embedding' + type: 'object' + type: 'array' + id: + description: 'Unique identifier for the embeddings response' + example: 'embd-1234567890' + type: 'string' + model: + description: 'The model used for embeddings' + example: 'openai/text-embedding-3-small' + type: 'string' + object: + enum: + - 'list' + type: 'string' + usage: + description: 'Token usage statistics' + example: + prompt_tokens: 8 + total_tokens: 8 + properties: + cost: + description: 'Cost of the request in credits' + example: 0.0001 + format: 'double' + type: 'number' + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: 'Whether a request was made using a Bring Your Own Key configuration' + type: 'boolean' + prompt_tokens: + description: 'Number of tokens in the input' + example: 8 + type: 'integer' + prompt_tokens_details: + description: '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.' + properties: + audio_tokens: + description: 'Number of audio tokens in the input' + type: 'integer' + file_tokens: + description: 'Number of file/document tokens in the input' + type: 'integer' + image_tokens: + description: 'Number of image tokens in the input' + example: 258 + type: 'integer' + text_tokens: + description: 'Number of text tokens in the input' + example: 8 + type: 'integer' + video_tokens: + description: 'Number of video tokens in the input' + type: 'integer' + type: 'object' + total_tokens: + description: 'Total number of tokens used' + example: 8 + type: 'integer' + required: + - 'prompt_tokens' + - 'total_tokens' + type: 'object' + required: + - 'object' + - 'data' + - 'model' + type: 'object' + request_id: + type: + - 'string' + - 'null' + status_code: + type: 'integer' + required: + - 'status_code' + - 'request_id' + - 'body' + type: + - 'object' + - 'null' + required: + - 'id' + - 'custom_id' + - 'response' + - 'error' + type: 'object' + type: + - 'array' + - 'null' + status: + enum: + - 'validating' + - 'in_progress' + - 'finalizing' + - 'completed' + - 'failed' + - 'expired' + - 'cancelling' + - 'cancelled' + type: 'string' + x-speakeasy-unknown-values: allow + usage: + properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' + completion_tokens: + description: 'The tokens generated' + type: 'integer' + completion_tokens_details: + properties: + audio_tokens: + description: 'Tokens generated by the model for audio output.' + type: + - 'integer' + - 'null' + image_tokens: + description: 'Tokens generated by the model for image output.' + type: + - 'integer' + - 'null' + reasoning_tokens: + description: 'Tokens generated by the model for reasoning.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + cost: + description: 'Cost of the completion' + format: 'double' + type: + - 'number' + - 'null' + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: 'Whether a request was made using a Bring Your Own Key configuration' + type: 'boolean' + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: + - 'array' + - 'null' + prompt_tokens: + description: 'Including images, input audio, and tools if any' + type: 'integer' + prompt_tokens_details: + description: 'Breakdown of tokens used in the prompt.' + properties: + audio_tokens: + description: 'Tokens used for input audio.' + type: + - 'integer' + - 'null' + cache_write_tokens: + description: 'Tokens written to cache. Only returned for models with explicit caching and cache write pricing.' + type: + - 'integer' + - 'null' + cached_tokens: + description: 'Tokens cached by the endpoint.' + type: + - 'integer' + - 'null' + file_tokens: + description: 'Tokens used for input files/documents.' + type: + - 'integer' + - 'null' + video_tokens: + description: 'Tokens used for input video.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + server_tool_use: + description: 'Usage for server-side tool execution (e.g., web search)' + properties: + tool_calls_executed: + description: 'Number of OpenRouter server tool calls that executed and produced a result.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + service_tier: + description: 'The service tier used by the upstream provider for this request' + type: + - 'string' + - 'null' + speed: + $ref: '#/components/schemas/AnthropicSpeed' + total_tokens: + description: 'Sum of the above two fields' + type: 'integer' + required: + - 'prompt_tokens' + - 'completion_tokens' + - 'total_tokens' + type: + - 'object' + - 'null' + required: + - 'id' + - 'object' + - 'endpoint' + - 'model' + - 'completion_window' + - 'status' + - 'created_at' + - 'finalized_at' + - 'request_counts' + - 'usage' + - 'results' + - 'error' + type: 'object' + BatchPaymentRequiredResponse: + description: 'Batch metadata with results withheld (results: null) plus the standard error envelope. Add credits to unlock the already-computed results; the batch is not re-run.' + properties: + completion_window: + enum: + - '24h' + type: 'string' + created_at: + type: 'integer' + endpoint: + type: 'string' + error: + properties: + code: + type: 'integer' + message: + type: 'string' + required: + - 'code' + - 'message' + type: 'object' + finalized_at: + type: + - 'integer' + - 'null' + id: + type: 'string' + model: + type: 'string' + object: + enum: + - 'batch' + type: 'string' + request_counts: + properties: + completed: + type: 'integer' + failed: + type: 'integer' + total: + type: 'integer' + required: + - 'total' + - 'completed' + - 'failed' + type: 'object' + results: + description: 'Always null: results are withheld until the batch charge is covered.' + type: 'null' + status: + enum: + - 'validating' + - 'in_progress' + - 'finalizing' + - 'completed' + - 'failed' + - 'expired' + - 'cancelling' + - 'cancelled' + type: 'string' + x-speakeasy-unknown-values: allow + usage: + properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' + completion_tokens: + description: 'The tokens generated' + type: 'integer' + completion_tokens_details: + properties: + audio_tokens: + description: 'Tokens generated by the model for audio output.' + type: + - 'integer' + - 'null' + image_tokens: + description: 'Tokens generated by the model for image output.' + type: + - 'integer' + - 'null' + reasoning_tokens: + description: 'Tokens generated by the model for reasoning.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + cost: + description: 'Cost of the completion' + format: 'double' + type: + - 'number' + - 'null' + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: 'Whether a request was made using a Bring Your Own Key configuration' + type: 'boolean' + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: + - 'array' + - 'null' + prompt_tokens: + description: 'Including images, input audio, and tools if any' + type: 'integer' + prompt_tokens_details: + description: 'Breakdown of tokens used in the prompt.' + properties: + audio_tokens: + description: 'Tokens used for input audio.' + type: + - 'integer' + - 'null' + cache_write_tokens: + description: 'Tokens written to cache. Only returned for models with explicit caching and cache write pricing.' + type: + - 'integer' + - 'null' + cached_tokens: + description: 'Tokens cached by the endpoint.' + type: + - 'integer' + - 'null' + file_tokens: + description: 'Tokens used for input files/documents.' + type: + - 'integer' + - 'null' + video_tokens: + description: 'Tokens used for input video.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + server_tool_use: + description: 'Usage for server-side tool execution (e.g., web search)' + properties: + tool_calls_executed: + description: 'Number of OpenRouter server tool calls that executed and produced a result.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + 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.' + type: + - 'integer' + - 'null' + type: + - 'object' + - 'null' + service_tier: + description: 'The service tier used by the upstream provider for this request' + type: + - 'string' + - 'null' + speed: + $ref: '#/components/schemas/AnthropicSpeed' + total_tokens: + description: 'Sum of the above two fields' + type: 'integer' + required: + - 'prompt_tokens' + - 'completion_tokens' + - 'total_tokens' + type: + - 'object' + - 'null' + required: + - 'id' + - 'object' + - 'endpoint' + - 'model' + - 'completion_window' + - 'status' + - 'created_at' + - 'finalized_at' + - 'request_counts' + - 'usage' + - 'results' + - 'error' + type: 'object' + BatchProviderPreferences: + additionalProperties: false + description: 'Batch provider routing preferences. Only `provider.only` is supported.' + example: + only: + - 'google-vertex' + properties: + only: + description: 'List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.' + example: + - 'openai' + - 'anthropic' + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: 'string' + type: + - 'array' + - 'null' + type: + - 'object' + - 'null' + BatchSubmitBody: + description: 'Batch submit request body.' + properties: + completion_window: + default: '24h' + enum: + - '24h' + type: 'string' + endpoint: + enum: + - '/v1/chat/completions' + - '/v1/responses' + - '/v1/messages' + - '/v1/embeddings' + type: 'string' + x-speakeasy-unknown-values: allow + model: + minLength: 1 + type: 'string' + provider: + $ref: '#/components/schemas/BatchProviderPreferences' + requests: + items: + properties: + body: + additionalProperties: true + description: 'Request payload for the batch `endpoint`.' + type: 'object' + custom_id: + minLength: 1 + type: 'string' + required: + - 'custom_id' + - 'body' + type: 'object' + minItems: 1 + type: 'array' + required: + - 'endpoint' + - 'model' + - 'requests' + type: 'object' BooleanCapability: description: 'A supported-or-not flag. Present means the parameter is accepted.' example: @@ -9232,6 +10719,16 @@ components: example: {} properties: {} type: 'object' + FinishReason: + enum: + - 'stop' + - 'length' + - 'tool_calls' + - 'content_filter' + - 'function_call' + example: 'stop' + type: 'string' + x-speakeasy-unknown-values: allow ForbiddenResponse: description: 'Forbidden - Authentication successful but insufficient permissions' example: @@ -31587,6 +33084,478 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" + /batches: + get: + description: 'Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page''s `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'listBatches' + parameters: + - description: 'Maximum number of batches to return, from 1 through 100.' + in: 'query' + name: 'limit' + required: false + schema: + description: 'Maximum number of batches to return, from 1 through 100.' + example: 20 + type: 'integer' + - description: 'Batch id from the previous page''s `last_id`.' + in: 'query' + name: 'after' + required: false + schema: + description: 'Batch id from the previous page''s `last_id`.' + example: 'batch_7a4b02' + minLength: 1 + type: 'string' + - description: 'Repeat this parameter to include more than one status.' + explode: true + in: 'query' + name: 'status' + required: false + schema: + description: 'Repeat this parameter to include more than one status.' + example: + - 'completed' + - 'failed' + items: + $ref: '#/components/schemas/BatchListStatus' + type: 'array' + style: 'form' + - description: 'Only include batches created strictly after this timestamp.' + in: 'query' + name: 'created_after' + required: false + schema: + $ref: '#/components/schemas/BatchListTimestamp' + - description: 'Only include batches created strictly before this timestamp.' + in: 'query' + name: 'created_before' + required: false + schema: + allOf: + - $ref: '#/components/schemas/BatchListTimestamp' + - description: 'Only include batches created strictly before this timestamp.' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchListResponse' + description: 'A newest-first page of batches.' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid batch list query.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Malformed or unsupported batch list query parameters.' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'No auth credentials found.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal server error.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Upstream batch-api is unavailable.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'List batches' + tags: + - 'Batch' + x-speakeasy-name-override: 'list' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'after' + type: 'cursor' + outputs: + nextCursor: '$.last_id' + results: '$.data' + type: 'cursor' + post: + description: 'Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: "validating"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'createBatches' + requestBody: + content: + application/json: + examples: + chatCompletions: + summary: 'Chat completions batch' + value: + endpoint: '/v1/chat/completions' + model: 'openai/gpt-4o' + requests: + - body: + messages: + - content: 'Summarize ...' + role: 'user' + model: 'openai/gpt-4o' + custom_id: 'req-0001' + messages: + summary: 'Messages batch' + value: + endpoint: '/v1/messages' + model: 'openai/gpt-5-nano' + requests: + - body: + max_tokens: 1024 + messages: + - content: 'Summarize ...' + role: 'user' + model: 'openai/gpt-5-nano' + custom_id: 'req-0001' + providerPinned: + summary: 'Batch pinned to Vertex' + value: + endpoint: '/v1/chat/completions' + model: 'google/gemini-3.6-flash' + provider: + only: + - 'google-vertex' + requests: + - body: + messages: + - content: 'Summarize ...' + role: 'user' + model: 'google/gemini-3.6-flash' + custom_id: 'req-0001' + responses: + summary: 'Responses batch' + value: + endpoint: '/v1/responses' + model: 'openai/gpt-4o' + requests: + - body: + input: + - content: + - text: 'Summarize ...' + type: 'input_text' + role: 'user' + model: 'openai/gpt-4o' + custom_id: 'req-0001' + schema: + $ref: '#/components/schemas/BatchSubmitBody' + description: 'The batch to create. Each item in `requests` has a unique `custom_id` and a `body` in the request format of the chosen `endpoint`.' + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchObject' + description: 'Batch payload durably persisted and queued for asynchronous validation and provider submission (`status: "validating"`).' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'custom_id is required on requests[0].' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Malformed batch input or an unknown/incompatible batch model.' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'No auth credentials found.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '402': + content: + application/json: + example: + error: + code: 402 + message: 'Insufficient balance for this batch.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The estimated batch cost exceeds the available balance.' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'The selected provider or model is not allowed.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The resolved batch endpoint is blocked by account policy.' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Batch not found.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'No batch exists for the given id.' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Batch input exceeds the 200 MB payload limit.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch input exceeds the maximum payload size.' + '422': + content: + application/json: + example: + error: + code: 422 + message: 'The batch request could not be processed.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The requested model variant or custom IDs violate Batch API constraints.' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal server error.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Upstream batch-api is unavailable.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'Create a batch' + tags: + - 'Batch' + x-speakeasy-retries: + retryConnectionErrors: false + statusCodes: + - '429' + strategy: 'backoff' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /batches/{id}: + delete: + description: 'Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'deleteBatch' + parameters: + - description: 'The batch job id returned from submit.' + in: 'path' + name: 'id' + required: true + schema: + description: 'The batch job id returned from submit.' + example: 'batch_abc123' + minLength: 1 + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchDeletedObject' + description: 'The batch was deleted; per-target outcomes are reported under `deletion`.' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'No auth credentials found.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Batch not found.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'No batch exists for the given id.' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Only completed, failed, expired, or cancelled batches can be deleted. Wait for the batch to finish and try again.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch is still processing, its required provider key is unavailable, or its state changed during deletion.' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal server error.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Upstream batch-api is unavailable.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'Delete a batch' + tags: + - 'Batch' + x-speakeasy-name-override: 'delete' + get: + description: 'Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'getBatches' + parameters: + - description: 'The batch job id returned from submit.' + in: 'path' + name: 'id' + required: true + schema: + description: 'The batch job id returned from submit.' + example: 'batch_abc123' + minLength: 1 + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchObject' + description: 'The current batch job status.' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'No auth credentials found.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchPaymentRequiredResponse' + description: 'The finalized batch cost exceeds the available balance; metadata is returned with `results: null`. Top up credits and poll again to receive the persisted results.' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Batch not found.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'No batch exists for the given id.' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal server error.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Upstream batch-api is unavailable.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'Get a batch' + tags: + - 'Batch' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /benchmarks: get: description: 'Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter''s own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter''s search benchmarks, which publish each model''s highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.' @@ -47555,6 +49524,8 @@ tags: name: 'Anthropic Messages' - description: 'BYOK endpoints' name: 'BYOK' + - description: 'Submit, list, poll, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart.' + name: 'Batch' - description: 'Benchmarks endpoints' name: 'Benchmarks' - description: 'Chat completion endpoints' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 16752744..715fd226 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:3300acddd2fd2bf4dd86533707050dd422c7297bccfa3b38546c88df69667864 - sourceBlobDigest: sha256:3a6c855be1c0b1e5ed3c4d831d2b5da76fe0d92432a3fbf6d2edfec6aab84c40 + sourceRevisionDigest: sha256:6ff78bd091299f16e703c9d4921e50eba69d63da300cc82aff35f997dc327863 + sourceBlobDigest: sha256:0b5a4d8ddfedee7aaa216ed03158ec191addc1d989e7bdd619fca20e112174f1 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:3300acddd2fd2bf4dd86533707050dd422c7297bccfa3b38546c88df69667864 - sourceBlobDigest: sha256:3a6c855be1c0b1e5ed3c4d831d2b5da76fe0d92432a3fbf6d2edfec6aab84c40 + sourceRevisionDigest: sha256:6ff78bd091299f16e703c9d4921e50eba69d63da300cc82aff35f997dc327863 + sourceBlobDigest: sha256:0b5a4d8ddfedee7aaa216ed03158ec191addc1d989e7bdd619fca20e112174f1 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:d618ed63247c77943456f9506235eca0ac64da62ade8439196342cfac374e221 + codeSamplesRevisionDigest: sha256:49a63522264eaf556e813b961ab040f3a4b98a839200607a4d0612e90262e84d workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/README-PYPI.md b/README-PYPI.md index 833bb3c3..01bc2a8f 100644 --- a/README-PYPI.md +++ b/README-PYPI.md @@ -244,7 +244,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.byok.list(offset=0, limit=50) + res = open_router.batch.list() while res is not None: # Handle items diff --git a/README.md b/README.md index 12cbcbdd..f696c00d 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.byok.list(offset=0, limit=50) + res = open_router.batch.list() while res is not None: # Handle items diff --git a/RELEASES.md b/RELEASES.md index df50d511..22d3d554 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2689,4 +2689,14 @@ Based on: ### Generated - [python v1.2.28] . ### Releases -- [PyPI v1.2.28] https://pypi.org/project/openrouter/1.2.28 - . \ No newline at end of file +- [PyPI v1.2.28] https://pypi.org/project/openrouter/1.2.28 - . + +## 2026-09-25 20:54:25 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.2.29] . +### Releases +- [PyPI v1.2.29] https://pypi.org/project/openrouter/1.2.29 - . \ No newline at end of file diff --git a/docs/components/annotation.mdx b/docs/components/annotation.mdx new file mode 100644 index 00000000..a91fc0f1 --- /dev/null +++ b/docs/components/annotation.mdx @@ -0,0 +1,24 @@ +--- +title: "Annotation" +--- + +## Supported Types + +### `components.AnnotationFile` + +```python +value: components.AnnotationFile = /* values here */ +``` + +### `components.AnnotationURLCitation` + +```python +value: components.AnnotationURLCitation = /* values here */ +``` + +### `components.AnnotationWebSearchCitation` + +```python +value: components.AnnotationWebSearchCitation = /* values here */ +``` + diff --git a/docs/components/annotationcontentunion.mdx b/docs/components/annotationcontentunion.mdx new file mode 100644 index 00000000..9c590a1b --- /dev/null +++ b/docs/components/annotationcontentunion.mdx @@ -0,0 +1,18 @@ +--- +title: "AnnotationContentUnion" +--- + +## Supported Types + +### `components.ContentText` + +```python +value: components.ContentText = /* values here */ +``` + +### `components.ContentImageURL` + +```python +value: components.ContentImageURL = /* values here */ +``` + diff --git a/docs/components/annotationfile.mdx b/docs/components/annotationfile.mdx new file mode 100644 index 00000000..50ae7e89 --- /dev/null +++ b/docs/components/annotationfile.mdx @@ -0,0 +1,10 @@ +--- +title: "AnnotationFile" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `file` | [components.BatchObjectFile](../components/batchobjectfile.mdx) | :heavy_check_mark: | N/A | +| `type` | [components.AnnotationTypeFile](../components/annotationtypefile.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/annotationtypefile.mdx b/docs/components/annotationtypefile.mdx new file mode 100644 index 00000000..8f6888ad --- /dev/null +++ b/docs/components/annotationtypefile.mdx @@ -0,0 +1,15 @@ +--- +title: "AnnotationTypeFile" +--- + +## Example Usage + +```python +from openrouter.components import AnnotationTypeFile +value: AnnotationTypeFile = "file" +``` + + +## Values + +- `"file"` diff --git a/docs/components/annotationtypeurlcitation.mdx b/docs/components/annotationtypeurlcitation.mdx new file mode 100644 index 00000000..a859249f --- /dev/null +++ b/docs/components/annotationtypeurlcitation.mdx @@ -0,0 +1,15 @@ +--- +title: "AnnotationTypeURLCitation" +--- + +## Example Usage + +```python +from openrouter.components import AnnotationTypeURLCitation +value: AnnotationTypeURLCitation = "url_citation" +``` + + +## Values + +- `"url_citation"` diff --git a/docs/components/annotationurlcitation.mdx b/docs/components/annotationurlcitation.mdx new file mode 100644 index 00000000..871c6191 --- /dev/null +++ b/docs/components/annotationurlcitation.mdx @@ -0,0 +1,10 @@ +--- +title: "AnnotationURLCitation" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | [components.AnnotationTypeURLCitation](../components/annotationtypeurlcitation.mdx) | :heavy_check_mark: | N/A | +| `url_citation` | [components.BatchObjectURLCitation](../components/batchobjecturlcitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/annotationwebsearchcitation.mdx b/docs/components/annotationwebsearchcitation.mdx new file mode 100644 index 00000000..a349dfd1 --- /dev/null +++ b/docs/components/annotationwebsearchcitation.mdx @@ -0,0 +1,10 @@ +--- +title: "AnnotationWebSearchCitation" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `type` | [components.TypeWebSearchCitation](../components/typewebsearchcitation.mdx) | :heavy_check_mark: | N/A | +| `web_search_citation` | [components.WebSearchCitation](../components/websearchcitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicadvisortoolresult.mdx b/docs/components/anthropicadvisortoolresult.mdx new file mode 100644 index 00000000..6511ee48 --- /dev/null +++ b/docs/components/anthropicadvisortoolresult.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicAdvisorToolResult" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `content` | Dict[str, *Any*] | :heavy_check_mark: | N/A | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicAdvisorToolResultType](../components/anthropicadvisortoolresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicadvisortoolresulttype.mdx b/docs/components/anthropicadvisortoolresulttype.mdx new file mode 100644 index 00000000..e48ed3e6 --- /dev/null +++ b/docs/components/anthropicadvisortoolresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicAdvisorToolResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicAdvisorToolResultType +value: AnthropicAdvisorToolResultType = "advisor_tool_result" +``` + + +## Values + +- `"advisor_tool_result"` diff --git a/docs/components/anthropicbashcodeexecutioncontent.mdx b/docs/components/anthropicbashcodeexecutioncontent.mdx new file mode 100644 index 00000000..b06e1ee7 --- /dev/null +++ b/docs/components/anthropicbashcodeexecutioncontent.mdx @@ -0,0 +1,18 @@ +--- +title: "AnthropicBashCodeExecutionContent" +--- + +## Supported Types + +### `components.AnthropicBashCodeExecutionResult` + +```python +value: components.AnthropicBashCodeExecutionResult = /* values here */ +``` + +### `components.AnthropicBashCodeExecutionToolResultError` + +```python +value: components.AnthropicBashCodeExecutionToolResultError = /* values here */ +``` + diff --git a/docs/components/anthropicbashcodeexecutionoutput.mdx b/docs/components/anthropicbashcodeexecutionoutput.mdx new file mode 100644 index 00000000..dc3f6e0f --- /dev/null +++ b/docs/components/anthropicbashcodeexecutionoutput.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicBashCodeExecutionOutput" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicBashCodeExecutionOutputType](../components/anthropicbashcodeexecutionoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicbashcodeexecutionoutputtype.mdx b/docs/components/anthropicbashcodeexecutionoutputtype.mdx new file mode 100644 index 00000000..d4823482 --- /dev/null +++ b/docs/components/anthropicbashcodeexecutionoutputtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicBashCodeExecutionOutputType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicBashCodeExecutionOutputType +value: AnthropicBashCodeExecutionOutputType = "bash_code_execution_output" +``` + + +## Values + +- `"bash_code_execution_output"` diff --git a/docs/components/anthropicbashcodeexecutionresult.mdx b/docs/components/anthropicbashcodeexecutionresult.mdx new file mode 100644 index 00000000..a48a5058 --- /dev/null +++ b/docs/components/anthropicbashcodeexecutionresult.mdx @@ -0,0 +1,13 @@ +--- +title: "AnthropicBashCodeExecutionResult" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `content` | List[[components.AnthropicBashCodeExecutionOutput](../components/anthropicbashcodeexecutionoutput.mdx)] | :heavy_check_mark: | N/A | +| `return_code` | *int* | :heavy_check_mark: | N/A | +| `stderr` | *str* | :heavy_check_mark: | N/A | +| `stdout` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicBashCodeExecutionResultType](../components/anthropicbashcodeexecutionresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicbashcodeexecutionresulttype.mdx b/docs/components/anthropicbashcodeexecutionresulttype.mdx new file mode 100644 index 00000000..281efa3c --- /dev/null +++ b/docs/components/anthropicbashcodeexecutionresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicBashCodeExecutionResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicBashCodeExecutionResultType +value: AnthropicBashCodeExecutionResultType = "bash_code_execution_result" +``` + + +## Values + +- `"bash_code_execution_result"` diff --git a/docs/components/anthropicbashcodeexecutiontoolresult.mdx b/docs/components/anthropicbashcodeexecutiontoolresult.mdx new file mode 100644 index 00000000..339bf784 --- /dev/null +++ b/docs/components/anthropicbashcodeexecutiontoolresult.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicBashCodeExecutionToolResult" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content` | [components.AnthropicBashCodeExecutionContent](../components/anthropicbashcodeexecutioncontent.mdx) | :heavy_check_mark: | N/A | \{
"content": [],
"return_code": 0,
"stderr": "",
"stdout": "Hello",
"type": "bash_code_execution_result"
} | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicBashCodeExecutionToolResultType](../components/anthropicbashcodeexecutiontoolresulttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicbashcodeexecutiontoolresulterror.mdx b/docs/components/anthropicbashcodeexecutiontoolresulterror.mdx new file mode 100644 index 00000000..ad9c88d1 --- /dev/null +++ b/docs/components/anthropicbashcodeexecutiontoolresulterror.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicBashCodeExecutionToolResultError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `error_code` | [components.AnthropicBashCodeExecutionToolResultErrorErrorCode](../components/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicBashCodeExecutionToolResultErrorType](../components/anthropicbashcodeexecutiontoolresulterrortype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx b/docs/components/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx new file mode 100644 index 00000000..ab7ee48f --- /dev/null +++ b/docs/components/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicBashCodeExecutionToolResultErrorErrorCode" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicBashCodeExecutionToolResultErrorErrorCode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicBashCodeExecutionToolResultErrorErrorCode = "invalid_tool_input" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"invalid_tool_input"` +- `"unavailable"` +- `"too_many_requests"` +- `"execution_time_exceeded"` +- `"output_file_too_large"` diff --git a/docs/components/anthropicbashcodeexecutiontoolresulterrortype.mdx b/docs/components/anthropicbashcodeexecutiontoolresulterrortype.mdx new file mode 100644 index 00000000..954e7691 --- /dev/null +++ b/docs/components/anthropicbashcodeexecutiontoolresulterrortype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicBashCodeExecutionToolResultErrorType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicBashCodeExecutionToolResultErrorType +value: AnthropicBashCodeExecutionToolResultErrorType = "bash_code_execution_tool_result_error" +``` + + +## Values + +- `"bash_code_execution_tool_result_error"` diff --git a/docs/components/anthropicbashcodeexecutiontoolresulttype.mdx b/docs/components/anthropicbashcodeexecutiontoolresulttype.mdx new file mode 100644 index 00000000..02e1d2e8 --- /dev/null +++ b/docs/components/anthropicbashcodeexecutiontoolresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicBashCodeExecutionToolResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicBashCodeExecutionToolResultType +value: AnthropicBashCodeExecutionToolResultType = "bash_code_execution_tool_result" +``` + + +## Values + +- `"bash_code_execution_tool_result"` diff --git a/docs/components/anthropiccaller.mdx b/docs/components/anthropiccaller.mdx new file mode 100644 index 00000000..18cfeeb9 --- /dev/null +++ b/docs/components/anthropiccaller.mdx @@ -0,0 +1,24 @@ +--- +title: "AnthropicCaller" +--- + +## Supported Types + +### `components.AnthropicCodeExecution20250825Caller` + +```python +value: components.AnthropicCodeExecution20250825Caller = /* values here */ +``` + +### `components.AnthropicCodeExecution20260120Caller` + +```python +value: components.AnthropicCodeExecution20260120Caller = /* values here */ +``` + +### `components.AnthropicDirectCaller` + +```python +value: components.AnthropicDirectCaller = /* values here */ +``` + diff --git a/docs/components/anthropiccitationcharlocation.mdx b/docs/components/anthropiccitationcharlocation.mdx new file mode 100644 index 00000000..9a79e2d2 --- /dev/null +++ b/docs/components/anthropiccitationcharlocation.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationCharLocation" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `cited_text` | *str* | :heavy_check_mark: | N/A | +| `document_index` | *int* | :heavy_check_mark: | N/A | +| `document_title` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `end_char_index` | *int* | :heavy_check_mark: | N/A | +| `file_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `start_char_index` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCitationCharLocationType](../components/anthropiccitationcharlocationtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationcharlocationtype.mdx b/docs/components/anthropiccitationcharlocationtype.mdx new file mode 100644 index 00000000..bbab5227 --- /dev/null +++ b/docs/components/anthropiccitationcharlocationtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationCharLocationType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCitationCharLocationType +value: AnthropicCitationCharLocationType = "char_location" +``` + + +## Values + +- `"char_location"` diff --git a/docs/components/anthropiccitationcontentblocklocation.mdx b/docs/components/anthropiccitationcontentblocklocation.mdx new file mode 100644 index 00000000..ae50edb4 --- /dev/null +++ b/docs/components/anthropiccitationcontentblocklocation.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationContentBlockLocation" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `cited_text` | *str* | :heavy_check_mark: | N/A | +| `document_index` | *int* | :heavy_check_mark: | N/A | +| `document_title` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `end_block_index` | *int* | :heavy_check_mark: | N/A | +| `file_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `start_block_index` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCitationContentBlockLocationType](../components/anthropiccitationcontentblocklocationtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationcontentblocklocationtype.mdx b/docs/components/anthropiccitationcontentblocklocationtype.mdx new file mode 100644 index 00000000..ba61935e --- /dev/null +++ b/docs/components/anthropiccitationcontentblocklocationtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationContentBlockLocationType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCitationContentBlockLocationType +value: AnthropicCitationContentBlockLocationType = "content_block_location" +``` + + +## Values + +- `"content_block_location"` diff --git a/docs/components/anthropiccitationpagelocation.mdx b/docs/components/anthropiccitationpagelocation.mdx new file mode 100644 index 00000000..d9cb06ae --- /dev/null +++ b/docs/components/anthropiccitationpagelocation.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationPageLocation" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `cited_text` | *str* | :heavy_check_mark: | N/A | +| `document_index` | *int* | :heavy_check_mark: | N/A | +| `document_title` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `end_page_number` | *int* | :heavy_check_mark: | N/A | +| `file_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `start_page_number` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCitationPageLocationType](../components/anthropiccitationpagelocationtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationpagelocationtype.mdx b/docs/components/anthropiccitationpagelocationtype.mdx new file mode 100644 index 00000000..fab850f3 --- /dev/null +++ b/docs/components/anthropiccitationpagelocationtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCitationPageLocationType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCitationPageLocationType +value: AnthropicCitationPageLocationType = "page_location" +``` + + +## Values + +- `"page_location"` diff --git a/docs/components/anthropiccitationsconfig.mdx b/docs/components/anthropiccitationsconfig.mdx new file mode 100644 index 00000000..de669423 --- /dev/null +++ b/docs/components/anthropiccitationsconfig.mdx @@ -0,0 +1,9 @@ +--- +title: "AnthropicCitationsConfig" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `enabled` | *bool* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccitationsearchresultlocation.mdx b/docs/components/anthropiccitationsearchresultlocation.mdx new file mode 100644 index 00000000..4766fcaa --- /dev/null +++ b/docs/components/anthropiccitationsearchresultlocation.mdx @@ -0,0 +1,15 @@ +--- +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/anthropiccitationsearchresultlocationtype.mdx b/docs/components/anthropiccitationsearchresultlocationtype.mdx new file mode 100644 index 00000000..096cc0d6 --- /dev/null +++ b/docs/components/anthropiccitationsearchresultlocationtype.mdx @@ -0,0 +1,15 @@ +--- +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 new file mode 100644 index 00000000..b03268fd --- /dev/null +++ b/docs/components/anthropiccitationwebsearchresultlocation.mdx @@ -0,0 +1,13 @@ +--- +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/anthropiccitationwebsearchresultlocationtype.mdx b/docs/components/anthropiccitationwebsearchresultlocationtype.mdx new file mode 100644 index 00000000..9cb6d29d --- /dev/null +++ b/docs/components/anthropiccitationwebsearchresultlocationtype.mdx @@ -0,0 +1,15 @@ +--- +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/anthropiccodeexecution20250825caller.mdx b/docs/components/anthropiccodeexecution20250825caller.mdx new file mode 100644 index 00000000..78b363bf --- /dev/null +++ b/docs/components/anthropiccodeexecution20250825caller.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicCodeExecution20250825Caller" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `tool_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCodeExecution20250825CallerType](../components/anthropiccodeexecution20250825callertype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccodeexecution20250825callertype.mdx b/docs/components/anthropiccodeexecution20250825callertype.mdx new file mode 100644 index 00000000..63181a5a --- /dev/null +++ b/docs/components/anthropiccodeexecution20250825callertype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCodeExecution20250825CallerType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCodeExecution20250825CallerType +value: AnthropicCodeExecution20250825CallerType = "code_execution_20250825" +``` + + +## Values + +- `"code_execution_20250825"` diff --git a/docs/components/anthropiccodeexecution20260120caller.mdx b/docs/components/anthropiccodeexecution20260120caller.mdx new file mode 100644 index 00000000..6c863ec8 --- /dev/null +++ b/docs/components/anthropiccodeexecution20260120caller.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicCodeExecution20260120Caller" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `tool_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCodeExecution20260120CallerType](../components/anthropiccodeexecution20260120callertype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccodeexecution20260120callertype.mdx b/docs/components/anthropiccodeexecution20260120callertype.mdx new file mode 100644 index 00000000..1cbc51d8 --- /dev/null +++ b/docs/components/anthropiccodeexecution20260120callertype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCodeExecution20260120CallerType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCodeExecution20260120CallerType +value: AnthropicCodeExecution20260120CallerType = "code_execution_20260120" +``` + + +## Values + +- `"code_execution_20260120"` diff --git a/docs/components/anthropiccodeexecutioncontent.mdx b/docs/components/anthropiccodeexecutioncontent.mdx new file mode 100644 index 00000000..b14a45ff --- /dev/null +++ b/docs/components/anthropiccodeexecutioncontent.mdx @@ -0,0 +1,24 @@ +--- +title: "AnthropicCodeExecutionContent" +--- + +## Supported Types + +### `components.AnthropicCodeExecutionResult` + +```python +value: components.AnthropicCodeExecutionResult = /* values here */ +``` + +### `components.AnthropicCodeExecutionToolResultError` + +```python +value: components.AnthropicCodeExecutionToolResultError = /* values here */ +``` + +### `components.AnthropicEncryptedCodeExecutionResult` + +```python +value: components.AnthropicEncryptedCodeExecutionResult = /* values here */ +``` + diff --git a/docs/components/anthropiccodeexecutionoutput.mdx b/docs/components/anthropiccodeexecutionoutput.mdx new file mode 100644 index 00000000..12529bc3 --- /dev/null +++ b/docs/components/anthropiccodeexecutionoutput.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicCodeExecutionOutput" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCodeExecutionOutputType](../components/anthropiccodeexecutionoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccodeexecutionoutputtype.mdx b/docs/components/anthropiccodeexecutionoutputtype.mdx new file mode 100644 index 00000000..1fd91054 --- /dev/null +++ b/docs/components/anthropiccodeexecutionoutputtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCodeExecutionOutputType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCodeExecutionOutputType +value: AnthropicCodeExecutionOutputType = "code_execution_output" +``` + + +## Values + +- `"code_execution_output"` diff --git a/docs/components/anthropiccodeexecutionresult.mdx b/docs/components/anthropiccodeexecutionresult.mdx new file mode 100644 index 00000000..c1e3a98c --- /dev/null +++ b/docs/components/anthropiccodeexecutionresult.mdx @@ -0,0 +1,13 @@ +--- +title: "AnthropicCodeExecutionResult" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `content` | List[[components.AnthropicCodeExecutionOutput](../components/anthropiccodeexecutionoutput.mdx)] | :heavy_check_mark: | N/A | +| `return_code` | *int* | :heavy_check_mark: | N/A | +| `stderr` | *str* | :heavy_check_mark: | N/A | +| `stdout` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicCodeExecutionResultType](../components/anthropiccodeexecutionresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccodeexecutionresulttype.mdx b/docs/components/anthropiccodeexecutionresulttype.mdx new file mode 100644 index 00000000..0b936aa9 --- /dev/null +++ b/docs/components/anthropiccodeexecutionresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCodeExecutionResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCodeExecutionResultType +value: AnthropicCodeExecutionResultType = "code_execution_result" +``` + + +## Values + +- `"code_execution_result"` diff --git a/docs/components/anthropiccodeexecutiontoolresult.mdx b/docs/components/anthropiccodeexecutiontoolresult.mdx new file mode 100644 index 00000000..fa5095cd --- /dev/null +++ b/docs/components/anthropiccodeexecutiontoolresult.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicCodeExecutionToolResult" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `content` | [components.AnthropicCodeExecutionContent](../components/anthropiccodeexecutioncontent.mdx) | :heavy_check_mark: | N/A | \{
"content": [],
"return_code": 0,
"stderr": "",
"stdout": "Hello",
"type": "code_execution_result"
} | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicCodeExecutionToolResultType](../components/anthropiccodeexecutiontoolresulttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropiccodeexecutiontoolresulterror.mdx b/docs/components/anthropiccodeexecutiontoolresulterror.mdx new file mode 100644 index 00000000..200c14d0 --- /dev/null +++ b/docs/components/anthropiccodeexecutiontoolresulterror.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicCodeExecutionToolResultError" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `error_code` | [components.AnthropicServerToolErrorCode](../components/anthropicservertoolerrorcode.mdx) | :heavy_check_mark: | N/A | unavailable | +| `type` | [components.AnthropicCodeExecutionToolResultErrorType](../components/anthropiccodeexecutiontoolresulterrortype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropiccodeexecutiontoolresulterrortype.mdx b/docs/components/anthropiccodeexecutiontoolresulterrortype.mdx new file mode 100644 index 00000000..de815842 --- /dev/null +++ b/docs/components/anthropiccodeexecutiontoolresulterrortype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCodeExecutionToolResultErrorType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCodeExecutionToolResultErrorType +value: AnthropicCodeExecutionToolResultErrorType = "code_execution_tool_result_error" +``` + + +## Values + +- `"code_execution_tool_result_error"` diff --git a/docs/components/anthropiccodeexecutiontoolresulttype.mdx b/docs/components/anthropiccodeexecutiontoolresulttype.mdx new file mode 100644 index 00000000..72295679 --- /dev/null +++ b/docs/components/anthropiccodeexecutiontoolresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCodeExecutionToolResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCodeExecutionToolResultType +value: AnthropicCodeExecutionToolResultType = "code_execution_tool_result" +``` + + +## Values + +- `"code_execution_tool_result"` diff --git a/docs/components/anthropiccompactionblock.mdx b/docs/components/anthropiccompactionblock.mdx new file mode 100644 index 00000000..95ab206e --- /dev/null +++ b/docs/components/anthropiccompactionblock.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicCompactionBlock" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `content` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `type` | [components.AnthropicCompactionBlockType](../components/anthropiccompactionblocktype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccompactionblocktype.mdx b/docs/components/anthropiccompactionblocktype.mdx new file mode 100644 index 00000000..017cf712 --- /dev/null +++ b/docs/components/anthropiccompactionblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicCompactionBlockType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicCompactionBlockType +value: AnthropicCompactionBlockType = "compaction" +``` + + +## Values + +- `"compaction"` diff --git a/docs/components/anthropiccontainer.mdx b/docs/components/anthropiccontainer.mdx new file mode 100644 index 00000000..620f4275 --- /dev/null +++ b/docs/components/anthropiccontainer.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicContainer" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `expires_at` | *str* | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `skills` | List[[components.AnthropicContainerSkill](../components/anthropiccontainerskill.mdx)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccontainerskill.mdx b/docs/components/anthropiccontainerskill.mdx new file mode 100644 index 00000000..06aea602 --- /dev/null +++ b/docs/components/anthropiccontainerskill.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicContainerSkill" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `skill_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicContainerSkillType](../components/anthropiccontainerskilltype.mdx) | :heavy_check_mark: | N/A | +| `version` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccontainerskilltype.mdx b/docs/components/anthropiccontainerskilltype.mdx new file mode 100644 index 00000000..83805e4b --- /dev/null +++ b/docs/components/anthropiccontainerskilltype.mdx @@ -0,0 +1,20 @@ +--- +title: "AnthropicContainerSkillType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicContainerSkillType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicContainerSkillType = "anthropic" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"anthropic"` +- `"custom"` diff --git a/docs/components/anthropiccontainerupload.mdx b/docs/components/anthropiccontainerupload.mdx new file mode 100644 index 00000000..cc5c98f8 --- /dev/null +++ b/docs/components/anthropiccontainerupload.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicContainerUpload" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicContainerUploadType](../components/anthropiccontaineruploadtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropiccontaineruploadtype.mdx b/docs/components/anthropiccontaineruploadtype.mdx new file mode 100644 index 00000000..ea8f01cb --- /dev/null +++ b/docs/components/anthropiccontaineruploadtype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicContainerUploadType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicContainerUploadType +value: AnthropicContainerUploadType = "container_upload" +``` + + +## Values + +- `"container_upload"` diff --git a/docs/components/anthropicdirectcaller.mdx b/docs/components/anthropicdirectcaller.mdx new file mode 100644 index 00000000..970780a2 --- /dev/null +++ b/docs/components/anthropicdirectcaller.mdx @@ -0,0 +1,9 @@ +--- +title: "AnthropicDirectCaller" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | [components.AnthropicDirectCallerType](../components/anthropicdirectcallertype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicdirectcallertype.mdx b/docs/components/anthropicdirectcallertype.mdx new file mode 100644 index 00000000..d8b96354 --- /dev/null +++ b/docs/components/anthropicdirectcallertype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicDirectCallerType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicDirectCallerType +value: AnthropicDirectCallerType = "direct" +``` + + +## Values + +- `"direct"` diff --git a/docs/components/anthropicdocumentblock.mdx b/docs/components/anthropicdocumentblock.mdx new file mode 100644 index 00000000..6d9011ff --- /dev/null +++ b/docs/components/anthropicdocumentblock.mdx @@ -0,0 +1,12 @@ +--- +title: "AnthropicDocumentBlock" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `citations` | [OptionalNullable[components.AnthropicCitationsConfig]](../components/anthropiccitationsconfig.mdx) | :heavy_minus_sign: | N/A | \{
"enabled": true
} | +| `source` | [components.AnthropicDocumentBlockSource](../components/anthropicdocumentblocksource.mdx) | :heavy_check_mark: | N/A | | +| `title` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicDocumentBlockType](../components/anthropicdocumentblocktype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicdocumentblockparam.mdx b/docs/components/anthropicdocumentblockparam.mdx index 1ed7b7cd..f49b6626 100644 --- a/docs/components/anthropicdocumentblockparam.mdx +++ b/docs/components/anthropicdocumentblockparam.mdx @@ -11,4 +11,4 @@ title: "AnthropicDocumentBlockParam" | `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 +| `type` | [components.AnthropicDocumentBlockParamTypeDocument](../components/anthropicdocumentblockparamtypedocument.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicdocumentblockparamtypedocument.mdx b/docs/components/anthropicdocumentblockparamtypedocument.mdx new file mode 100644 index 00000000..baa0ea0a --- /dev/null +++ b/docs/components/anthropicdocumentblockparamtypedocument.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicDocumentBlockParamTypeDocument" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicDocumentBlockParamTypeDocument +value: AnthropicDocumentBlockParamTypeDocument = "document" +``` + + +## Values + +- `"document"` diff --git a/docs/components/anthropicdocumentblocksource.mdx b/docs/components/anthropicdocumentblocksource.mdx new file mode 100644 index 00000000..bc195ec7 --- /dev/null +++ b/docs/components/anthropicdocumentblocksource.mdx @@ -0,0 +1,18 @@ +--- +title: "AnthropicDocumentBlockSource" +--- + +## Supported Types + +### `components.AnthropicBase64PdfSource` + +```python +value: components.AnthropicBase64PdfSource = /* values here */ +``` + +### `components.AnthropicPlainTextSource` + +```python +value: components.AnthropicPlainTextSource = /* values here */ +``` + diff --git a/docs/components/anthropicdocumentblocktype.mdx b/docs/components/anthropicdocumentblocktype.mdx new file mode 100644 index 00000000..970df2bc --- /dev/null +++ b/docs/components/anthropicdocumentblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicDocumentBlockType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicDocumentBlockType +value: AnthropicDocumentBlockType = "document" +``` + + +## Values + +- `"document"` diff --git a/docs/components/anthropicencryptedcodeexecutionresult.mdx b/docs/components/anthropicencryptedcodeexecutionresult.mdx new file mode 100644 index 00000000..2f992ca4 --- /dev/null +++ b/docs/components/anthropicencryptedcodeexecutionresult.mdx @@ -0,0 +1,13 @@ +--- +title: "AnthropicEncryptedCodeExecutionResult" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `content` | List[[components.AnthropicCodeExecutionOutput](../components/anthropiccodeexecutionoutput.mdx)] | :heavy_check_mark: | N/A | +| `encrypted_stdout` | *str* | :heavy_check_mark: | N/A | +| `return_code` | *int* | :heavy_check_mark: | N/A | +| `stderr` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicEncryptedCodeExecutionResultType](../components/anthropicencryptedcodeexecutionresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicencryptedcodeexecutionresulttype.mdx b/docs/components/anthropicencryptedcodeexecutionresulttype.mdx new file mode 100644 index 00000000..368125c1 --- /dev/null +++ b/docs/components/anthropicencryptedcodeexecutionresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicEncryptedCodeExecutionResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicEncryptedCodeExecutionResultType +value: AnthropicEncryptedCodeExecutionResultType = "encrypted_code_execution_result" +``` + + +## Values + +- `"encrypted_code_execution_result"` diff --git a/docs/components/anthropicinputtransformation.mdx b/docs/components/anthropicinputtransformation.mdx new file mode 100644 index 00000000..5eadea13 --- /dev/null +++ b/docs/components/anthropicinputtransformation.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicInputTransformation" +--- + +A server-side transformation Anthropic applied to the request input + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `path` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `reason` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `type` | *str* | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \{
"path": "messages.1.content.0",
"reason": "prefix_binding_mismatch",
"type": "thinking_dropped"
} | \ No newline at end of file diff --git a/docs/components/anthropicoutputtokensdetails.mdx b/docs/components/anthropicoutputtokensdetails.mdx new file mode 100644 index 00000000..5e531708 --- /dev/null +++ b/docs/components/anthropicoutputtokensdetails.mdx @@ -0,0 +1,9 @@ +--- +title: "AnthropicOutputTokensDetails" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `thinking_tokens` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicredactedthinkingblock.mdx b/docs/components/anthropicredactedthinkingblock.mdx new file mode 100644 index 00000000..df0aaeaa --- /dev/null +++ b/docs/components/anthropicredactedthinkingblock.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicRedactedThinkingBlock" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `data` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicRedactedThinkingBlockType](../components/anthropicredactedthinkingblocktype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicredactedthinkingblocktype.mdx b/docs/components/anthropicredactedthinkingblocktype.mdx new file mode 100644 index 00000000..09c048fb --- /dev/null +++ b/docs/components/anthropicredactedthinkingblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicRedactedThinkingBlockType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicRedactedThinkingBlockType +value: AnthropicRedactedThinkingBlockType = "redacted_thinking" +``` + + +## Values + +- `"redacted_thinking"` diff --git a/docs/components/anthropicrefusalstopdetails.mdx b/docs/components/anthropicrefusalstopdetails.mdx new file mode 100644 index 00000000..0b310ef7 --- /dev/null +++ b/docs/components/anthropicrefusalstopdetails.mdx @@ -0,0 +1,14 @@ +--- +title: "AnthropicRefusalStopDetails" +--- + +Structured information about a refusal + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `category` | [Nullable[components.AnthropicRefusalStopDetailsCategory]](../components/anthropicrefusalstopdetailscategory.mdx) | :heavy_check_mark: | N/A | +| `explanation` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicRefusalStopDetailsType](../components/anthropicrefusalstopdetailstype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicrefusalstopdetailscategory.mdx b/docs/components/anthropicrefusalstopdetailscategory.mdx new file mode 100644 index 00000000..e8fa541d --- /dev/null +++ b/docs/components/anthropicrefusalstopdetailscategory.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicRefusalStopDetailsCategory" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicRefusalStopDetailsCategory + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicRefusalStopDetailsCategory = "cyber" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"cyber"` +- `"bio"` +- `"frontier_llm"` +- `"reasoning_extraction"` +- `"general_harms"` diff --git a/docs/components/anthropicrefusalstopdetailstype.mdx b/docs/components/anthropicrefusalstopdetailstype.mdx new file mode 100644 index 00000000..4b9b057f --- /dev/null +++ b/docs/components/anthropicrefusalstopdetailstype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicRefusalStopDetailsType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicRefusalStopDetailsType +value: AnthropicRefusalStopDetailsType = "refusal" +``` + + +## Values + +- `"refusal"` diff --git a/docs/components/anthropicservertoolerrorcode.mdx b/docs/components/anthropicservertoolerrorcode.mdx new file mode 100644 index 00000000..043523bd --- /dev/null +++ b/docs/components/anthropicservertoolerrorcode.mdx @@ -0,0 +1,22 @@ +--- +title: "AnthropicServerToolErrorCode" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicServerToolErrorCode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicServerToolErrorCode = "invalid_tool_input" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"invalid_tool_input"` +- `"unavailable"` +- `"too_many_requests"` +- `"execution_time_exceeded"` diff --git a/docs/components/anthropicservertoolusage.mdx b/docs/components/anthropicservertoolusage.mdx new file mode 100644 index 00000000..c3f95be7 --- /dev/null +++ b/docs/components/anthropicservertoolusage.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicServerToolUsage" +--- + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `web_fetch_requests` | *int* | :heavy_check_mark: | N/A | +| `web_search_requests` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicservicetier.mdx b/docs/components/anthropicservicetier.mdx new file mode 100644 index 00000000..7cf6ee64 --- /dev/null +++ b/docs/components/anthropicservicetier.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicServiceTier" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicServiceTier + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicServiceTier = "standard" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"standard"` +- `"priority"` +- `"batch"` diff --git a/docs/components/anthropictextblock.mdx b/docs/components/anthropictextblock.mdx new file mode 100644 index 00000000..ac26f79d --- /dev/null +++ b/docs/components/anthropictextblock.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicTextBlock" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `citations` | List[[components.AnthropicTextCitation](../components/anthropictextcitation.mdx)] | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicTextBlockType](../components/anthropictextblocktype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropictextblocktype.mdx b/docs/components/anthropictextblocktype.mdx new file mode 100644 index 00000000..95be2eb7 --- /dev/null +++ b/docs/components/anthropictextblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicTextBlockType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicTextBlockType +value: AnthropicTextBlockType = "text" +``` + + +## Values + +- `"text"` diff --git a/docs/components/anthropictextcitation.mdx b/docs/components/anthropictextcitation.mdx new file mode 100644 index 00000000..3e6e66fa --- /dev/null +++ b/docs/components/anthropictextcitation.mdx @@ -0,0 +1,36 @@ +--- +title: "AnthropicTextCitation" +--- + +## Supported Types + +### `components.AnthropicCitationCharLocation` + +```python +value: components.AnthropicCitationCharLocation = /* values here */ +``` + +### `components.AnthropicCitationContentBlockLocation` + +```python +value: components.AnthropicCitationContentBlockLocation = /* values here */ +``` + +### `components.AnthropicCitationPageLocation` + +```python +value: components.AnthropicCitationPageLocation = /* values here */ +``` + +### `components.AnthropicCitationSearchResultLocation` + +```python +value: components.AnthropicCitationSearchResultLocation = /* values here */ +``` + +### `components.AnthropicCitationWebSearchResultLocation` + +```python +value: components.AnthropicCitationWebSearchResultLocation = /* values here */ +``` + diff --git a/docs/components/anthropictexteditorcodeexecutioncontent.mdx b/docs/components/anthropictexteditorcodeexecutioncontent.mdx new file mode 100644 index 00000000..c4c1b8b8 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutioncontent.mdx @@ -0,0 +1,30 @@ +--- +title: "AnthropicTextEditorCodeExecutionContent" +--- + +## Supported Types + +### `components.AnthropicTextEditorCodeExecutionCreateResult` + +```python +value: components.AnthropicTextEditorCodeExecutionCreateResult = /* values here */ +``` + +### `components.AnthropicTextEditorCodeExecutionStrReplaceResult` + +```python +value: components.AnthropicTextEditorCodeExecutionStrReplaceResult = /* values here */ +``` + +### `components.AnthropicTextEditorCodeExecutionToolResultError` + +```python +value: components.AnthropicTextEditorCodeExecutionToolResultError = /* values here */ +``` + +### `components.AnthropicTextEditorCodeExecutionViewResult` + +```python +value: components.AnthropicTextEditorCodeExecutionViewResult = /* values here */ +``` + diff --git a/docs/components/anthropictexteditorcodeexecutioncreateresult.mdx b/docs/components/anthropictexteditorcodeexecutioncreateresult.mdx new file mode 100644 index 00000000..7e94b8f7 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutioncreateresult.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicTextEditorCodeExecutionCreateResult" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `is_file_update` | *bool* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicTextEditorCodeExecutionCreateResultType](../components/anthropictexteditorcodeexecutioncreateresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropictexteditorcodeexecutioncreateresulttype.mdx b/docs/components/anthropictexteditorcodeexecutioncreateresulttype.mdx new file mode 100644 index 00000000..415ae0df --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutioncreateresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicTextEditorCodeExecutionCreateResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicTextEditorCodeExecutionCreateResultType +value: AnthropicTextEditorCodeExecutionCreateResultType = "text_editor_code_execution_create_result" +``` + + +## Values + +- `"text_editor_code_execution_create_result"` diff --git a/docs/components/anthropictexteditorcodeexecutionstrreplaceresult.mdx b/docs/components/anthropictexteditorcodeexecutionstrreplaceresult.mdx new file mode 100644 index 00000000..cd8b9eef --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutionstrreplaceresult.mdx @@ -0,0 +1,14 @@ +--- +title: "AnthropicTextEditorCodeExecutionStrReplaceResult" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `lines` | List[*str*] | :heavy_check_mark: | N/A | +| `new_lines` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `new_start` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `old_lines` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `old_start` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicTextEditorCodeExecutionStrReplaceResultType](../components/anthropictexteditorcodeexecutionstrreplaceresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropictexteditorcodeexecutionstrreplaceresulttype.mdx b/docs/components/anthropictexteditorcodeexecutionstrreplaceresulttype.mdx new file mode 100644 index 00000000..46b9ec22 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutionstrreplaceresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicTextEditorCodeExecutionStrReplaceResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicTextEditorCodeExecutionStrReplaceResultType +value: AnthropicTextEditorCodeExecutionStrReplaceResultType = "text_editor_code_execution_str_replace_result" +``` + + +## Values + +- `"text_editor_code_execution_str_replace_result"` diff --git a/docs/components/anthropictexteditorcodeexecutiontoolresult.mdx b/docs/components/anthropictexteditorcodeexecutiontoolresult.mdx new file mode 100644 index 00000000..9c05b442 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutiontoolresult.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResult" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | [components.AnthropicTextEditorCodeExecutionContent](../components/anthropictexteditorcodeexecutioncontent.mdx) | :heavy_check_mark: | N/A | \{
"content": "file content",
"file_type": "text",
"num_lines": 10,
"start_line": 1,
"total_lines": 10,
"type": "text_editor_code_execution_view_result"
} | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicTextEditorCodeExecutionToolResultType](../components/anthropictexteditorcodeexecutiontoolresulttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropictexteditorcodeexecutiontoolresulterror.mdx b/docs/components/anthropictexteditorcodeexecutiontoolresulterror.mdx new file mode 100644 index 00000000..c818a4b4 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutiontoolresulterror.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResultError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `error_code` | [components.AnthropicTextEditorCodeExecutionToolResultErrorErrorCode](../components/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `error_message` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicTextEditorCodeExecutionToolResultErrorType](../components/anthropictexteditorcodeexecutiontoolresulterrortype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx b/docs/components/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx new file mode 100644 index 00000000..b2644703 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResultErrorErrorCode" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicTextEditorCodeExecutionToolResultErrorErrorCode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicTextEditorCodeExecutionToolResultErrorErrorCode = "invalid_tool_input" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"invalid_tool_input"` +- `"unavailable"` +- `"too_many_requests"` +- `"execution_time_exceeded"` +- `"file_not_found"` diff --git a/docs/components/anthropictexteditorcodeexecutiontoolresulterrortype.mdx b/docs/components/anthropictexteditorcodeexecutiontoolresulterrortype.mdx new file mode 100644 index 00000000..2303b765 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutiontoolresulterrortype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResultErrorType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicTextEditorCodeExecutionToolResultErrorType +value: AnthropicTextEditorCodeExecutionToolResultErrorType = "text_editor_code_execution_tool_result_error" +``` + + +## Values + +- `"text_editor_code_execution_tool_result_error"` diff --git a/docs/components/anthropictexteditorcodeexecutiontoolresulttype.mdx b/docs/components/anthropictexteditorcodeexecutiontoolresulttype.mdx new file mode 100644 index 00000000..4db2eb26 --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutiontoolresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicTextEditorCodeExecutionToolResultType +value: AnthropicTextEditorCodeExecutionToolResultType = "text_editor_code_execution_tool_result" +``` + + +## Values + +- `"text_editor_code_execution_tool_result"` diff --git a/docs/components/anthropictexteditorcodeexecutionviewresult.mdx b/docs/components/anthropictexteditorcodeexecutionviewresult.mdx new file mode 100644 index 00000000..f1fe04ca --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutionviewresult.mdx @@ -0,0 +1,14 @@ +--- +title: "AnthropicTextEditorCodeExecutionViewResult" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `content` | *str* | :heavy_check_mark: | N/A | +| `file_type` | [components.FileType](../components/filetype.mdx) | :heavy_check_mark: | N/A | +| `num_lines` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `start_line` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `total_lines` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicTextEditorCodeExecutionViewResultType](../components/anthropictexteditorcodeexecutionviewresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropictexteditorcodeexecutionviewresulttype.mdx b/docs/components/anthropictexteditorcodeexecutionviewresulttype.mdx new file mode 100644 index 00000000..a5d4be4b --- /dev/null +++ b/docs/components/anthropictexteditorcodeexecutionviewresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicTextEditorCodeExecutionViewResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicTextEditorCodeExecutionViewResultType +value: AnthropicTextEditorCodeExecutionViewResultType = "text_editor_code_execution_view_result" +``` + + +## Values + +- `"text_editor_code_execution_view_result"` diff --git a/docs/components/anthropicthinkingblock.mdx b/docs/components/anthropicthinkingblock.mdx new file mode 100644 index 00000000..7ca58e1c --- /dev/null +++ b/docs/components/anthropicthinkingblock.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicThinkingBlock" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `signature` | *str* | :heavy_check_mark: | N/A | +| `thinking` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicThinkingBlockType](../components/anthropicthinkingblocktype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicthinkingblocktype.mdx b/docs/components/anthropicthinkingblocktype.mdx new file mode 100644 index 00000000..db7ecee5 --- /dev/null +++ b/docs/components/anthropicthinkingblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicThinkingBlockType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicThinkingBlockType +value: AnthropicThinkingBlockType = "thinking" +``` + + +## Values + +- `"thinking"` diff --git a/docs/components/anthropictoolreference.mdx b/docs/components/anthropictoolreference.mdx new file mode 100644 index 00000000..ee8d6b27 --- /dev/null +++ b/docs/components/anthropictoolreference.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicToolReference" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `tool_name` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicToolReferenceType](../components/anthropictoolreferencetype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropictoolreferencetype.mdx b/docs/components/anthropictoolreferencetype.mdx new file mode 100644 index 00000000..fc9557da --- /dev/null +++ b/docs/components/anthropictoolreferencetype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicToolReferenceType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicToolReferenceType +value: AnthropicToolReferenceType = "tool_reference" +``` + + +## Values + +- `"tool_reference"` diff --git a/docs/components/anthropictoolsearchcontent.mdx b/docs/components/anthropictoolsearchcontent.mdx new file mode 100644 index 00000000..73aba99a --- /dev/null +++ b/docs/components/anthropictoolsearchcontent.mdx @@ -0,0 +1,18 @@ +--- +title: "AnthropicToolSearchContent" +--- + +## Supported Types + +### `components.AnthropicToolSearchResultError` + +```python +value: components.AnthropicToolSearchResultError = /* values here */ +``` + +### `components.AnthropicToolSearchResult` + +```python +value: components.AnthropicToolSearchResult = /* values here */ +``` + diff --git a/docs/components/anthropictoolsearchresult.mdx b/docs/components/anthropictoolsearchresult.mdx new file mode 100644 index 00000000..69a738d2 --- /dev/null +++ b/docs/components/anthropictoolsearchresult.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicToolSearchResult" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `tool_references` | List[[components.AnthropicToolReference](../components/anthropictoolreference.mdx)] | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicToolSearchResultType](../components/anthropictoolsearchresulttype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropictoolsearchresulterror.mdx b/docs/components/anthropictoolsearchresulterror.mdx new file mode 100644 index 00000000..1e624f11 --- /dev/null +++ b/docs/components/anthropictoolsearchresulterror.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicToolSearchResultError" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `error_code` | [components.AnthropicServerToolErrorCode](../components/anthropicservertoolerrorcode.mdx) | :heavy_check_mark: | N/A | unavailable | +| `error_message` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicToolSearchResultErrorType](../components/anthropictoolsearchresulterrortype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropictoolsearchresulterrortype.mdx b/docs/components/anthropictoolsearchresulterrortype.mdx new file mode 100644 index 00000000..11db20ae --- /dev/null +++ b/docs/components/anthropictoolsearchresulterrortype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicToolSearchResultErrorType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicToolSearchResultErrorType +value: AnthropicToolSearchResultErrorType = "tool_search_tool_result_error" +``` + + +## Values + +- `"tool_search_tool_result_error"` diff --git a/docs/components/anthropictoolsearchresulttype.mdx b/docs/components/anthropictoolsearchresulttype.mdx new file mode 100644 index 00000000..761dcd93 --- /dev/null +++ b/docs/components/anthropictoolsearchresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicToolSearchResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicToolSearchResultType +value: AnthropicToolSearchResultType = "tool_search_tool_search_result" +``` + + +## Values + +- `"tool_search_tool_search_result"` diff --git a/docs/components/anthropictoolsearchtoolresult.mdx b/docs/components/anthropictoolsearchtoolresult.mdx new file mode 100644 index 00000000..191c13c2 --- /dev/null +++ b/docs/components/anthropictoolsearchtoolresult.mdx @@ -0,0 +1,11 @@ +--- +title: "AnthropicToolSearchToolResult" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `content` | [components.AnthropicToolSearchContent](../components/anthropictoolsearchcontent.mdx) | :heavy_check_mark: | N/A | \{
"tool_references": [
\{
"tool_name": "my_tool",
"type": "tool_reference"
}
],
"type": "tool_search_tool_search_result"
} | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicToolSearchToolResultType](../components/anthropictoolsearchtoolresulttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropictoolsearchtoolresulttype.mdx b/docs/components/anthropictoolsearchtoolresulttype.mdx new file mode 100644 index 00000000..0f0d20d3 --- /dev/null +++ b/docs/components/anthropictoolsearchtoolresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicToolSearchToolResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicToolSearchToolResultType +value: AnthropicToolSearchToolResultType = "tool_search_tool_result" +``` + + +## Values + +- `"tool_search_tool_result"` diff --git a/docs/components/anthropictooluseblock.mdx b/docs/components/anthropictooluseblock.mdx new file mode 100644 index 00000000..51bc60d2 --- /dev/null +++ b/docs/components/anthropictooluseblock.mdx @@ -0,0 +1,13 @@ +--- +title: "AnthropicToolUseBlock" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `caller` | [components.AnthropicCaller](../components/anthropiccaller.mdx) | :heavy_check_mark: | N/A | \{
"type": "direct"
} | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `input` | *Optional[Any]* | :heavy_minus_sign: | N/A | | +| `name` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicToolUseBlockType](../components/anthropictooluseblocktype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropictooluseblocktype.mdx b/docs/components/anthropictooluseblocktype.mdx new file mode 100644 index 00000000..a6cd369f --- /dev/null +++ b/docs/components/anthropictooluseblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicToolUseBlockType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicToolUseBlockType +value: AnthropicToolUseBlockType = "tool_use" +``` + + +## Values + +- `"tool_use"` diff --git a/docs/components/anthropicwebfetchblock.mdx b/docs/components/anthropicwebfetchblock.mdx new file mode 100644 index 00000000..e130a578 --- /dev/null +++ b/docs/components/anthropicwebfetchblock.mdx @@ -0,0 +1,12 @@ +--- +title: "AnthropicWebFetchBlock" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | [components.AnthropicDocumentBlock](../components/anthropicdocumentblock.mdx) | :heavy_check_mark: | N/A | \{
"citations": null,
"source": \{
"data": "Hello, world!",
"media_type": "text/plain",
"type": "text"
},
"title": null,
"type": "document"
} | +| `retrieved_at` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicWebFetchBlockType](../components/anthropicwebfetchblocktype.mdx) | :heavy_check_mark: | N/A | | +| `url` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicwebfetchblocktype.mdx b/docs/components/anthropicwebfetchblocktype.mdx new file mode 100644 index 00000000..266ddbb5 --- /dev/null +++ b/docs/components/anthropicwebfetchblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicWebFetchBlockType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebFetchBlockType +value: AnthropicWebFetchBlockType = "web_fetch_result" +``` + + +## Values + +- `"web_fetch_result"` diff --git a/docs/components/anthropicwebfetchcontent.mdx b/docs/components/anthropicwebfetchcontent.mdx new file mode 100644 index 00000000..b3ec99cc --- /dev/null +++ b/docs/components/anthropicwebfetchcontent.mdx @@ -0,0 +1,18 @@ +--- +title: "AnthropicWebFetchContent" +--- + +## Supported Types + +### `components.AnthropicWebFetchBlock` + +```python +value: components.AnthropicWebFetchBlock = /* values here */ +``` + +### `components.AnthropicWebFetchToolResultError` + +```python +value: components.AnthropicWebFetchToolResultError = /* values here */ +``` + diff --git a/docs/components/anthropicwebfetchtoolresult.mdx b/docs/components/anthropicwebfetchtoolresult.mdx new file mode 100644 index 00000000..d33f72fb --- /dev/null +++ b/docs/components/anthropicwebfetchtoolresult.mdx @@ -0,0 +1,12 @@ +--- +title: "AnthropicWebFetchToolResult" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `caller` | [components.AnthropicCaller](../components/anthropiccaller.mdx) | :heavy_check_mark: | N/A | \{
"type": "direct"
} | +| `content` | [components.AnthropicWebFetchContent](../components/anthropicwebfetchcontent.mdx) | :heavy_check_mark: | N/A | \{
"content": \{
"citations": null,
"source": \{
"data": "",
"media_type": "text/plain",
"type": "text"
},
"title": null,
"type": "document"
},
"retrieved_at": null,
"type": "web_fetch_result",
"url": "https://example.com"
} | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicWebFetchToolResultType](../components/anthropicwebfetchtoolresulttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicwebfetchtoolresulterror.mdx b/docs/components/anthropicwebfetchtoolresulterror.mdx new file mode 100644 index 00000000..3b9150ee --- /dev/null +++ b/docs/components/anthropicwebfetchtoolresulterror.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicWebFetchToolResultError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `error_code` | [components.AnthropicWebFetchToolResultErrorErrorCode](../components/anthropicwebfetchtoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicWebFetchToolResultErrorType](../components/anthropicwebfetchtoolresulterrortype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicwebfetchtoolresulterrorerrorcode.mdx b/docs/components/anthropicwebfetchtoolresulterrorerrorcode.mdx new file mode 100644 index 00000000..6fe9c5d3 --- /dev/null +++ b/docs/components/anthropicwebfetchtoolresulterrorerrorcode.mdx @@ -0,0 +1,26 @@ +--- +title: "AnthropicWebFetchToolResultErrorErrorCode" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebFetchToolResultErrorErrorCode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicWebFetchToolResultErrorErrorCode = "invalid_tool_input" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"invalid_tool_input"` +- `"url_too_long"` +- `"url_not_allowed"` +- `"url_not_accessible"` +- `"unsupported_content_type"` +- `"too_many_requests"` +- `"max_uses_exceeded"` +- `"unavailable"` diff --git a/docs/components/anthropicwebfetchtoolresulterrortype.mdx b/docs/components/anthropicwebfetchtoolresulterrortype.mdx new file mode 100644 index 00000000..8b015442 --- /dev/null +++ b/docs/components/anthropicwebfetchtoolresulterrortype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicWebFetchToolResultErrorType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebFetchToolResultErrorType +value: AnthropicWebFetchToolResultErrorType = "web_fetch_tool_result_error" +``` + + +## Values + +- `"web_fetch_tool_result_error"` diff --git a/docs/components/anthropicwebfetchtoolresulttype.mdx b/docs/components/anthropicwebfetchtoolresulttype.mdx new file mode 100644 index 00000000..8155ccbc --- /dev/null +++ b/docs/components/anthropicwebfetchtoolresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicWebFetchToolResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebFetchToolResultType +value: AnthropicWebFetchToolResultType = "web_fetch_tool_result" +``` + + +## Values + +- `"web_fetch_tool_result"` diff --git a/docs/components/anthropicwebsearchresult.mdx b/docs/components/anthropicwebsearchresult.mdx new file mode 100644 index 00000000..9f44a313 --- /dev/null +++ b/docs/components/anthropicwebsearchresult.mdx @@ -0,0 +1,13 @@ +--- +title: "AnthropicWebSearchResult" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `encrypted_content` | *str* | :heavy_check_mark: | N/A | +| `page_age` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `title` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicWebSearchResultType](../components/anthropicwebsearchresulttype.mdx) | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicwebsearchresulttype.mdx b/docs/components/anthropicwebsearchresulttype.mdx new file mode 100644 index 00000000..fa7a557a --- /dev/null +++ b/docs/components/anthropicwebsearchresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicWebSearchResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebSearchResultType +value: AnthropicWebSearchResultType = "web_search_result" +``` + + +## Values + +- `"web_search_result"` diff --git a/docs/components/anthropicwebsearchtoolresult.mdx b/docs/components/anthropicwebsearchtoolresult.mdx new file mode 100644 index 00000000..52ae78a2 --- /dev/null +++ b/docs/components/anthropicwebsearchtoolresult.mdx @@ -0,0 +1,12 @@ +--- +title: "AnthropicWebSearchToolResult" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `caller` | [components.AnthropicCaller](../components/anthropiccaller.mdx) | :heavy_check_mark: | N/A | \{
"type": "direct"
} | +| `content` | [components.AnthropicWebSearchToolResultContent](../components/anthropicwebsearchtoolresultcontent.mdx) | :heavy_check_mark: | N/A | | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.AnthropicWebSearchToolResultType](../components/anthropicwebsearchtoolresulttype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/anthropicwebsearchtoolresultcontent.mdx b/docs/components/anthropicwebsearchtoolresultcontent.mdx new file mode 100644 index 00000000..c6f194c6 --- /dev/null +++ b/docs/components/anthropicwebsearchtoolresultcontent.mdx @@ -0,0 +1,18 @@ +--- +title: "AnthropicWebSearchToolResultContent" +--- + +## Supported Types + +### `List[components.AnthropicWebSearchResult]` + +```python +value: List[components.AnthropicWebSearchResult] = /* values here */ +``` + +### `components.AnthropicWebSearchToolResultError` + +```python +value: components.AnthropicWebSearchToolResultError = /* values here */ +``` + diff --git a/docs/components/anthropicwebsearchtoolresulterror.mdx b/docs/components/anthropicwebsearchtoolresulterror.mdx new file mode 100644 index 00000000..7b7cb137 --- /dev/null +++ b/docs/components/anthropicwebsearchtoolresulterror.mdx @@ -0,0 +1,10 @@ +--- +title: "AnthropicWebSearchToolResultError" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `error_code` | [components.AnthropicWebSearchToolResultErrorErrorCode](../components/anthropicwebsearchtoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | [components.AnthropicWebSearchToolResultErrorType](../components/anthropicwebsearchtoolresulterrortype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/anthropicwebsearchtoolresulterrorerrorcode.mdx b/docs/components/anthropicwebsearchtoolresulterrorerrorcode.mdx new file mode 100644 index 00000000..d4501237 --- /dev/null +++ b/docs/components/anthropicwebsearchtoolresulterrorerrorcode.mdx @@ -0,0 +1,24 @@ +--- +title: "AnthropicWebSearchToolResultErrorErrorCode" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebSearchToolResultErrorErrorCode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AnthropicWebSearchToolResultErrorErrorCode = "invalid_tool_input" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"invalid_tool_input"` +- `"unavailable"` +- `"max_uses_exceeded"` +- `"too_many_requests"` +- `"query_too_long"` +- `"request_too_large"` diff --git a/docs/components/anthropicwebsearchtoolresulterrortype.mdx b/docs/components/anthropicwebsearchtoolresulterrortype.mdx new file mode 100644 index 00000000..fec3efb4 --- /dev/null +++ b/docs/components/anthropicwebsearchtoolresulterrortype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicWebSearchToolResultErrorType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebSearchToolResultErrorType +value: AnthropicWebSearchToolResultErrorType = "web_search_tool_result_error" +``` + + +## Values + +- `"web_search_tool_result_error"` diff --git a/docs/components/anthropicwebsearchtoolresulttype.mdx b/docs/components/anthropicwebsearchtoolresulttype.mdx new file mode 100644 index 00000000..2dc56e0d --- /dev/null +++ b/docs/components/anthropicwebsearchtoolresulttype.mdx @@ -0,0 +1,15 @@ +--- +title: "AnthropicWebSearchToolResultType" +--- + +## Example Usage + +```python +from openrouter.components import AnthropicWebSearchToolResultType +value: AnthropicWebSearchToolResultType = "web_search_tool_result" +``` + + +## Values + +- `"web_search_tool_result"` diff --git a/docs/components/batchdeletedobject.mdx b/docs/components/batchdeletedobject.mdx new file mode 100644 index 00000000..9c7da3ad --- /dev/null +++ b/docs/components/batchdeletedobject.mdx @@ -0,0 +1,14 @@ +--- +title: "BatchDeletedObject" +--- + +Confirms a terminal batch was removed from the API and its OpenRouter-held artifacts purged. Deletion is not cancellation and does not erase billing or audit records. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `deletion` | [components.BatchDeletionTargets](../components/batchdeletiontargets.mdx) | :heavy_check_mark: | OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome. | \{
"openrouter": "deleted",
"upstream": \{
"provider": "Anthropic",
"status": "deleted"
}
} | +| `id` | *str* | :heavy_check_mark: | N/A | batch_abc123 | +| `object` | [components.BatchDeletedObjectObject](../components/batchdeletedobjectobject.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/batchdeletedobjectobject.mdx b/docs/components/batchdeletedobjectobject.mdx new file mode 100644 index 00000000..fcf8a53f --- /dev/null +++ b/docs/components/batchdeletedobjectobject.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchDeletedObjectObject" +--- + +## Example Usage + +```python +from openrouter.components import BatchDeletedObjectObject +value: BatchDeletedObjectObject = "batch" +``` + + +## Values + +- `"batch"` diff --git a/docs/components/batchdeletionoutcome.mdx b/docs/components/batchdeletionoutcome.mdx new file mode 100644 index 00000000..946b5aec --- /dev/null +++ b/docs/components/batchdeletionoutcome.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchDeletionOutcome" +--- + +Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target). + +## Example Usage + +```python +from openrouter.components import BatchDeletionOutcome + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BatchDeletionOutcome = "deleted" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"deleted"` +- `"unsupported"` +- `"not_applicable"` diff --git a/docs/components/batchdeletiontargets.mdx b/docs/components/batchdeletiontargets.mdx new file mode 100644 index 00000000..70b3c642 --- /dev/null +++ b/docs/components/batchdeletiontargets.mdx @@ -0,0 +1,13 @@ +--- +title: "BatchDeletionTargets" +--- + +OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `openrouter` | [components.Openrouter](../components/openrouter.mdx) | :heavy_check_mark: | OpenRouter-held request and result artifacts were purged. | +| `upstream` | [Optional[components.Upstream]](../components/upstream.mdx) | :heavy_minus_sign: | The upstream batch deletion outcome; omitted when no provider was assigned. | \ No newline at end of file diff --git a/docs/components/batcherrorresponseerror.mdx b/docs/components/batcherrorresponseerror.mdx new file mode 100644 index 00000000..230a7c61 --- /dev/null +++ b/docs/components/batcherrorresponseerror.mdx @@ -0,0 +1,10 @@ +--- +title: "BatchErrorResponseError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `code` | *int* | :heavy_check_mark: | N/A | +| `message` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchlistitem.mdx b/docs/components/batchlistitem.mdx new file mode 100644 index 00000000..7a39aba9 --- /dev/null +++ b/docs/components/batchlistitem.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchListItem" +--- + +Metadata-only batch object. `results` is always `null` in list responses. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `completion_window` | [components.BatchListItemCompletionWindow](../components/batchlistitemcompletionwindow.mdx) | :heavy_check_mark: | N/A | +| `created_at` | *int* | :heavy_check_mark: | N/A | +| `endpoint` | *str* | :heavy_check_mark: | N/A | +| `error` | [Nullable[components.BatchListItemError]](../components/batchlistitemerror.mdx) | :heavy_check_mark: | N/A | +| `finalized_at` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `object` | [components.BatchListItemObject](../components/batchlistitemobject.mdx) | :heavy_check_mark: | N/A | +| `request_counts` | [components.BatchListItemRequestCounts](../components/batchlistitemrequestcounts.mdx) | :heavy_check_mark: | N/A | +| `results` | *Nullable[Any]* | :heavy_check_mark: | Always null: retrieve the batch with `GET /batches/{id}` to access its results. | +| `status` | [components.BatchListItemStatus](../components/batchlistitemstatus.mdx) | :heavy_check_mark: | N/A | +| `usage` | [Nullable[components.BatchListItemUsage]](../components/batchlistitemusage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchlistitemcompletiontokensdetails.mdx b/docs/components/batchlistitemcompletiontokensdetails.mdx new file mode 100644 index 00000000..769284c9 --- /dev/null +++ b/docs/components/batchlistitemcompletiontokensdetails.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchListItemCompletionTokensDetails" +--- + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `image_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoning_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/components/batchlistitemcompletionwindow.mdx b/docs/components/batchlistitemcompletionwindow.mdx new file mode 100644 index 00000000..cf1f7458 --- /dev/null +++ b/docs/components/batchlistitemcompletionwindow.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchListItemCompletionWindow" +--- + +## Example Usage + +```python +from openrouter.components import BatchListItemCompletionWindow +value: BatchListItemCompletionWindow = "24h" +``` + + +## Values + +- `"24h"` diff --git a/docs/components/batchlistitemerror.mdx b/docs/components/batchlistitemerror.mdx new file mode 100644 index 00000000..1891de19 --- /dev/null +++ b/docs/components/batchlistitemerror.mdx @@ -0,0 +1,9 @@ +--- +title: "BatchListItemError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `message` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchlistitemobject.mdx b/docs/components/batchlistitemobject.mdx new file mode 100644 index 00000000..66dd9916 --- /dev/null +++ b/docs/components/batchlistitemobject.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchListItemObject" +--- + +## Example Usage + +```python +from openrouter.components import BatchListItemObject +value: BatchListItemObject = "batch" +``` + + +## Values + +- `"batch"` diff --git a/docs/components/batchlistitemprompttokensdetails.mdx b/docs/components/batchlistitemprompttokensdetails.mdx new file mode 100644 index 00000000..6da3113e --- /dev/null +++ b/docs/components/batchlistitemprompttokensdetails.mdx @@ -0,0 +1,16 @@ +--- +title: "BatchListItemPromptTokensDetails" +--- + +Breakdown of tokens used in the prompt. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input audio. | +| `cache_write_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cached_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `file_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `video_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/components/batchlistitemrequestcounts.mdx b/docs/components/batchlistitemrequestcounts.mdx new file mode 100644 index 00000000..695a4266 --- /dev/null +++ b/docs/components/batchlistitemrequestcounts.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchListItemRequestCounts" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `completed` | *int* | :heavy_check_mark: | N/A | +| `failed` | *int* | :heavy_check_mark: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchlistitemservertooluse.mdx b/docs/components/batchlistitemservertooluse.mdx new file mode 100644 index 00000000..becd2789 --- /dev/null +++ b/docs/components/batchlistitemservertooluse.mdx @@ -0,0 +1,14 @@ +--- +title: "BatchListItemServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + + +## Fields + +| 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_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/batchlistitemstatus.mdx b/docs/components/batchlistitemstatus.mdx new file mode 100644 index 00000000..44586cdb --- /dev/null +++ b/docs/components/batchlistitemstatus.mdx @@ -0,0 +1,26 @@ +--- +title: "BatchListItemStatus" +--- + +## Example Usage + +```python +from openrouter.components import BatchListItemStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BatchListItemStatus = "validating" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"validating"` +- `"in_progress"` +- `"finalizing"` +- `"completed"` +- `"failed"` +- `"expired"` +- `"cancelling"` +- `"cancelled"` diff --git a/docs/components/batchlistitemusage.mdx b/docs/components/batchlistitemusage.mdx new file mode 100644 index 00000000..770b7357 --- /dev/null +++ b/docs/components/batchlistitemusage.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchListItemUsage" +--- + +## Fields + +| 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.BatchListItemCompletionTokensDetails]](../components/batchlistitemcompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | | +| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | | +| `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 | | +| `iterations` | List[[components.AnthropicUsageIteration](../components/anthropicusageiteration.mdx)] | :heavy_minus_sign: | N/A | | +| `prompt_tokens` | *int* | :heavy_check_mark: | Including images, input audio, and tools if any | | +| `prompt_tokens_details` | [OptionalNullable[components.BatchListItemPromptTokensDetails]](../components/batchlistitemprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | +| `server_tool_use` | [OptionalNullable[components.BatchListItemServerToolUse]](../components/batchlistitemservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | +| `speed` | [OptionalNullable[components.AnthropicSpeed]](../components/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | +| `total_tokens` | *int* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/components/batchlistresponse.mdx b/docs/components/batchlistresponse.mdx new file mode 100644 index 00000000..31a10bfb --- /dev/null +++ b/docs/components/batchlistresponse.mdx @@ -0,0 +1,16 @@ +--- +title: "BatchListResponse" +--- + +A newest-first page of metadata-only batch objects. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `data` | List[[components.BatchListItem](../components/batchlistitem.mdx)] | :heavy_check_mark: | N/A | +| `first_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `has_more` | *bool* | :heavy_check_mark: | N/A | +| `last_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `object` | [components.BatchListResponseObject](../components/batchlistresponseobject.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchlistresponseobject.mdx b/docs/components/batchlistresponseobject.mdx new file mode 100644 index 00000000..e283e541 --- /dev/null +++ b/docs/components/batchlistresponseobject.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchListResponseObject" +--- + +## Example Usage + +```python +from openrouter.components import BatchListResponseObject +value: BatchListResponseObject = "list" +``` + + +## Values + +- `"list"` diff --git a/docs/components/batchliststatus.mdx b/docs/components/batchliststatus.mdx new file mode 100644 index 00000000..c7629b16 --- /dev/null +++ b/docs/components/batchliststatus.mdx @@ -0,0 +1,26 @@ +--- +title: "BatchListStatus" +--- + +A batch status that is durably represented by the list data source. `finalizing` and `cancelling` are not accepted because stored jobs collapse those phases into `in_progress`. + +## Example Usage + +```python +from openrouter.components import BatchListStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BatchListStatus = "validating" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"validating"` +- `"in_progress"` +- `"completed"` +- `"failed"` +- `"expired"` +- `"cancelled"` diff --git a/docs/components/batchlisttimestamp.mdx b/docs/components/batchlisttimestamp.mdx new file mode 100644 index 00000000..8040fd18 --- /dev/null +++ b/docs/components/batchlisttimestamp.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchListTimestamp" +--- + +Only include batches created strictly after this timestamp. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `date` + +```python +value: date = /* values here */ +``` + diff --git a/docs/components/batchobject.mdx b/docs/components/batchobject.mdx new file mode 100644 index 00000000..cec2c6ae --- /dev/null +++ b/docs/components/batchobject.mdx @@ -0,0 +1,20 @@ +--- +title: "BatchObject" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `completion_window` | [components.BatchObjectCompletionWindow](../components/batchobjectcompletionwindow.mdx) | :heavy_check_mark: | N/A | +| `created_at` | *int* | :heavy_check_mark: | N/A | +| `endpoint` | *str* | :heavy_check_mark: | N/A | +| `error` | [Nullable[components.BatchObjectError]](../components/batchobjecterror.mdx) | :heavy_check_mark: | N/A | +| `finalized_at` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `object` | [components.BatchObjectObjectBatch](../components/batchobjectobjectbatch.mdx) | :heavy_check_mark: | N/A | +| `request_counts` | [components.BatchObjectRequestCounts](../components/batchobjectrequestcounts.mdx) | :heavy_check_mark: | N/A | +| `results` | List[[components.Result](../components/result.mdx)] | :heavy_check_mark: | N/A | +| `status` | [components.BatchObjectStatus](../components/batchobjectstatus.mdx) | :heavy_check_mark: | N/A | +| `usage` | [Nullable[components.BatchObjectUsage]](../components/batchobjectusage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectcompletiontokensdetails.mdx b/docs/components/batchobjectcompletiontokensdetails.mdx new file mode 100644 index 00000000..e9374e70 --- /dev/null +++ b/docs/components/batchobjectcompletiontokensdetails.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchObjectCompletionTokensDetails" +--- + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `image_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoning_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/components/batchobjectcompletionwindow.mdx b/docs/components/batchobjectcompletionwindow.mdx new file mode 100644 index 00000000..e2fc9fd2 --- /dev/null +++ b/docs/components/batchobjectcompletionwindow.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchObjectCompletionWindow" +--- + +## Example Usage + +```python +from openrouter.components import BatchObjectCompletionWindow +value: BatchObjectCompletionWindow = "24h" +``` + + +## Values + +- `"24h"` diff --git a/docs/components/batchobjectdata.mdx b/docs/components/batchobjectdata.mdx new file mode 100644 index 00000000..9fab2e05 --- /dev/null +++ b/docs/components/batchobjectdata.mdx @@ -0,0 +1,14 @@ +--- +title: "BatchObjectData" +--- + +A single embedding object + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `embedding` | [components.Embedding](../components/embedding.mdx) | :heavy_check_mark: | Embedding vector as an array of floats or a base64 string | [
0.0023064255,
-0.009327292,
0.015797347
] | +| `index` | *Optional[int]* | :heavy_minus_sign: | Index of the embedding in the input list | 0 | +| `object` | [components.ObjectEmbedding](../components/objectembedding.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/batchobjectdebug.mdx b/docs/components/batchobjectdebug.mdx new file mode 100644 index 00000000..2c534c62 --- /dev/null +++ b/docs/components/batchobjectdebug.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchObjectDebug" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `echo_upstream_body` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `timings` | [Optional[components.BatchObjectTimings]](../components/batchobjecttimings.mdx) | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjecterror.mdx b/docs/components/batchobjecterror.mdx new file mode 100644 index 00000000..ae47da32 --- /dev/null +++ b/docs/components/batchobjecterror.mdx @@ -0,0 +1,9 @@ +--- +title: "BatchObjectError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `message` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectevent.mdx b/docs/components/batchobjectevent.mdx new file mode 100644 index 00000000..fd15fa87 --- /dev/null +++ b/docs/components/batchobjectevent.mdx @@ -0,0 +1,22 @@ +--- +title: "BatchObjectEvent" +--- + +## Example Usage + +```python +from openrouter.components import BatchObjectEvent + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BatchObjectEvent = "adapter_request" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"adapter_request"` +- `"upstream_headers_received"` +- `"first_token_received"` +- `"upstream_body_ended"` diff --git a/docs/components/batchobjectfile.mdx b/docs/components/batchobjectfile.mdx new file mode 100644 index 00000000..497b2436 --- /dev/null +++ b/docs/components/batchobjectfile.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchObjectFile" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `content` | List[[components.AnnotationContentUnion](../components/annotationcontentunion.mdx)] | :heavy_check_mark: | N/A | +| `hash` | *str* | :heavy_check_mark: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectfunction.mdx b/docs/components/batchobjectfunction.mdx new file mode 100644 index 00000000..0a854d99 --- /dev/null +++ b/docs/components/batchobjectfunction.mdx @@ -0,0 +1,10 @@ +--- +title: "BatchObjectFunction" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `arguments` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectimageurl.mdx b/docs/components/batchobjectimageurl.mdx new file mode 100644 index 00000000..70172ed5 --- /dev/null +++ b/docs/components/batchobjectimageurl.mdx @@ -0,0 +1,9 @@ +--- +title: "BatchObjectImageURL" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectobjectbatch.mdx b/docs/components/batchobjectobjectbatch.mdx new file mode 100644 index 00000000..0f98fc84 --- /dev/null +++ b/docs/components/batchobjectobjectbatch.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchObjectObjectBatch" +--- + +## Example Usage + +```python +from openrouter.components import BatchObjectObjectBatch +value: BatchObjectObjectBatch = "batch" +``` + + +## Values + +- `"batch"` diff --git a/docs/components/batchobjectprompttokensdetails.mdx b/docs/components/batchobjectprompttokensdetails.mdx new file mode 100644 index 00000000..1bbcffd3 --- /dev/null +++ b/docs/components/batchobjectprompttokensdetails.mdx @@ -0,0 +1,16 @@ +--- +title: "BatchObjectPromptTokensDetails" +--- + +Breakdown of tokens used in the prompt. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input audio. | +| `cache_write_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cached_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `file_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `video_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/components/batchobjectrequestcounts.mdx b/docs/components/batchobjectrequestcounts.mdx new file mode 100644 index 00000000..cc180f2e --- /dev/null +++ b/docs/components/batchobjectrequestcounts.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchObjectRequestCounts" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `completed` | *int* | :heavy_check_mark: | N/A | +| `failed` | *int* | :heavy_check_mark: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectresponse.mdx b/docs/components/batchobjectresponse.mdx new file mode 100644 index 00000000..2c8c0304 --- /dev/null +++ b/docs/components/batchobjectresponse.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchObjectResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `body` | [components.Body](../components/body.mdx) | :heavy_check_mark: | N/A | +| `request_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectrole.mdx b/docs/components/batchobjectrole.mdx new file mode 100644 index 00000000..012b7107 --- /dev/null +++ b/docs/components/batchobjectrole.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchObjectRole" +--- + +## Example Usage + +```python +from openrouter.components import BatchObjectRole +value: BatchObjectRole = "assistant" +``` + + +## Values + +- `"assistant"` diff --git a/docs/components/batchobjectservertooluse.mdx b/docs/components/batchobjectservertooluse.mdx new file mode 100644 index 00000000..86a21119 --- /dev/null +++ b/docs/components/batchobjectservertooluse.mdx @@ -0,0 +1,14 @@ +--- +title: "BatchObjectServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + + +## Fields + +| 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_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/batchobjectservertoolusedetails.mdx b/docs/components/batchobjectservertoolusedetails.mdx new file mode 100644 index 00000000..2ba9abb7 --- /dev/null +++ b/docs/components/batchobjectservertoolusedetails.mdx @@ -0,0 +1,14 @@ +--- +title: "BatchObjectServerToolUseDetails" +--- + +Usage for server-side tool execution (e.g., web search) + + +## Fields + +| 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_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/batchobjectstatus.mdx b/docs/components/batchobjectstatus.mdx new file mode 100644 index 00000000..de882a33 --- /dev/null +++ b/docs/components/batchobjectstatus.mdx @@ -0,0 +1,26 @@ +--- +title: "BatchObjectStatus" +--- + +## Example Usage + +```python +from openrouter.components import BatchObjectStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BatchObjectStatus = "validating" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"validating"` +- `"in_progress"` +- `"finalizing"` +- `"completed"` +- `"failed"` +- `"expired"` +- `"cancelling"` +- `"cancelled"` diff --git a/docs/components/batchobjecttimings.mdx b/docs/components/batchobjecttimings.mdx new file mode 100644 index 00000000..528b987d --- /dev/null +++ b/docs/components/batchobjecttimings.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchObjectTimings" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `epoch_ms` | *int* | :heavy_check_mark: | N/A | +| `event` | [components.BatchObjectEvent](../components/batchobjectevent.mdx) | :heavy_check_mark: | N/A | +| `start_ms` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjecttypemessage.mdx b/docs/components/batchobjecttypemessage.mdx new file mode 100644 index 00000000..25bd6ec2 --- /dev/null +++ b/docs/components/batchobjecttypemessage.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchObjectTypeMessage" +--- + +## Example Usage + +```python +from openrouter.components import BatchObjectTypeMessage +value: BatchObjectTypeMessage = "message" +``` + + +## Values + +- `"message"` diff --git a/docs/components/batchobjecturlcitation.mdx b/docs/components/batchobjecturlcitation.mdx new file mode 100644 index 00000000..41036e47 --- /dev/null +++ b/docs/components/batchobjecturlcitation.mdx @@ -0,0 +1,13 @@ +--- +title: "BatchObjectURLCitation" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `content` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `end_index` | *int* | :heavy_check_mark: | N/A | +| `start_index` | *int* | :heavy_check_mark: | N/A | +| `title` | *str* | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchobjectusage.mdx b/docs/components/batchobjectusage.mdx new file mode 100644 index 00000000..6fc6121a --- /dev/null +++ b/docs/components/batchobjectusage.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchObjectUsage" +--- + +## Fields + +| 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.BatchObjectCompletionTokensDetails]](../components/batchobjectcompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | | +| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | | +| `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 | | +| `iterations` | List[[components.AnthropicUsageIteration](../components/anthropicusageiteration.mdx)] | :heavy_minus_sign: | N/A | | +| `prompt_tokens` | *int* | :heavy_check_mark: | Including images, input audio, and tools if any | | +| `prompt_tokens_details` | [OptionalNullable[components.BatchObjectPromptTokensDetails]](../components/batchobjectprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | +| `server_tool_use` | [OptionalNullable[components.BatchObjectServerToolUse]](../components/batchobjectservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | +| `speed` | [OptionalNullable[components.AnthropicSpeed]](../components/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | +| `total_tokens` | *int* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/components/batchpaymentrequiredresponsecompletiontokensdetails.mdx b/docs/components/batchpaymentrequiredresponsecompletiontokensdetails.mdx new file mode 100644 index 00000000..02caac2a --- /dev/null +++ b/docs/components/batchpaymentrequiredresponsecompletiontokensdetails.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchPaymentRequiredResponseCompletionTokensDetails" +--- + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `image_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoning_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/components/batchpaymentrequiredresponsecompletionwindow.mdx b/docs/components/batchpaymentrequiredresponsecompletionwindow.mdx new file mode 100644 index 00000000..c87441a1 --- /dev/null +++ b/docs/components/batchpaymentrequiredresponsecompletionwindow.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchPaymentRequiredResponseCompletionWindow" +--- + +## Example Usage + +```python +from openrouter.components import BatchPaymentRequiredResponseCompletionWindow +value: BatchPaymentRequiredResponseCompletionWindow = "24h" +``` + + +## Values + +- `"24h"` diff --git a/docs/components/batchpaymentrequiredresponseerror.mdx b/docs/components/batchpaymentrequiredresponseerror.mdx new file mode 100644 index 00000000..e07f3acc --- /dev/null +++ b/docs/components/batchpaymentrequiredresponseerror.mdx @@ -0,0 +1,10 @@ +--- +title: "BatchPaymentRequiredResponseError" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `code` | *int* | :heavy_check_mark: | N/A | +| `message` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchpaymentrequiredresponseobject.mdx b/docs/components/batchpaymentrequiredresponseobject.mdx new file mode 100644 index 00000000..f77e2c65 --- /dev/null +++ b/docs/components/batchpaymentrequiredresponseobject.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchPaymentRequiredResponseObject" +--- + +## Example Usage + +```python +from openrouter.components import BatchPaymentRequiredResponseObject +value: BatchPaymentRequiredResponseObject = "batch" +``` + + +## Values + +- `"batch"` diff --git a/docs/components/batchpaymentrequiredresponseprompttokensdetails.mdx b/docs/components/batchpaymentrequiredresponseprompttokensdetails.mdx new file mode 100644 index 00000000..bc41b301 --- /dev/null +++ b/docs/components/batchpaymentrequiredresponseprompttokensdetails.mdx @@ -0,0 +1,16 @@ +--- +title: "BatchPaymentRequiredResponsePromptTokensDetails" +--- + +Breakdown of tokens used in the prompt. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input audio. | +| `cache_write_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cached_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `file_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `video_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/components/batchpaymentrequiredresponserequestcounts.mdx b/docs/components/batchpaymentrequiredresponserequestcounts.mdx new file mode 100644 index 00000000..66d9b483 --- /dev/null +++ b/docs/components/batchpaymentrequiredresponserequestcounts.mdx @@ -0,0 +1,11 @@ +--- +title: "BatchPaymentRequiredResponseRequestCounts" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `completed` | *int* | :heavy_check_mark: | N/A | +| `failed` | *int* | :heavy_check_mark: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/batchpaymentrequiredresponseservertooluse.mdx b/docs/components/batchpaymentrequiredresponseservertooluse.mdx new file mode 100644 index 00000000..907e4660 --- /dev/null +++ b/docs/components/batchpaymentrequiredresponseservertooluse.mdx @@ -0,0 +1,14 @@ +--- +title: "BatchPaymentRequiredResponseServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + + +## Fields + +| 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_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/batchpaymentrequiredresponsestatus.mdx b/docs/components/batchpaymentrequiredresponsestatus.mdx new file mode 100644 index 00000000..4801c427 --- /dev/null +++ b/docs/components/batchpaymentrequiredresponsestatus.mdx @@ -0,0 +1,26 @@ +--- +title: "BatchPaymentRequiredResponseStatus" +--- + +## Example Usage + +```python +from openrouter.components import BatchPaymentRequiredResponseStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BatchPaymentRequiredResponseStatus = "validating" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"validating"` +- `"in_progress"` +- `"finalizing"` +- `"completed"` +- `"failed"` +- `"expired"` +- `"cancelling"` +- `"cancelled"` diff --git a/docs/components/batchpaymentrequiredresponseusage.mdx b/docs/components/batchpaymentrequiredresponseusage.mdx new file mode 100644 index 00000000..e4b28f4d --- /dev/null +++ b/docs/components/batchpaymentrequiredresponseusage.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchPaymentRequiredResponseUsage" +--- + +## Fields + +| 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.BatchPaymentRequiredResponseCompletionTokensDetails]](../components/batchpaymentrequiredresponsecompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | | +| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | Cost of the completion | | +| `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 | | +| `iterations` | List[[components.AnthropicUsageIteration](../components/anthropicusageiteration.mdx)] | :heavy_minus_sign: | N/A | | +| `prompt_tokens` | *int* | :heavy_check_mark: | Including images, input audio, and tools if any | | +| `prompt_tokens_details` | [OptionalNullable[components.BatchPaymentRequiredResponsePromptTokensDetails]](../components/batchpaymentrequiredresponseprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | +| `server_tool_use` | [OptionalNullable[components.BatchPaymentRequiredResponseServerToolUse]](../components/batchpaymentrequiredresponseservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | +| `speed` | [OptionalNullable[components.AnthropicSpeed]](../components/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | +| `total_tokens` | *int* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/components/batchproviderpreferences.mdx b/docs/components/batchproviderpreferences.mdx new file mode 100644 index 00000000..541b7dae --- /dev/null +++ b/docs/components/batchproviderpreferences.mdx @@ -0,0 +1,12 @@ +--- +title: "BatchProviderPreferences" +--- + +Batch provider routing preferences. Only `provider.only` is supported. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `only` | List[[components.BatchProviderPreferencesOnly](../components/batchproviderpreferencesonly.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"
] | \ No newline at end of file diff --git a/docs/components/batchproviderpreferencesonly.mdx b/docs/components/batchproviderpreferencesonly.mdx new file mode 100644 index 00000000..d25f8767 --- /dev/null +++ b/docs/components/batchproviderpreferencesonly.mdx @@ -0,0 +1,18 @@ +--- +title: "BatchProviderPreferencesOnly" +--- + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/batchsubmitbody.mdx b/docs/components/batchsubmitbody.mdx new file mode 100644 index 00000000..18a8a279 --- /dev/null +++ b/docs/components/batchsubmitbody.mdx @@ -0,0 +1,16 @@ +--- +title: "BatchSubmitBody" +--- + +Batch submit request body. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `completion_window` | [Optional[components.BatchSubmitBodyCompletionWindow]](../components/batchsubmitbodycompletionwindow.mdx) | :heavy_minus_sign: | N/A | | +| `endpoint` | [components.Endpoint](../components/endpoint.mdx) | :heavy_check_mark: | N/A | | +| `model` | *str* | :heavy_check_mark: | N/A | | +| `provider` | [OptionalNullable[components.BatchProviderPreferences]](../components/batchproviderpreferences.mdx) | :heavy_minus_sign: | Batch provider routing preferences. Only `provider.only` is supported. | \{
"only": [
"google-vertex"
]
} | +| `requests` | List[[components.Request](../components/request.mdx)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/batchsubmitbodycompletionwindow.mdx b/docs/components/batchsubmitbodycompletionwindow.mdx new file mode 100644 index 00000000..7c715d4d --- /dev/null +++ b/docs/components/batchsubmitbodycompletionwindow.mdx @@ -0,0 +1,15 @@ +--- +title: "BatchSubmitBodyCompletionWindow" +--- + +## Example Usage + +```python +from openrouter.components import BatchSubmitBodyCompletionWindow +value: BatchSubmitBodyCompletionWindow = "24h" +``` + + +## Values + +- `"24h"` diff --git a/docs/components/body.mdx b/docs/components/body.mdx new file mode 100644 index 00000000..8871db44 --- /dev/null +++ b/docs/components/body.mdx @@ -0,0 +1,30 @@ +--- +title: "Body" +--- + +## Supported Types + +### `components.BodyChatCompletion` + +```python +value: components.BodyChatCompletion = /* values here */ +``` + +### `components.OpenResponsesResult` + +```python +value: components.OpenResponsesResult = /* values here */ +``` + +### `components.BodyMessage` + +```python +value: components.BodyMessage = /* values here */ +``` + +### `components.BodyList` + +```python +value: components.BodyList = /* values here */ +``` + diff --git a/docs/components/bodychatcompletion.mdx b/docs/components/bodychatcompletion.mdx new file mode 100644 index 00000000..462f8bf0 --- /dev/null +++ b/docs/components/bodychatcompletion.mdx @@ -0,0 +1,19 @@ +--- +title: "BodyChatCompletion" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `choices` | List[[components.Choice](../components/choice.mdx)] | :heavy_check_mark: | N/A | | +| `created` | *int* | :heavy_check_mark: | N/A | | +| `debug` | [Optional[components.BatchObjectDebug]](../components/batchobjectdebug.mdx) | :heavy_minus_sign: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `model` | *str* | :heavy_check_mark: | N/A | | +| `object` | [components.BodyObjectChatCompletion](../components/bodyobjectchatcompletion.mdx) | :heavy_check_mark: | N/A | | +| `openrouter_metadata` | [Optional[components.OpenRouterMetadata]](../components/openroutermetadata.mdx) | :heavy_minus_sign: | N/A | \{
"attempt": 1,
"endpoints": \{
"available": [
\{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"generation_time": 2016,
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | +| `provider` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `usage` | [Optional[components.BodyUsage1]](../components/bodyusage1.mdx) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/bodycompletiontokensdetails.mdx b/docs/components/bodycompletiontokensdetails.mdx new file mode 100644 index 00000000..903c963c --- /dev/null +++ b/docs/components/bodycompletiontokensdetails.mdx @@ -0,0 +1,11 @@ +--- +title: "BodyCompletionTokensDetails" +--- + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `image_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoning_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/components/bodylist.mdx b/docs/components/bodylist.mdx new file mode 100644 index 00000000..2cd0a5e7 --- /dev/null +++ b/docs/components/bodylist.mdx @@ -0,0 +1,16 @@ +--- +title: "BodyList" +--- + +Embeddings response containing embedding vectors + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `data` | List[[components.BatchObjectData](../components/batchobjectdata.mdx)] | :heavy_check_mark: | List of embedding objects | [
\{
"embedding": [
0.0023064255,
-0.009327292,
0.015797347
],
"index": 0,
"object": "embedding"
}
] | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the embeddings response | embd-1234567890 | +| `model` | *str* | :heavy_check_mark: | The model used for embeddings | openai/text-embedding-3-small | +| `object` | [components.BodyObjectList](../components/bodyobjectlist.mdx) | :heavy_check_mark: | N/A | | +| `usage` | [Optional[components.BodyUsage3]](../components/bodyusage3.mdx) | :heavy_minus_sign: | Token usage statistics | \{
"prompt_tokens": 8,
"total_tokens": 8
} | \ No newline at end of file diff --git a/docs/components/bodymessage.mdx b/docs/components/bodymessage.mdx new file mode 100644 index 00000000..92a8aa87 --- /dev/null +++ b/docs/components/bodymessage.mdx @@ -0,0 +1,19 @@ +--- +title: "BodyMessage" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `container` | [Nullable[components.AnthropicContainer]](../components/anthropiccontainer.mdx) | :heavy_check_mark: | N/A | \{
"expires_at": "2026-04-08T00:00:00Z",
"id": "ctr_01abc",
"skills": null
} | +| `content` | List[[components.ORAnthropicContentBlock](../components/oranthropiccontentblock.mdx)] | :heavy_check_mark: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `input_transformations` | List[[components.AnthropicInputTransformation](../components/anthropicinputtransformation.mdx)] | :heavy_minus_sign: | N/A | | +| `model` | *str* | :heavy_check_mark: | N/A | | +| `role` | [components.BatchObjectRole](../components/batchobjectrole.mdx) | :heavy_check_mark: | N/A | | +| `stop_details` | [Nullable[components.AnthropicRefusalStopDetails]](../components/anthropicrefusalstopdetails.mdx) | :heavy_check_mark: | Structured information about a refusal | \{
"category": "cyber",
"explanation": "The request was refused due to policy.",
"type": "refusal"
} | +| `stop_reason` | [Nullable[components.ORAnthropicStopReason]](../components/oranthropicstopreason.mdx) | :heavy_check_mark: | N/A | end_turn | +| `stop_sequence` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `type` | [components.BatchObjectTypeMessage](../components/batchobjecttypemessage.mdx) | :heavy_check_mark: | N/A | | +| `usage` | [components.BodyUsage2](../components/bodyusage2.mdx) | :heavy_check_mark: | N/A | \{
"cache_creation": null,
"cache_creation_input_tokens": null,
"cache_read_input_tokens": null,
"inference_geo": null,
"input_tokens": 100,
"output_tokens": 50,
"output_tokens_details": null,
"server_tool_use": null,
"service_tier": "standard"
} | \ No newline at end of file diff --git a/docs/components/bodyobjectchatcompletion.mdx b/docs/components/bodyobjectchatcompletion.mdx new file mode 100644 index 00000000..f16cab8d --- /dev/null +++ b/docs/components/bodyobjectchatcompletion.mdx @@ -0,0 +1,15 @@ +--- +title: "BodyObjectChatCompletion" +--- + +## Example Usage + +```python +from openrouter.components import BodyObjectChatCompletion +value: BodyObjectChatCompletion = "chat.completion" +``` + + +## Values + +- `"chat.completion"` diff --git a/docs/components/bodyobjectlist.mdx b/docs/components/bodyobjectlist.mdx new file mode 100644 index 00000000..c9a4024f --- /dev/null +++ b/docs/components/bodyobjectlist.mdx @@ -0,0 +1,15 @@ +--- +title: "BodyObjectList" +--- + +## Example Usage + +```python +from openrouter.components import BodyObjectList +value: BodyObjectList = "list" +``` + + +## Values + +- `"list"` diff --git a/docs/components/bodyprompttokensdetails1.mdx b/docs/components/bodyprompttokensdetails1.mdx new file mode 100644 index 00000000..29c62241 --- /dev/null +++ b/docs/components/bodyprompttokensdetails1.mdx @@ -0,0 +1,16 @@ +--- +title: "BodyPromptTokensDetails1" +--- + +Breakdown of tokens used in the prompt. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input audio. | +| `cache_write_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cached_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `file_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `video_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/components/bodyprompttokensdetails2.mdx b/docs/components/bodyprompttokensdetails2.mdx new file mode 100644 index 00000000..6462670e --- /dev/null +++ b/docs/components/bodyprompttokensdetails2.mdx @@ -0,0 +1,16 @@ +--- +title: "BodyPromptTokensDetails2" +--- + +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. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `audio_tokens` | *Optional[int]* | :heavy_minus_sign: | Number of audio tokens in the input | | +| `file_tokens` | *Optional[int]* | :heavy_minus_sign: | Number of file/document tokens in the input | | +| `image_tokens` | *Optional[int]* | :heavy_minus_sign: | Number of image tokens in the input | 258 | +| `text_tokens` | *Optional[int]* | :heavy_minus_sign: | Number of text tokens in the input | 8 | +| `video_tokens` | *Optional[int]* | :heavy_minus_sign: | Number of video tokens in the input | | \ No newline at end of file diff --git a/docs/components/servertooluse.mdx b/docs/components/bodyservertooluse.mdx similarity index 99% rename from docs/components/servertooluse.mdx rename to docs/components/bodyservertooluse.mdx index a90fbbef..3e20a38a 100644 --- a/docs/components/servertooluse.mdx +++ b/docs/components/bodyservertooluse.mdx @@ -1,5 +1,5 @@ --- -title: "ServerToolUse" +title: "BodyServerToolUse" --- Usage for server-side tool execution (e.g., web search) diff --git a/docs/components/bodyusage1.mdx b/docs/components/bodyusage1.mdx new file mode 100644 index 00000000..61f933e3 --- /dev/null +++ b/docs/components/bodyusage1.mdx @@ -0,0 +1,15 @@ +--- +title: "BodyUsage1" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `completion_tokens` | *int* | :heavy_check_mark: | The tokens generated | +| `completion_tokens_details` | [OptionalNullable[components.BodyCompletionTokensDetails]](../components/bodycompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | +| `prompt_tokens` | *int* | :heavy_check_mark: | Including images, input audio, and tools if any | +| `prompt_tokens_details` | [OptionalNullable[components.BodyPromptTokensDetails1]](../components/bodyprompttokensdetails1.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | +| `server_tool_use` | [OptionalNullable[components.BodyServerToolUse]](../components/bodyservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | +| `server_tool_use_details` | [OptionalNullable[components.BatchObjectServerToolUseDetails]](../components/batchobjectservertoolusedetails.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | +| `total_tokens` | *int* | :heavy_check_mark: | Sum of the above two fields | \ No newline at end of file diff --git a/docs/components/bodyusage2.mdx b/docs/components/bodyusage2.mdx new file mode 100644 index 00000000..56c99f9b --- /dev/null +++ b/docs/components/bodyusage2.mdx @@ -0,0 +1,19 @@ +--- +title: "BodyUsage2" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `cache_creation` | [Nullable[components.AnthropicCacheCreation]](../components/anthropiccachecreation.mdx) | :heavy_check_mark: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} | +| `cache_creation_input_tokens` | *Nullable[int]* | :heavy_check_mark: | N/A | | +| `cache_read_input_tokens` | *Nullable[int]* | :heavy_check_mark: | N/A | | +| `inference_geo` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `input_tokens` | *int* | :heavy_check_mark: | N/A | | +| `output_tokens` | *int* | :heavy_check_mark: | N/A | | +| `output_tokens_details` | [Nullable[components.AnthropicOutputTokensDetails]](../components/anthropicoutputtokensdetails.mdx) | :heavy_check_mark: | N/A | \{
"thinking_tokens": 0
} | +| `server_tool_use` | [Nullable[components.AnthropicServerToolUsage]](../components/anthropicservertoolusage.mdx) | :heavy_check_mark: | N/A | \{
"web_fetch_requests": 0,
"web_search_requests": 1
} | +| `service_tier` | [Nullable[components.AnthropicServiceTier]](../components/anthropicservicetier.mdx) | :heavy_check_mark: | N/A | standard | +| `iterations` | List[[components.AnthropicUsageIteration](../components/anthropicusageiteration.mdx)] | :heavy_minus_sign: | N/A | | +| `speed` | [OptionalNullable[components.AnthropicSpeed]](../components/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | \ No newline at end of file diff --git a/docs/components/bodyusage3.mdx b/docs/components/bodyusage3.mdx new file mode 100644 index 00000000..9de6b2bf --- /dev/null +++ b/docs/components/bodyusage3.mdx @@ -0,0 +1,17 @@ +--- +title: "BodyUsage3" +--- + +Token usage statistics + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cost` | *Optional[float]* | :heavy_minus_sign: | Cost of the request in credits | 0.0001 | +| `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[components.BodyPromptTokensDetails2]](../components/bodyprompttokensdetails2.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. | | +| `total_tokens` | *int* | :heavy_check_mark: | Total number of tokens used | 8 | \ No newline at end of file diff --git a/docs/components/choice.mdx b/docs/components/choice.mdx new file mode 100644 index 00000000..09102913 --- /dev/null +++ b/docs/components/choice.mdx @@ -0,0 +1,13 @@ +--- +title: "Choice" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `finish_reason` | [components.FinishReason](../components/finishreason.mdx) | :heavy_check_mark: | N/A | stop | +| `index` | *int* | :heavy_check_mark: | N/A | | +| `logprobs` | [Nullable[components.Logprobs]](../components/logprobs.mdx) | :heavy_check_mark: | N/A | | +| `message` | [components.Message](../components/message.mdx) | :heavy_check_mark: | N/A | | +| `native_finish_reason` | *Nullable[str]* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/choicerole.mdx b/docs/components/choicerole.mdx new file mode 100644 index 00000000..6640a4c7 --- /dev/null +++ b/docs/components/choicerole.mdx @@ -0,0 +1,15 @@ +--- +title: "ChoiceRole" +--- + +## Example Usage + +```python +from openrouter.components import ChoiceRole +value: ChoiceRole = "assistant" +``` + + +## Values + +- `"assistant"` diff --git a/docs/components/choicetypefunction.mdx b/docs/components/choicetypefunction.mdx new file mode 100644 index 00000000..51945adb --- /dev/null +++ b/docs/components/choicetypefunction.mdx @@ -0,0 +1,15 @@ +--- +title: "ChoiceTypeFunction" +--- + +## Example Usage + +```python +from openrouter.components import ChoiceTypeFunction +value: ChoiceTypeFunction = "function" +``` + + +## Values + +- `"function"` diff --git a/docs/components/choicetypeimageurl.mdx b/docs/components/choicetypeimageurl.mdx new file mode 100644 index 00000000..63cbbcf1 --- /dev/null +++ b/docs/components/choicetypeimageurl.mdx @@ -0,0 +1,15 @@ +--- +title: "ChoiceTypeImageURL" +--- + +## Example Usage + +```python +from openrouter.components import ChoiceTypeImageURL +value: ChoiceTypeImageURL = "image_url" +``` + + +## Values + +- `"image_url"` diff --git a/docs/components/contentimageurl.mdx b/docs/components/contentimageurl.mdx new file mode 100644 index 00000000..41aae9e0 --- /dev/null +++ b/docs/components/contentimageurl.mdx @@ -0,0 +1,10 @@ +--- +title: "ContentImageURL" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `image_url` | [components.ContentImageURLImageURL](../components/contentimageurlimageurl.mdx) | :heavy_check_mark: | N/A | +| `type` | [components.FileTypeImageURL](../components/filetypeimageurl.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/contentimageurlimageurl.mdx b/docs/components/contentimageurlimageurl.mdx new file mode 100644 index 00000000..dc4af468 --- /dev/null +++ b/docs/components/contentimageurlimageurl.mdx @@ -0,0 +1,9 @@ +--- +title: "ContentImageURLImageURL" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/contentredactedthinking.mdx b/docs/components/contentredactedthinking.mdx index f9c4eeef..03ca5bcd 100644 --- a/docs/components/contentredactedthinking.mdx +++ b/docs/components/contentredactedthinking.mdx @@ -4,7 +4,7 @@ title: "ContentRedactedThinking" ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `data` | *str* | :heavy_check_mark: | N/A | -| `type` | [components.TypeRedactedThinking](../components/typeredactedthinking.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `data` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.MessagesMessageParamTypeRedactedThinking](../components/messagesmessageparamtyperedactedthinking.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/contentservertooluse.mdx b/docs/components/contentservertooluse.mdx index 7f97379b..c2377ff2 100644 --- a/docs/components/contentservertooluse.mdx +++ b/docs/components/contentservertooluse.mdx @@ -10,4 +10,4 @@ title: "ContentServerToolUse" | `id` | *str* | :heavy_check_mark: | N/A | | | `input` | *Optional[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 +| `type` | [components.MessagesMessageParamTypeServerToolUse](../components/messagesmessageparamtypeservertooluse.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/debug.mdx b/docs/components/contenttext.mdx similarity index 59% rename from docs/components/debug.mdx rename to docs/components/contenttext.mdx index 15d4e237..cfdd29ee 100644 --- a/docs/components/debug.mdx +++ b/docs/components/contenttext.mdx @@ -1,10 +1,10 @@ --- -title: "Debug" +title: "ContentText" --- ## Fields | Field | Type | Required | Description | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `echo_upstream_body` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | -| `timings` | [Optional[components.Timings]](../components/timings.mdx) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `text` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.FileTypeText](../components/filetypetext.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/contentthinking.mdx b/docs/components/contentthinking.mdx index 8c9a9246..a7921fd6 100644 --- a/docs/components/contentthinking.mdx +++ b/docs/components/contentthinking.mdx @@ -4,8 +4,8 @@ title: "ContentThinking" ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `signature` | *str* | :heavy_check_mark: | N/A | -| `thinking` | *str* | :heavy_check_mark: | N/A | -| `type` | [components.TypeThinking](../components/typethinking.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `signature` | *str* | :heavy_check_mark: | N/A | +| `thinking` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.MessagesMessageParamTypeThinking](../components/messagesmessageparamtypethinking.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 0f54e811..fcb07253 100644 --- a/docs/components/contenttooluse.mdx +++ b/docs/components/contenttooluse.mdx @@ -10,4 +10,4 @@ title: "ContentToolUse" | `id` | *str* | :heavy_check_mark: | N/A | | | `input` | *Optional[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 +| `type` | [components.MessagesMessageParamTypeToolUse](../components/messagesmessageparamtypetooluse.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/contenttoplogprob.mdx b/docs/components/contenttoplogprob.mdx new file mode 100644 index 00000000..5ac97a3d --- /dev/null +++ b/docs/components/contenttoplogprob.mdx @@ -0,0 +1,11 @@ +--- +title: "ContentTopLogprob" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `bytes_` | List[*int*] | :heavy_check_mark: | N/A | +| `logprob` | *float* | :heavy_check_mark: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/contentwebsearchtoolresult.mdx b/docs/components/contentwebsearchtoolresult.mdx index 9a9180dc..3f3b1c7f 100644 --- a/docs/components/contentwebsearchtoolresult.mdx +++ b/docs/components/contentwebsearchtoolresult.mdx @@ -9,4 +9,4 @@ title: "ContentWebSearchToolResult" | `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 +| `type` | [components.MessagesMessageParamTypeWebSearchToolResult](../components/messagesmessageparamtypewebsearchtoolresult.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/contentwebsearchtoolresulterror.mdx b/docs/components/contentwebsearchtoolresulterror.mdx index c944724a..ab974796 100644 --- a/docs/components/contentwebsearchtoolresulterror.mdx +++ b/docs/components/contentwebsearchtoolresulterror.mdx @@ -4,7 +4,7 @@ title: "ContentWebSearchToolResultError" ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `error_code` | [components.ErrorCode](../components/errorcode.mdx) | :heavy_check_mark: | N/A | -| `type` | [components.TypeWebSearchToolResultError](../components/typewebsearchtoolresulterror.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `error_code` | [components.MessagesMessageParamErrorCode](../components/messagesmessageparamerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | [components.MessagesMessageParamTypeWebSearchToolResultError](../components/messagesmessageparamtypewebsearchtoolresulterror.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/debugevent.mdx b/docs/components/debugevent.mdx index 1a76e56a..fb80bd74 100644 --- a/docs/components/debugevent.mdx +++ b/docs/components/debugevent.mdx @@ -7,8 +7,8 @@ Debug event emitted when debug.echo_upstream_body is true. Contains the transfor ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `debug` | [components.Debug](../components/debug.mdx) | :heavy_check_mark: | N/A | -| `sequence_number` | *int* | :heavy_check_mark: | N/A | -| `type` | [components.DebugEventType](../components/debugeventtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `debug` | [components.DebugEventDebug](../components/debugeventdebug.mdx) | :heavy_check_mark: | N/A | +| `sequence_number` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.DebugEventType](../components/debugeventtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/debugeventdebug.mdx b/docs/components/debugeventdebug.mdx new file mode 100644 index 00000000..feaaf1f4 --- /dev/null +++ b/docs/components/debugeventdebug.mdx @@ -0,0 +1,10 @@ +--- +title: "DebugEventDebug" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `echo_upstream_body` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `timings` | [Optional[components.DebugEventTimings]](../components/debugeventtimings.mdx) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/event.mdx b/docs/components/debugeventevent.mdx similarity index 71% rename from docs/components/event.mdx rename to docs/components/debugeventevent.mdx index 3f077ae5..cc98ef71 100644 --- a/docs/components/event.mdx +++ b/docs/components/debugeventevent.mdx @@ -1,14 +1,14 @@ --- -title: "Event" +title: "DebugEventEvent" --- ## Example Usage ```python -from openrouter.components import Event +from openrouter.components import DebugEventEvent # Open enum: unrecognized values are captured as UnrecognizedStr -value: Event = "adapter_request" +value: DebugEventEvent = "adapter_request" ``` diff --git a/docs/components/debugeventtimings.mdx b/docs/components/debugeventtimings.mdx new file mode 100644 index 00000000..0d5b176d --- /dev/null +++ b/docs/components/debugeventtimings.mdx @@ -0,0 +1,11 @@ +--- +title: "DebugEventTimings" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `epoch_ms` | *int* | :heavy_check_mark: | N/A | +| `event` | [components.DebugEventEvent](../components/debugeventevent.mdx) | :heavy_check_mark: | N/A | +| `start_ms` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/embedding.mdx b/docs/components/embedding.mdx new file mode 100644 index 00000000..166a8bd4 --- /dev/null +++ b/docs/components/embedding.mdx @@ -0,0 +1,21 @@ +--- +title: "Embedding" +--- + +Embedding vector as an array of floats or a base64 string + + +## Supported Types + +### `List[float]` + +```python +value: List[float] = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/endpoint.mdx b/docs/components/endpoint.mdx new file mode 100644 index 00000000..557833b9 --- /dev/null +++ b/docs/components/endpoint.mdx @@ -0,0 +1,22 @@ +--- +title: "Endpoint" +--- + +## Example Usage + +```python +from openrouter.components import Endpoint + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Endpoint = "/v1/chat/completions" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"/v1/chat/completions"` +- `"/v1/responses"` +- `"/v1/messages"` +- `"/v1/embeddings"` diff --git a/docs/components/filetype.mdx b/docs/components/filetype.mdx new file mode 100644 index 00000000..fafd3cfa --- /dev/null +++ b/docs/components/filetype.mdx @@ -0,0 +1,21 @@ +--- +title: "FileType" +--- + +## Example Usage + +```python +from openrouter.components import FileType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: FileType = "text" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"text"` +- `"image"` +- `"pdf"` diff --git a/docs/components/filetypeimageurl.mdx b/docs/components/filetypeimageurl.mdx new file mode 100644 index 00000000..f9f1f323 --- /dev/null +++ b/docs/components/filetypeimageurl.mdx @@ -0,0 +1,15 @@ +--- +title: "FileTypeImageURL" +--- + +## Example Usage + +```python +from openrouter.components import FileTypeImageURL +value: FileTypeImageURL = "image_url" +``` + + +## Values + +- `"image_url"` diff --git a/docs/components/filetypetext.mdx b/docs/components/filetypetext.mdx new file mode 100644 index 00000000..87fc5863 --- /dev/null +++ b/docs/components/filetypetext.mdx @@ -0,0 +1,15 @@ +--- +title: "FileTypeText" +--- + +## Example Usage + +```python +from openrouter.components import FileTypeText +value: FileTypeText = "text" +``` + + +## Values + +- `"text"` diff --git a/docs/components/finishreason.mdx b/docs/components/finishreason.mdx index 0693755f..4cc750a3 100644 --- a/docs/components/finishreason.mdx +++ b/docs/components/finishreason.mdx @@ -2,15 +2,13 @@ title: "FinishReason" --- -`null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. - ## Example Usage ```python from openrouter.components import FinishReason # Open enum: unrecognized values are captured as UnrecognizedStr -value: FinishReason = "error" +value: FinishReason = "stop" ``` @@ -18,6 +16,8 @@ value: FinishReason = "error" This is an open enum. Unrecognized values will not fail type checks. -- `"error"` - `"stop"` +- `"length"` - `"tool_calls"` +- `"content_filter"` +- `"function_call"` diff --git a/docs/components/image.mdx b/docs/components/image.mdx new file mode 100644 index 00000000..36a2381e --- /dev/null +++ b/docs/components/image.mdx @@ -0,0 +1,10 @@ +--- +title: "Image" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `image_url` | [components.BatchObjectImageURL](../components/batchobjectimageurl.mdx) | :heavy_check_mark: | N/A | +| `type` | [components.ChoiceTypeImageURL](../components/choicetypeimageurl.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 cb01cf31..fa7df815 100644 --- a/docs/components/imagegenerationusage.mdx +++ b/docs/components/imagegenerationusage.mdx @@ -18,7 +18,7 @@ Token and cost usage for the image generation request, when available | `iterations` | List[[components.AnthropicUsageIteration](../components/anthropicusageiteration.mdx)] | :heavy_minus_sign: | N/A | | | `prompt_tokens` | *int* | :heavy_check_mark: | Including images, input audio, and tools if any | | | `prompt_tokens_details` | [OptionalNullable[components.ImageGenerationUsagePromptTokensDetails]](../components/imagegenerationusageprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | -| `server_tool_use` | [OptionalNullable[components.ServerToolUse]](../components/servertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `server_tool_use` | [OptionalNullable[components.ImageGenerationUsageServerToolUse]](../components/imagegenerationusageservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | | `service_tier` | *OptionalNullable[str]* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | | `speed` | [OptionalNullable[components.AnthropicSpeed]](../components/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | | `total_tokens` | *int* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/components/imagegenerationusageservertooluse.mdx b/docs/components/imagegenerationusageservertooluse.mdx new file mode 100644 index 00000000..427cf8d0 --- /dev/null +++ b/docs/components/imagegenerationusageservertooluse.mdx @@ -0,0 +1,14 @@ +--- +title: "ImageGenerationUsageServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + + +## Fields + +| 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_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/internchatchoice.mdx b/docs/components/internchatchoice.mdx index 78a4f7f4..7d0bdde0 100644 --- a/docs/components/internchatchoice.mdx +++ b/docs/components/internchatchoice.mdx @@ -10,5 +10,5 @@ The single choice this endpoint streams. | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `delta` | [components.InternChatDelta](../components/internchatdelta.mdx) | :heavy_check_mark: | The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry. | \{
"content": "Hello"
} | -| `finish_reason` | [Nullable[components.FinishReason]](../components/finishreason.mdx) | :heavy_check_mark: | `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. | | +| `finish_reason` | [Nullable[components.InternChatChoiceFinishReason]](../components/internchatchoicefinishreason.mdx) | :heavy_check_mark: | `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. | | | `index` | *int* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/internchatchoicefinishreason.mdx b/docs/components/internchatchoicefinishreason.mdx new file mode 100644 index 00000000..ebcb8202 --- /dev/null +++ b/docs/components/internchatchoicefinishreason.mdx @@ -0,0 +1,23 @@ +--- +title: "InternChatChoiceFinishReason" +--- + +`null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. + +## Example Usage + +```python +from openrouter.components import InternChatChoiceFinishReason + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: InternChatChoiceFinishReason = "error" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"error"` +- `"stop"` +- `"tool_calls"` diff --git a/docs/components/logprobs.mdx b/docs/components/logprobs.mdx new file mode 100644 index 00000000..c0b2da9f --- /dev/null +++ b/docs/components/logprobs.mdx @@ -0,0 +1,10 @@ +--- +title: "Logprobs" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `content` | List[[components.LogprobsContent](../components/logprobscontent.mdx)] | :heavy_check_mark: | N/A | +| `refusal` | List[[components.Refusal](../components/refusal.mdx)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/logprobscontent.mdx b/docs/components/logprobscontent.mdx new file mode 100644 index 00000000..0645e0cd --- /dev/null +++ b/docs/components/logprobscontent.mdx @@ -0,0 +1,12 @@ +--- +title: "LogprobsContent" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `bytes_` | List[*int*] | :heavy_check_mark: | N/A | +| `logprob` | *float* | :heavy_check_mark: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | +| `top_logprobs` | List[[components.ContentTopLogprob](../components/contenttoplogprob.mdx)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/message.mdx b/docs/components/message.mdx new file mode 100644 index 00000000..293ccd90 --- /dev/null +++ b/docs/components/message.mdx @@ -0,0 +1,16 @@ +--- +title: "Message" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `annotations` | List[[components.Annotation](../components/annotation.mdx)] | :heavy_minus_sign: | N/A | +| `content` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `images` | List[[components.Image](../components/image.mdx)] | :heavy_minus_sign: | N/A | +| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `reasoning_details` | List[[Nullable[components.ReasoningDetail]](../components/reasoningdetail.mdx)] | :heavy_minus_sign: | N/A | +| `refusal` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `role` | [components.ChoiceRole](../components/choicerole.mdx) | :heavy_check_mark: | N/A | +| `tool_calls` | List[[components.ToolCall](../components/toolcall.mdx)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/messagesbashtoolresultblock.mdx b/docs/components/messagesbashtoolresultblock.mdx index 34a24b71..cf49493d 100644 --- a/docs/components/messagesbashtoolresultblock.mdx +++ b/docs/components/messagesbashtoolresultblock.mdx @@ -13,4 +13,4 @@ Output of a sandbox-executed `openrouter:bash` call from a prior assistant turn. | `content` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `files` | List[[components.MessagesBashToolResultBlockFile](../components/messagesbashtoolresultblockfile.mdx)] | :heavy_minus_sign: | Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. | | `tool_use_id` | *str* | :heavy_check_mark: | N/A | -| `type` | [components.TypeOpenrouterBashToolResult](../components/typeopenrouterbashtoolresult.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| `type` | [components.MessagesBashToolResultBlockTypeOpenrouterBashToolResult](../components/messagesbashtoolresultblocktypeopenrouterbashtoolresult.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/messagesbashtoolresultblocktypeopenrouterbashtoolresult.mdx b/docs/components/messagesbashtoolresultblocktypeopenrouterbashtoolresult.mdx new file mode 100644 index 00000000..97ad4d6c --- /dev/null +++ b/docs/components/messagesbashtoolresultblocktypeopenrouterbashtoolresult.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesBashToolResultBlockTypeOpenrouterBashToolResult" +--- + +## Example Usage + +```python +from openrouter.components import MessagesBashToolResultBlockTypeOpenrouterBashToolResult +value: MessagesBashToolResultBlockTypeOpenrouterBashToolResult = "openrouter_bash_tool_result" +``` + + +## Values + +- `"openrouter_bash_tool_result"` diff --git a/docs/components/errorcode.mdx b/docs/components/messagesmessageparamerrorcode.mdx similarity index 64% rename from docs/components/errorcode.mdx rename to docs/components/messagesmessageparamerrorcode.mdx index c177e307..b93c6f8f 100644 --- a/docs/components/errorcode.mdx +++ b/docs/components/messagesmessageparamerrorcode.mdx @@ -1,14 +1,14 @@ --- -title: "ErrorCode" +title: "MessagesMessageParamErrorCode" --- ## Example Usage ```python -from openrouter.components import ErrorCode +from openrouter.components import MessagesMessageParamErrorCode # Open enum: unrecognized values are captured as UnrecognizedStr -value: ErrorCode = "invalid_tool_input" +value: MessagesMessageParamErrorCode = "invalid_tool_input" ``` diff --git a/docs/components/messagesmessageparamtyperedactedthinking.mdx b/docs/components/messagesmessageparamtyperedactedthinking.mdx new file mode 100644 index 00000000..0f6a22b1 --- /dev/null +++ b/docs/components/messagesmessageparamtyperedactedthinking.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesMessageParamTypeRedactedThinking" +--- + +## Example Usage + +```python +from openrouter.components import MessagesMessageParamTypeRedactedThinking +value: MessagesMessageParamTypeRedactedThinking = "redacted_thinking" +``` + + +## Values + +- `"redacted_thinking"` diff --git a/docs/components/messagesmessageparamtypeservertooluse.mdx b/docs/components/messagesmessageparamtypeservertooluse.mdx new file mode 100644 index 00000000..00176a27 --- /dev/null +++ b/docs/components/messagesmessageparamtypeservertooluse.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesMessageParamTypeServerToolUse" +--- + +## Example Usage + +```python +from openrouter.components import MessagesMessageParamTypeServerToolUse +value: MessagesMessageParamTypeServerToolUse = "server_tool_use" +``` + + +## Values + +- `"server_tool_use"` diff --git a/docs/components/messagesmessageparamtypethinking.mdx b/docs/components/messagesmessageparamtypethinking.mdx new file mode 100644 index 00000000..204db375 --- /dev/null +++ b/docs/components/messagesmessageparamtypethinking.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesMessageParamTypeThinking" +--- + +## Example Usage + +```python +from openrouter.components import MessagesMessageParamTypeThinking +value: MessagesMessageParamTypeThinking = "thinking" +``` + + +## Values + +- `"thinking"` diff --git a/docs/components/messagesmessageparamtypetooluse.mdx b/docs/components/messagesmessageparamtypetooluse.mdx new file mode 100644 index 00000000..f9c15cdb --- /dev/null +++ b/docs/components/messagesmessageparamtypetooluse.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesMessageParamTypeToolUse" +--- + +## Example Usage + +```python +from openrouter.components import MessagesMessageParamTypeToolUse +value: MessagesMessageParamTypeToolUse = "tool_use" +``` + + +## Values + +- `"tool_use"` diff --git a/docs/components/messagesmessageparamtypewebsearchtoolresult.mdx b/docs/components/messagesmessageparamtypewebsearchtoolresult.mdx new file mode 100644 index 00000000..eacc1a82 --- /dev/null +++ b/docs/components/messagesmessageparamtypewebsearchtoolresult.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesMessageParamTypeWebSearchToolResult" +--- + +## Example Usage + +```python +from openrouter.components import MessagesMessageParamTypeWebSearchToolResult +value: MessagesMessageParamTypeWebSearchToolResult = "web_search_tool_result" +``` + + +## Values + +- `"web_search_tool_result"` diff --git a/docs/components/messagesmessageparamtypewebsearchtoolresulterror.mdx b/docs/components/messagesmessageparamtypewebsearchtoolresulterror.mdx new file mode 100644 index 00000000..5b9020f7 --- /dev/null +++ b/docs/components/messagesmessageparamtypewebsearchtoolresulterror.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesMessageParamTypeWebSearchToolResultError" +--- + +## Example Usage + +```python +from openrouter.components import MessagesMessageParamTypeWebSearchToolResultError +value: MessagesMessageParamTypeWebSearchToolResultError = "web_search_tool_result_error" +``` + + +## Values + +- `"web_search_tool_result_error"` diff --git a/docs/components/messagesshelltoolresultblock.mdx b/docs/components/messagesshelltoolresultblock.mdx index 7c48f8d3..c078c4b3 100644 --- a/docs/components/messagesshelltoolresultblock.mdx +++ b/docs/components/messagesshelltoolresultblock.mdx @@ -13,4 +13,4 @@ Output of an `openrouter:shell` call from a prior assistant turn. Accepted on re | `content` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `files` | List[[components.MessagesShellToolResultBlockFile](../components/messagesshelltoolresultblockfile.mdx)] | :heavy_minus_sign: | Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. | | `tool_use_id` | *str* | :heavy_check_mark: | N/A | -| `type` | [components.TypeOpenrouterShellToolResult](../components/typeopenroutershelltoolresult.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| `type` | [components.MessagesShellToolResultBlockTypeOpenrouterShellToolResult](../components/messagesshelltoolresultblocktypeopenroutershelltoolresult.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/messagesshelltoolresultblocktypeopenroutershelltoolresult.mdx b/docs/components/messagesshelltoolresultblocktypeopenroutershelltoolresult.mdx new file mode 100644 index 00000000..dea5b508 --- /dev/null +++ b/docs/components/messagesshelltoolresultblocktypeopenroutershelltoolresult.mdx @@ -0,0 +1,15 @@ +--- +title: "MessagesShellToolResultBlockTypeOpenrouterShellToolResult" +--- + +## Example Usage + +```python +from openrouter.components import MessagesShellToolResultBlockTypeOpenrouterShellToolResult +value: MessagesShellToolResultBlockTypeOpenrouterShellToolResult = "openrouter_shell_tool_result" +``` + + +## Values + +- `"openrouter_shell_tool_result"` diff --git a/docs/components/objectembedding.mdx b/docs/components/objectembedding.mdx new file mode 100644 index 00000000..58159d41 --- /dev/null +++ b/docs/components/objectembedding.mdx @@ -0,0 +1,15 @@ +--- +title: "ObjectEmbedding" +--- + +## Example Usage + +```python +from openrouter.components import ObjectEmbedding +value: ObjectEmbedding = "embedding" +``` + + +## Values + +- `"embedding"` diff --git a/docs/components/openrouter.mdx b/docs/components/openrouter.mdx new file mode 100644 index 00000000..995c9165 --- /dev/null +++ b/docs/components/openrouter.mdx @@ -0,0 +1,17 @@ +--- +title: "Openrouter" +--- + +OpenRouter-held request and result artifacts were purged. + +## Example Usage + +```python +from openrouter.components import Openrouter +value: Openrouter = "deleted" +``` + + +## Values + +- `"deleted"` diff --git a/docs/components/oranthropicbashtoolresult.mdx b/docs/components/oranthropicbashtoolresult.mdx new file mode 100644 index 00000000..4428fcec --- /dev/null +++ b/docs/components/oranthropicbashtoolresult.mdx @@ -0,0 +1,16 @@ +--- +title: "ORAnthropicBashToolResult" +--- + +Output of an `openrouter:bash` call executed in the OpenRouter sandbox (`engine: 'openrouter'`) + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `container_id` | *Optional[str]* | :heavy_minus_sign: | The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed. | +| `content` | Dict[str, *Any*] | :heavy_check_mark: | N/A | +| `files` | List[[components.ORAnthropicBashToolResultFile](../components/oranthropicbashtoolresultfile.mdx)] | :heavy_minus_sign: | Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.ORAnthropicBashToolResultTypeOpenrouterBashToolResult](../components/oranthropicbashtoolresulttypeopenrouterbashtoolresult.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/oranthropicbashtoolresultfile.mdx b/docs/components/oranthropicbashtoolresultfile.mdx new file mode 100644 index 00000000..350d2e76 --- /dev/null +++ b/docs/components/oranthropicbashtoolresultfile.mdx @@ -0,0 +1,14 @@ +--- +title: "ORAnthropicBashToolResultFile" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `container_id` | *str* | :heavy_check_mark: | N/A | +| `end_index` | *int* | :heavy_check_mark: | N/A | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `filename` | *str* | :heavy_check_mark: | N/A | +| `start_index` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.ORAnthropicBashToolResultTypeContainerFileCitation](../components/oranthropicbashtoolresulttypecontainerfilecitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/oranthropicbashtoolresulttypecontainerfilecitation.mdx b/docs/components/oranthropicbashtoolresulttypecontainerfilecitation.mdx new file mode 100644 index 00000000..b8a438c6 --- /dev/null +++ b/docs/components/oranthropicbashtoolresulttypecontainerfilecitation.mdx @@ -0,0 +1,15 @@ +--- +title: "ORAnthropicBashToolResultTypeContainerFileCitation" +--- + +## Example Usage + +```python +from openrouter.components import ORAnthropicBashToolResultTypeContainerFileCitation +value: ORAnthropicBashToolResultTypeContainerFileCitation = "container_file_citation" +``` + + +## Values + +- `"container_file_citation"` diff --git a/docs/components/oranthropicbashtoolresulttypeopenrouterbashtoolresult.mdx b/docs/components/oranthropicbashtoolresulttypeopenrouterbashtoolresult.mdx new file mode 100644 index 00000000..81e1641c --- /dev/null +++ b/docs/components/oranthropicbashtoolresulttypeopenrouterbashtoolresult.mdx @@ -0,0 +1,15 @@ +--- +title: "ORAnthropicBashToolResultTypeOpenrouterBashToolResult" +--- + +## Example Usage + +```python +from openrouter.components import ORAnthropicBashToolResultTypeOpenrouterBashToolResult +value: ORAnthropicBashToolResultTypeOpenrouterBashToolResult = "openrouter_bash_tool_result" +``` + + +## Values + +- `"openrouter_bash_tool_result"` diff --git a/docs/components/oranthropiccontentblock.mdx b/docs/components/oranthropiccontentblock.mdx new file mode 100644 index 00000000..9dae5680 --- /dev/null +++ b/docs/components/oranthropiccontentblock.mdx @@ -0,0 +1,102 @@ +--- +title: "ORAnthropicContentBlock" +--- + +## Supported Types + +### `components.AnthropicAdvisorToolResult` + +```python +value: components.AnthropicAdvisorToolResult = /* values here */ +``` + +### `components.AnthropicBashCodeExecutionToolResult` + +```python +value: components.AnthropicBashCodeExecutionToolResult = /* values here */ +``` + +### `components.AnthropicCodeExecutionToolResult` + +```python +value: components.AnthropicCodeExecutionToolResult = /* values here */ +``` + +### `components.AnthropicCompactionBlock` + +```python +value: components.AnthropicCompactionBlock = /* values here */ +``` + +### `components.AnthropicContainerUpload` + +```python +value: components.AnthropicContainerUpload = /* values here */ +``` + +### `components.ORAnthropicBashToolResult` + +```python +value: components.ORAnthropicBashToolResult = /* values here */ +``` + +### `components.ORAnthropicShellToolResult` + +```python +value: components.ORAnthropicShellToolResult = /* values here */ +``` + +### `components.AnthropicRedactedThinkingBlock` + +```python +value: components.AnthropicRedactedThinkingBlock = /* values here */ +``` + +### `components.ORAnthropicServerToolUseBlock` + +```python +value: components.ORAnthropicServerToolUseBlock = /* values here */ +``` + +### `components.AnthropicTextBlock` + +```python +value: components.AnthropicTextBlock = /* values here */ +``` + +### `components.AnthropicTextEditorCodeExecutionToolResult` + +```python +value: components.AnthropicTextEditorCodeExecutionToolResult = /* values here */ +``` + +### `components.AnthropicThinkingBlock` + +```python +value: components.AnthropicThinkingBlock = /* values here */ +``` + +### `components.AnthropicToolSearchToolResult` + +```python +value: components.AnthropicToolSearchToolResult = /* values here */ +``` + +### `components.AnthropicToolUseBlock` + +```python +value: components.AnthropicToolUseBlock = /* values here */ +``` + +### `components.AnthropicWebFetchToolResult` + +```python +value: components.AnthropicWebFetchToolResult = /* values here */ +``` + +### `components.AnthropicWebSearchToolResult` + +```python +value: components.AnthropicWebSearchToolResult = /* values here */ +``` + diff --git a/docs/components/oranthropicnullablecaller.mdx b/docs/components/oranthropicnullablecaller.mdx new file mode 100644 index 00000000..2468ce49 --- /dev/null +++ b/docs/components/oranthropicnullablecaller.mdx @@ -0,0 +1,24 @@ +--- +title: "ORAnthropicNullableCaller" +--- + +## Supported Types + +### `components.AnthropicCodeExecution20250825Caller` + +```python +value: components.AnthropicCodeExecution20250825Caller = /* values here */ +``` + +### `components.AnthropicCodeExecution20260120Caller` + +```python +value: components.AnthropicCodeExecution20260120Caller = /* values here */ +``` + +### `components.AnthropicDirectCaller` + +```python +value: components.AnthropicDirectCaller = /* values here */ +``` + diff --git a/docs/components/oranthropicservertooluseblock.mdx b/docs/components/oranthropicservertooluseblock.mdx new file mode 100644 index 00000000..f88678ac --- /dev/null +++ b/docs/components/oranthropicservertooluseblock.mdx @@ -0,0 +1,13 @@ +--- +title: "ORAnthropicServerToolUseBlock" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `caller` | [OptionalNullable[components.ORAnthropicNullableCaller]](../components/oranthropicnullablecaller.mdx) | :heavy_minus_sign: | N/A | \{
"type": "direct"
} | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `input` | *Optional[Any]* | :heavy_minus_sign: | N/A | | +| `name` | *str* | :heavy_check_mark: | N/A | | +| `type` | [components.ORAnthropicServerToolUseBlockType](../components/oranthropicservertooluseblocktype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/oranthropicservertooluseblocktype.mdx b/docs/components/oranthropicservertooluseblocktype.mdx new file mode 100644 index 00000000..71e0efcc --- /dev/null +++ b/docs/components/oranthropicservertooluseblocktype.mdx @@ -0,0 +1,15 @@ +--- +title: "ORAnthropicServerToolUseBlockType" +--- + +## Example Usage + +```python +from openrouter.components import ORAnthropicServerToolUseBlockType +value: ORAnthropicServerToolUseBlockType = "server_tool_use" +``` + + +## Values + +- `"server_tool_use"` diff --git a/docs/components/oranthropicshelltoolresult.mdx b/docs/components/oranthropicshelltoolresult.mdx new file mode 100644 index 00000000..4ac936c4 --- /dev/null +++ b/docs/components/oranthropicshelltoolresult.mdx @@ -0,0 +1,16 @@ +--- +title: "ORAnthropicShellToolResult" +--- + +Output of an `openrouter:shell` call executed in the OpenRouter sandbox + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `container_id` | *Optional[str]* | :heavy_minus_sign: | The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed. | +| `content` | Dict[str, *Any*] | :heavy_check_mark: | N/A | +| `files` | List[[components.ORAnthropicShellToolResultFile](../components/oranthropicshelltoolresultfile.mdx)] | :heavy_minus_sign: | Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. | +| `tool_use_id` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.ORAnthropicShellToolResultTypeOpenrouterShellToolResult](../components/oranthropicshelltoolresulttypeopenroutershelltoolresult.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/oranthropicshelltoolresultfile.mdx b/docs/components/oranthropicshelltoolresultfile.mdx new file mode 100644 index 00000000..8ffa1419 --- /dev/null +++ b/docs/components/oranthropicshelltoolresultfile.mdx @@ -0,0 +1,14 @@ +--- +title: "ORAnthropicShellToolResultFile" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `container_id` | *str* | :heavy_check_mark: | N/A | +| `end_index` | *int* | :heavy_check_mark: | N/A | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `filename` | *str* | :heavy_check_mark: | N/A | +| `start_index` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.ORAnthropicShellToolResultTypeContainerFileCitation](../components/oranthropicshelltoolresulttypecontainerfilecitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/oranthropicshelltoolresulttypecontainerfilecitation.mdx b/docs/components/oranthropicshelltoolresulttypecontainerfilecitation.mdx new file mode 100644 index 00000000..4d45fb35 --- /dev/null +++ b/docs/components/oranthropicshelltoolresulttypecontainerfilecitation.mdx @@ -0,0 +1,15 @@ +--- +title: "ORAnthropicShellToolResultTypeContainerFileCitation" +--- + +## Example Usage + +```python +from openrouter.components import ORAnthropicShellToolResultTypeContainerFileCitation +value: ORAnthropicShellToolResultTypeContainerFileCitation = "container_file_citation" +``` + + +## Values + +- `"container_file_citation"` diff --git a/docs/components/oranthropicshelltoolresulttypeopenroutershelltoolresult.mdx b/docs/components/oranthropicshelltoolresulttypeopenroutershelltoolresult.mdx new file mode 100644 index 00000000..fb293351 --- /dev/null +++ b/docs/components/oranthropicshelltoolresulttypeopenroutershelltoolresult.mdx @@ -0,0 +1,15 @@ +--- +title: "ORAnthropicShellToolResultTypeOpenrouterShellToolResult" +--- + +## Example Usage + +```python +from openrouter.components import ORAnthropicShellToolResultTypeOpenrouterShellToolResult +value: ORAnthropicShellToolResultTypeOpenrouterShellToolResult = "openrouter_shell_tool_result" +``` + + +## Values + +- `"openrouter_shell_tool_result"` diff --git a/docs/components/oranthropicstopreason.mdx b/docs/components/oranthropicstopreason.mdx new file mode 100644 index 00000000..d04c1aa3 --- /dev/null +++ b/docs/components/oranthropicstopreason.mdx @@ -0,0 +1,26 @@ +--- +title: "ORAnthropicStopReason" +--- + +## Example Usage + +```python +from openrouter.components import ORAnthropicStopReason + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ORAnthropicStopReason = "end_turn" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"end_turn"` +- `"max_tokens"` +- `"model_context_window_exceeded"` +- `"stop_sequence"` +- `"tool_use"` +- `"pause_turn"` +- `"refusal"` +- `"compaction"` diff --git a/docs/components/outputcodeinterpretercallitem.mdx b/docs/components/outputcodeinterpretercallitem.mdx index bd964353..2998f969 100644 --- a/docs/components/outputcodeinterpretercallitem.mdx +++ b/docs/components/outputcodeinterpretercallitem.mdx @@ -7,12 +7,12 @@ A code interpreter execution call with outputs ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `container_id` | *Optional[str]* | :heavy_minus_sign: | N/A | | -| `id` | *str* | :heavy_check_mark: | N/A | | -| `outputs` | List[[components.OutputCodeInterpreterCallItemOutput](../components/outputcodeinterpretercallitemoutput.mdx)] | :heavy_minus_sign: | N/A | | -| `status` | [components.OutputCodeInterpreterCallItemStatus](../components/outputcodeinterpretercallitemstatus.mdx) | :heavy_check_mark: | N/A | | -| `type` | [components.OutputCodeInterpreterCallItemType](../components/outputcodeinterpretercallitemtype.mdx) | :heavy_check_mark: | N/A | | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \{
"code": "print(\"hello\")",
"container_id": "ctr-xyz789",
"id": "ci-abc123",
"outputs": [
\{
"logs": "hello\n",
"type": "logs"
}
],
"status": "completed",
"type": "code_interpreter_call"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `container_id` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `outputs` | List[[components.OutputCodeInterpreterCallItemOutput](../components/outputcodeinterpretercallitemoutput.mdx)] | :heavy_minus_sign: | N/A | | +| `status` | [components.OutputCodeInterpreterCallItemStatus](../components/outputcodeinterpretercallitemstatus.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.OutputCodeInterpreterCallItemType](../components/outputcodeinterpretercallitemtype.mdx) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \{
"content": [
\{
"text": "Hello! How can I help you today?",
"type": "output_text"
}
],
"id": "msg-abc123",
"role": "assistant",
"status": "completed",
"type": "message"
} | \ No newline at end of file diff --git a/docs/components/outputfusionservertoolitem.mdx b/docs/components/outputfusionservertoolitem.mdx index 0d66d4e0..dfc07a5c 100644 --- a/docs/components/outputfusionservertoolitem.mdx +++ b/docs/components/outputfusionservertoolitem.mdx @@ -14,7 +14,7 @@ An openrouter:fusion server tool output item | `failed_models` | List[[components.FailedModel](../components/failedmodel.mdx)] | :heavy_minus_sign: | Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel. | | | `failure_reason` | *Optional[str]* | :heavy_minus_sign: | Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, invalid_model, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion. The four analysis-stage codes keep their pre-rename `judge_` spelling so existing consumers keep matching. The consumer-cancellation code is `cancelled`. | | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | -| `responses` | List[[components.Response](../components/response.mdx)] | :heavy_minus_sign: | Analysis models that produced a response in this fusion run, with each model's full panel content. | | +| `responses` | List[[components.OutputFusionServerToolItemResponse](../components/outputfusionservertoolitemresponse.mdx)] | :heavy_minus_sign: | Analysis models that produced a response in this fusion run, with each model's full panel content. | | | `sources` | List[[components.FusionSource](../components/fusionsource.mdx)] | :heavy_minus_sign: | Web pages the analysis panels and analyst retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source. | | | `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | :heavy_check_mark: | N/A | completed | | `type` | [components.OutputFusionServerToolItemType](../components/outputfusionservertoolitemtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/response.mdx b/docs/components/outputfusionservertoolitemresponse.mdx similarity index 89% rename from docs/components/response.mdx rename to docs/components/outputfusionservertoolitemresponse.mdx index f12a0a04..f7862f7d 100644 --- a/docs/components/response.mdx +++ b/docs/components/outputfusionservertoolitemresponse.mdx @@ -1,5 +1,5 @@ --- -title: "Response" +title: "OutputFusionServerToolItemResponse" --- ## Fields diff --git a/docs/components/outputwebsearchcallitem.mdx b/docs/components/outputwebsearchcallitem.mdx index 746838c8..cd7081d3 100644 --- a/docs/components/outputwebsearchcallitem.mdx +++ b/docs/components/outputwebsearchcallitem.mdx @@ -4,10 +4,10 @@ title: "OutputWebSearchCallItem" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `action` | [Optional[components.Action]](../components/action.mdx) | :heavy_minus_sign: | N/A | | -| `id` | *str* | :heavy_check_mark: | N/A | | -| `status` | [components.WebSearchStatus](../components/websearchstatus.mdx) | :heavy_check_mark: | N/A | completed | -| `type` | [components.TypeWebSearchCall](../components/typewebsearchcall.mdx) | :heavy_check_mark: | N/A | | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \{
"id": "ws-abc123",
"status": "completed",
"type": "web_search_call"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `action` | [Optional[components.Action]](../components/action.mdx) | :heavy_minus_sign: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `status` | [components.WebSearchStatus](../components/websearchstatus.mdx) | :heavy_check_mark: | N/A | completed | +| `type` | [components.TypeWebSearchCall](../components/typewebsearchcall.mdx) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \{
"content": [
\{
"text": "Hello! How can I help you today?",
"type": "output_text"
}
],
"id": "msg-abc123",
"role": "assistant",
"status": "completed",
"type": "message"
} | \ No newline at end of file diff --git a/docs/components/reasoningdetail.mdx b/docs/components/reasoningdetail.mdx new file mode 100644 index 00000000..476708cc --- /dev/null +++ b/docs/components/reasoningdetail.mdx @@ -0,0 +1,30 @@ +--- +title: "ReasoningDetail" +--- + +## Supported Types + +### `components.ReasoningDetailSummary` + +```python +value: components.ReasoningDetailSummary = /* values here */ +``` + +### `components.ReasoningDetailEncrypted` + +```python +value: components.ReasoningDetailEncrypted = /* values here */ +``` + +### `components.ReasoningDetailText` + +```python +value: components.ReasoningDetailText = /* values here */ +``` + +### `components.ReasoningDetailServerToolCall` + +```python +value: components.ReasoningDetailServerToolCall = /* values here */ +``` + diff --git a/docs/components/refusal.mdx b/docs/components/refusal.mdx new file mode 100644 index 00000000..2d1c89c3 --- /dev/null +++ b/docs/components/refusal.mdx @@ -0,0 +1,12 @@ +--- +title: "Refusal" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `bytes_` | List[*int*] | :heavy_check_mark: | N/A | +| `logprob` | *float* | :heavy_check_mark: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | +| `top_logprobs` | List[[components.RefusalTopLogprob](../components/refusaltoplogprob.mdx)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/refusaltoplogprob.mdx b/docs/components/refusaltoplogprob.mdx new file mode 100644 index 00000000..fa0f7cb0 --- /dev/null +++ b/docs/components/refusaltoplogprob.mdx @@ -0,0 +1,11 @@ +--- +title: "RefusalTopLogprob" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `bytes_` | List[*int*] | :heavy_check_mark: | N/A | +| `logprob` | *float* | :heavy_check_mark: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/request.mdx b/docs/components/request.mdx new file mode 100644 index 00000000..3ae4bc94 --- /dev/null +++ b/docs/components/request.mdx @@ -0,0 +1,10 @@ +--- +title: "Request" +--- + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `body` | Dict[str, *Any*] | :heavy_check_mark: | Request payload for the batch `endpoint`. | +| `custom_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/result.mdx b/docs/components/result.mdx new file mode 100644 index 00000000..77ee4848 --- /dev/null +++ b/docs/components/result.mdx @@ -0,0 +1,12 @@ +--- +title: "Result" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `custom_id` | *str* | :heavy_check_mark: | N/A | +| `error` | [Nullable[components.ResultError]](../components/resulterror.mdx) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `response` | [Nullable[components.BatchObjectResponse]](../components/batchobjectresponse.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/resulterror.mdx b/docs/components/resulterror.mdx new file mode 100644 index 00000000..2609a9af --- /dev/null +++ b/docs/components/resulterror.mdx @@ -0,0 +1,12 @@ +--- +title: "ResultError" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `error_type` | [Optional[components.APIErrorType]](../components/apierrortype.mdx) | :heavy_minus_sign: | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded | +| `message` | *str* | :heavy_check_mark: | N/A | | +| `param` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `type` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/submitgenerationfeedbackrequest.mdx b/docs/components/submitgenerationfeedbackrequest.mdx index 9e56152e..4ac73ca3 100644 --- a/docs/components/submitgenerationfeedbackrequest.mdx +++ b/docs/components/submitgenerationfeedbackrequest.mdx @@ -7,8 +7,8 @@ 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 +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `category` | [components.SubmitGenerationFeedbackRequestCategory](../components/submitgenerationfeedbackrequestcategory.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/category.mdx b/docs/components/submitgenerationfeedbackrequestcategory.mdx similarity index 65% rename from docs/components/category.mdx rename to docs/components/submitgenerationfeedbackrequestcategory.mdx index e67ca2a0..59087549 100644 --- a/docs/components/category.mdx +++ b/docs/components/submitgenerationfeedbackrequestcategory.mdx @@ -1,5 +1,5 @@ --- -title: "Category" +title: "SubmitGenerationFeedbackRequestCategory" --- The category of feedback being reported @@ -7,10 +7,10 @@ The category of feedback being reported ## Example Usage ```python -from openrouter.components import Category +from openrouter.components import SubmitGenerationFeedbackRequestCategory # Open enum: unrecognized values are captured as UnrecognizedStr -value: Category = "latency" +value: SubmitGenerationFeedbackRequestCategory = "latency" ``` diff --git a/docs/components/timings.mdx b/docs/components/timings.mdx deleted file mode 100644 index 8d52bfae..00000000 --- a/docs/components/timings.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Timings" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `epoch_ms` | *int* | :heavy_check_mark: | N/A | -| `event` | [components.Event](../components/event.mdx) | :heavy_check_mark: | N/A | -| `start_ms` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/toolcall.mdx b/docs/components/toolcall.mdx new file mode 100644 index 00000000..c5f4d327 --- /dev/null +++ b/docs/components/toolcall.mdx @@ -0,0 +1,12 @@ +--- +title: "ToolCall" +--- + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `function` | [components.BatchObjectFunction](../components/batchobjectfunction.mdx) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `index` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.ChoiceTypeFunction](../components/choicetypefunction.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/typedocument.mdx b/docs/components/typedocument.mdx deleted file mode 100644 index 328ae7fc..00000000 --- a/docs/components/typedocument.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeDocument" ---- - -## Example Usage - -```python -from openrouter.components import TypeDocument -value: TypeDocument = "document" -``` - - -## Values - -- `"document"` diff --git a/docs/components/typeopenrouterbashtoolresult.mdx b/docs/components/typeopenrouterbashtoolresult.mdx deleted file mode 100644 index ea0d4fae..00000000 --- a/docs/components/typeopenrouterbashtoolresult.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeOpenrouterBashToolResult" ---- - -## Example Usage - -```python -from openrouter.components import TypeOpenrouterBashToolResult -value: TypeOpenrouterBashToolResult = "openrouter_bash_tool_result" -``` - - -## Values - -- `"openrouter_bash_tool_result"` diff --git a/docs/components/typeopenroutershelltoolresult.mdx b/docs/components/typeopenroutershelltoolresult.mdx deleted file mode 100644 index 76a40699..00000000 --- a/docs/components/typeopenroutershelltoolresult.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeOpenrouterShellToolResult" ---- - -## Example Usage - -```python -from openrouter.components import TypeOpenrouterShellToolResult -value: TypeOpenrouterShellToolResult = "openrouter_shell_tool_result" -``` - - -## Values - -- `"openrouter_shell_tool_result"` diff --git a/docs/components/typeredactedthinking.mdx b/docs/components/typeredactedthinking.mdx deleted file mode 100644 index c02fa818..00000000 --- a/docs/components/typeredactedthinking.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeRedactedThinking" ---- - -## Example Usage - -```python -from openrouter.components import TypeRedactedThinking -value: TypeRedactedThinking = "redacted_thinking" -``` - - -## Values - -- `"redacted_thinking"` diff --git a/docs/components/typeservertooluse.mdx b/docs/components/typeservertooluse.mdx deleted file mode 100644 index 9c498fcc..00000000 --- a/docs/components/typeservertooluse.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeServerToolUse" ---- - -## Example Usage - -```python -from openrouter.components import TypeServerToolUse -value: TypeServerToolUse = "server_tool_use" -``` - - -## Values - -- `"server_tool_use"` diff --git a/docs/components/typethinking.mdx b/docs/components/typethinking.mdx deleted file mode 100644 index d2a69036..00000000 --- a/docs/components/typethinking.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeThinking" ---- - -## Example Usage - -```python -from openrouter.components import TypeThinking -value: TypeThinking = "thinking" -``` - - -## Values - -- `"thinking"` diff --git a/docs/components/typetooluse.mdx b/docs/components/typetooluse.mdx deleted file mode 100644 index 6e4df39f..00000000 --- a/docs/components/typetooluse.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeToolUse" ---- - -## Example Usage - -```python -from openrouter.components import TypeToolUse -value: TypeToolUse = "tool_use" -``` - - -## Values - -- `"tool_use"` diff --git a/docs/components/typewebsearchcitation.mdx b/docs/components/typewebsearchcitation.mdx new file mode 100644 index 00000000..98eb3478 --- /dev/null +++ b/docs/components/typewebsearchcitation.mdx @@ -0,0 +1,15 @@ +--- +title: "TypeWebSearchCitation" +--- + +## Example Usage + +```python +from openrouter.components import TypeWebSearchCitation +value: TypeWebSearchCitation = "web_search_citation" +``` + + +## Values + +- `"web_search_citation"` diff --git a/docs/components/typewebsearchtoolresult.mdx b/docs/components/typewebsearchtoolresult.mdx deleted file mode 100644 index 1d9df7e9..00000000 --- a/docs/components/typewebsearchtoolresult.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeWebSearchToolResult" ---- - -## Example Usage - -```python -from openrouter.components import TypeWebSearchToolResult -value: TypeWebSearchToolResult = "web_search_tool_result" -``` - - -## Values - -- `"web_search_tool_result"` diff --git a/docs/components/typewebsearchtoolresulterror.mdx b/docs/components/typewebsearchtoolresulterror.mdx deleted file mode 100644 index ff44734c..00000000 --- a/docs/components/typewebsearchtoolresulterror.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeWebSearchToolResultError" ---- - -## Example Usage - -```python -from openrouter.components import TypeWebSearchToolResultError -value: TypeWebSearchToolResultError = "web_search_tool_result_error" -``` - - -## Values - -- `"web_search_tool_result_error"` diff --git a/docs/components/upstream.mdx b/docs/components/upstream.mdx new file mode 100644 index 00000000..961a0770 --- /dev/null +++ b/docs/components/upstream.mdx @@ -0,0 +1,13 @@ +--- +title: "Upstream" +--- + +The upstream batch deletion outcome; omitted when no provider was assigned. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `provider` | *str* | :heavy_check_mark: | The provider name stored on the batch. | OpenAI | +| `status` | [components.BatchDeletionOutcome](../components/batchdeletionoutcome.mdx) | :heavy_check_mark: | Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target). | deleted | \ No newline at end of file diff --git a/docs/components/websearchcitation.mdx b/docs/components/websearchcitation.mdx new file mode 100644 index 00000000..c9531635 --- /dev/null +++ b/docs/components/websearchcitation.mdx @@ -0,0 +1,12 @@ +--- +title: "WebSearchCitation" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `cited_text` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `encrypted_index` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `title` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/docs.json b/docs/docs.json index d7a03593..59f920a7 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -12,6 +12,7 @@ "overview", "sdks/analytics/README", "sdks/apikeys/README", + "sdks/batch/README", "sdks/benchmarks/README", "sdks/betaresponses/README", "sdks/byok/README", diff --git a/docs/errors/batcherrorresponse.mdx b/docs/errors/batcherrorresponse.mdx new file mode 100644 index 00000000..6b8ce49b --- /dev/null +++ b/docs/errors/batcherrorresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "BatchErrorResponse" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `error` | [components.BatchErrorResponseError](../components/batcherrorresponseerror.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/errors/batchpaymentrequiredresponseerror.mdx b/docs/errors/batchpaymentrequiredresponseerror.mdx new file mode 100644 index 00000000..9c093bb2 --- /dev/null +++ b/docs/errors/batchpaymentrequiredresponseerror.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchPaymentRequiredResponseError" +--- + +Batch metadata with results withheld (results: null) plus the standard error envelope. Add credits to unlock the already-computed results; the batch is not re-run. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `completion_window` | [components.BatchPaymentRequiredResponseCompletionWindow](../components/batchpaymentrequiredresponsecompletionwindow.mdx) | :heavy_check_mark: | N/A | +| `created_at` | *int* | :heavy_check_mark: | N/A | +| `endpoint` | *str* | :heavy_check_mark: | N/A | +| `error` | [components.BatchPaymentRequiredResponseError](../components/batchpaymentrequiredresponseerror.mdx) | :heavy_check_mark: | N/A | +| `finalized_at` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `object` | [components.BatchPaymentRequiredResponseObject](../components/batchpaymentrequiredresponseobject.mdx) | :heavy_check_mark: | N/A | +| `request_counts` | [components.BatchPaymentRequiredResponseRequestCounts](../components/batchpaymentrequiredresponserequestcounts.mdx) | :heavy_check_mark: | N/A | +| `results` | *Nullable[Any]* | :heavy_check_mark: | Always null: results are withheld until the batch charge is covered. | +| `status` | [components.BatchPaymentRequiredResponseStatus](../components/batchpaymentrequiredresponsestatus.mdx) | :heavy_check_mark: | N/A | +| `usage` | [Nullable[components.BatchPaymentRequiredResponseUsage]](../components/batchpaymentrequiredresponseusage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/createbatchesglobals.mdx b/docs/operations/createbatchesglobals.mdx new file mode 100644 index 00000000..3fc8554f --- /dev/null +++ b/docs/operations/createbatchesglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "CreateBatchesGlobals" +--- + +## 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/createbatchesrequest.mdx b/docs/operations/createbatchesrequest.mdx new file mode 100644 index 00000000..a809455b --- /dev/null +++ b/docs/operations/createbatchesrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "CreateBatchesRequest" +--- + +## 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.
| +| `batch_submit_body` | [components.BatchSubmitBody](../components/batchsubmitbody.mdx) | :heavy_check_mark: | The batch to create. Each item in `requests` has a unique `custom_id` and a `body` in the request format of the chosen `endpoint`. | \ No newline at end of file diff --git a/docs/operations/deletebatchglobals.mdx b/docs/operations/deletebatchglobals.mdx new file mode 100644 index 00000000..ab6c9c87 --- /dev/null +++ b/docs/operations/deletebatchglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "DeleteBatchGlobals" +--- + +## 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/deletebatchrequest.mdx b/docs/operations/deletebatchrequest.mdx new file mode 100644 index 00000000..4733d5e1 --- /dev/null +++ b/docs/operations/deletebatchrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "DeleteBatchRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | The batch job id returned from submit. | batch_abc123 | \ No newline at end of file diff --git a/docs/operations/getbatchesglobals.mdx b/docs/operations/getbatchesglobals.mdx new file mode 100644 index 00000000..0f082c13 --- /dev/null +++ b/docs/operations/getbatchesglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "GetBatchesGlobals" +--- + +## 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/getbatchesrequest.mdx b/docs/operations/getbatchesrequest.mdx new file mode 100644 index 00000000..522a7e42 --- /dev/null +++ b/docs/operations/getbatchesrequest.mdx @@ -0,0 +1,12 @@ +--- +title: "GetBatchesRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *str* | :heavy_check_mark: | The batch job id returned from submit. | batch_abc123 | \ No newline at end of file diff --git a/docs/operations/listbatchesglobals.mdx b/docs/operations/listbatchesglobals.mdx new file mode 100644 index 00000000..62c0e67f --- /dev/null +++ b/docs/operations/listbatchesglobals.mdx @@ -0,0 +1,11 @@ +--- +title: "ListBatchesGlobals" +--- + +## 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/listbatchesrequest.mdx b/docs/operations/listbatchesrequest.mdx new file mode 100644 index 00000000..fd00d5a7 --- /dev/null +++ b/docs/operations/listbatchesrequest.mdx @@ -0,0 +1,16 @@ +--- +title: "ListBatchesRequest" +--- + +## 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.
| | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of batches to return, from 1 through 100. | 20 | +| `after` | *Optional[str]* | :heavy_minus_sign: | Batch id from the previous page's `last_id`. | batch_7a4b02 | +| `status` | List[[components.BatchListStatus](../components/batchliststatus.mdx)] | :heavy_minus_sign: | Repeat this parameter to include more than one status. | [
"completed",
"failed"
] | +| `created_after` | [Optional[components.BatchListTimestamp]](../components/batchlisttimestamp.mdx) | :heavy_minus_sign: | Only include batches created strictly after this timestamp. | 2026-08-20T00:00:00Z | +| `created_before` | [Optional[components.BatchListTimestamp]](../components/batchlisttimestamp.mdx) | :heavy_minus_sign: | Only include batches created strictly before this timestamp. | 2026-08-20T00:00:00Z | \ No newline at end of file diff --git a/docs/operations/listbatchesresponse.mdx b/docs/operations/listbatchesresponse.mdx new file mode 100644 index 00000000..9a218bcd --- /dev/null +++ b/docs/operations/listbatchesresponse.mdx @@ -0,0 +1,9 @@ +--- +title: "ListBatchesResponse" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `result` | [components.BatchListResponse](../components/batchlistresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [],
"first_id": null,
"has_more": false,
"last_id": null,
"object": "list"
} | \ No newline at end of file diff --git a/docs/sdks/batch/README.mdx b/docs/sdks/batch/README.mdx new file mode 100644 index 00000000..9a0bdf21 --- /dev/null +++ b/docs/sdks/batch/README.mdx @@ -0,0 +1,332 @@ +--- +title: "Batch" +description: "Submit, list, poll, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart." +--- + +## Overview + +Submit, list, poll, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart. + +### Available Operations + +* [list](#list) - List batches +* [create_batches](#create_batches) - Create a batch +* [delete](#delete) - Delete a batch +* [get_batches](#get_batches) - Get a batch + +## list + +Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page's `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + +### 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.batch.list() + + 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.
| | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of batches to return, from 1 through 100. | 20 | +| `after` | *Optional[str]* | :heavy_minus_sign: | Batch id from the previous page's `last_id`. | batch_7a4b02 | +| `status` | List[[components.BatchListStatus](../../components/batchliststatus.mdx)] | :heavy_minus_sign: | Repeat this parameter to include more than one status. | [
"completed",
"failed"
] | +| `created_after` | [Optional[components.BatchListTimestamp]](../../components/batchlisttimestamp.mdx) | :heavy_minus_sign: | Only include batches created strictly after this timestamp. | 2026-08-20T00:00:00Z | +| `created_before` | [Optional[components.BatchListTimestamp]](../../components/batchlisttimestamp.mdx) | :heavy_minus_sign: | Only include batches created strictly before this timestamp. | 2026-08-20T00:00:00Z | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.ListBatchesResponse](../../operations/listbatchesresponse.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------- | ----------------------------- | ----------------------------- | +| errors.BatchErrorResponse | 400, 401, 429 | application/json | +| errors.BatchErrorResponse | 500, 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create_batches + +Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: "validating"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + +### Example Usage: chatCompletions + +```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.batch.create_batches(endpoint="/v1/chat/completions", model="openai/gpt-4o", requests=[ + { + "body": { + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "openai/gpt-4o", + }, + "custom_id": "req-0001", + }, + ], completion_window="24h") + + # Handle response + print(res) + +``` +### Example Usage: messages + +```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.batch.create_batches(endpoint="/v1/messages", model="openai/gpt-5-nano", requests=[ + { + "body": { + "max_tokens": 1024, + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "openai/gpt-5-nano", + }, + "custom_id": "req-0001", + }, + ], completion_window="24h") + + # Handle response + print(res) + +``` +### Example Usage: providerPinned + +```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.batch.create_batches(endpoint="/v1/chat/completions", model="google/gemini-3.6-flash", requests=[ + { + "body": { + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "google/gemini-3.6-flash", + }, + "custom_id": "req-0001", + }, + ], completion_window="24h") + + # Handle response + print(res) + +``` +### Example Usage: responses + +```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.batch.create_batches(endpoint="/v1/responses", model="openai/gpt-4o", requests=[ + { + "body": { + "input": [ + { + "content": [ + { + "text": "Summarize ...", + "type": "input_text", + }, + ], + "role": "user", + }, + ], + "model": "openai/gpt-4o", + }, + "custom_id": "req-0001", + }, + ], completion_window="24h") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `endpoint` | [components.Endpoint](../../components/endpoint.mdx) | :heavy_check_mark: | N/A | | +| `model` | *str* | :heavy_check_mark: | N/A | | +| `requests` | List[[components.Request](../../components/request.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.
| | +| `completion_window` | [Optional[components.BatchSubmitBodyCompletionWindow]](../../components/batchsubmitbodycompletionwindow.mdx) | :heavy_minus_sign: | N/A | | +| `provider` | [OptionalNullable[components.BatchProviderPreferences]](../../components/batchproviderpreferences.mdx) | :heavy_minus_sign: | Batch provider routing preferences. Only `provider.only` is supported. | \{
"only": [
"google-vertex"
]
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.BatchObject](../../components/batchobject.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.BatchErrorResponse | 400, 401, 402, 403, 404, 413, 422, 429 | application/json | +| errors.BatchErrorResponse | 500, 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete + +Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + +### 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.batch.delete(id="batch_abc123") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The batch job id returned from submit. | batch_abc123 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.BatchDeletedObject](../../components/batchdeletedobject.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------- | ----------------------------- | ----------------------------- | +| errors.BatchErrorResponse | 401, 404, 409, 429 | application/json | +| errors.BatchErrorResponse | 500, 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## get_batches + +Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + +### 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.batch.get_batches(id="batch_abc123") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The batch job id returned from submit. | batch_abc123 | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[components.BatchObject](../../components/batchobject.mdx)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| errors.BatchPaymentRequiredResponseError | 402 | application/json | +| errors.BatchErrorResponse | 401, 404, 429 | application/json | +| errors.BatchErrorResponse | 500, 502 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/generations/README.mdx b/docs/sdks/generations/README.mdx index 064751ea..a3866532 100644 --- a/docs/sdks/generations/README.mdx +++ b/docs/sdks/generations/README.mdx @@ -148,7 +148,7 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `category` | [components.Category](../../components/category.mdx) | :heavy_check_mark: | The category of feedback being reported | incorrect_response | +| `category` | [components.SubmitGenerationFeedbackRequestCategory](../../components/submitgenerationfeedbackrequestcategory.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.
| | diff --git a/pyproject.toml b/pyproject.toml index 08d4dd47..4c30db41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.2.28" +version = "1.2.29" 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 39525f89..85ff2233 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.2.28" +__version__: str = "1.2.29" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.2.28 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.2.29 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/batch.py b/src/openrouter/batch.py new file mode 100644 index 00000000..be2ba7c0 --- /dev/null +++ b/src/openrouter/batch.py @@ -0,0 +1,1181 @@ +"""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, Awaitable, Dict, Iterable, List, Mapping, Optional, Union + + +class Batch(BaseSDK): + r"""Submit, list, poll, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart.""" + + def list( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + limit: Optional[int] = None, + after: Optional[str] = None, + status: Optional[Iterable[components.BatchListStatus]] = None, + created_after: Optional[ + Union[components.BatchListTimestamp, components.BatchListTimestampTypedDict] + ] = None, + created_before: Optional[ + Union[components.BatchListTimestamp, components.BatchListTimestampTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[operations.ListBatchesResponse]: + r"""List batches + + Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page's `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :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 limit: Maximum number of batches to return, from 1 through 100. + :param after: Batch id from the previous page's `last_id`. + :param status: Repeat this parameter to include more than one status. + :param created_after: Only include batches created strictly after this timestamp. + :param created_before: Only include batches created strictly before this timestamp. + :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.ListBatchesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + limit=limit, + after=after, + status=utils.unmarshal(status, Optional[List[components.BatchListStatus]]), + created_after=created_after, + created_before=created_before, + ) + + req = self._build_request( + method="GET", + path="/batches", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListBatchesGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listBatches", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + def next_func() -> Optional[operations.ListBatchesResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + next_cursor = JSONPath("$.last_id").parse(body) + + if len(next_cursor) == 0: + return None + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return None + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + + return self.list( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + limit=limit, + after=next_cursor, + status=status, + created_after=created_after, + created_before=created_before, + 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 operations.ListBatchesResponse( + result=unmarshal_json_response(components.BatchListResponse, http_res), + next=next_func, + ) + if utils.match_response(http_res, ["400", "401", "429"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_async( + self, + *, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + limit: Optional[int] = None, + after: Optional[str] = None, + status: Optional[Iterable[components.BatchListStatus]] = None, + created_after: Optional[ + Union[components.BatchListTimestamp, components.BatchListTimestampTypedDict] + ] = None, + created_before: Optional[ + Union[components.BatchListTimestamp, components.BatchListTimestampTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[operations.ListBatchesResponse]: + r"""List batches + + Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page's `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :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 limit: Maximum number of batches to return, from 1 through 100. + :param after: Batch id from the previous page's `last_id`. + :param status: Repeat this parameter to include more than one status. + :param created_after: Only include batches created strictly after this timestamp. + :param created_before: Only include batches created strictly before this timestamp. + :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.ListBatchesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + limit=limit, + after=after, + status=utils.unmarshal(status, Optional[List[components.BatchListStatus]]), + created_after=created_after, + created_before=created_before, + ) + + req = self._build_request_async( + method="GET", + path="/batches", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.ListBatchesGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listBatches", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + def next_func() -> Awaitable[Optional[operations.ListBatchesResponse]]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + async def empty_result(): + return None + + next_cursor = JSONPath("$.last_id").parse(body) + + if len(next_cursor) == 0: + return empty_result() + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return empty_result() + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return empty_result() + + return self.list_async( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + limit=limit, + after=next_cursor, + status=status, + created_after=created_after, + created_before=created_before, + 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 operations.ListBatchesResponse( + result=unmarshal_json_response(components.BatchListResponse, http_res), + next=next_func, + ) + if utils.match_response(http_res, ["400", "401", "429"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def create_batches( + self, + *, + endpoint: components.Endpoint, + model: str, + requests: Union[ + Iterable[components.Request], Iterable[components.RequestTypedDict] + ], + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + completion_window: Optional[components.BatchSubmitBodyCompletionWindow] = "24h", + provider: OptionalNullable[ + Union[ + components.BatchProviderPreferences, + components.BatchProviderPreferencesTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.BatchObject: + r"""Create a batch + + Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: \"validating\"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :param endpoint: + :param model: + :param requests: + :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 completion_window: + :param provider: Batch provider routing preferences. Only `provider.only` is supported. + :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.CreateBatchesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + batch_submit_body=components.BatchSubmitBody( + completion_window=completion_window, + endpoint=endpoint, + model=model, + provider=utils.get_pydantic_model( + provider, OptionalNullable[components.BatchProviderPreferences] + ), + requests=utils.get_pydantic_model(requests, List[components.Request]), + ), + ) + + req = self._build_request( + method="POST", + path="/batches", + 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.CreateBatchesGlobals( + 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.batch_submit_body, + False, + False, + "json", + components.BatchSubmitBody, + ), + 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), False + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createBatches", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + 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, "202", "application/json"): + return unmarshal_json_response(components.BatchObject, http_res) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "413", "422", "429"], + "application/json", + ): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(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_batches_async( + self, + *, + endpoint: components.Endpoint, + model: str, + requests: Union[ + Iterable[components.Request], Iterable[components.RequestTypedDict] + ], + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + completion_window: Optional[components.BatchSubmitBodyCompletionWindow] = "24h", + provider: OptionalNullable[ + Union[ + components.BatchProviderPreferences, + components.BatchProviderPreferencesTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.BatchObject: + r"""Create a batch + + Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: \"validating\"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :param endpoint: + :param model: + :param requests: + :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 completion_window: + :param provider: Batch provider routing preferences. Only `provider.only` is supported. + :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.CreateBatchesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + batch_submit_body=components.BatchSubmitBody( + completion_window=completion_window, + endpoint=endpoint, + model=model, + provider=utils.get_pydantic_model( + provider, OptionalNullable[components.BatchProviderPreferences] + ), + requests=utils.get_pydantic_model(requests, List[components.Request]), + ), + ) + + req = self._build_request_async( + method="POST", + path="/batches", + 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.CreateBatchesGlobals( + 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.batch_submit_body, + False, + False, + "json", + components.BatchSubmitBody, + ), + 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), False + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createBatches", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + 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, "202", "application/json"): + return unmarshal_json_response(components.BatchObject, http_res) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "413", "422", "429"], + "application/json", + ): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def delete( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.BatchDeletedObject: + r"""Delete a batch + + Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :param id: The batch job id returned from submit. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.DeleteBatchRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request( + method="DELETE", + path="/batches/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.DeleteBatchGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteBatch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + 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.BatchDeletedObject, http_res) + if utils.match_response( + http_res, ["401", "404", "409", "429"], "application/json" + ): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.BatchDeletedObject: + r"""Delete a batch + + Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :param id: The batch job id returned from submit. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.DeleteBatchRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request_async( + method="DELETE", + path="/batches/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.DeleteBatchGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteBatch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + 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.BatchDeletedObject, http_res) + if utils.match_response( + http_res, ["401", "404", "409", "429"], "application/json" + ): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def get_batches( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.BatchObject: + r"""Get a batch + + Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :param id: The batch job id returned from submit. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetBatchesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request( + method="GET", + path="/batches/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.GetBatchesGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getBatches", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + 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.BatchObject, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + errors.BatchPaymentRequiredResponseErrorData, http_res + ) + raise errors.BatchPaymentRequiredResponseError(response_data, http_res) + if utils.match_response(http_res, ["401", "404", "429"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def get_batches_async( + self, + *, + id: str, + http_referer: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> components.BatchObject: + r"""Get a batch + + Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + + :param id: The batch job id returned from submit. + :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetBatchesRequest( + http_referer=http_referer, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/batches/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=operations.GetBatchesGlobals( + http_referer=self.sdk_configuration.globals.http_referer, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, + ), + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getBatches", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + tags=["Batch"], + 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.BatchObject, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + errors.BatchPaymentRequiredResponseErrorData, http_res + ) + raise errors.BatchPaymentRequiredResponseError(response_data, http_res) + if utils.match_response(http_res, ["401", "404", "429"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(response_data, http_res) + if utils.match_response(http_res, ["500", "502"], "application/json"): + response_data = unmarshal_json_response( + errors.BatchErrorResponseData, http_res + ) + raise errors.BatchErrorResponse(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/components/__init__.py b/src/openrouter/components/__init__.py index 471fad91..53174068 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -61,6 +61,11 @@ AnthropicAdvisorMessageUsageIterationType, AnthropicAdvisorMessageUsageIterationTypedDict, ) + from .anthropicadvisortoolresult import ( + AnthropicAdvisorToolResult, + AnthropicAdvisorToolResultType, + AnthropicAdvisorToolResultTypedDict, + ) from .anthropicallowedcallers import AnthropicAllowedCallers from .anthropicbase64imagesource import ( AnthropicBase64ImageSource, @@ -73,6 +78,32 @@ AnthropicBase64PdfSourceType, AnthropicBase64PdfSourceTypedDict, ) + from .anthropicbashcodeexecutioncontent import ( + AnthropicBashCodeExecutionContent, + AnthropicBashCodeExecutionContentTypedDict, + UnknownAnthropicBashCodeExecutionContent, + ) + from .anthropicbashcodeexecutionoutput import ( + AnthropicBashCodeExecutionOutput, + AnthropicBashCodeExecutionOutputType, + AnthropicBashCodeExecutionOutputTypedDict, + ) + from .anthropicbashcodeexecutionresult import ( + AnthropicBashCodeExecutionResult, + AnthropicBashCodeExecutionResultType, + AnthropicBashCodeExecutionResultTypedDict, + ) + from .anthropicbashcodeexecutiontoolresult import ( + AnthropicBashCodeExecutionToolResult, + AnthropicBashCodeExecutionToolResultType, + AnthropicBashCodeExecutionToolResultTypedDict, + ) + from .anthropicbashcodeexecutiontoolresulterror import ( + AnthropicBashCodeExecutionToolResultError, + AnthropicBashCodeExecutionToolResultErrorErrorCode, + AnthropicBashCodeExecutionToolResultErrorType, + AnthropicBashCodeExecutionToolResultErrorTypedDict, + ) from .anthropiccachecontroldirective import ( AnthropicCacheControlDirective, AnthropicCacheControlDirectiveType, @@ -83,36 +114,134 @@ AnthropicCacheCreation, AnthropicCacheCreationTypedDict, ) + from .anthropiccaller import ( + AnthropicCaller, + AnthropicCallerTypedDict, + UnknownAnthropicCaller, + ) + from .anthropiccitationcharlocation import ( + AnthropicCitationCharLocation, + AnthropicCitationCharLocationType, + AnthropicCitationCharLocationTypedDict, + ) from .anthropiccitationcharlocationparam import ( AnthropicCitationCharLocationParam, AnthropicCitationCharLocationParamType, AnthropicCitationCharLocationParamTypedDict, ) + from .anthropiccitationcontentblocklocation import ( + AnthropicCitationContentBlockLocation, + AnthropicCitationContentBlockLocationType, + AnthropicCitationContentBlockLocationTypedDict, + ) from .anthropiccitationcontentblocklocationparam import ( AnthropicCitationContentBlockLocationParam, AnthropicCitationContentBlockLocationParamType, AnthropicCitationContentBlockLocationParamTypedDict, ) + from .anthropiccitationpagelocation import ( + AnthropicCitationPageLocation, + AnthropicCitationPageLocationType, + AnthropicCitationPageLocationTypedDict, + ) from .anthropiccitationpagelocationparam import ( AnthropicCitationPageLocationParam, AnthropicCitationPageLocationParamType, AnthropicCitationPageLocationParamTypedDict, ) + from .anthropiccitationsconfig import ( + AnthropicCitationsConfig, + AnthropicCitationsConfigTypedDict, + ) + 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 .anthropiccodeexecution20250825caller import ( + AnthropicCodeExecution20250825Caller, + AnthropicCodeExecution20250825CallerType, + AnthropicCodeExecution20250825CallerTypedDict, + ) + from .anthropiccodeexecution20260120caller import ( + AnthropicCodeExecution20260120Caller, + AnthropicCodeExecution20260120CallerType, + AnthropicCodeExecution20260120CallerTypedDict, + ) + from .anthropiccodeexecutioncontent import ( + AnthropicCodeExecutionContent, + AnthropicCodeExecutionContentTypedDict, + UnknownAnthropicCodeExecutionContent, + ) + from .anthropiccodeexecutionoutput import ( + AnthropicCodeExecutionOutput, + AnthropicCodeExecutionOutputType, + AnthropicCodeExecutionOutputTypedDict, + ) + from .anthropiccodeexecutionresult import ( + AnthropicCodeExecutionResult, + AnthropicCodeExecutionResultType, + AnthropicCodeExecutionResultTypedDict, + ) + from .anthropiccodeexecutiontoolresult import ( + AnthropicCodeExecutionToolResult, + AnthropicCodeExecutionToolResultType, + AnthropicCodeExecutionToolResultTypedDict, + ) + from .anthropiccodeexecutiontoolresulterror import ( + AnthropicCodeExecutionToolResultError, + AnthropicCodeExecutionToolResultErrorType, + AnthropicCodeExecutionToolResultErrorTypedDict, + ) + from .anthropiccompactionblock import ( + AnthropicCompactionBlock, + AnthropicCompactionBlockType, + AnthropicCompactionBlockTypedDict, + ) from .anthropiccompactionusageiteration import ( AnthropicCompactionUsageIteration, AnthropicCompactionUsageIterationType, AnthropicCompactionUsageIterationTypedDict, ) + from .anthropiccontainer import AnthropicContainer, AnthropicContainerTypedDict + from .anthropiccontainerskill import ( + AnthropicContainerSkill, + AnthropicContainerSkillType, + AnthropicContainerSkillTypedDict, + ) + from .anthropiccontainerupload import ( + AnthropicContainerUpload, + AnthropicContainerUploadType, + AnthropicContainerUploadTypedDict, + ) + from .anthropicdirectcaller import ( + AnthropicDirectCaller, + AnthropicDirectCallerType, + AnthropicDirectCallerTypedDict, + ) + from .anthropicdocumentblock import ( + AnthropicDocumentBlock, + AnthropicDocumentBlockSource, + AnthropicDocumentBlockSourceTypedDict, + AnthropicDocumentBlockType, + AnthropicDocumentBlockTypedDict, + UnknownAnthropicDocumentBlockSource, + ) from .anthropicdocumentblockparam import ( AnthropicDocumentBlockParam, AnthropicDocumentBlockParamCitations, @@ -123,11 +252,16 @@ AnthropicDocumentBlockParamContent2TypedDict, AnthropicDocumentBlockParamSourceUnion, AnthropicDocumentBlockParamSourceUnionTypedDict, + AnthropicDocumentBlockParamTypeDocument, AnthropicDocumentBlockParamTypedDict, SourceContent, SourceContentTypedDict, SourceType, - TypeDocument, + ) + from .anthropicencryptedcodeexecutionresult import ( + AnthropicEncryptedCodeExecutionResult, + AnthropicEncryptedCodeExecutionResultType, + AnthropicEncryptedCodeExecutionResultTypedDict, ) from .anthropicfile import ( AnthropicFile, @@ -169,6 +303,10 @@ AnthropicInputTokensTriggerType, AnthropicInputTokensTriggerTypedDict, ) + from .anthropicinputtransformation import ( + AnthropicInputTransformation, + AnthropicInputTransformationTypedDict, + ) from .anthropiciterationcachecreation import ( AnthropicIterationCacheCreation, AnthropicIterationCacheCreationTypedDict, @@ -183,12 +321,27 @@ AnthropicMessageUsageIterationTypedDict, ) from .anthropicoutputeffort import AnthropicOutputEffort + from .anthropicoutputtokensdetails import ( + AnthropicOutputTokensDetails, + AnthropicOutputTokensDetailsTypedDict, + ) from .anthropicplaintextsource import ( AnthropicPlainTextSource, AnthropicPlainTextSourceMediaType, AnthropicPlainTextSourceType, AnthropicPlainTextSourceTypedDict, ) + from .anthropicredactedthinkingblock import ( + AnthropicRedactedThinkingBlock, + AnthropicRedactedThinkingBlockType, + AnthropicRedactedThinkingBlockTypedDict, + ) + from .anthropicrefusalstopdetails import ( + AnthropicRefusalStopDetails, + AnthropicRefusalStopDetailsCategory, + AnthropicRefusalStopDetailsType, + AnthropicRefusalStopDetailsTypedDict, + ) from .anthropicsafeguard import AnthropicSafeguard, AnthropicSafeguardTypedDict from .anthropicsearchresultblockparam import ( AnthropicSearchResultBlockParam, @@ -197,8 +350,19 @@ AnthropicSearchResultBlockParamType, AnthropicSearchResultBlockParamTypedDict, ) + from .anthropicservertoolerrorcode import AnthropicServerToolErrorCode + from .anthropicservertoolusage import ( + AnthropicServerToolUsage, + AnthropicServerToolUsageTypedDict, + ) + from .anthropicservicetier import AnthropicServiceTier from .anthropicspeed import AnthropicSpeed from .anthropicsystemclearat import AnthropicSystemClearAt + from .anthropictextblock import ( + AnthropicTextBlock, + AnthropicTextBlockType, + AnthropicTextBlockTypedDict, + ) from .anthropictextblockparam import ( AnthropicTextBlockParam, AnthropicTextBlockParamType, @@ -206,6 +370,48 @@ Citation, CitationTypedDict, ) + from .anthropictextcitation import ( + AnthropicTextCitation, + AnthropicTextCitationTypedDict, + UnknownAnthropicTextCitation, + ) + from .anthropictexteditorcodeexecutioncontent import ( + AnthropicTextEditorCodeExecutionContent, + AnthropicTextEditorCodeExecutionContentTypedDict, + UnknownAnthropicTextEditorCodeExecutionContent, + ) + from .anthropictexteditorcodeexecutioncreateresult import ( + AnthropicTextEditorCodeExecutionCreateResult, + AnthropicTextEditorCodeExecutionCreateResultType, + AnthropicTextEditorCodeExecutionCreateResultTypedDict, + ) + from .anthropictexteditorcodeexecutionstrreplaceresult import ( + AnthropicTextEditorCodeExecutionStrReplaceResult, + AnthropicTextEditorCodeExecutionStrReplaceResultType, + AnthropicTextEditorCodeExecutionStrReplaceResultTypedDict, + ) + from .anthropictexteditorcodeexecutiontoolresult import ( + AnthropicTextEditorCodeExecutionToolResult, + AnthropicTextEditorCodeExecutionToolResultType, + AnthropicTextEditorCodeExecutionToolResultTypedDict, + ) + from .anthropictexteditorcodeexecutiontoolresulterror import ( + AnthropicTextEditorCodeExecutionToolResultError, + AnthropicTextEditorCodeExecutionToolResultErrorErrorCode, + AnthropicTextEditorCodeExecutionToolResultErrorType, + AnthropicTextEditorCodeExecutionToolResultErrorTypedDict, + ) + from .anthropictexteditorcodeexecutionviewresult import ( + AnthropicTextEditorCodeExecutionViewResult, + AnthropicTextEditorCodeExecutionViewResultType, + AnthropicTextEditorCodeExecutionViewResultTypedDict, + FileType, + ) + from .anthropicthinkingblock import ( + AnthropicThinkingBlock, + AnthropicThinkingBlockType, + AnthropicThinkingBlockTypedDict, + ) from .anthropicthinkingblockbinding import ( AnthropicThinkingBlockBinding, AnthropicThinkingBlockBindingTypedDict, @@ -218,6 +424,26 @@ AnthropicThinkingTurnsType, AnthropicThinkingTurnsTypedDict, ) + from .anthropictoolreference import ( + AnthropicToolReference, + AnthropicToolReferenceType, + AnthropicToolReferenceTypedDict, + ) + from .anthropictoolsearchcontent import ( + AnthropicToolSearchContent, + AnthropicToolSearchContentTypedDict, + UnknownAnthropicToolSearchContent, + ) + from .anthropictoolsearchresult import ( + AnthropicToolSearchResult, + AnthropicToolSearchResultType, + AnthropicToolSearchResultTypedDict, + ) + from .anthropictoolsearchresulterror import ( + AnthropicToolSearchResultError, + AnthropicToolSearchResultErrorType, + AnthropicToolSearchResultErrorTypedDict, + ) from .anthropictoolsearchtoolbm25 import ( AnthropicToolSearchToolBm25, AnthropicToolSearchToolBm25Name, @@ -230,6 +456,16 @@ AnthropicToolSearchToolRegexType, AnthropicToolSearchToolRegexTypedDict, ) + from .anthropictoolsearchtoolresult import ( + AnthropicToolSearchToolResult, + AnthropicToolSearchToolResultType, + AnthropicToolSearchToolResultTypedDict, + ) + from .anthropictooluseblock import ( + AnthropicToolUseBlock, + AnthropicToolUseBlockType, + AnthropicToolUseBlockTypedDict, + ) from .anthropictooluseskeep import ( AnthropicToolUsesKeep, AnthropicToolUsesKeepType, @@ -258,11 +494,50 @@ AnthropicUsageIteration, AnthropicUsageIterationTypedDict, ) + from .anthropicwebfetchblock import ( + AnthropicWebFetchBlock, + AnthropicWebFetchBlockType, + AnthropicWebFetchBlockTypedDict, + ) + from .anthropicwebfetchcontent import ( + AnthropicWebFetchContent, + AnthropicWebFetchContentTypedDict, + UnknownAnthropicWebFetchContent, + ) + from .anthropicwebfetchtoolresult import ( + AnthropicWebFetchToolResult, + AnthropicWebFetchToolResultType, + AnthropicWebFetchToolResultTypedDict, + ) + from .anthropicwebfetchtoolresulterror import ( + AnthropicWebFetchToolResultError, + AnthropicWebFetchToolResultErrorErrorCode, + AnthropicWebFetchToolResultErrorType, + AnthropicWebFetchToolResultErrorTypedDict, + ) + from .anthropicwebsearchresult import ( + AnthropicWebSearchResult, + AnthropicWebSearchResultType, + AnthropicWebSearchResultTypedDict, + ) from .anthropicwebsearchresultblockparam import ( AnthropicWebSearchResultBlockParam, AnthropicWebSearchResultBlockParamType, AnthropicWebSearchResultBlockParamTypedDict, ) + from .anthropicwebsearchtoolresult import ( + AnthropicWebSearchToolResult, + AnthropicWebSearchToolResultContent, + AnthropicWebSearchToolResultContentTypedDict, + AnthropicWebSearchToolResultType, + AnthropicWebSearchToolResultTypedDict, + ) + from .anthropicwebsearchtoolresulterror import ( + AnthropicWebSearchToolResultError, + AnthropicWebSearchToolResultErrorErrorCode, + AnthropicWebSearchToolResultErrorType, + AnthropicWebSearchToolResultErrorTypedDict, + ) from .anthropicwebsearchtooluserlocation import ( AnthropicWebSearchToolUserLocation, AnthropicWebSearchToolUserLocationType, @@ -387,6 +662,200 @@ BashServerToolEnvironment, BashServerToolEnvironmentTypedDict, ) + from .batchdeletedobject import ( + BatchDeletedObject, + BatchDeletedObjectObject, + BatchDeletedObjectTypedDict, + ) + from .batchdeletionoutcome import BatchDeletionOutcome + from .batchdeletiontargets import ( + BatchDeletionTargets, + BatchDeletionTargetsTypedDict, + Openrouter, + Upstream, + UpstreamTypedDict, + ) + from .batcherrorresponse import ( + BatchErrorResponseError, + BatchErrorResponseErrorTypedDict, + ) + from .batchlistitem import ( + BatchListItem, + BatchListItemCompletionTokensDetails, + BatchListItemCompletionTokensDetailsTypedDict, + BatchListItemCompletionWindow, + BatchListItemError, + BatchListItemErrorTypedDict, + BatchListItemObject, + BatchListItemPromptTokensDetails, + BatchListItemPromptTokensDetailsTypedDict, + BatchListItemRequestCounts, + BatchListItemRequestCountsTypedDict, + BatchListItemServerToolUse, + BatchListItemServerToolUseTypedDict, + BatchListItemStatus, + BatchListItemTypedDict, + BatchListItemUsage, + BatchListItemUsageTypedDict, + ) + from .batchlistresponse import ( + BatchListResponse, + BatchListResponseObject, + BatchListResponseTypedDict, + ) + from .batchliststatus import BatchListStatus + from .batchlisttimestamp import BatchListTimestamp, BatchListTimestampTypedDict + from .batchobject import ( + Annotation, + AnnotationContentUnion, + AnnotationContentUnionTypedDict, + AnnotationFile, + AnnotationFileTypedDict, + AnnotationTypeFile, + AnnotationTypeURLCitation, + AnnotationTypedDict, + AnnotationURLCitation, + AnnotationURLCitationTypedDict, + AnnotationWebSearchCitation, + AnnotationWebSearchCitationTypedDict, + BatchObject, + BatchObjectCompletionTokensDetails, + BatchObjectCompletionTokensDetailsTypedDict, + BatchObjectCompletionWindow, + BatchObjectData, + BatchObjectDataTypedDict, + BatchObjectDebug, + BatchObjectDebugTypedDict, + BatchObjectError, + BatchObjectErrorTypedDict, + BatchObjectEvent, + BatchObjectFile, + BatchObjectFileTypedDict, + BatchObjectFunction, + BatchObjectFunctionTypedDict, + BatchObjectImageURL, + BatchObjectImageURLTypedDict, + BatchObjectObjectBatch, + BatchObjectPromptTokensDetails, + BatchObjectPromptTokensDetailsTypedDict, + BatchObjectRequestCounts, + BatchObjectRequestCountsTypedDict, + BatchObjectResponse, + BatchObjectResponseTypedDict, + BatchObjectRole, + BatchObjectServerToolUse, + BatchObjectServerToolUseDetails, + BatchObjectServerToolUseDetailsTypedDict, + BatchObjectServerToolUseTypedDict, + BatchObjectStatus, + BatchObjectTimings, + BatchObjectTimingsTypedDict, + BatchObjectTypeMessage, + BatchObjectTypedDict, + BatchObjectURLCitation, + BatchObjectURLCitationTypedDict, + BatchObjectUsage, + BatchObjectUsageTypedDict, + Body, + BodyChatCompletion, + BodyChatCompletionTypedDict, + BodyCompletionTokensDetails, + BodyCompletionTokensDetailsTypedDict, + BodyList, + BodyListTypedDict, + BodyMessage, + BodyMessageTypedDict, + BodyObjectChatCompletion, + BodyObjectList, + BodyPromptTokensDetails1, + BodyPromptTokensDetails1TypedDict, + BodyPromptTokensDetails2, + BodyPromptTokensDetails2TypedDict, + BodyServerToolUse, + BodyServerToolUseTypedDict, + BodyTypedDict, + BodyUsage1, + BodyUsage1TypedDict, + BodyUsage2, + BodyUsage2TypedDict, + BodyUsage3, + BodyUsage3TypedDict, + Choice, + ChoiceRole, + ChoiceTypeFunction, + ChoiceTypeImageURL, + ChoiceTypedDict, + ContentImageURL, + ContentImageURLImageURL, + ContentImageURLImageURLTypedDict, + ContentImageURLTypedDict, + ContentText, + ContentTextTypedDict, + ContentTopLogprob, + ContentTopLogprobTypedDict, + Embedding, + EmbeddingTypedDict, + FileTypeImageURL, + FileTypeText, + Image, + ImageTypedDict, + Logprobs, + LogprobsContent, + LogprobsContentTypedDict, + LogprobsTypedDict, + Message, + MessageTypedDict, + ObjectEmbedding, + ReasoningDetail, + ReasoningDetailTypedDict, + Refusal, + RefusalTopLogprob, + RefusalTopLogprobTypedDict, + RefusalTypedDict, + Result, + ResultError, + ResultErrorTypedDict, + ResultTypedDict, + ToolCall, + ToolCallTypedDict, + TypeWebSearchCitation, + UnknownAnnotation, + UnknownAnnotationContentUnion, + UnknownReasoningDetail, + WebSearchCitation, + WebSearchCitationTypedDict, + ) + from .batchpaymentrequiredresponse_error import ( + BatchPaymentRequiredResponseCompletionTokensDetails, + BatchPaymentRequiredResponseCompletionTokensDetailsTypedDict, + BatchPaymentRequiredResponseCompletionWindow, + BatchPaymentRequiredResponseError, + BatchPaymentRequiredResponseErrorTypedDict, + BatchPaymentRequiredResponseObject, + BatchPaymentRequiredResponsePromptTokensDetails, + BatchPaymentRequiredResponsePromptTokensDetailsTypedDict, + BatchPaymentRequiredResponseRequestCounts, + BatchPaymentRequiredResponseRequestCountsTypedDict, + BatchPaymentRequiredResponseServerToolUse, + BatchPaymentRequiredResponseServerToolUseTypedDict, + BatchPaymentRequiredResponseStatus, + BatchPaymentRequiredResponseUsage, + BatchPaymentRequiredResponseUsageTypedDict, + ) + from .batchproviderpreferences import ( + BatchProviderPreferences, + BatchProviderPreferencesOnly, + BatchProviderPreferencesOnlyTypedDict, + BatchProviderPreferencesTypedDict, + ) + from .batchsubmitbody import ( + BatchSubmitBody, + BatchSubmitBodyCompletionWindow, + BatchSubmitBodyTypedDict, + Endpoint, + Request, + RequestTypedDict, + ) from .booleancapability import ( BooleanCapability, BooleanCapabilityType, @@ -976,14 +1445,14 @@ DatetimeServerToolConfigTypedDict, ) from .debugevent import ( - Debug, DebugEvent, + DebugEventDebug, + DebugEventDebugTypedDict, + DebugEventEvent, + DebugEventTimings, + DebugEventTimingsTypedDict, DebugEventType, DebugEventTypedDict, - DebugTypedDict, - Event, - Timings, - TimingsTypedDict, ) from .decisionschoiceanswer import ( DecisionsChoiceAnswer, @@ -1162,6 +1631,7 @@ FilesServerToolConfig, FilesServerToolConfigTypedDict, ) + from .finishreason import FinishReason from .forbiddenresponseerrordata import ( ForbiddenResponseErrorData, ForbiddenResponseErrorDataTypedDict, @@ -1471,9 +1941,9 @@ ImageGenerationUsageCompletionTokensDetailsTypedDict, ImageGenerationUsagePromptTokensDetails, ImageGenerationUsagePromptTokensDetailsTypedDict, + ImageGenerationUsageServerToolUse, + ImageGenerationUsageServerToolUseTypedDict, ImageGenerationUsageTypedDict, - ServerToolUse, - ServerToolUseTypedDict, ) from .imagegenpartialimageevent import ( ImageGenPartialImageEvent, @@ -1616,8 +2086,8 @@ InternChatAssistantMessageTypedDict, ) from .internchatchoice import ( - FinishReason, InternChatChoice, + InternChatChoiceFinishReason, InternChatChoiceTypedDict, ) from .internchatcompletionchunk import ( @@ -1868,8 +2338,8 @@ MessagesBashToolResultBlockFile, MessagesBashToolResultBlockFileTypedDict, MessagesBashToolResultBlockTypeContainerFileCitation, + MessagesBashToolResultBlockTypeOpenrouterBashToolResult, MessagesBashToolResultBlockTypedDict, - TypeOpenrouterBashToolResult, ) from .messagesfallbackparam import ( MessagesFallbackParam, @@ -1894,7 +2364,6 @@ ContentWebSearchToolResultError, ContentWebSearchToolResultErrorTypedDict, ContentWebSearchToolResultTypedDict, - ErrorCode, MessagesMessageParam, MessagesMessageParamContentUnion1, MessagesMessageParamContentUnion1TypedDict, @@ -1906,17 +2375,18 @@ MessagesMessageParamContentUnion4TypedDict, MessagesMessageParamContentUnion5, MessagesMessageParamContentUnion5TypedDict, + MessagesMessageParamErrorCode, MessagesMessageParamRole, MessagesMessageParamTypeCompaction, + MessagesMessageParamTypeRedactedThinking, + MessagesMessageParamTypeServerToolUse, + MessagesMessageParamTypeThinking, MessagesMessageParamTypeToolReference, + MessagesMessageParamTypeToolUse, + MessagesMessageParamTypeWebSearchToolResult, + MessagesMessageParamTypeWebSearchToolResultError, MessagesMessageParamTypedDict, - TypeRedactedThinking, - TypeServerToolUse, - TypeThinking, TypeToolResult, - TypeToolUse, - TypeWebSearchToolResult, - TypeWebSearchToolResultError, ) from .messagesoutputconfig import ( MessagesOutputConfig, @@ -2030,8 +2500,8 @@ MessagesShellToolResultBlockFile, MessagesShellToolResultBlockFileTypedDict, MessagesShellToolResultBlockTypeContainerFileCitation, + MessagesShellToolResultBlockTypeOpenrouterShellToolResult, MessagesShellToolResultBlockTypedDict, - TypeOpenrouterShellToolResult, ) from .messagestooladditionblock import ( MessagesToolAdditionBlock, @@ -2419,6 +2889,38 @@ OpenRouterWebSearchServerToolType, OpenRouterWebSearchServerToolTypedDict, ) + from .oranthropicbashtoolresult import ( + ORAnthropicBashToolResult, + ORAnthropicBashToolResultFile, + ORAnthropicBashToolResultFileTypedDict, + ORAnthropicBashToolResultTypeContainerFileCitation, + ORAnthropicBashToolResultTypeOpenrouterBashToolResult, + ORAnthropicBashToolResultTypedDict, + ) + from .oranthropiccontentblock import ( + ORAnthropicContentBlock, + ORAnthropicContentBlockTypedDict, + UnknownORAnthropicContentBlock, + ) + from .oranthropicnullablecaller import ( + ORAnthropicNullableCaller, + ORAnthropicNullableCallerTypedDict, + UnknownORAnthropicNullableCaller, + ) + from .oranthropicservertooluseblock import ( + ORAnthropicServerToolUseBlock, + ORAnthropicServerToolUseBlockType, + ORAnthropicServerToolUseBlockTypedDict, + ) + from .oranthropicshelltoolresult import ( + ORAnthropicShellToolResult, + ORAnthropicShellToolResultFile, + ORAnthropicShellToolResultFileTypedDict, + ORAnthropicShellToolResultTypeContainerFileCitation, + ORAnthropicShellToolResultTypeOpenrouterShellToolResult, + ORAnthropicShellToolResultTypedDict, + ) + from .oranthropicstopreason import ORAnthropicStopReason from .outputadvisorservertoolitem import ( OutputAdvisorServerToolItem, OutputAdvisorServerToolItemType, @@ -2511,10 +3013,10 @@ FailedModel, FailedModelTypedDict, OutputFusionServerToolItem, + OutputFusionServerToolItemResponse, + OutputFusionServerToolItemResponseTypedDict, OutputFusionServerToolItemType, OutputFusionServerToolItemTypedDict, - Response, - ResponseTypedDict, ) from .outputimagegenerationcallitem import ( OutputImageGenerationCallItem, @@ -3185,8 +3687,8 @@ SubagentServerToolConfigTypedDict, ) from .submitgenerationfeedbackrequest import ( - Category, SubmitGenerationFeedbackRequest, + SubmitGenerationFeedbackRequestCategory, SubmitGenerationFeedbackRequestTypedDict, ) from .submitgenerationfeedbackresponse import ( @@ -3576,14 +4078,29 @@ "AllowedToolsUnionTypedDict", "Always", "AlwaysTypedDict", + "Annotation", "AnnotationAddedEvent", "AnnotationAddedEventType", "AnnotationAddedEventTypedDict", + "AnnotationContentUnion", + "AnnotationContentUnionTypedDict", + "AnnotationFile", + "AnnotationFileTypedDict", + "AnnotationTypeFile", + "AnnotationTypeURLCitation", + "AnnotationTypedDict", + "AnnotationURLCitation", + "AnnotationURLCitationTypedDict", + "AnnotationWebSearchCitation", + "AnnotationWebSearchCitationTypedDict", "Answers", "AnswersTypedDict", "AnthropicAdvisorMessageUsageIteration", "AnthropicAdvisorMessageUsageIterationType", "AnthropicAdvisorMessageUsageIterationTypedDict", + "AnthropicAdvisorToolResult", + "AnthropicAdvisorToolResultType", + "AnthropicAdvisorToolResultTypedDict", "AnthropicAllowedCallers", "AnthropicBase64ImageSource", "AnthropicBase64ImageSourceType", @@ -3592,30 +4109,99 @@ "AnthropicBase64PdfSourceMediaType", "AnthropicBase64PdfSourceType", "AnthropicBase64PdfSourceTypedDict", + "AnthropicBashCodeExecutionContent", + "AnthropicBashCodeExecutionContentTypedDict", + "AnthropicBashCodeExecutionOutput", + "AnthropicBashCodeExecutionOutputType", + "AnthropicBashCodeExecutionOutputTypedDict", + "AnthropicBashCodeExecutionResult", + "AnthropicBashCodeExecutionResultType", + "AnthropicBashCodeExecutionResultTypedDict", + "AnthropicBashCodeExecutionToolResult", + "AnthropicBashCodeExecutionToolResultError", + "AnthropicBashCodeExecutionToolResultErrorErrorCode", + "AnthropicBashCodeExecutionToolResultErrorType", + "AnthropicBashCodeExecutionToolResultErrorTypedDict", + "AnthropicBashCodeExecutionToolResultType", + "AnthropicBashCodeExecutionToolResultTypedDict", "AnthropicCacheControlDirective", "AnthropicCacheControlDirectiveType", "AnthropicCacheControlDirectiveTypedDict", "AnthropicCacheControlTTL", "AnthropicCacheCreation", "AnthropicCacheCreationTypedDict", + "AnthropicCaller", + "AnthropicCallerTypedDict", + "AnthropicCitationCharLocation", "AnthropicCitationCharLocationParam", "AnthropicCitationCharLocationParamType", "AnthropicCitationCharLocationParamTypedDict", + "AnthropicCitationCharLocationType", + "AnthropicCitationCharLocationTypedDict", + "AnthropicCitationContentBlockLocation", "AnthropicCitationContentBlockLocationParam", "AnthropicCitationContentBlockLocationParamType", "AnthropicCitationContentBlockLocationParamTypedDict", + "AnthropicCitationContentBlockLocationType", + "AnthropicCitationContentBlockLocationTypedDict", + "AnthropicCitationPageLocation", "AnthropicCitationPageLocationParam", "AnthropicCitationPageLocationParamType", "AnthropicCitationPageLocationParamTypedDict", + "AnthropicCitationPageLocationType", + "AnthropicCitationPageLocationTypedDict", + "AnthropicCitationSearchResultLocation", "AnthropicCitationSearchResultLocationParam", "AnthropicCitationSearchResultLocationParamType", "AnthropicCitationSearchResultLocationParamTypedDict", + "AnthropicCitationSearchResultLocationType", + "AnthropicCitationSearchResultLocationTypedDict", + "AnthropicCitationWebSearchResultLocation", "AnthropicCitationWebSearchResultLocationParam", "AnthropicCitationWebSearchResultLocationParamType", "AnthropicCitationWebSearchResultLocationParamTypedDict", + "AnthropicCitationWebSearchResultLocationType", + "AnthropicCitationWebSearchResultLocationTypedDict", + "AnthropicCitationsConfig", + "AnthropicCitationsConfigTypedDict", + "AnthropicCodeExecution20250825Caller", + "AnthropicCodeExecution20250825CallerType", + "AnthropicCodeExecution20250825CallerTypedDict", + "AnthropicCodeExecution20260120Caller", + "AnthropicCodeExecution20260120CallerType", + "AnthropicCodeExecution20260120CallerTypedDict", + "AnthropicCodeExecutionContent", + "AnthropicCodeExecutionContentTypedDict", + "AnthropicCodeExecutionOutput", + "AnthropicCodeExecutionOutputType", + "AnthropicCodeExecutionOutputTypedDict", + "AnthropicCodeExecutionResult", + "AnthropicCodeExecutionResultType", + "AnthropicCodeExecutionResultTypedDict", + "AnthropicCodeExecutionToolResult", + "AnthropicCodeExecutionToolResultError", + "AnthropicCodeExecutionToolResultErrorType", + "AnthropicCodeExecutionToolResultErrorTypedDict", + "AnthropicCodeExecutionToolResultType", + "AnthropicCodeExecutionToolResultTypedDict", + "AnthropicCompactionBlock", + "AnthropicCompactionBlockType", + "AnthropicCompactionBlockTypedDict", "AnthropicCompactionUsageIteration", "AnthropicCompactionUsageIterationType", "AnthropicCompactionUsageIterationTypedDict", + "AnthropicContainer", + "AnthropicContainerSkill", + "AnthropicContainerSkillType", + "AnthropicContainerSkillTypedDict", + "AnthropicContainerTypedDict", + "AnthropicContainerUpload", + "AnthropicContainerUploadType", + "AnthropicContainerUploadTypedDict", + "AnthropicDirectCaller", + "AnthropicDirectCallerType", + "AnthropicDirectCallerTypedDict", + "AnthropicDocumentBlock", "AnthropicDocumentBlockParam", "AnthropicDocumentBlockParamCitations", "AnthropicDocumentBlockParamCitationsTypedDict", @@ -3625,7 +4211,15 @@ "AnthropicDocumentBlockParamContent2TypedDict", "AnthropicDocumentBlockParamSourceUnion", "AnthropicDocumentBlockParamSourceUnionTypedDict", + "AnthropicDocumentBlockParamTypeDocument", "AnthropicDocumentBlockParamTypedDict", + "AnthropicDocumentBlockSource", + "AnthropicDocumentBlockSourceTypedDict", + "AnthropicDocumentBlockType", + "AnthropicDocumentBlockTypedDict", + "AnthropicEncryptedCodeExecutionResult", + "AnthropicEncryptedCodeExecutionResultType", + "AnthropicEncryptedCodeExecutionResultTypedDict", "AnthropicFile", "AnthropicFileDeleted", "AnthropicFileDeletedShape", @@ -3652,6 +4246,8 @@ "AnthropicInputTokensTrigger", "AnthropicInputTokensTriggerType", "AnthropicInputTokensTriggerTypedDict", + "AnthropicInputTransformation", + "AnthropicInputTransformationTypedDict", "AnthropicIterationCacheCreation", "AnthropicIterationCacheCreationTypedDict", "AnthropicMessageOutputConfig", @@ -3660,10 +4256,19 @@ "AnthropicMessageUsageIterationType", "AnthropicMessageUsageIterationTypedDict", "AnthropicOutputEffort", + "AnthropicOutputTokensDetails", + "AnthropicOutputTokensDetailsTypedDict", "AnthropicPlainTextSource", "AnthropicPlainTextSourceMediaType", "AnthropicPlainTextSourceType", "AnthropicPlainTextSourceTypedDict", + "AnthropicRedactedThinkingBlock", + "AnthropicRedactedThinkingBlockType", + "AnthropicRedactedThinkingBlockTypedDict", + "AnthropicRefusalStopDetails", + "AnthropicRefusalStopDetailsCategory", + "AnthropicRefusalStopDetailsType", + "AnthropicRefusalStopDetailsTypedDict", "AnthropicSafeguard", "AnthropicSafeguardTypedDict", "AnthropicSearchResultBlockParam", @@ -3671,17 +4276,58 @@ "AnthropicSearchResultBlockParamCitationsTypedDict", "AnthropicSearchResultBlockParamType", "AnthropicSearchResultBlockParamTypedDict", + "AnthropicServerToolErrorCode", + "AnthropicServerToolUsage", + "AnthropicServerToolUsageTypedDict", + "AnthropicServiceTier", "AnthropicSpeed", "AnthropicSystemClearAt", + "AnthropicTextBlock", "AnthropicTextBlockParam", "AnthropicTextBlockParamType", "AnthropicTextBlockParamTypedDict", + "AnthropicTextBlockType", + "AnthropicTextBlockTypedDict", + "AnthropicTextCitation", + "AnthropicTextCitationTypedDict", + "AnthropicTextEditorCodeExecutionContent", + "AnthropicTextEditorCodeExecutionContentTypedDict", + "AnthropicTextEditorCodeExecutionCreateResult", + "AnthropicTextEditorCodeExecutionCreateResultType", + "AnthropicTextEditorCodeExecutionCreateResultTypedDict", + "AnthropicTextEditorCodeExecutionStrReplaceResult", + "AnthropicTextEditorCodeExecutionStrReplaceResultType", + "AnthropicTextEditorCodeExecutionStrReplaceResultTypedDict", + "AnthropicTextEditorCodeExecutionToolResult", + "AnthropicTextEditorCodeExecutionToolResultError", + "AnthropicTextEditorCodeExecutionToolResultErrorErrorCode", + "AnthropicTextEditorCodeExecutionToolResultErrorType", + "AnthropicTextEditorCodeExecutionToolResultErrorTypedDict", + "AnthropicTextEditorCodeExecutionToolResultType", + "AnthropicTextEditorCodeExecutionToolResultTypedDict", + "AnthropicTextEditorCodeExecutionViewResult", + "AnthropicTextEditorCodeExecutionViewResultType", + "AnthropicTextEditorCodeExecutionViewResultTypedDict", + "AnthropicThinkingBlock", "AnthropicThinkingBlockBinding", "AnthropicThinkingBlockBindingTypedDict", + "AnthropicThinkingBlockType", + "AnthropicThinkingBlockTypedDict", "AnthropicThinkingDisplay", "AnthropicThinkingTurns", "AnthropicThinkingTurnsType", "AnthropicThinkingTurnsTypedDict", + "AnthropicToolReference", + "AnthropicToolReferenceType", + "AnthropicToolReferenceTypedDict", + "AnthropicToolSearchContent", + "AnthropicToolSearchContentTypedDict", + "AnthropicToolSearchResult", + "AnthropicToolSearchResultError", + "AnthropicToolSearchResultErrorType", + "AnthropicToolSearchResultErrorTypedDict", + "AnthropicToolSearchResultType", + "AnthropicToolSearchResultTypedDict", "AnthropicToolSearchToolBm25", "AnthropicToolSearchToolBm25Name", "AnthropicToolSearchToolBm25Type", @@ -3690,6 +4336,12 @@ "AnthropicToolSearchToolRegexName", "AnthropicToolSearchToolRegexType", "AnthropicToolSearchToolRegexTypedDict", + "AnthropicToolSearchToolResult", + "AnthropicToolSearchToolResultType", + "AnthropicToolSearchToolResultTypedDict", + "AnthropicToolUseBlock", + "AnthropicToolUseBlockType", + "AnthropicToolUseBlockTypedDict", "AnthropicToolUsesKeep", "AnthropicToolUsesKeepType", "AnthropicToolUsesKeepTypedDict", @@ -3706,9 +4358,33 @@ "AnthropicUnknownUsageIterationTypedDict", "AnthropicUsageIteration", "AnthropicUsageIterationTypedDict", + "AnthropicWebFetchBlock", + "AnthropicWebFetchBlockType", + "AnthropicWebFetchBlockTypedDict", + "AnthropicWebFetchContent", + "AnthropicWebFetchContentTypedDict", + "AnthropicWebFetchToolResult", + "AnthropicWebFetchToolResultError", + "AnthropicWebFetchToolResultErrorErrorCode", + "AnthropicWebFetchToolResultErrorType", + "AnthropicWebFetchToolResultErrorTypedDict", + "AnthropicWebFetchToolResultType", + "AnthropicWebFetchToolResultTypedDict", + "AnthropicWebSearchResult", "AnthropicWebSearchResultBlockParam", "AnthropicWebSearchResultBlockParamType", "AnthropicWebSearchResultBlockParamTypedDict", + "AnthropicWebSearchResultType", + "AnthropicWebSearchResultTypedDict", + "AnthropicWebSearchToolResult", + "AnthropicWebSearchToolResultContent", + "AnthropicWebSearchToolResultContentTypedDict", + "AnthropicWebSearchToolResultError", + "AnthropicWebSearchToolResultErrorErrorCode", + "AnthropicWebSearchToolResultErrorType", + "AnthropicWebSearchToolResultErrorTypedDict", + "AnthropicWebSearchToolResultType", + "AnthropicWebSearchToolResultTypedDict", "AnthropicWebSearchToolUserLocation", "AnthropicWebSearchToolUserLocationType", "AnthropicWebSearchToolUserLocationTypedDict", @@ -3800,7 +4476,122 @@ "BashServerToolEnvironmentTypedDict", "BashServerToolType", "BashServerToolTypedDict", + "BatchDeletedObject", + "BatchDeletedObjectObject", + "BatchDeletedObjectTypedDict", + "BatchDeletionOutcome", + "BatchDeletionTargets", + "BatchDeletionTargetsTypedDict", + "BatchErrorResponseError", + "BatchErrorResponseErrorTypedDict", + "BatchListItem", + "BatchListItemCompletionTokensDetails", + "BatchListItemCompletionTokensDetailsTypedDict", + "BatchListItemCompletionWindow", + "BatchListItemError", + "BatchListItemErrorTypedDict", + "BatchListItemObject", + "BatchListItemPromptTokensDetails", + "BatchListItemPromptTokensDetailsTypedDict", + "BatchListItemRequestCounts", + "BatchListItemRequestCountsTypedDict", + "BatchListItemServerToolUse", + "BatchListItemServerToolUseTypedDict", + "BatchListItemStatus", + "BatchListItemTypedDict", + "BatchListItemUsage", + "BatchListItemUsageTypedDict", + "BatchListResponse", + "BatchListResponseObject", + "BatchListResponseTypedDict", + "BatchListStatus", + "BatchListTimestamp", + "BatchListTimestampTypedDict", + "BatchObject", + "BatchObjectCompletionTokensDetails", + "BatchObjectCompletionTokensDetailsTypedDict", + "BatchObjectCompletionWindow", + "BatchObjectData", + "BatchObjectDataTypedDict", + "BatchObjectDebug", + "BatchObjectDebugTypedDict", + "BatchObjectError", + "BatchObjectErrorTypedDict", + "BatchObjectEvent", + "BatchObjectFile", + "BatchObjectFileTypedDict", + "BatchObjectFunction", + "BatchObjectFunctionTypedDict", + "BatchObjectImageURL", + "BatchObjectImageURLTypedDict", + "BatchObjectObjectBatch", + "BatchObjectPromptTokensDetails", + "BatchObjectPromptTokensDetailsTypedDict", + "BatchObjectRequestCounts", + "BatchObjectRequestCountsTypedDict", + "BatchObjectResponse", + "BatchObjectResponseTypedDict", + "BatchObjectRole", + "BatchObjectServerToolUse", + "BatchObjectServerToolUseDetails", + "BatchObjectServerToolUseDetailsTypedDict", + "BatchObjectServerToolUseTypedDict", + "BatchObjectStatus", + "BatchObjectTimings", + "BatchObjectTimingsTypedDict", + "BatchObjectTypeMessage", + "BatchObjectTypedDict", + "BatchObjectURLCitation", + "BatchObjectURLCitationTypedDict", + "BatchObjectUsage", + "BatchObjectUsageTypedDict", + "BatchPaymentRequiredResponseCompletionTokensDetails", + "BatchPaymentRequiredResponseCompletionTokensDetailsTypedDict", + "BatchPaymentRequiredResponseCompletionWindow", + "BatchPaymentRequiredResponseError", + "BatchPaymentRequiredResponseErrorTypedDict", + "BatchPaymentRequiredResponseObject", + "BatchPaymentRequiredResponsePromptTokensDetails", + "BatchPaymentRequiredResponsePromptTokensDetailsTypedDict", + "BatchPaymentRequiredResponseRequestCounts", + "BatchPaymentRequiredResponseRequestCountsTypedDict", + "BatchPaymentRequiredResponseServerToolUse", + "BatchPaymentRequiredResponseServerToolUseTypedDict", + "BatchPaymentRequiredResponseStatus", + "BatchPaymentRequiredResponseUsage", + "BatchPaymentRequiredResponseUsageTypedDict", + "BatchProviderPreferences", + "BatchProviderPreferencesOnly", + "BatchProviderPreferencesOnlyTypedDict", + "BatchProviderPreferencesTypedDict", + "BatchSubmitBody", + "BatchSubmitBodyCompletionWindow", + "BatchSubmitBodyTypedDict", "Billable", + "Body", + "BodyChatCompletion", + "BodyChatCompletionTypedDict", + "BodyCompletionTokensDetails", + "BodyCompletionTokensDetailsTypedDict", + "BodyList", + "BodyListTypedDict", + "BodyMessage", + "BodyMessageTypedDict", + "BodyObjectChatCompletion", + "BodyObjectList", + "BodyPromptTokensDetails1", + "BodyPromptTokensDetails1TypedDict", + "BodyPromptTokensDetails2", + "BodyPromptTokensDetails2TypedDict", + "BodyServerToolUse", + "BodyServerToolUseTypedDict", + "BodyTypedDict", + "BodyUsage1", + "BodyUsage1TypedDict", + "BodyUsage2", + "BodyUsage2TypedDict", + "BodyUsage3", + "BodyUsage3TypedDict", "BooleanCapability", "BooleanCapabilityType", "BooleanCapabilityTypedDict", @@ -3831,7 +4622,6 @@ "By", "CapabilityDescriptor", "CapabilityDescriptorTypedDict", - "Category", "ChatAssistantImages", "ChatAssistantImagesImageURL", "ChatAssistantImagesImageURLTypedDict", @@ -3997,6 +4787,11 @@ "ChatWebSearchShorthand", "ChatWebSearchShorthandType", "ChatWebSearchShorthandTypedDict", + "Choice", + "ChoiceRole", + "ChoiceTypeFunction", + "ChoiceTypeImageURL", + "ChoiceTypedDict", "Citation", "CitationTypedDict", "ClearToolInputs", @@ -4090,6 +4885,10 @@ "ContentFilterBuiltinSlug", "ContentFilterEntry", "ContentFilterEntryTypedDict", + "ContentImageURL", + "ContentImageURLImageURL", + "ContentImageURLImageURLTypedDict", + "ContentImageURLTypedDict", "ContentPartAddedEvent", "ContentPartAddedEventPart", "ContentPartAddedEventPartTypedDict", @@ -4124,6 +4923,8 @@ "ContentRedactedThinkingTypedDict", "ContentServerToolUse", "ContentServerToolUseTypedDict", + "ContentText", + "ContentTextTypedDict", "ContentThinking", "ContentThinkingTypedDict", "ContentToolReference", @@ -4132,6 +4933,8 @@ "ContentToolResultTypedDict", "ContentToolUse", "ContentToolUseTypedDict", + "ContentTopLogprob", + "ContentTopLogprobTypedDict", "ContentWebSearchToolResult", "ContentWebSearchToolResultError", "ContentWebSearchToolResultErrorTypedDict", @@ -4215,11 +5018,14 @@ "DatetimeServerToolConfigTypedDict", "DatetimeServerToolType", "DatetimeServerToolTypedDict", - "Debug", "DebugEvent", + "DebugEventDebug", + "DebugEventDebugTypedDict", + "DebugEventEvent", + "DebugEventTimings", + "DebugEventTimingsTypedDict", "DebugEventType", "DebugEventTypedDict", - "DebugTypedDict", "Decisions", "DecisionsChoiceAnswer", "DecisionsChoiceAnswerType", @@ -4305,8 +5111,11 @@ "EditCompact20260112TypedDict", "EditTypeInputTokens", "EditTypedDict", + "Embedding", + "EmbeddingTypedDict", "Embeddings", "EmbeddingsTypedDict", + "Endpoint", "EndpointInfo", "EndpointInfoTypedDict", "EndpointStatus", @@ -4316,12 +5125,10 @@ "EnumCapabilityType", "EnumCapabilityTypedDict", "Environment", - "ErrorCode", "ErrorEnum", "ErrorEvent", "ErrorEventType", "ErrorEventTypedDict", - "Event", "FailableToolCallStatus", "FailedModel", "FailedModelTypedDict", @@ -4350,6 +5157,9 @@ "FileSearchServerToolValue1TypedDict", "FileSearchServerToolValue2", "FileSearchServerToolValue2TypedDict", + "FileType", + "FileTypeImageURL", + "FileTypeText", "FilesServerTool", "FilesServerToolConfig", "FilesServerToolConfigTypedDict", @@ -4500,6 +5310,7 @@ "GuardrailDataRegion", "GuardrailInterval", "GuardrailTypedDict", + "Image", "ImageConfig", "ImageConfigTypedDict", "ImageEndpoint", @@ -4575,6 +5386,8 @@ "ImageGenerationUsageCompletionTokensDetailsTypedDict", "ImageGenerationUsagePromptTokensDetails", "ImageGenerationUsagePromptTokensDetailsTypedDict", + "ImageGenerationUsageServerToolUse", + "ImageGenerationUsageServerToolUseTypedDict", "ImageGenerationUsageTypedDict", "ImageInputModality", "ImageModelArchitecture", @@ -4592,6 +5405,7 @@ "ImageStreamingResponseData", "ImageStreamingResponseDataTypedDict", "ImageStreamingResponseTypedDict", + "ImageTypedDict", "IncompleteDetails", "IncompleteDetailsReason", "IncompleteDetailsTypedDict", @@ -4680,6 +5494,7 @@ "InternChatAssistantMessageRole", "InternChatAssistantMessageTypedDict", "InternChatChoice", + "InternChatChoiceFinishReason", "InternChatChoiceTypedDict", "InternChatCompletionChunk", "InternChatCompletionChunkObject", @@ -4815,6 +5630,10 @@ "Logic", "Logprob", "LogprobTypedDict", + "Logprobs", + "LogprobsContent", + "LogprobsContentTypedDict", + "LogprobsTypedDict", "MaxPrice", "MaxPriceTypedDict", "McpApprovalRequestItem", @@ -4848,6 +5667,8 @@ "MemberAssignment", "MemberAssignmentTypedDict", "MemoryLimit", + "Message", + "MessageTypedDict", "MessagesAdvisorToolResultBlock", "MessagesAdvisorToolResultBlockType", "MessagesAdvisorToolResultBlockTypedDict", @@ -4855,6 +5676,7 @@ "MessagesBashToolResultBlockFile", "MessagesBashToolResultBlockFileTypedDict", "MessagesBashToolResultBlockTypeContainerFileCitation", + "MessagesBashToolResultBlockTypeOpenrouterBashToolResult", "MessagesBashToolResultBlockTypedDict", "MessagesFallbackParam", "MessagesFallbackParamTypedDict", @@ -4869,9 +5691,16 @@ "MessagesMessageParamContentUnion4TypedDict", "MessagesMessageParamContentUnion5", "MessagesMessageParamContentUnion5TypedDict", + "MessagesMessageParamErrorCode", "MessagesMessageParamRole", "MessagesMessageParamTypeCompaction", + "MessagesMessageParamTypeRedactedThinking", + "MessagesMessageParamTypeServerToolUse", + "MessagesMessageParamTypeThinking", "MessagesMessageParamTypeToolReference", + "MessagesMessageParamTypeToolUse", + "MessagesMessageParamTypeWebSearchToolResult", + "MessagesMessageParamTypeWebSearchToolResultError", "MessagesMessageParamTypedDict", "MessagesOutputConfig", "MessagesOutputConfigEffort", @@ -4896,6 +5725,7 @@ "MessagesShellToolResultBlockFile", "MessagesShellToolResultBlockFileTypedDict", "MessagesShellToolResultBlockTypeContainerFileCitation", + "MessagesShellToolResultBlockTypeOpenrouterShellToolResult", "MessagesShellToolResultBlockTypedDict", "MessagesToolAdditionBlock", "MessagesToolAdditionBlockToolMcpToolReference", @@ -4977,6 +5807,27 @@ "NotFoundResponseErrorDataTypedDict", "OAuthJwks", "OAuthJwksTypedDict", + "ORAnthropicBashToolResult", + "ORAnthropicBashToolResultFile", + "ORAnthropicBashToolResultFileTypedDict", + "ORAnthropicBashToolResultTypeContainerFileCitation", + "ORAnthropicBashToolResultTypeOpenrouterBashToolResult", + "ORAnthropicBashToolResultTypedDict", + "ORAnthropicContentBlock", + "ORAnthropicContentBlockTypedDict", + "ORAnthropicNullableCaller", + "ORAnthropicNullableCallerTypedDict", + "ORAnthropicServerToolUseBlock", + "ORAnthropicServerToolUseBlockType", + "ORAnthropicServerToolUseBlockTypedDict", + "ORAnthropicShellToolResult", + "ORAnthropicShellToolResultFile", + "ORAnthropicShellToolResultFileTypedDict", + "ORAnthropicShellToolResultTypeContainerFileCitation", + "ORAnthropicShellToolResultTypeOpenrouterShellToolResult", + "ORAnthropicShellToolResultTypedDict", + "ORAnthropicStopReason", + "ObjectEmbedding", "ObservabilityArizeDestination", "ObservabilityArizeDestinationConfig", "ObservabilityArizeDestinationConfigTypedDict", @@ -5174,6 +6025,7 @@ "OpenRouterWebSearchServerTool", "OpenRouterWebSearchServerToolType", "OpenRouterWebSearchServerToolTypedDict", + "Openrouter", "Operator", "Outcome", "OutcomeExit", @@ -5239,6 +6091,8 @@ "OutputFunctionCallItemType", "OutputFunctionCallItemTypedDict", "OutputFusionServerToolItem", + "OutputFusionServerToolItemResponse", + "OutputFusionServerToolItemResponseTypedDict", "OutputFusionServerToolItemType", "OutputFusionServerToolItemTypedDict", "OutputImageGenerationCallItem", @@ -5480,6 +6334,7 @@ "ReasoningDeltaEvent", "ReasoningDeltaEventType", "ReasoningDeltaEventTypedDict", + "ReasoningDetail", "ReasoningDetailEncrypted", "ReasoningDetailEncryptedType", "ReasoningDetailEncryptedTypedDict", @@ -5492,6 +6347,7 @@ "ReasoningDetailText", "ReasoningDetailTextType", "ReasoningDetailTextTypedDict", + "ReasoningDetailTypedDict", "ReasoningDetailUnion", "ReasoningDetailUnionTypedDict", "ReasoningDoneEvent", @@ -5527,15 +6383,21 @@ "ReasoningTextContent", "ReasoningTextContentType", "ReasoningTextContentTypedDict", + "Refusal", "RefusalDeltaEvent", "RefusalDeltaEventType", "RefusalDeltaEventTypedDict", "RefusalDoneEvent", "RefusalDoneEventType", "RefusalDoneEventTypedDict", + "RefusalTopLogprob", + "RefusalTopLogprobTypedDict", + "RefusalTypedDict", "Region", + "Request", "RequestTimeoutResponseErrorData", "RequestTimeoutResponseErrorDataTypedDict", + "RequestTypedDict", "RequestedTokenType", "RequireApproval", "RequireApprovalAlways", @@ -5546,7 +6408,6 @@ "Rerank", "RerankTypedDict", "ResetInterval", - "Response", "ResponseFormat", "ResponseFormatTypedDict", "ResponseHealingPlugin", @@ -5558,7 +6419,6 @@ "ResponseOutputTextTopLogprobTypedDict", "ResponseOutputTextType", "ResponseOutputTextTypedDict", - "ResponseTypedDict", "ResponsesErrorField", "ResponsesErrorFieldTypedDict", "ResponsesRequest", @@ -5573,6 +6433,10 @@ "ResponsesRequestTypedDict", "ResponsesStreamingResponse", "ResponsesStreamingResponseTypedDict", + "Result", + "ResultError", + "ResultErrorTypedDict", + "ResultTypedDict", "RoutedServiceTier", "RouterAttempt", "RouterAttemptTypedDict", @@ -5618,10 +6482,8 @@ "SearchSurface", "Security", "SecurityTypedDict", - "ServerToolUse", "ServerToolUseDetails", "ServerToolUseDetailsTypedDict", - "ServerToolUseTypedDict", "ServiceUnavailableResponseErrorData", "ServiceUnavailableResponseErrorDataTypedDict", "SessionCostItem", @@ -5738,6 +6600,7 @@ "SubagentServerToolOpenRouterTypedDict", "SubjectTokenType", "SubmitGenerationFeedbackRequest", + "SubmitGenerationFeedbackRequestCategory", "SubmitGenerationFeedbackRequestTypedDict", "SubmitGenerationFeedbackResponse", "SubmitGenerationFeedbackResponseData", @@ -5788,8 +6651,6 @@ "ThinkingEnabledTypedDict", "ThinkingTypeDisabled", "ThinkingTypedDict", - "Timings", - "TimingsTypedDict", "TokenExchangeRequest", "TokenExchangeRequestTypedDict", "TokenExchangeResponse", @@ -5801,7 +6662,9 @@ "ToolAdvisor20260301TypedDict", "ToolBash20250124", "ToolBash20250124TypedDict", + "ToolCall", "ToolCallStatus", + "ToolCallTypedDict", "ToolChoice", "ToolChoiceAllowed", "ToolChoiceAllowedType", @@ -5858,7 +6721,6 @@ "TypeClearToolUses20250919", "TypeCodeInterpreter", "TypeCompact20260112", - "TypeDocument", "TypeEnabled", "TypeEncryptedContent", "TypeExec", @@ -5868,25 +6730,18 @@ "TypeLocalShellCall", "TypeNone", "TypeOpenPage", - "TypeOpenrouterBashToolResult", - "TypeOpenrouterShellToolResult", - "TypeRedactedThinking", - "TypeServerToolUse", "TypeTextEditor20250124", - "TypeThinking", "TypeTimeout", "TypeTokens", "TypeTool", "TypeToolAddition", "TypeToolRemoval", "TypeToolResult", - "TypeToolUse", "TypeTypedDict", "TypeWebSearch20250305", "TypeWebSearch20260209", "TypeWebSearchCall", - "TypeWebSearchToolResult", - "TypeWebSearchToolResultError", + "TypeWebSearchCitation", "URLCitation", "URLCitationType", "URLCitationTypedDict", @@ -5923,7 +6778,17 @@ "Unit", "Unknown", "UnknownAction", + "UnknownAnnotation", + "UnknownAnnotationContentUnion", "UnknownAnswers", + "UnknownAnthropicBashCodeExecutionContent", + "UnknownAnthropicCaller", + "UnknownAnthropicCodeExecutionContent", + "UnknownAnthropicDocumentBlockSource", + "UnknownAnthropicTextCitation", + "UnknownAnthropicTextEditorCodeExecutionContent", + "UnknownAnthropicToolSearchContent", + "UnknownAnthropicWebFetchContent", "UnknownApplyPatchCallOperation", "UnknownBaseInputsContent1", "UnknownCapabilityDescriptor", @@ -5937,6 +6802,8 @@ "UnknownFormats", "UnknownImageStreamingResponseData", "UnknownNamespaceToolTool", + "UnknownORAnthropicContentBlock", + "UnknownORAnthropicNullableCaller", "UnknownObservabilityDestination", "UnknownOpenAIResponseCustomToolCallOutputOutput1", "UnknownOpenAIResponseFunctionToolCallOutputOutput1", @@ -5948,6 +6815,7 @@ "UnknownOutputItems", "UnknownOutputMessageContent", "UnknownOutputMessageItemContent", + "UnknownReasoningDetail", "UnknownReasoningDetailUnion", "UnknownStreamEvents", "UnknownTypedDict", @@ -5983,6 +6851,8 @@ "UpsertWorkspaceBudgetRequestTypedDict", "UpsertWorkspaceBudgetResponse", "UpsertWorkspaceBudgetResponseTypedDict", + "Upstream", + "UpstreamTypedDict", "Usage", "UsageCostDetails", "UsageCostDetailsTypedDict", @@ -6045,6 +6915,8 @@ "WebSearchCallSearchingEvent", "WebSearchCallSearchingEventType", "WebSearchCallSearchingEventTypedDict", + "WebSearchCitation", + "WebSearchCitationTypedDict", "WebSearchConfig", "WebSearchConfigTypedDict", "WebSearchDomainFilter", @@ -6132,6 +7004,9 @@ "AnthropicAdvisorMessageUsageIteration": ".anthropicadvisormessageusageiteration", "AnthropicAdvisorMessageUsageIterationType": ".anthropicadvisormessageusageiteration", "AnthropicAdvisorMessageUsageIterationTypedDict": ".anthropicadvisormessageusageiteration", + "AnthropicAdvisorToolResult": ".anthropicadvisortoolresult", + "AnthropicAdvisorToolResultType": ".anthropicadvisortoolresult", + "AnthropicAdvisorToolResultTypedDict": ".anthropicadvisortoolresult", "AnthropicAllowedCallers": ".anthropicallowedcallers", "AnthropicBase64ImageSource": ".anthropicbase64imagesource", "AnthropicBase64ImageSourceType": ".anthropicbase64imagesource", @@ -6140,30 +7015,107 @@ "AnthropicBase64PdfSourceMediaType": ".anthropicbase64pdfsource", "AnthropicBase64PdfSourceType": ".anthropicbase64pdfsource", "AnthropicBase64PdfSourceTypedDict": ".anthropicbase64pdfsource", + "AnthropicBashCodeExecutionContent": ".anthropicbashcodeexecutioncontent", + "AnthropicBashCodeExecutionContentTypedDict": ".anthropicbashcodeexecutioncontent", + "UnknownAnthropicBashCodeExecutionContent": ".anthropicbashcodeexecutioncontent", + "AnthropicBashCodeExecutionOutput": ".anthropicbashcodeexecutionoutput", + "AnthropicBashCodeExecutionOutputType": ".anthropicbashcodeexecutionoutput", + "AnthropicBashCodeExecutionOutputTypedDict": ".anthropicbashcodeexecutionoutput", + "AnthropicBashCodeExecutionResult": ".anthropicbashcodeexecutionresult", + "AnthropicBashCodeExecutionResultType": ".anthropicbashcodeexecutionresult", + "AnthropicBashCodeExecutionResultTypedDict": ".anthropicbashcodeexecutionresult", + "AnthropicBashCodeExecutionToolResult": ".anthropicbashcodeexecutiontoolresult", + "AnthropicBashCodeExecutionToolResultType": ".anthropicbashcodeexecutiontoolresult", + "AnthropicBashCodeExecutionToolResultTypedDict": ".anthropicbashcodeexecutiontoolresult", + "AnthropicBashCodeExecutionToolResultError": ".anthropicbashcodeexecutiontoolresulterror", + "AnthropicBashCodeExecutionToolResultErrorErrorCode": ".anthropicbashcodeexecutiontoolresulterror", + "AnthropicBashCodeExecutionToolResultErrorType": ".anthropicbashcodeexecutiontoolresulterror", + "AnthropicBashCodeExecutionToolResultErrorTypedDict": ".anthropicbashcodeexecutiontoolresulterror", "AnthropicCacheControlDirective": ".anthropiccachecontroldirective", "AnthropicCacheControlDirectiveType": ".anthropiccachecontroldirective", "AnthropicCacheControlDirectiveTypedDict": ".anthropiccachecontroldirective", "AnthropicCacheControlTTL": ".anthropiccachecontrolttl", "AnthropicCacheCreation": ".anthropiccachecreation", "AnthropicCacheCreationTypedDict": ".anthropiccachecreation", + "AnthropicCaller": ".anthropiccaller", + "AnthropicCallerTypedDict": ".anthropiccaller", + "UnknownAnthropicCaller": ".anthropiccaller", + "AnthropicCitationCharLocation": ".anthropiccitationcharlocation", + "AnthropicCitationCharLocationType": ".anthropiccitationcharlocation", + "AnthropicCitationCharLocationTypedDict": ".anthropiccitationcharlocation", "AnthropicCitationCharLocationParam": ".anthropiccitationcharlocationparam", "AnthropicCitationCharLocationParamType": ".anthropiccitationcharlocationparam", "AnthropicCitationCharLocationParamTypedDict": ".anthropiccitationcharlocationparam", + "AnthropicCitationContentBlockLocation": ".anthropiccitationcontentblocklocation", + "AnthropicCitationContentBlockLocationType": ".anthropiccitationcontentblocklocation", + "AnthropicCitationContentBlockLocationTypedDict": ".anthropiccitationcontentblocklocation", "AnthropicCitationContentBlockLocationParam": ".anthropiccitationcontentblocklocationparam", "AnthropicCitationContentBlockLocationParamType": ".anthropiccitationcontentblocklocationparam", "AnthropicCitationContentBlockLocationParamTypedDict": ".anthropiccitationcontentblocklocationparam", + "AnthropicCitationPageLocation": ".anthropiccitationpagelocation", + "AnthropicCitationPageLocationType": ".anthropiccitationpagelocation", + "AnthropicCitationPageLocationTypedDict": ".anthropiccitationpagelocation", "AnthropicCitationPageLocationParam": ".anthropiccitationpagelocationparam", "AnthropicCitationPageLocationParamType": ".anthropiccitationpagelocationparam", "AnthropicCitationPageLocationParamTypedDict": ".anthropiccitationpagelocationparam", + "AnthropicCitationsConfig": ".anthropiccitationsconfig", + "AnthropicCitationsConfigTypedDict": ".anthropiccitationsconfig", + "AnthropicCitationSearchResultLocation": ".anthropiccitationsearchresultlocation", + "AnthropicCitationSearchResultLocationType": ".anthropiccitationsearchresultlocation", + "AnthropicCitationSearchResultLocationTypedDict": ".anthropiccitationsearchresultlocation", "AnthropicCitationSearchResultLocationParam": ".anthropiccitationsearchresultlocationparam", "AnthropicCitationSearchResultLocationParamType": ".anthropiccitationsearchresultlocationparam", "AnthropicCitationSearchResultLocationParamTypedDict": ".anthropiccitationsearchresultlocationparam", + "AnthropicCitationWebSearchResultLocation": ".anthropiccitationwebsearchresultlocation", + "AnthropicCitationWebSearchResultLocationType": ".anthropiccitationwebsearchresultlocation", + "AnthropicCitationWebSearchResultLocationTypedDict": ".anthropiccitationwebsearchresultlocation", "AnthropicCitationWebSearchResultLocationParam": ".anthropiccitationwebsearchresultlocationparam", "AnthropicCitationWebSearchResultLocationParamType": ".anthropiccitationwebsearchresultlocationparam", "AnthropicCitationWebSearchResultLocationParamTypedDict": ".anthropiccitationwebsearchresultlocationparam", + "AnthropicCodeExecution20250825Caller": ".anthropiccodeexecution20250825caller", + "AnthropicCodeExecution20250825CallerType": ".anthropiccodeexecution20250825caller", + "AnthropicCodeExecution20250825CallerTypedDict": ".anthropiccodeexecution20250825caller", + "AnthropicCodeExecution20260120Caller": ".anthropiccodeexecution20260120caller", + "AnthropicCodeExecution20260120CallerType": ".anthropiccodeexecution20260120caller", + "AnthropicCodeExecution20260120CallerTypedDict": ".anthropiccodeexecution20260120caller", + "AnthropicCodeExecutionContent": ".anthropiccodeexecutioncontent", + "AnthropicCodeExecutionContentTypedDict": ".anthropiccodeexecutioncontent", + "UnknownAnthropicCodeExecutionContent": ".anthropiccodeexecutioncontent", + "AnthropicCodeExecutionOutput": ".anthropiccodeexecutionoutput", + "AnthropicCodeExecutionOutputType": ".anthropiccodeexecutionoutput", + "AnthropicCodeExecutionOutputTypedDict": ".anthropiccodeexecutionoutput", + "AnthropicCodeExecutionResult": ".anthropiccodeexecutionresult", + "AnthropicCodeExecutionResultType": ".anthropiccodeexecutionresult", + "AnthropicCodeExecutionResultTypedDict": ".anthropiccodeexecutionresult", + "AnthropicCodeExecutionToolResult": ".anthropiccodeexecutiontoolresult", + "AnthropicCodeExecutionToolResultType": ".anthropiccodeexecutiontoolresult", + "AnthropicCodeExecutionToolResultTypedDict": ".anthropiccodeexecutiontoolresult", + "AnthropicCodeExecutionToolResultError": ".anthropiccodeexecutiontoolresulterror", + "AnthropicCodeExecutionToolResultErrorType": ".anthropiccodeexecutiontoolresulterror", + "AnthropicCodeExecutionToolResultErrorTypedDict": ".anthropiccodeexecutiontoolresulterror", + "AnthropicCompactionBlock": ".anthropiccompactionblock", + "AnthropicCompactionBlockType": ".anthropiccompactionblock", + "AnthropicCompactionBlockTypedDict": ".anthropiccompactionblock", "AnthropicCompactionUsageIteration": ".anthropiccompactionusageiteration", "AnthropicCompactionUsageIterationType": ".anthropiccompactionusageiteration", "AnthropicCompactionUsageIterationTypedDict": ".anthropiccompactionusageiteration", + "AnthropicContainer": ".anthropiccontainer", + "AnthropicContainerTypedDict": ".anthropiccontainer", + "AnthropicContainerSkill": ".anthropiccontainerskill", + "AnthropicContainerSkillType": ".anthropiccontainerskill", + "AnthropicContainerSkillTypedDict": ".anthropiccontainerskill", + "AnthropicContainerUpload": ".anthropiccontainerupload", + "AnthropicContainerUploadType": ".anthropiccontainerupload", + "AnthropicContainerUploadTypedDict": ".anthropiccontainerupload", + "AnthropicDirectCaller": ".anthropicdirectcaller", + "AnthropicDirectCallerType": ".anthropicdirectcaller", + "AnthropicDirectCallerTypedDict": ".anthropicdirectcaller", + "AnthropicDocumentBlock": ".anthropicdocumentblock", + "AnthropicDocumentBlockSource": ".anthropicdocumentblock", + "AnthropicDocumentBlockSourceTypedDict": ".anthropicdocumentblock", + "AnthropicDocumentBlockType": ".anthropicdocumentblock", + "AnthropicDocumentBlockTypedDict": ".anthropicdocumentblock", + "UnknownAnthropicDocumentBlockSource": ".anthropicdocumentblock", "AnthropicDocumentBlockParam": ".anthropicdocumentblockparam", "AnthropicDocumentBlockParamCitations": ".anthropicdocumentblockparam", "AnthropicDocumentBlockParamCitationsTypedDict": ".anthropicdocumentblockparam", @@ -6173,11 +7125,14 @@ "AnthropicDocumentBlockParamContent2TypedDict": ".anthropicdocumentblockparam", "AnthropicDocumentBlockParamSourceUnion": ".anthropicdocumentblockparam", "AnthropicDocumentBlockParamSourceUnionTypedDict": ".anthropicdocumentblockparam", + "AnthropicDocumentBlockParamTypeDocument": ".anthropicdocumentblockparam", "AnthropicDocumentBlockParamTypedDict": ".anthropicdocumentblockparam", "SourceContent": ".anthropicdocumentblockparam", "SourceContentTypedDict": ".anthropicdocumentblockparam", "SourceType": ".anthropicdocumentblockparam", - "TypeDocument": ".anthropicdocumentblockparam", + "AnthropicEncryptedCodeExecutionResult": ".anthropicencryptedcodeexecutionresult", + "AnthropicEncryptedCodeExecutionResultType": ".anthropicencryptedcodeexecutionresult", + "AnthropicEncryptedCodeExecutionResultTypedDict": ".anthropicencryptedcodeexecutionresult", "AnthropicFile": ".anthropicfile", "AnthropicFileShape": ".anthropicfile", "AnthropicFileType": ".anthropicfile", @@ -6204,6 +7159,8 @@ "AnthropicInputTokensTrigger": ".anthropicinputtokenstrigger", "AnthropicInputTokensTriggerType": ".anthropicinputtokenstrigger", "AnthropicInputTokensTriggerTypedDict": ".anthropicinputtokenstrigger", + "AnthropicInputTransformation": ".anthropicinputtransformation", + "AnthropicInputTransformationTypedDict": ".anthropicinputtransformation", "AnthropicIterationCacheCreation": ".anthropiciterationcachecreation", "AnthropicIterationCacheCreationTypedDict": ".anthropiciterationcachecreation", "AnthropicMessageOutputConfig": ".anthropicmessageoutputconfig", @@ -6212,10 +7169,19 @@ "AnthropicMessageUsageIterationType": ".anthropicmessageusageiteration", "AnthropicMessageUsageIterationTypedDict": ".anthropicmessageusageiteration", "AnthropicOutputEffort": ".anthropicoutputeffort", + "AnthropicOutputTokensDetails": ".anthropicoutputtokensdetails", + "AnthropicOutputTokensDetailsTypedDict": ".anthropicoutputtokensdetails", "AnthropicPlainTextSource": ".anthropicplaintextsource", "AnthropicPlainTextSourceMediaType": ".anthropicplaintextsource", "AnthropicPlainTextSourceType": ".anthropicplaintextsource", "AnthropicPlainTextSourceTypedDict": ".anthropicplaintextsource", + "AnthropicRedactedThinkingBlock": ".anthropicredactedthinkingblock", + "AnthropicRedactedThinkingBlockType": ".anthropicredactedthinkingblock", + "AnthropicRedactedThinkingBlockTypedDict": ".anthropicredactedthinkingblock", + "AnthropicRefusalStopDetails": ".anthropicrefusalstopdetails", + "AnthropicRefusalStopDetailsCategory": ".anthropicrefusalstopdetails", + "AnthropicRefusalStopDetailsType": ".anthropicrefusalstopdetails", + "AnthropicRefusalStopDetailsTypedDict": ".anthropicrefusalstopdetails", "AnthropicSafeguard": ".anthropicsafeguard", "AnthropicSafeguardTypedDict": ".anthropicsafeguard", "AnthropicSearchResultBlockParam": ".anthropicsearchresultblockparam", @@ -6223,13 +7189,46 @@ "AnthropicSearchResultBlockParamCitationsTypedDict": ".anthropicsearchresultblockparam", "AnthropicSearchResultBlockParamType": ".anthropicsearchresultblockparam", "AnthropicSearchResultBlockParamTypedDict": ".anthropicsearchresultblockparam", + "AnthropicServerToolErrorCode": ".anthropicservertoolerrorcode", + "AnthropicServerToolUsage": ".anthropicservertoolusage", + "AnthropicServerToolUsageTypedDict": ".anthropicservertoolusage", + "AnthropicServiceTier": ".anthropicservicetier", "AnthropicSpeed": ".anthropicspeed", "AnthropicSystemClearAt": ".anthropicsystemclearat", + "AnthropicTextBlock": ".anthropictextblock", + "AnthropicTextBlockType": ".anthropictextblock", + "AnthropicTextBlockTypedDict": ".anthropictextblock", "AnthropicTextBlockParam": ".anthropictextblockparam", "AnthropicTextBlockParamType": ".anthropictextblockparam", "AnthropicTextBlockParamTypedDict": ".anthropictextblockparam", "Citation": ".anthropictextblockparam", "CitationTypedDict": ".anthropictextblockparam", + "AnthropicTextCitation": ".anthropictextcitation", + "AnthropicTextCitationTypedDict": ".anthropictextcitation", + "UnknownAnthropicTextCitation": ".anthropictextcitation", + "AnthropicTextEditorCodeExecutionContent": ".anthropictexteditorcodeexecutioncontent", + "AnthropicTextEditorCodeExecutionContentTypedDict": ".anthropictexteditorcodeexecutioncontent", + "UnknownAnthropicTextEditorCodeExecutionContent": ".anthropictexteditorcodeexecutioncontent", + "AnthropicTextEditorCodeExecutionCreateResult": ".anthropictexteditorcodeexecutioncreateresult", + "AnthropicTextEditorCodeExecutionCreateResultType": ".anthropictexteditorcodeexecutioncreateresult", + "AnthropicTextEditorCodeExecutionCreateResultTypedDict": ".anthropictexteditorcodeexecutioncreateresult", + "AnthropicTextEditorCodeExecutionStrReplaceResult": ".anthropictexteditorcodeexecutionstrreplaceresult", + "AnthropicTextEditorCodeExecutionStrReplaceResultType": ".anthropictexteditorcodeexecutionstrreplaceresult", + "AnthropicTextEditorCodeExecutionStrReplaceResultTypedDict": ".anthropictexteditorcodeexecutionstrreplaceresult", + "AnthropicTextEditorCodeExecutionToolResult": ".anthropictexteditorcodeexecutiontoolresult", + "AnthropicTextEditorCodeExecutionToolResultType": ".anthropictexteditorcodeexecutiontoolresult", + "AnthropicTextEditorCodeExecutionToolResultTypedDict": ".anthropictexteditorcodeexecutiontoolresult", + "AnthropicTextEditorCodeExecutionToolResultError": ".anthropictexteditorcodeexecutiontoolresulterror", + "AnthropicTextEditorCodeExecutionToolResultErrorErrorCode": ".anthropictexteditorcodeexecutiontoolresulterror", + "AnthropicTextEditorCodeExecutionToolResultErrorType": ".anthropictexteditorcodeexecutiontoolresulterror", + "AnthropicTextEditorCodeExecutionToolResultErrorTypedDict": ".anthropictexteditorcodeexecutiontoolresulterror", + "AnthropicTextEditorCodeExecutionViewResult": ".anthropictexteditorcodeexecutionviewresult", + "AnthropicTextEditorCodeExecutionViewResultType": ".anthropictexteditorcodeexecutionviewresult", + "AnthropicTextEditorCodeExecutionViewResultTypedDict": ".anthropictexteditorcodeexecutionviewresult", + "FileType": ".anthropictexteditorcodeexecutionviewresult", + "AnthropicThinkingBlock": ".anthropicthinkingblock", + "AnthropicThinkingBlockType": ".anthropicthinkingblock", + "AnthropicThinkingBlockTypedDict": ".anthropicthinkingblock", "AnthropicThinkingBlockBinding": ".anthropicthinkingblockbinding", "AnthropicThinkingBlockBindingTypedDict": ".anthropicthinkingblockbinding", "MismatchBehavior": ".anthropicthinkingblockbinding", @@ -6238,6 +7237,18 @@ "AnthropicThinkingTurns": ".anthropicthinkingturns", "AnthropicThinkingTurnsType": ".anthropicthinkingturns", "AnthropicThinkingTurnsTypedDict": ".anthropicthinkingturns", + "AnthropicToolReference": ".anthropictoolreference", + "AnthropicToolReferenceType": ".anthropictoolreference", + "AnthropicToolReferenceTypedDict": ".anthropictoolreference", + "AnthropicToolSearchContent": ".anthropictoolsearchcontent", + "AnthropicToolSearchContentTypedDict": ".anthropictoolsearchcontent", + "UnknownAnthropicToolSearchContent": ".anthropictoolsearchcontent", + "AnthropicToolSearchResult": ".anthropictoolsearchresult", + "AnthropicToolSearchResultType": ".anthropictoolsearchresult", + "AnthropicToolSearchResultTypedDict": ".anthropictoolsearchresult", + "AnthropicToolSearchResultError": ".anthropictoolsearchresulterror", + "AnthropicToolSearchResultErrorType": ".anthropictoolsearchresulterror", + "AnthropicToolSearchResultErrorTypedDict": ".anthropictoolsearchresulterror", "AnthropicToolSearchToolBm25": ".anthropictoolsearchtoolbm25", "AnthropicToolSearchToolBm25Name": ".anthropictoolsearchtoolbm25", "AnthropicToolSearchToolBm25Type": ".anthropictoolsearchtoolbm25", @@ -6246,6 +7257,12 @@ "AnthropicToolSearchToolRegexName": ".anthropictoolsearchtoolregex", "AnthropicToolSearchToolRegexType": ".anthropictoolsearchtoolregex", "AnthropicToolSearchToolRegexTypedDict": ".anthropictoolsearchtoolregex", + "AnthropicToolSearchToolResult": ".anthropictoolsearchtoolresult", + "AnthropicToolSearchToolResultType": ".anthropictoolsearchtoolresult", + "AnthropicToolSearchToolResultTypedDict": ".anthropictoolsearchtoolresult", + "AnthropicToolUseBlock": ".anthropictooluseblock", + "AnthropicToolUseBlockType": ".anthropictooluseblock", + "AnthropicToolUseBlockTypedDict": ".anthropictooluseblock", "AnthropicToolUsesKeep": ".anthropictooluseskeep", "AnthropicToolUsesKeepType": ".anthropictooluseskeep", "AnthropicToolUsesKeepTypedDict": ".anthropictooluseskeep", @@ -6262,9 +7279,34 @@ "AnthropicURLPdfSourceTypedDict": ".anthropicurlpdfsource", "AnthropicUsageIteration": ".anthropicusageiteration", "AnthropicUsageIterationTypedDict": ".anthropicusageiteration", + "AnthropicWebFetchBlock": ".anthropicwebfetchblock", + "AnthropicWebFetchBlockType": ".anthropicwebfetchblock", + "AnthropicWebFetchBlockTypedDict": ".anthropicwebfetchblock", + "AnthropicWebFetchContent": ".anthropicwebfetchcontent", + "AnthropicWebFetchContentTypedDict": ".anthropicwebfetchcontent", + "UnknownAnthropicWebFetchContent": ".anthropicwebfetchcontent", + "AnthropicWebFetchToolResult": ".anthropicwebfetchtoolresult", + "AnthropicWebFetchToolResultType": ".anthropicwebfetchtoolresult", + "AnthropicWebFetchToolResultTypedDict": ".anthropicwebfetchtoolresult", + "AnthropicWebFetchToolResultError": ".anthropicwebfetchtoolresulterror", + "AnthropicWebFetchToolResultErrorErrorCode": ".anthropicwebfetchtoolresulterror", + "AnthropicWebFetchToolResultErrorType": ".anthropicwebfetchtoolresulterror", + "AnthropicWebFetchToolResultErrorTypedDict": ".anthropicwebfetchtoolresulterror", + "AnthropicWebSearchResult": ".anthropicwebsearchresult", + "AnthropicWebSearchResultType": ".anthropicwebsearchresult", + "AnthropicWebSearchResultTypedDict": ".anthropicwebsearchresult", "AnthropicWebSearchResultBlockParam": ".anthropicwebsearchresultblockparam", "AnthropicWebSearchResultBlockParamType": ".anthropicwebsearchresultblockparam", "AnthropicWebSearchResultBlockParamTypedDict": ".anthropicwebsearchresultblockparam", + "AnthropicWebSearchToolResult": ".anthropicwebsearchtoolresult", + "AnthropicWebSearchToolResultContent": ".anthropicwebsearchtoolresult", + "AnthropicWebSearchToolResultContentTypedDict": ".anthropicwebsearchtoolresult", + "AnthropicWebSearchToolResultType": ".anthropicwebsearchtoolresult", + "AnthropicWebSearchToolResultTypedDict": ".anthropicwebsearchtoolresult", + "AnthropicWebSearchToolResultError": ".anthropicwebsearchtoolresulterror", + "AnthropicWebSearchToolResultErrorErrorCode": ".anthropicwebsearchtoolresulterror", + "AnthropicWebSearchToolResultErrorType": ".anthropicwebsearchtoolresulterror", + "AnthropicWebSearchToolResultErrorTypedDict": ".anthropicwebsearchtoolresulterror", "AnthropicWebSearchToolUserLocation": ".anthropicwebsearchtooluserlocation", "AnthropicWebSearchToolUserLocationType": ".anthropicwebsearchtooluserlocation", "AnthropicWebSearchToolUserLocationTypedDict": ".anthropicwebsearchtooluserlocation", @@ -6352,6 +7394,183 @@ "BashServerToolEngine": ".bashservertoolengine", "BashServerToolEnvironment": ".bashservertoolenvironment", "BashServerToolEnvironmentTypedDict": ".bashservertoolenvironment", + "BatchDeletedObject": ".batchdeletedobject", + "BatchDeletedObjectObject": ".batchdeletedobject", + "BatchDeletedObjectTypedDict": ".batchdeletedobject", + "BatchDeletionOutcome": ".batchdeletionoutcome", + "BatchDeletionTargets": ".batchdeletiontargets", + "BatchDeletionTargetsTypedDict": ".batchdeletiontargets", + "Openrouter": ".batchdeletiontargets", + "Upstream": ".batchdeletiontargets", + "UpstreamTypedDict": ".batchdeletiontargets", + "BatchErrorResponseError": ".batcherrorresponse", + "BatchErrorResponseErrorTypedDict": ".batcherrorresponse", + "BatchListItem": ".batchlistitem", + "BatchListItemCompletionTokensDetails": ".batchlistitem", + "BatchListItemCompletionTokensDetailsTypedDict": ".batchlistitem", + "BatchListItemCompletionWindow": ".batchlistitem", + "BatchListItemError": ".batchlistitem", + "BatchListItemErrorTypedDict": ".batchlistitem", + "BatchListItemObject": ".batchlistitem", + "BatchListItemPromptTokensDetails": ".batchlistitem", + "BatchListItemPromptTokensDetailsTypedDict": ".batchlistitem", + "BatchListItemRequestCounts": ".batchlistitem", + "BatchListItemRequestCountsTypedDict": ".batchlistitem", + "BatchListItemServerToolUse": ".batchlistitem", + "BatchListItemServerToolUseTypedDict": ".batchlistitem", + "BatchListItemStatus": ".batchlistitem", + "BatchListItemTypedDict": ".batchlistitem", + "BatchListItemUsage": ".batchlistitem", + "BatchListItemUsageTypedDict": ".batchlistitem", + "BatchListResponse": ".batchlistresponse", + "BatchListResponseObject": ".batchlistresponse", + "BatchListResponseTypedDict": ".batchlistresponse", + "BatchListStatus": ".batchliststatus", + "BatchListTimestamp": ".batchlisttimestamp", + "BatchListTimestampTypedDict": ".batchlisttimestamp", + "Annotation": ".batchobject", + "AnnotationContentUnion": ".batchobject", + "AnnotationContentUnionTypedDict": ".batchobject", + "AnnotationFile": ".batchobject", + "AnnotationFileTypedDict": ".batchobject", + "AnnotationTypeFile": ".batchobject", + "AnnotationTypeURLCitation": ".batchobject", + "AnnotationTypedDict": ".batchobject", + "AnnotationURLCitation": ".batchobject", + "AnnotationURLCitationTypedDict": ".batchobject", + "AnnotationWebSearchCitation": ".batchobject", + "AnnotationWebSearchCitationTypedDict": ".batchobject", + "BatchObject": ".batchobject", + "BatchObjectCompletionTokensDetails": ".batchobject", + "BatchObjectCompletionTokensDetailsTypedDict": ".batchobject", + "BatchObjectCompletionWindow": ".batchobject", + "BatchObjectData": ".batchobject", + "BatchObjectDataTypedDict": ".batchobject", + "BatchObjectDebug": ".batchobject", + "BatchObjectDebugTypedDict": ".batchobject", + "BatchObjectError": ".batchobject", + "BatchObjectErrorTypedDict": ".batchobject", + "BatchObjectEvent": ".batchobject", + "BatchObjectFile": ".batchobject", + "BatchObjectFileTypedDict": ".batchobject", + "BatchObjectFunction": ".batchobject", + "BatchObjectFunctionTypedDict": ".batchobject", + "BatchObjectImageURL": ".batchobject", + "BatchObjectImageURLTypedDict": ".batchobject", + "BatchObjectObjectBatch": ".batchobject", + "BatchObjectPromptTokensDetails": ".batchobject", + "BatchObjectPromptTokensDetailsTypedDict": ".batchobject", + "BatchObjectRequestCounts": ".batchobject", + "BatchObjectRequestCountsTypedDict": ".batchobject", + "BatchObjectResponse": ".batchobject", + "BatchObjectResponseTypedDict": ".batchobject", + "BatchObjectRole": ".batchobject", + "BatchObjectServerToolUse": ".batchobject", + "BatchObjectServerToolUseDetails": ".batchobject", + "BatchObjectServerToolUseDetailsTypedDict": ".batchobject", + "BatchObjectServerToolUseTypedDict": ".batchobject", + "BatchObjectStatus": ".batchobject", + "BatchObjectTimings": ".batchobject", + "BatchObjectTimingsTypedDict": ".batchobject", + "BatchObjectTypeMessage": ".batchobject", + "BatchObjectTypedDict": ".batchobject", + "BatchObjectURLCitation": ".batchobject", + "BatchObjectURLCitationTypedDict": ".batchobject", + "BatchObjectUsage": ".batchobject", + "BatchObjectUsageTypedDict": ".batchobject", + "Body": ".batchobject", + "BodyChatCompletion": ".batchobject", + "BodyChatCompletionTypedDict": ".batchobject", + "BodyCompletionTokensDetails": ".batchobject", + "BodyCompletionTokensDetailsTypedDict": ".batchobject", + "BodyList": ".batchobject", + "BodyListTypedDict": ".batchobject", + "BodyMessage": ".batchobject", + "BodyMessageTypedDict": ".batchobject", + "BodyObjectChatCompletion": ".batchobject", + "BodyObjectList": ".batchobject", + "BodyPromptTokensDetails1": ".batchobject", + "BodyPromptTokensDetails1TypedDict": ".batchobject", + "BodyPromptTokensDetails2": ".batchobject", + "BodyPromptTokensDetails2TypedDict": ".batchobject", + "BodyServerToolUse": ".batchobject", + "BodyServerToolUseTypedDict": ".batchobject", + "BodyTypedDict": ".batchobject", + "BodyUsage1": ".batchobject", + "BodyUsage1TypedDict": ".batchobject", + "BodyUsage2": ".batchobject", + "BodyUsage2TypedDict": ".batchobject", + "BodyUsage3": ".batchobject", + "BodyUsage3TypedDict": ".batchobject", + "Choice": ".batchobject", + "ChoiceRole": ".batchobject", + "ChoiceTypeFunction": ".batchobject", + "ChoiceTypeImageURL": ".batchobject", + "ChoiceTypedDict": ".batchobject", + "ContentImageURL": ".batchobject", + "ContentImageURLImageURL": ".batchobject", + "ContentImageURLImageURLTypedDict": ".batchobject", + "ContentImageURLTypedDict": ".batchobject", + "ContentText": ".batchobject", + "ContentTextTypedDict": ".batchobject", + "ContentTopLogprob": ".batchobject", + "ContentTopLogprobTypedDict": ".batchobject", + "Embedding": ".batchobject", + "EmbeddingTypedDict": ".batchobject", + "FileTypeImageURL": ".batchobject", + "FileTypeText": ".batchobject", + "Image": ".batchobject", + "ImageTypedDict": ".batchobject", + "Logprobs": ".batchobject", + "LogprobsContent": ".batchobject", + "LogprobsContentTypedDict": ".batchobject", + "LogprobsTypedDict": ".batchobject", + "Message": ".batchobject", + "MessageTypedDict": ".batchobject", + "ObjectEmbedding": ".batchobject", + "ReasoningDetail": ".batchobject", + "ReasoningDetailTypedDict": ".batchobject", + "Refusal": ".batchobject", + "RefusalTopLogprob": ".batchobject", + "RefusalTopLogprobTypedDict": ".batchobject", + "RefusalTypedDict": ".batchobject", + "Result": ".batchobject", + "ResultError": ".batchobject", + "ResultErrorTypedDict": ".batchobject", + "ResultTypedDict": ".batchobject", + "ToolCall": ".batchobject", + "ToolCallTypedDict": ".batchobject", + "TypeWebSearchCitation": ".batchobject", + "UnknownAnnotation": ".batchobject", + "UnknownAnnotationContentUnion": ".batchobject", + "UnknownReasoningDetail": ".batchobject", + "WebSearchCitation": ".batchobject", + "WebSearchCitationTypedDict": ".batchobject", + "BatchPaymentRequiredResponseCompletionTokensDetails": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseCompletionTokensDetailsTypedDict": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseCompletionWindow": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseError": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseErrorTypedDict": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseObject": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponsePromptTokensDetails": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponsePromptTokensDetailsTypedDict": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseRequestCounts": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseRequestCountsTypedDict": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseServerToolUse": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseServerToolUseTypedDict": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseStatus": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseUsage": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseUsageTypedDict": ".batchpaymentrequiredresponse_error", + "BatchProviderPreferences": ".batchproviderpreferences", + "BatchProviderPreferencesOnly": ".batchproviderpreferences", + "BatchProviderPreferencesOnlyTypedDict": ".batchproviderpreferences", + "BatchProviderPreferencesTypedDict": ".batchproviderpreferences", + "BatchSubmitBody": ".batchsubmitbody", + "BatchSubmitBodyCompletionWindow": ".batchsubmitbody", + "BatchSubmitBodyTypedDict": ".batchsubmitbody", + "Endpoint": ".batchsubmitbody", + "Request": ".batchsubmitbody", + "RequestTypedDict": ".batchsubmitbody", "BooleanCapability": ".booleancapability", "BooleanCapabilityType": ".booleancapability", "BooleanCapabilityTypedDict": ".booleancapability", @@ -6754,14 +7973,14 @@ "DatetimeServerToolTypedDict": ".datetimeservertool", "DatetimeServerToolConfig": ".datetimeservertoolconfig", "DatetimeServerToolConfigTypedDict": ".datetimeservertoolconfig", - "Debug": ".debugevent", "DebugEvent": ".debugevent", + "DebugEventDebug": ".debugevent", + "DebugEventDebugTypedDict": ".debugevent", + "DebugEventEvent": ".debugevent", + "DebugEventTimings": ".debugevent", + "DebugEventTimingsTypedDict": ".debugevent", "DebugEventType": ".debugevent", "DebugEventTypedDict": ".debugevent", - "DebugTypedDict": ".debugevent", - "Event": ".debugevent", - "Timings": ".debugevent", - "TimingsTypedDict": ".debugevent", "DecisionsChoiceAnswer": ".decisionschoiceanswer", "DecisionsChoiceAnswerType": ".decisionschoiceanswer", "DecisionsChoiceAnswerTypedDict": ".decisionschoiceanswer", @@ -6903,6 +8122,7 @@ "FilesServerToolTypedDict": ".filesservertool", "FilesServerToolConfig": ".filesservertoolconfig", "FilesServerToolConfigTypedDict": ".filesservertoolconfig", + "FinishReason": ".finishreason", "ForbiddenResponseErrorData": ".forbiddenresponseerrordata", "ForbiddenResponseErrorDataTypedDict": ".forbiddenresponseerrordata", "FormatJSONObjectConfig": ".formatjsonobjectconfig", @@ -7121,9 +8341,9 @@ "ImageGenerationUsageCompletionTokensDetailsTypedDict": ".imagegenerationusage", "ImageGenerationUsagePromptTokensDetails": ".imagegenerationusage", "ImageGenerationUsagePromptTokensDetailsTypedDict": ".imagegenerationusage", + "ImageGenerationUsageServerToolUse": ".imagegenerationusage", + "ImageGenerationUsageServerToolUseTypedDict": ".imagegenerationusage", "ImageGenerationUsageTypedDict": ".imagegenerationusage", - "ServerToolUse": ".imagegenerationusage", - "ServerToolUseTypedDict": ".imagegenerationusage", "ImageGenPartialImageEvent": ".imagegenpartialimageevent", "ImageGenPartialImageEventType": ".imagegenpartialimageevent", "ImageGenPartialImageEventTypedDict": ".imagegenpartialimageevent", @@ -7236,8 +8456,8 @@ "InternChatAssistantMessage": ".internchatassistantmessage", "InternChatAssistantMessageRole": ".internchatassistantmessage", "InternChatAssistantMessageTypedDict": ".internchatassistantmessage", - "FinishReason": ".internchatchoice", "InternChatChoice": ".internchatchoice", + "InternChatChoiceFinishReason": ".internchatchoice", "InternChatChoiceTypedDict": ".internchatchoice", "InternChatCompletionChunk": ".internchatcompletionchunk", "InternChatCompletionChunkObject": ".internchatcompletionchunk", @@ -7410,8 +8630,8 @@ "MessagesBashToolResultBlockFile": ".messagesbashtoolresultblock", "MessagesBashToolResultBlockFileTypedDict": ".messagesbashtoolresultblock", "MessagesBashToolResultBlockTypeContainerFileCitation": ".messagesbashtoolresultblock", + "MessagesBashToolResultBlockTypeOpenrouterBashToolResult": ".messagesbashtoolresultblock", "MessagesBashToolResultBlockTypedDict": ".messagesbashtoolresultblock", - "TypeOpenrouterBashToolResult": ".messagesbashtoolresultblock", "MessagesFallbackParam": ".messagesfallbackparam", "MessagesFallbackParamTypedDict": ".messagesfallbackparam", "ContentCompaction": ".messagesmessageparam", @@ -7432,7 +8652,6 @@ "ContentWebSearchToolResultError": ".messagesmessageparam", "ContentWebSearchToolResultErrorTypedDict": ".messagesmessageparam", "ContentWebSearchToolResultTypedDict": ".messagesmessageparam", - "ErrorCode": ".messagesmessageparam", "MessagesMessageParam": ".messagesmessageparam", "MessagesMessageParamContentUnion1": ".messagesmessageparam", "MessagesMessageParamContentUnion1TypedDict": ".messagesmessageparam", @@ -7444,17 +8663,18 @@ "MessagesMessageParamContentUnion4TypedDict": ".messagesmessageparam", "MessagesMessageParamContentUnion5": ".messagesmessageparam", "MessagesMessageParamContentUnion5TypedDict": ".messagesmessageparam", + "MessagesMessageParamErrorCode": ".messagesmessageparam", "MessagesMessageParamRole": ".messagesmessageparam", "MessagesMessageParamTypeCompaction": ".messagesmessageparam", + "MessagesMessageParamTypeRedactedThinking": ".messagesmessageparam", + "MessagesMessageParamTypeServerToolUse": ".messagesmessageparam", + "MessagesMessageParamTypeThinking": ".messagesmessageparam", "MessagesMessageParamTypeToolReference": ".messagesmessageparam", + "MessagesMessageParamTypeToolUse": ".messagesmessageparam", + "MessagesMessageParamTypeWebSearchToolResult": ".messagesmessageparam", + "MessagesMessageParamTypeWebSearchToolResultError": ".messagesmessageparam", "MessagesMessageParamTypedDict": ".messagesmessageparam", - "TypeRedactedThinking": ".messagesmessageparam", - "TypeServerToolUse": ".messagesmessageparam", - "TypeThinking": ".messagesmessageparam", "TypeToolResult": ".messagesmessageparam", - "TypeToolUse": ".messagesmessageparam", - "TypeWebSearchToolResult": ".messagesmessageparam", - "TypeWebSearchToolResultError": ".messagesmessageparam", "MessagesOutputConfig": ".messagesoutputconfig", "MessagesOutputConfigEffort": ".messagesoutputconfig", "MessagesOutputConfigFormat": ".messagesoutputconfig", @@ -7560,8 +8780,8 @@ "MessagesShellToolResultBlockFile": ".messagesshelltoolresultblock", "MessagesShellToolResultBlockFileTypedDict": ".messagesshelltoolresultblock", "MessagesShellToolResultBlockTypeContainerFileCitation": ".messagesshelltoolresultblock", + "MessagesShellToolResultBlockTypeOpenrouterShellToolResult": ".messagesshelltoolresultblock", "MessagesShellToolResultBlockTypedDict": ".messagesshelltoolresultblock", - "TypeOpenrouterShellToolResult": ".messagesshelltoolresultblock", "MessagesToolAdditionBlock": ".messagestooladditionblock", "MessagesToolAdditionBlockToolMcpToolReference": ".messagestooladditionblock", "MessagesToolAdditionBlockToolMcpToolReferenceTypedDict": ".messagestooladditionblock", @@ -7862,6 +9082,28 @@ "OpenRouterWebSearchServerTool": ".openrouterwebsearchservertool", "OpenRouterWebSearchServerToolType": ".openrouterwebsearchservertool", "OpenRouterWebSearchServerToolTypedDict": ".openrouterwebsearchservertool", + "ORAnthropicBashToolResult": ".oranthropicbashtoolresult", + "ORAnthropicBashToolResultFile": ".oranthropicbashtoolresult", + "ORAnthropicBashToolResultFileTypedDict": ".oranthropicbashtoolresult", + "ORAnthropicBashToolResultTypeContainerFileCitation": ".oranthropicbashtoolresult", + "ORAnthropicBashToolResultTypeOpenrouterBashToolResult": ".oranthropicbashtoolresult", + "ORAnthropicBashToolResultTypedDict": ".oranthropicbashtoolresult", + "ORAnthropicContentBlock": ".oranthropiccontentblock", + "ORAnthropicContentBlockTypedDict": ".oranthropiccontentblock", + "UnknownORAnthropicContentBlock": ".oranthropiccontentblock", + "ORAnthropicNullableCaller": ".oranthropicnullablecaller", + "ORAnthropicNullableCallerTypedDict": ".oranthropicnullablecaller", + "UnknownORAnthropicNullableCaller": ".oranthropicnullablecaller", + "ORAnthropicServerToolUseBlock": ".oranthropicservertooluseblock", + "ORAnthropicServerToolUseBlockType": ".oranthropicservertooluseblock", + "ORAnthropicServerToolUseBlockTypedDict": ".oranthropicservertooluseblock", + "ORAnthropicShellToolResult": ".oranthropicshelltoolresult", + "ORAnthropicShellToolResultFile": ".oranthropicshelltoolresult", + "ORAnthropicShellToolResultFileTypedDict": ".oranthropicshelltoolresult", + "ORAnthropicShellToolResultTypeContainerFileCitation": ".oranthropicshelltoolresult", + "ORAnthropicShellToolResultTypeOpenrouterShellToolResult": ".oranthropicshelltoolresult", + "ORAnthropicShellToolResultTypedDict": ".oranthropicshelltoolresult", + "ORAnthropicStopReason": ".oranthropicstopreason", "OutputAdvisorServerToolItem": ".outputadvisorservertoolitem", "OutputAdvisorServerToolItemType": ".outputadvisorservertoolitem", "OutputAdvisorServerToolItemTypedDict": ".outputadvisorservertoolitem", @@ -7925,10 +9167,10 @@ "FailedModel": ".outputfusionservertoolitem", "FailedModelTypedDict": ".outputfusionservertoolitem", "OutputFusionServerToolItem": ".outputfusionservertoolitem", + "OutputFusionServerToolItemResponse": ".outputfusionservertoolitem", + "OutputFusionServerToolItemResponseTypedDict": ".outputfusionservertoolitem", "OutputFusionServerToolItemType": ".outputfusionservertoolitem", "OutputFusionServerToolItemTypedDict": ".outputfusionservertoolitem", - "Response": ".outputfusionservertoolitem", - "ResponseTypedDict": ".outputfusionservertoolitem", "OutputImageGenerationCallItem": ".outputimagegenerationcallitem", "OutputImageGenerationCallItemType": ".outputimagegenerationcallitem", "OutputImageGenerationCallItemTypedDict": ".outputimagegenerationcallitem", @@ -8424,8 +9666,8 @@ "SubagentServerToolOpenRouterTypedDict": ".subagentservertool_openrouter", "SubagentServerToolConfig": ".subagentservertoolconfig", "SubagentServerToolConfigTypedDict": ".subagentservertoolconfig", - "Category": ".submitgenerationfeedbackrequest", "SubmitGenerationFeedbackRequest": ".submitgenerationfeedbackrequest", + "SubmitGenerationFeedbackRequestCategory": ".submitgenerationfeedbackrequest", "SubmitGenerationFeedbackRequestTypedDict": ".submitgenerationfeedbackrequest", "SubmitGenerationFeedbackResponse": ".submitgenerationfeedbackresponse", "SubmitGenerationFeedbackResponseData": ".submitgenerationfeedbackresponse", diff --git a/src/openrouter/components/anthropicadvisortoolresult.py b/src/openrouter/components/anthropicadvisortoolresult.py new file mode 100644 index 00000000..d3c9dda2 --- /dev/null +++ b/src/openrouter/components/anthropicadvisortoolresult.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Any, Dict, Literal +from typing_extensions import TypedDict + + +AnthropicAdvisorToolResultType = Literal["advisor_tool_result",] + + +class AnthropicAdvisorToolResultTypedDict(TypedDict): + content: Dict[str, Any] + tool_use_id: str + type: AnthropicAdvisorToolResultType + + +class AnthropicAdvisorToolResult(BaseModel): + content: Dict[str, Any] + + tool_use_id: str + + type: AnthropicAdvisorToolResultType diff --git a/src/openrouter/components/anthropicbashcodeexecutioncontent.py b/src/openrouter/components/anthropicbashcodeexecutioncontent.py new file mode 100644 index 00000000..29bde3fd --- /dev/null +++ b/src/openrouter/components/anthropicbashcodeexecutioncontent.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicbashcodeexecutionresult import ( + AnthropicBashCodeExecutionResult, + AnthropicBashCodeExecutionResultTypedDict, +) +from .anthropicbashcodeexecutiontoolresulterror import ( + AnthropicBashCodeExecutionToolResultError, + AnthropicBashCodeExecutionToolResultErrorTypedDict, +) +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +AnthropicBashCodeExecutionContentTypedDict = TypeAliasType( + "AnthropicBashCodeExecutionContentTypedDict", + Union[ + AnthropicBashCodeExecutionToolResultErrorTypedDict, + AnthropicBashCodeExecutionResultTypedDict, + ], +) + + +class UnknownAnthropicBashCodeExecutionContent(BaseModel): + r"""A AnthropicBashCodeExecutionContent variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_BASH_CODE_EXECUTION_CONTENT_VARIANTS: dict[str, Any] = { + "bash_code_execution_result": AnthropicBashCodeExecutionResult, + "bash_code_execution_tool_result_error": AnthropicBashCodeExecutionToolResultError, +} + + +AnthropicBashCodeExecutionContent = Annotated[ + Union[ + AnthropicBashCodeExecutionResult, + AnthropicBashCodeExecutionToolResultError, + UnknownAnthropicBashCodeExecutionContent, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANTHROPIC_BASH_CODE_EXECUTION_CONTENT_VARIANTS, + unknown_cls=UnknownAnthropicBashCodeExecutionContent, + union_name="AnthropicBashCodeExecutionContent", + ) + ), +] diff --git a/src/openrouter/components/anthropicbashcodeexecutionoutput.py b/src/openrouter/components/anthropicbashcodeexecutionoutput.py new file mode 100644 index 00000000..de397905 --- /dev/null +++ b/src/openrouter/components/anthropicbashcodeexecutionoutput.py @@ -0,0 +1,20 @@ +"""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 + + +AnthropicBashCodeExecutionOutputType = Literal["bash_code_execution_output",] + + +class AnthropicBashCodeExecutionOutputTypedDict(TypedDict): + file_id: str + type: AnthropicBashCodeExecutionOutputType + + +class AnthropicBashCodeExecutionOutput(BaseModel): + file_id: str + + type: AnthropicBashCodeExecutionOutputType diff --git a/src/openrouter/components/anthropicbashcodeexecutionresult.py b/src/openrouter/components/anthropicbashcodeexecutionresult.py new file mode 100644 index 00000000..518ef1e9 --- /dev/null +++ b/src/openrouter/components/anthropicbashcodeexecutionresult.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicbashcodeexecutionoutput import ( + AnthropicBashCodeExecutionOutput, + AnthropicBashCodeExecutionOutputTypedDict, +) +from openrouter.types import BaseModel +from typing import List, Literal +from typing_extensions import TypedDict + + +AnthropicBashCodeExecutionResultType = Literal["bash_code_execution_result",] + + +class AnthropicBashCodeExecutionResultTypedDict(TypedDict): + content: List[AnthropicBashCodeExecutionOutputTypedDict] + return_code: int + stderr: str + stdout: str + type: AnthropicBashCodeExecutionResultType + + +class AnthropicBashCodeExecutionResult(BaseModel): + content: List[AnthropicBashCodeExecutionOutput] + + return_code: int + + stderr: str + + stdout: str + + type: AnthropicBashCodeExecutionResultType diff --git a/src/openrouter/components/anthropicbashcodeexecutiontoolresult.py b/src/openrouter/components/anthropicbashcodeexecutiontoolresult.py new file mode 100644 index 00000000..941a8a05 --- /dev/null +++ b/src/openrouter/components/anthropicbashcodeexecutiontoolresult.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicbashcodeexecutioncontent import ( + AnthropicBashCodeExecutionContent, + AnthropicBashCodeExecutionContentTypedDict, +) +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicBashCodeExecutionToolResultType = Literal["bash_code_execution_tool_result",] + + +class AnthropicBashCodeExecutionToolResultTypedDict(TypedDict): + content: AnthropicBashCodeExecutionContentTypedDict + tool_use_id: str + type: AnthropicBashCodeExecutionToolResultType + + +class AnthropicBashCodeExecutionToolResult(BaseModel): + content: AnthropicBashCodeExecutionContent + + tool_use_id: str + + type: AnthropicBashCodeExecutionToolResultType diff --git a/src/openrouter/components/anthropicbashcodeexecutiontoolresulterror.py b/src/openrouter/components/anthropicbashcodeexecutiontoolresulterror.py new file mode 100644 index 00000000..f390d0d6 --- /dev/null +++ b/src/openrouter/components/anthropicbashcodeexecutiontoolresulterror.py @@ -0,0 +1,34 @@ +"""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 + + +AnthropicBashCodeExecutionToolResultErrorErrorCode = Union[ + Literal[ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded", + "output_file_too_large", + ], + UnrecognizedStr, +] + + +AnthropicBashCodeExecutionToolResultErrorType = Literal[ + "bash_code_execution_tool_result_error", +] + + +class AnthropicBashCodeExecutionToolResultErrorTypedDict(TypedDict): + error_code: AnthropicBashCodeExecutionToolResultErrorErrorCode + type: AnthropicBashCodeExecutionToolResultErrorType + + +class AnthropicBashCodeExecutionToolResultError(BaseModel): + error_code: AnthropicBashCodeExecutionToolResultErrorErrorCode + + type: AnthropicBashCodeExecutionToolResultErrorType diff --git a/src/openrouter/components/anthropiccaller.py b/src/openrouter/components/anthropiccaller.py new file mode 100644 index 00000000..c3817a83 --- /dev/null +++ b/src/openrouter/components/anthropiccaller.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccodeexecution20250825caller import ( + AnthropicCodeExecution20250825Caller, + AnthropicCodeExecution20250825CallerTypedDict, +) +from .anthropiccodeexecution20260120caller import ( + AnthropicCodeExecution20260120Caller, + AnthropicCodeExecution20260120CallerTypedDict, +) +from .anthropicdirectcaller import AnthropicDirectCaller, AnthropicDirectCallerTypedDict +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +AnthropicCallerTypedDict = TypeAliasType( + "AnthropicCallerTypedDict", + Union[ + AnthropicDirectCallerTypedDict, + AnthropicCodeExecution20250825CallerTypedDict, + AnthropicCodeExecution20260120CallerTypedDict, + ], +) + + +class UnknownAnthropicCaller(BaseModel): + r"""A AnthropicCaller variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_CALLER_VARIANTS: dict[str, Any] = { + "code_execution_20250825": AnthropicCodeExecution20250825Caller, + "code_execution_20260120": AnthropicCodeExecution20260120Caller, + "direct": AnthropicDirectCaller, +} + + +AnthropicCaller = Annotated[ + Union[ + AnthropicCodeExecution20250825Caller, + AnthropicCodeExecution20260120Caller, + AnthropicDirectCaller, + UnknownAnthropicCaller, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANTHROPIC_CALLER_VARIANTS, + unknown_cls=UnknownAnthropicCaller, + union_name="AnthropicCaller", + ) + ), +] diff --git a/src/openrouter/components/anthropiccitationcharlocation.py b/src/openrouter/components/anthropiccitationcharlocation.py new file mode 100644 index 00000000..6ced1553 --- /dev/null +++ b/src/openrouter/components/anthropiccitationcharlocation.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicCitationCharLocationType = Literal["char_location",] + + +class AnthropicCitationCharLocationTypedDict(TypedDict): + cited_text: str + document_index: int + document_title: Nullable[str] + end_char_index: int + file_id: Nullable[str] + start_char_index: int + type: AnthropicCitationCharLocationType + + +class AnthropicCitationCharLocation(BaseModel): + cited_text: str + + document_index: int + + document_title: Nullable[str] + + end_char_index: int + + file_id: Nullable[str] + + start_char_index: int + + type: AnthropicCitationCharLocationType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropiccitationcontentblocklocation.py b/src/openrouter/components/anthropiccitationcontentblocklocation.py new file mode 100644 index 00000000..045e0d65 --- /dev/null +++ b/src/openrouter/components/anthropiccitationcontentblocklocation.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicCitationContentBlockLocationType = Literal["content_block_location",] + + +class AnthropicCitationContentBlockLocationTypedDict(TypedDict): + cited_text: str + document_index: int + document_title: Nullable[str] + end_block_index: int + file_id: Nullable[str] + start_block_index: int + type: AnthropicCitationContentBlockLocationType + + +class AnthropicCitationContentBlockLocation(BaseModel): + cited_text: str + + document_index: int + + document_title: Nullable[str] + + end_block_index: int + + file_id: Nullable[str] + + start_block_index: int + + type: AnthropicCitationContentBlockLocationType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropiccitationpagelocation.py b/src/openrouter/components/anthropiccitationpagelocation.py new file mode 100644 index 00000000..42127615 --- /dev/null +++ b/src/openrouter/components/anthropiccitationpagelocation.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicCitationPageLocationType = Literal["page_location",] + + +class AnthropicCitationPageLocationTypedDict(TypedDict): + cited_text: str + document_index: int + document_title: Nullable[str] + end_page_number: int + file_id: Nullable[str] + start_page_number: int + type: AnthropicCitationPageLocationType + + +class AnthropicCitationPageLocation(BaseModel): + cited_text: str + + document_index: int + + document_title: Nullable[str] + + end_page_number: int + + file_id: Nullable[str] + + start_page_number: int + + type: AnthropicCitationPageLocationType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropiccitationsconfig.py b/src/openrouter/components/anthropiccitationsconfig.py new file mode 100644 index 00000000..ad09de36 --- /dev/null +++ b/src/openrouter/components/anthropiccitationsconfig.py @@ -0,0 +1,13 @@ +"""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 AnthropicCitationsConfigTypedDict(TypedDict): + enabled: bool + + +class AnthropicCitationsConfig(BaseModel): + enabled: bool diff --git a/src/openrouter/components/anthropiccitationsearchresultlocation.py b/src/openrouter/components/anthropiccitationsearchresultlocation.py new file mode 100644 index 00000000..8a90ed4f --- /dev/null +++ b/src/openrouter/components/anthropiccitationsearchresultlocation.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicCitationSearchResultLocationType = Literal["search_result_location",] + + +class AnthropicCitationSearchResultLocationTypedDict(TypedDict): + cited_text: str + end_block_index: int + search_result_index: int + source: str + start_block_index: int + title: Nullable[str] + type: AnthropicCitationSearchResultLocationType + + +class AnthropicCitationSearchResultLocation(BaseModel): + cited_text: str + + end_block_index: int + + search_result_index: int + + source: str + + start_block_index: int + + title: Nullable[str] + + type: AnthropicCitationSearchResultLocationType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropiccitationwebsearchresultlocation.py b/src/openrouter/components/anthropiccitationwebsearchresultlocation.py new file mode 100644 index 00000000..4d061c61 --- /dev/null +++ b/src/openrouter/components/anthropiccitationwebsearchresultlocation.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicCitationWebSearchResultLocationType = Literal["web_search_result_location",] + + +class AnthropicCitationWebSearchResultLocationTypedDict(TypedDict): + cited_text: str + encrypted_index: str + title: Nullable[str] + type: AnthropicCitationWebSearchResultLocationType + url: str + + +class AnthropicCitationWebSearchResultLocation(BaseModel): + cited_text: str + + encrypted_index: str + + title: Nullable[str] + + type: AnthropicCitationWebSearchResultLocationType + + url: str + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropiccodeexecution20250825caller.py b/src/openrouter/components/anthropiccodeexecution20250825caller.py new file mode 100644 index 00000000..181666c5 --- /dev/null +++ b/src/openrouter/components/anthropiccodeexecution20250825caller.py @@ -0,0 +1,20 @@ +"""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 + + +AnthropicCodeExecution20250825CallerType = Literal["code_execution_20250825",] + + +class AnthropicCodeExecution20250825CallerTypedDict(TypedDict): + tool_id: str + type: AnthropicCodeExecution20250825CallerType + + +class AnthropicCodeExecution20250825Caller(BaseModel): + tool_id: str + + type: AnthropicCodeExecution20250825CallerType diff --git a/src/openrouter/components/anthropiccodeexecution20260120caller.py b/src/openrouter/components/anthropiccodeexecution20260120caller.py new file mode 100644 index 00000000..87b00d06 --- /dev/null +++ b/src/openrouter/components/anthropiccodeexecution20260120caller.py @@ -0,0 +1,20 @@ +"""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 + + +AnthropicCodeExecution20260120CallerType = Literal["code_execution_20260120",] + + +class AnthropicCodeExecution20260120CallerTypedDict(TypedDict): + tool_id: str + type: AnthropicCodeExecution20260120CallerType + + +class AnthropicCodeExecution20260120Caller(BaseModel): + tool_id: str + + type: AnthropicCodeExecution20260120CallerType diff --git a/src/openrouter/components/anthropiccodeexecutioncontent.py b/src/openrouter/components/anthropiccodeexecutioncontent.py new file mode 100644 index 00000000..e34862f2 --- /dev/null +++ b/src/openrouter/components/anthropiccodeexecutioncontent.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccodeexecutionresult import ( + AnthropicCodeExecutionResult, + AnthropicCodeExecutionResultTypedDict, +) +from .anthropiccodeexecutiontoolresulterror import ( + AnthropicCodeExecutionToolResultError, + AnthropicCodeExecutionToolResultErrorTypedDict, +) +from .anthropicencryptedcodeexecutionresult import ( + AnthropicEncryptedCodeExecutionResult, + AnthropicEncryptedCodeExecutionResultTypedDict, +) +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +AnthropicCodeExecutionContentTypedDict = TypeAliasType( + "AnthropicCodeExecutionContentTypedDict", + Union[ + AnthropicCodeExecutionToolResultErrorTypedDict, + AnthropicCodeExecutionResultTypedDict, + AnthropicEncryptedCodeExecutionResultTypedDict, + ], +) + + +class UnknownAnthropicCodeExecutionContent(BaseModel): + r"""A AnthropicCodeExecutionContent variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_CODE_EXECUTION_CONTENT_VARIANTS: dict[str, Any] = { + "code_execution_result": AnthropicCodeExecutionResult, + "code_execution_tool_result_error": AnthropicCodeExecutionToolResultError, + "encrypted_code_execution_result": AnthropicEncryptedCodeExecutionResult, +} + + +AnthropicCodeExecutionContent = Annotated[ + Union[ + AnthropicCodeExecutionResult, + AnthropicCodeExecutionToolResultError, + AnthropicEncryptedCodeExecutionResult, + UnknownAnthropicCodeExecutionContent, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANTHROPIC_CODE_EXECUTION_CONTENT_VARIANTS, + unknown_cls=UnknownAnthropicCodeExecutionContent, + union_name="AnthropicCodeExecutionContent", + ) + ), +] diff --git a/src/openrouter/components/anthropiccodeexecutionoutput.py b/src/openrouter/components/anthropiccodeexecutionoutput.py new file mode 100644 index 00000000..8f648dcd --- /dev/null +++ b/src/openrouter/components/anthropiccodeexecutionoutput.py @@ -0,0 +1,20 @@ +"""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 + + +AnthropicCodeExecutionOutputType = Literal["code_execution_output",] + + +class AnthropicCodeExecutionOutputTypedDict(TypedDict): + file_id: str + type: AnthropicCodeExecutionOutputType + + +class AnthropicCodeExecutionOutput(BaseModel): + file_id: str + + type: AnthropicCodeExecutionOutputType diff --git a/src/openrouter/components/anthropiccodeexecutionresult.py b/src/openrouter/components/anthropiccodeexecutionresult.py new file mode 100644 index 00000000..08b6f163 --- /dev/null +++ b/src/openrouter/components/anthropiccodeexecutionresult.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccodeexecutionoutput import ( + AnthropicCodeExecutionOutput, + AnthropicCodeExecutionOutputTypedDict, +) +from openrouter.types import BaseModel +from typing import List, Literal +from typing_extensions import TypedDict + + +AnthropicCodeExecutionResultType = Literal["code_execution_result",] + + +class AnthropicCodeExecutionResultTypedDict(TypedDict): + content: List[AnthropicCodeExecutionOutputTypedDict] + return_code: int + stderr: str + stdout: str + type: AnthropicCodeExecutionResultType + + +class AnthropicCodeExecutionResult(BaseModel): + content: List[AnthropicCodeExecutionOutput] + + return_code: int + + stderr: str + + stdout: str + + type: AnthropicCodeExecutionResultType diff --git a/src/openrouter/components/anthropiccodeexecutiontoolresult.py b/src/openrouter/components/anthropiccodeexecutiontoolresult.py new file mode 100644 index 00000000..047c8b31 --- /dev/null +++ b/src/openrouter/components/anthropiccodeexecutiontoolresult.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccodeexecutioncontent import ( + AnthropicCodeExecutionContent, + AnthropicCodeExecutionContentTypedDict, +) +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicCodeExecutionToolResultType = Literal["code_execution_tool_result",] + + +class AnthropicCodeExecutionToolResultTypedDict(TypedDict): + content: AnthropicCodeExecutionContentTypedDict + tool_use_id: str + type: AnthropicCodeExecutionToolResultType + + +class AnthropicCodeExecutionToolResult(BaseModel): + content: AnthropicCodeExecutionContent + + tool_use_id: str + + type: AnthropicCodeExecutionToolResultType diff --git a/src/openrouter/components/anthropiccodeexecutiontoolresulterror.py b/src/openrouter/components/anthropiccodeexecutiontoolresulterror.py new file mode 100644 index 00000000..113e7dc6 --- /dev/null +++ b/src/openrouter/components/anthropiccodeexecutiontoolresulterror.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicservertoolerrorcode import AnthropicServerToolErrorCode +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicCodeExecutionToolResultErrorType = Literal["code_execution_tool_result_error",] + + +class AnthropicCodeExecutionToolResultErrorTypedDict(TypedDict): + error_code: AnthropicServerToolErrorCode + type: AnthropicCodeExecutionToolResultErrorType + + +class AnthropicCodeExecutionToolResultError(BaseModel): + error_code: AnthropicServerToolErrorCode + + type: AnthropicCodeExecutionToolResultErrorType diff --git a/src/openrouter/components/anthropiccompactionblock.py b/src/openrouter/components/anthropiccompactionblock.py new file mode 100644 index 00000000..f69cb21d --- /dev/null +++ b/src/openrouter/components/anthropiccompactionblock.py @@ -0,0 +1,55 @@ +"""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 + + +AnthropicCompactionBlockType = Literal["compaction",] + + +class AnthropicCompactionBlockTypedDict(TypedDict): + content: Nullable[str] + type: AnthropicCompactionBlockType + encrypted_content: NotRequired[Nullable[str]] + + +class AnthropicCompactionBlock(BaseModel): + content: Nullable[str] + + type: AnthropicCompactionBlockType + + encrypted_content: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["encrypted_content"]) + nullable_fields = set(["content", "encrypted_content"]) + 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/anthropiccontainer.py b/src/openrouter/components/anthropiccontainer.py new file mode 100644 index 00000000..abfe56b2 --- /dev/null +++ b/src/openrouter/components/anthropiccontainer.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccontainerskill import ( + AnthropicContainerSkill, + AnthropicContainerSkillTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class AnthropicContainerTypedDict(TypedDict): + expires_at: str + id: str + skills: NotRequired[Nullable[List[AnthropicContainerSkillTypedDict]]] + + +class AnthropicContainer(BaseModel): + expires_at: str + + id: str + + skills: OptionalNullable[List[AnthropicContainerSkill]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["skills"]) + nullable_fields = set(["skills"]) + 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/anthropiccontainerskill.py b/src/openrouter/components/anthropiccontainerskill.py new file mode 100644 index 00000000..3256669c --- /dev/null +++ b/src/openrouter/components/anthropiccontainerskill.py @@ -0,0 +1,29 @@ +"""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 + + +AnthropicContainerSkillType = Union[ + Literal[ + "anthropic", + "custom", + ], + UnrecognizedStr, +] + + +class AnthropicContainerSkillTypedDict(TypedDict): + skill_id: str + type: AnthropicContainerSkillType + version: str + + +class AnthropicContainerSkill(BaseModel): + skill_id: str + + type: AnthropicContainerSkillType + + version: str diff --git a/src/openrouter/components/anthropiccontainerupload.py b/src/openrouter/components/anthropiccontainerupload.py new file mode 100644 index 00000000..aecc5f27 --- /dev/null +++ b/src/openrouter/components/anthropiccontainerupload.py @@ -0,0 +1,20 @@ +"""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 + + +AnthropicContainerUploadType = Literal["container_upload",] + + +class AnthropicContainerUploadTypedDict(TypedDict): + file_id: str + type: AnthropicContainerUploadType + + +class AnthropicContainerUpload(BaseModel): + file_id: str + + type: AnthropicContainerUploadType diff --git a/src/openrouter/components/anthropicdirectcaller.py b/src/openrouter/components/anthropicdirectcaller.py new file mode 100644 index 00000000..507daf9c --- /dev/null +++ b/src/openrouter/components/anthropicdirectcaller.py @@ -0,0 +1,17 @@ +"""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 + + +AnthropicDirectCallerType = Literal["direct",] + + +class AnthropicDirectCallerTypedDict(TypedDict): + type: AnthropicDirectCallerType + + +class AnthropicDirectCaller(BaseModel): + type: AnthropicDirectCallerType diff --git a/src/openrouter/components/anthropicdocumentblock.py b/src/openrouter/components/anthropicdocumentblock.py new file mode 100644 index 00000000..44608934 --- /dev/null +++ b/src/openrouter/components/anthropicdocumentblock.py @@ -0,0 +1,113 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicbase64pdfsource import ( + AnthropicBase64PdfSource, + AnthropicBase64PdfSourceTypedDict, +) +from .anthropiccitationsconfig import ( + AnthropicCitationsConfig, + AnthropicCitationsConfigTypedDict, +) +from .anthropicplaintextsource import ( + AnthropicPlainTextSource, + AnthropicPlainTextSourceTypedDict, +) +from functools import partial +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AnthropicDocumentBlockSourceTypedDict = TypeAliasType( + "AnthropicDocumentBlockSourceTypedDict", + Union[AnthropicBase64PdfSourceTypedDict, AnthropicPlainTextSourceTypedDict], +) + + +class UnknownAnthropicDocumentBlockSource(BaseModel): + r"""A AnthropicDocumentBlockSource variant the SDK doesn't recognize. Preserves the raw payload.""" + + media_type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_DOCUMENT_BLOCK_SOURCE_VARIANTS: dict[str, Any] = { + "application/pdf": AnthropicBase64PdfSource, + "text/plain": AnthropicPlainTextSource, +} + + +AnthropicDocumentBlockSource = Annotated[ + Union[ + AnthropicBase64PdfSource, + AnthropicPlainTextSource, + UnknownAnthropicDocumentBlockSource, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="media_type", + variants=_ANTHROPIC_DOCUMENT_BLOCK_SOURCE_VARIANTS, + unknown_cls=UnknownAnthropicDocumentBlockSource, + union_name="AnthropicDocumentBlockSource", + ) + ), +] + + +AnthropicDocumentBlockType = Literal["document",] + + +class AnthropicDocumentBlockTypedDict(TypedDict): + source: AnthropicDocumentBlockSourceTypedDict + title: Nullable[str] + type: AnthropicDocumentBlockType + citations: NotRequired[Nullable[AnthropicCitationsConfigTypedDict]] + + +class AnthropicDocumentBlock(BaseModel): + source: AnthropicDocumentBlockSource + + title: Nullable[str] + + type: AnthropicDocumentBlockType + + citations: OptionalNullable[AnthropicCitationsConfig] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["citations"]) + nullable_fields = set(["citations", "title"]) + 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/anthropicdocumentblockparam.py b/src/openrouter/components/anthropicdocumentblockparam.py index be2d48fe..f89f4b1b 100644 --- a/src/openrouter/components/anthropicdocumentblockparam.py +++ b/src/openrouter/components/anthropicdocumentblockparam.py @@ -128,12 +128,12 @@ class SourceContent(BaseModel): ] -TypeDocument = Literal["document",] +AnthropicDocumentBlockParamTypeDocument = Literal["document",] class AnthropicDocumentBlockParamTypedDict(TypedDict): source: AnthropicDocumentBlockParamSourceUnionTypedDict - type: TypeDocument + type: AnthropicDocumentBlockParamTypeDocument 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. 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]] @@ -144,7 +144,7 @@ class AnthropicDocumentBlockParamTypedDict(TypedDict): class AnthropicDocumentBlockParam(BaseModel): source: AnthropicDocumentBlockParamSourceUnion - type: TypeDocument + type: AnthropicDocumentBlockParamTypeDocument 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. 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.""" diff --git a/src/openrouter/components/anthropicencryptedcodeexecutionresult.py b/src/openrouter/components/anthropicencryptedcodeexecutionresult.py new file mode 100644 index 00000000..45e7fdcb --- /dev/null +++ b/src/openrouter/components/anthropicencryptedcodeexecutionresult.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccodeexecutionoutput import ( + AnthropicCodeExecutionOutput, + AnthropicCodeExecutionOutputTypedDict, +) +from openrouter.types import BaseModel +from typing import List, Literal +from typing_extensions import TypedDict + + +AnthropicEncryptedCodeExecutionResultType = Literal["encrypted_code_execution_result",] + + +class AnthropicEncryptedCodeExecutionResultTypedDict(TypedDict): + content: List[AnthropicCodeExecutionOutputTypedDict] + encrypted_stdout: str + return_code: int + stderr: str + type: AnthropicEncryptedCodeExecutionResultType + + +class AnthropicEncryptedCodeExecutionResult(BaseModel): + content: List[AnthropicCodeExecutionOutput] + + encrypted_stdout: str + + return_code: int + + stderr: str + + type: AnthropicEncryptedCodeExecutionResultType diff --git a/src/openrouter/components/anthropicinputtransformation.py b/src/openrouter/components/anthropicinputtransformation.py new file mode 100644 index 00000000..f585c44e --- /dev/null +++ b/src/openrouter/components/anthropicinputtransformation.py @@ -0,0 +1,73 @@ +"""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 +from typing_extensions import NotRequired, TypedDict + + +class AnthropicInputTransformationTypedDict(TypedDict): + r"""A server-side transformation Anthropic applied to the request input""" + + type: str + path: NotRequired[Nullable[str]] + reason: NotRequired[Nullable[str]] + + +class AnthropicInputTransformation(BaseModel): + r"""A server-side transformation Anthropic applied to the request input""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + type: str + + path: OptionalNullable[str] = UNSET + + reason: 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(["path", "reason"]) + nullable_fields = set(["path", "reason"]) + 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/anthropicoutputtokensdetails.py b/src/openrouter/components/anthropicoutputtokensdetails.py new file mode 100644 index 00000000..7349f8f9 --- /dev/null +++ b/src/openrouter/components/anthropicoutputtokensdetails.py @@ -0,0 +1,13 @@ +"""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 AnthropicOutputTokensDetailsTypedDict(TypedDict): + thinking_tokens: int + + +class AnthropicOutputTokensDetails(BaseModel): + thinking_tokens: int diff --git a/src/openrouter/components/anthropicredactedthinkingblock.py b/src/openrouter/components/anthropicredactedthinkingblock.py new file mode 100644 index 00000000..bd8bc681 --- /dev/null +++ b/src/openrouter/components/anthropicredactedthinkingblock.py @@ -0,0 +1,20 @@ +"""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 + + +AnthropicRedactedThinkingBlockType = Literal["redacted_thinking",] + + +class AnthropicRedactedThinkingBlockTypedDict(TypedDict): + data: str + type: AnthropicRedactedThinkingBlockType + + +class AnthropicRedactedThinkingBlock(BaseModel): + data: str + + type: AnthropicRedactedThinkingBlockType diff --git a/src/openrouter/components/anthropicrefusalstopdetails.py b/src/openrouter/components/anthropicrefusalstopdetails.py new file mode 100644 index 00000000..674698c5 --- /dev/null +++ b/src/openrouter/components/anthropicrefusalstopdetails.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import TypedDict + + +AnthropicRefusalStopDetailsCategory = Union[ + Literal[ + "cyber", + "bio", + "frontier_llm", + "reasoning_extraction", + "general_harms", + ], + UnrecognizedStr, +] + + +AnthropicRefusalStopDetailsType = Literal["refusal",] + + +class AnthropicRefusalStopDetailsTypedDict(TypedDict): + r"""Structured information about a refusal""" + + category: Nullable[AnthropicRefusalStopDetailsCategory] + explanation: Nullable[str] + type: AnthropicRefusalStopDetailsType + + +class AnthropicRefusalStopDetails(BaseModel): + r"""Structured information about a refusal""" + + category: Nullable[AnthropicRefusalStopDetailsCategory] + + explanation: Nullable[str] + + type: AnthropicRefusalStopDetailsType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropicservertoolerrorcode.py b/src/openrouter/components/anthropicservertoolerrorcode.py new file mode 100644 index 00000000..7eef1af2 --- /dev/null +++ b/src/openrouter/components/anthropicservertoolerrorcode.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 + + +AnthropicServerToolErrorCode = Union[ + Literal[ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/anthropicservertoolusage.py b/src/openrouter/components/anthropicservertoolusage.py new file mode 100644 index 00000000..a49ba8b6 --- /dev/null +++ b/src/openrouter/components/anthropicservertoolusage.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 AnthropicServerToolUsageTypedDict(TypedDict): + web_fetch_requests: int + web_search_requests: int + + +class AnthropicServerToolUsage(BaseModel): + web_fetch_requests: int + + web_search_requests: int diff --git a/src/openrouter/components/anthropicservicetier.py b/src/openrouter/components/anthropicservicetier.py new file mode 100644 index 00000000..12117ebb --- /dev/null +++ b/src/openrouter/components/anthropicservicetier.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 + + +AnthropicServiceTier = Union[ + Literal[ + "standard", + "priority", + "batch", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/anthropictextblock.py b/src/openrouter/components/anthropictextblock.py new file mode 100644 index 00000000..bd7bf10f --- /dev/null +++ b/src/openrouter/components/anthropictextblock.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropictextcitation import AnthropicTextCitation, AnthropicTextCitationTypedDict +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Literal +from typing_extensions import TypedDict + + +AnthropicTextBlockType = Literal["text",] + + +class AnthropicTextBlockTypedDict(TypedDict): + citations: Nullable[List[AnthropicTextCitationTypedDict]] + text: str + type: AnthropicTextBlockType + + +class AnthropicTextBlock(BaseModel): + citations: Nullable[List[AnthropicTextCitation]] + + text: str + + type: AnthropicTextBlockType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropictextcitation.py b/src/openrouter/components/anthropictextcitation.py new file mode 100644 index 00000000..8f9d103a --- /dev/null +++ b/src/openrouter/components/anthropictextcitation.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccitationcharlocation import ( + AnthropicCitationCharLocation, + AnthropicCitationCharLocationTypedDict, +) +from .anthropiccitationcontentblocklocation import ( + AnthropicCitationContentBlockLocation, + AnthropicCitationContentBlockLocationTypedDict, +) +from .anthropiccitationpagelocation import ( + AnthropicCitationPageLocation, + AnthropicCitationPageLocationTypedDict, +) +from .anthropiccitationsearchresultlocation import ( + AnthropicCitationSearchResultLocation, + AnthropicCitationSearchResultLocationTypedDict, +) +from .anthropiccitationwebsearchresultlocation import ( + AnthropicCitationWebSearchResultLocation, + AnthropicCitationWebSearchResultLocationTypedDict, +) +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +AnthropicTextCitationTypedDict = TypeAliasType( + "AnthropicTextCitationTypedDict", + Union[ + AnthropicCitationWebSearchResultLocationTypedDict, + AnthropicCitationCharLocationTypedDict, + AnthropicCitationPageLocationTypedDict, + AnthropicCitationContentBlockLocationTypedDict, + AnthropicCitationSearchResultLocationTypedDict, + ], +) + + +class UnknownAnthropicTextCitation(BaseModel): + r"""A AnthropicTextCitation variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_TEXT_CITATION_VARIANTS: dict[str, Any] = { + "char_location": AnthropicCitationCharLocation, + "content_block_location": AnthropicCitationContentBlockLocation, + "page_location": AnthropicCitationPageLocation, + "search_result_location": AnthropicCitationSearchResultLocation, + "web_search_result_location": AnthropicCitationWebSearchResultLocation, +} + + +AnthropicTextCitation = Annotated[ + Union[ + AnthropicCitationCharLocation, + AnthropicCitationContentBlockLocation, + AnthropicCitationPageLocation, + AnthropicCitationSearchResultLocation, + AnthropicCitationWebSearchResultLocation, + UnknownAnthropicTextCitation, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANTHROPIC_TEXT_CITATION_VARIANTS, + unknown_cls=UnknownAnthropicTextCitation, + union_name="AnthropicTextCitation", + ) + ), +] diff --git a/src/openrouter/components/anthropictexteditorcodeexecutioncontent.py b/src/openrouter/components/anthropictexteditorcodeexecutioncontent.py new file mode 100644 index 00000000..bc6d21b4 --- /dev/null +++ b/src/openrouter/components/anthropictexteditorcodeexecutioncontent.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropictexteditorcodeexecutioncreateresult import ( + AnthropicTextEditorCodeExecutionCreateResult, + AnthropicTextEditorCodeExecutionCreateResultTypedDict, +) +from .anthropictexteditorcodeexecutionstrreplaceresult import ( + AnthropicTextEditorCodeExecutionStrReplaceResult, + AnthropicTextEditorCodeExecutionStrReplaceResultTypedDict, +) +from .anthropictexteditorcodeexecutiontoolresulterror import ( + AnthropicTextEditorCodeExecutionToolResultError, + AnthropicTextEditorCodeExecutionToolResultErrorTypedDict, +) +from .anthropictexteditorcodeexecutionviewresult import ( + AnthropicTextEditorCodeExecutionViewResult, + AnthropicTextEditorCodeExecutionViewResultTypedDict, +) +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +AnthropicTextEditorCodeExecutionContentTypedDict = TypeAliasType( + "AnthropicTextEditorCodeExecutionContentTypedDict", + Union[ + AnthropicTextEditorCodeExecutionCreateResultTypedDict, + AnthropicTextEditorCodeExecutionToolResultErrorTypedDict, + AnthropicTextEditorCodeExecutionViewResultTypedDict, + AnthropicTextEditorCodeExecutionStrReplaceResultTypedDict, + ], +) + + +class UnknownAnthropicTextEditorCodeExecutionContent(BaseModel): + r"""A AnthropicTextEditorCodeExecutionContent variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_TEXT_EDITOR_CODE_EXECUTION_CONTENT_VARIANTS: dict[str, Any] = { + "text_editor_code_execution_create_result": AnthropicTextEditorCodeExecutionCreateResult, + "text_editor_code_execution_str_replace_result": AnthropicTextEditorCodeExecutionStrReplaceResult, + "text_editor_code_execution_tool_result_error": AnthropicTextEditorCodeExecutionToolResultError, + "text_editor_code_execution_view_result": AnthropicTextEditorCodeExecutionViewResult, +} + + +AnthropicTextEditorCodeExecutionContent = Annotated[ + Union[ + AnthropicTextEditorCodeExecutionCreateResult, + AnthropicTextEditorCodeExecutionStrReplaceResult, + AnthropicTextEditorCodeExecutionToolResultError, + AnthropicTextEditorCodeExecutionViewResult, + UnknownAnthropicTextEditorCodeExecutionContent, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANTHROPIC_TEXT_EDITOR_CODE_EXECUTION_CONTENT_VARIANTS, + unknown_cls=UnknownAnthropicTextEditorCodeExecutionContent, + union_name="AnthropicTextEditorCodeExecutionContent", + ) + ), +] diff --git a/src/openrouter/components/anthropictexteditorcodeexecutioncreateresult.py b/src/openrouter/components/anthropictexteditorcodeexecutioncreateresult.py new file mode 100644 index 00000000..a3443591 --- /dev/null +++ b/src/openrouter/components/anthropictexteditorcodeexecutioncreateresult.py @@ -0,0 +1,22 @@ +"""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 + + +AnthropicTextEditorCodeExecutionCreateResultType = Literal[ + "text_editor_code_execution_create_result", +] + + +class AnthropicTextEditorCodeExecutionCreateResultTypedDict(TypedDict): + is_file_update: bool + type: AnthropicTextEditorCodeExecutionCreateResultType + + +class AnthropicTextEditorCodeExecutionCreateResult(BaseModel): + is_file_update: bool + + type: AnthropicTextEditorCodeExecutionCreateResultType diff --git a/src/openrouter/components/anthropictexteditorcodeexecutionstrreplaceresult.py b/src/openrouter/components/anthropictexteditorcodeexecutionstrreplaceresult.py new file mode 100644 index 00000000..20a5dd93 --- /dev/null +++ b/src/openrouter/components/anthropictexteditorcodeexecutionstrreplaceresult.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Literal +from typing_extensions import TypedDict + + +AnthropicTextEditorCodeExecutionStrReplaceResultType = Literal[ + "text_editor_code_execution_str_replace_result", +] + + +class AnthropicTextEditorCodeExecutionStrReplaceResultTypedDict(TypedDict): + lines: Nullable[List[str]] + new_lines: Nullable[int] + new_start: Nullable[int] + old_lines: Nullable[int] + old_start: Nullable[int] + type: AnthropicTextEditorCodeExecutionStrReplaceResultType + + +class AnthropicTextEditorCodeExecutionStrReplaceResult(BaseModel): + lines: Nullable[List[str]] + + new_lines: Nullable[int] + + new_start: Nullable[int] + + old_lines: Nullable[int] + + old_start: Nullable[int] + + type: AnthropicTextEditorCodeExecutionStrReplaceResultType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropictexteditorcodeexecutiontoolresult.py b/src/openrouter/components/anthropictexteditorcodeexecutiontoolresult.py new file mode 100644 index 00000000..32f1e7af --- /dev/null +++ b/src/openrouter/components/anthropictexteditorcodeexecutiontoolresult.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropictexteditorcodeexecutioncontent import ( + AnthropicTextEditorCodeExecutionContent, + AnthropicTextEditorCodeExecutionContentTypedDict, +) +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicTextEditorCodeExecutionToolResultType = Literal[ + "text_editor_code_execution_tool_result", +] + + +class AnthropicTextEditorCodeExecutionToolResultTypedDict(TypedDict): + content: AnthropicTextEditorCodeExecutionContentTypedDict + tool_use_id: str + type: AnthropicTextEditorCodeExecutionToolResultType + + +class AnthropicTextEditorCodeExecutionToolResult(BaseModel): + content: AnthropicTextEditorCodeExecutionContent + + tool_use_id: str + + type: AnthropicTextEditorCodeExecutionToolResultType diff --git a/src/openrouter/components/anthropictexteditorcodeexecutiontoolresulterror.py b/src/openrouter/components/anthropictexteditorcodeexecutiontoolresulterror.py new file mode 100644 index 00000000..10f99a34 --- /dev/null +++ b/src/openrouter/components/anthropictexteditorcodeexecutiontoolresulterror.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import TypedDict + + +AnthropicTextEditorCodeExecutionToolResultErrorErrorCode = Union[ + Literal[ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded", + "file_not_found", + ], + UnrecognizedStr, +] + + +AnthropicTextEditorCodeExecutionToolResultErrorType = Literal[ + "text_editor_code_execution_tool_result_error", +] + + +class AnthropicTextEditorCodeExecutionToolResultErrorTypedDict(TypedDict): + error_code: AnthropicTextEditorCodeExecutionToolResultErrorErrorCode + error_message: Nullable[str] + type: AnthropicTextEditorCodeExecutionToolResultErrorType + + +class AnthropicTextEditorCodeExecutionToolResultError(BaseModel): + error_code: AnthropicTextEditorCodeExecutionToolResultErrorErrorCode + + error_message: Nullable[str] + + type: AnthropicTextEditorCodeExecutionToolResultErrorType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropictexteditorcodeexecutionviewresult.py b/src/openrouter/components/anthropictexteditorcodeexecutionviewresult.py new file mode 100644 index 00000000..c686ddc0 --- /dev/null +++ b/src/openrouter/components/anthropictexteditorcodeexecutionviewresult.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import TypedDict + + +FileType = Union[ + Literal[ + "text", + "image", + "pdf", + ], + UnrecognizedStr, +] + + +AnthropicTextEditorCodeExecutionViewResultType = Literal[ + "text_editor_code_execution_view_result", +] + + +class AnthropicTextEditorCodeExecutionViewResultTypedDict(TypedDict): + content: str + file_type: FileType + num_lines: Nullable[int] + start_line: Nullable[int] + total_lines: Nullable[int] + type: AnthropicTextEditorCodeExecutionViewResultType + + +class AnthropicTextEditorCodeExecutionViewResult(BaseModel): + content: str + + file_type: FileType + + num_lines: Nullable[int] + + start_line: Nullable[int] + + total_lines: Nullable[int] + + type: AnthropicTextEditorCodeExecutionViewResultType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropicthinkingblock.py b/src/openrouter/components/anthropicthinkingblock.py new file mode 100644 index 00000000..9681bc67 --- /dev/null +++ b/src/openrouter/components/anthropicthinkingblock.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicThinkingBlockType = Literal["thinking",] + + +class AnthropicThinkingBlockTypedDict(TypedDict): + signature: str + thinking: str + type: AnthropicThinkingBlockType + + +class AnthropicThinkingBlock(BaseModel): + signature: str + + thinking: str + + type: AnthropicThinkingBlockType diff --git a/src/openrouter/components/anthropictoolreference.py b/src/openrouter/components/anthropictoolreference.py new file mode 100644 index 00000000..e23435f4 --- /dev/null +++ b/src/openrouter/components/anthropictoolreference.py @@ -0,0 +1,20 @@ +"""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 + + +AnthropicToolReferenceType = Literal["tool_reference",] + + +class AnthropicToolReferenceTypedDict(TypedDict): + tool_name: str + type: AnthropicToolReferenceType + + +class AnthropicToolReference(BaseModel): + tool_name: str + + type: AnthropicToolReferenceType diff --git a/src/openrouter/components/anthropictoolsearchcontent.py b/src/openrouter/components/anthropictoolsearchcontent.py new file mode 100644 index 00000000..626dc44a --- /dev/null +++ b/src/openrouter/components/anthropictoolsearchcontent.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropictoolsearchresult import ( + AnthropicToolSearchResult, + AnthropicToolSearchResultTypedDict, +) +from .anthropictoolsearchresulterror import ( + AnthropicToolSearchResultError, + AnthropicToolSearchResultErrorTypedDict, +) +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +AnthropicToolSearchContentTypedDict = TypeAliasType( + "AnthropicToolSearchContentTypedDict", + Union[AnthropicToolSearchResultTypedDict, AnthropicToolSearchResultErrorTypedDict], +) + + +class UnknownAnthropicToolSearchContent(BaseModel): + r"""A AnthropicToolSearchContent variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_TOOL_SEARCH_CONTENT_VARIANTS: dict[str, Any] = { + "tool_search_tool_result_error": AnthropicToolSearchResultError, + "tool_search_tool_search_result": AnthropicToolSearchResult, +} + + +AnthropicToolSearchContent = Annotated[ + Union[ + AnthropicToolSearchResultError, + AnthropicToolSearchResult, + UnknownAnthropicToolSearchContent, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANTHROPIC_TOOL_SEARCH_CONTENT_VARIANTS, + unknown_cls=UnknownAnthropicToolSearchContent, + union_name="AnthropicToolSearchContent", + ) + ), +] diff --git a/src/openrouter/components/anthropictoolsearchresult.py b/src/openrouter/components/anthropictoolsearchresult.py new file mode 100644 index 00000000..ea496e6f --- /dev/null +++ b/src/openrouter/components/anthropictoolsearchresult.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropictoolreference import ( + AnthropicToolReference, + AnthropicToolReferenceTypedDict, +) +from openrouter.types import BaseModel +from typing import List, Literal +from typing_extensions import TypedDict + + +AnthropicToolSearchResultType = Literal["tool_search_tool_search_result",] + + +class AnthropicToolSearchResultTypedDict(TypedDict): + tool_references: List[AnthropicToolReferenceTypedDict] + type: AnthropicToolSearchResultType + + +class AnthropicToolSearchResult(BaseModel): + tool_references: List[AnthropicToolReference] + + type: AnthropicToolSearchResultType diff --git a/src/openrouter/components/anthropictoolsearchresulterror.py b/src/openrouter/components/anthropictoolsearchresulterror.py new file mode 100644 index 00000000..d7612e2c --- /dev/null +++ b/src/openrouter/components/anthropictoolsearchresulterror.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicservertoolerrorcode import AnthropicServerToolErrorCode +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicToolSearchResultErrorType = Literal["tool_search_tool_result_error",] + + +class AnthropicToolSearchResultErrorTypedDict(TypedDict): + error_code: AnthropicServerToolErrorCode + error_message: Nullable[str] + type: AnthropicToolSearchResultErrorType + + +class AnthropicToolSearchResultError(BaseModel): + error_code: AnthropicServerToolErrorCode + + error_message: Nullable[str] + + type: AnthropicToolSearchResultErrorType + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropictoolsearchtoolresult.py b/src/openrouter/components/anthropictoolsearchtoolresult.py new file mode 100644 index 00000000..5ea0f0af --- /dev/null +++ b/src/openrouter/components/anthropictoolsearchtoolresult.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropictoolsearchcontent import ( + AnthropicToolSearchContent, + AnthropicToolSearchContentTypedDict, +) +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicToolSearchToolResultType = Literal["tool_search_tool_result",] + + +class AnthropicToolSearchToolResultTypedDict(TypedDict): + content: AnthropicToolSearchContentTypedDict + tool_use_id: str + type: AnthropicToolSearchToolResultType + + +class AnthropicToolSearchToolResult(BaseModel): + content: AnthropicToolSearchContent + + tool_use_id: str + + type: AnthropicToolSearchToolResultType diff --git a/src/openrouter/components/anthropictooluseblock.py b/src/openrouter/components/anthropictooluseblock.py new file mode 100644 index 00000000..386e8884 --- /dev/null +++ b/src/openrouter/components/anthropictooluseblock.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccaller import AnthropicCaller, AnthropicCallerTypedDict +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +AnthropicToolUseBlockType = Literal["tool_use",] + + +class AnthropicToolUseBlockTypedDict(TypedDict): + caller: AnthropicCallerTypedDict + id: str + name: str + type: AnthropicToolUseBlockType + input: NotRequired[Any] + + +class AnthropicToolUseBlock(BaseModel): + caller: AnthropicCaller + + id: str + + name: str + + type: AnthropicToolUseBlockType + + input: Optional[Any] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input"]) + 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/anthropicwebfetchblock.py b/src/openrouter/components/anthropicwebfetchblock.py new file mode 100644 index 00000000..9a8c0f33 --- /dev/null +++ b/src/openrouter/components/anthropicwebfetchblock.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicdocumentblock import ( + AnthropicDocumentBlock, + AnthropicDocumentBlockTypedDict, +) +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicWebFetchBlockType = Literal["web_fetch_result",] + + +class AnthropicWebFetchBlockTypedDict(TypedDict): + content: AnthropicDocumentBlockTypedDict + retrieved_at: Nullable[str] + type: AnthropicWebFetchBlockType + url: str + + +class AnthropicWebFetchBlock(BaseModel): + content: AnthropicDocumentBlock + + retrieved_at: Nullable[str] + + type: AnthropicWebFetchBlockType + + url: str + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropicwebfetchcontent.py b/src/openrouter/components/anthropicwebfetchcontent.py new file mode 100644 index 00000000..09f0bf80 --- /dev/null +++ b/src/openrouter/components/anthropicwebfetchcontent.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicwebfetchblock import ( + AnthropicWebFetchBlock, + AnthropicWebFetchBlockTypedDict, +) +from .anthropicwebfetchtoolresulterror import ( + AnthropicWebFetchToolResultError, + AnthropicWebFetchToolResultErrorTypedDict, +) +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +AnthropicWebFetchContentTypedDict = TypeAliasType( + "AnthropicWebFetchContentTypedDict", + Union[AnthropicWebFetchToolResultErrorTypedDict, AnthropicWebFetchBlockTypedDict], +) + + +class UnknownAnthropicWebFetchContent(BaseModel): + r"""A AnthropicWebFetchContent variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANTHROPIC_WEB_FETCH_CONTENT_VARIANTS: dict[str, Any] = { + "web_fetch_result": AnthropicWebFetchBlock, + "web_fetch_tool_result_error": AnthropicWebFetchToolResultError, +} + + +AnthropicWebFetchContent = Annotated[ + Union[ + AnthropicWebFetchBlock, + AnthropicWebFetchToolResultError, + UnknownAnthropicWebFetchContent, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANTHROPIC_WEB_FETCH_CONTENT_VARIANTS, + unknown_cls=UnknownAnthropicWebFetchContent, + union_name="AnthropicWebFetchContent", + ) + ), +] diff --git a/src/openrouter/components/anthropicwebfetchtoolresult.py b/src/openrouter/components/anthropicwebfetchtoolresult.py new file mode 100644 index 00000000..c26f5546 --- /dev/null +++ b/src/openrouter/components/anthropicwebfetchtoolresult.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccaller import AnthropicCaller, AnthropicCallerTypedDict +from .anthropicwebfetchcontent import ( + AnthropicWebFetchContent, + AnthropicWebFetchContentTypedDict, +) +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicWebFetchToolResultType = Literal["web_fetch_tool_result",] + + +class AnthropicWebFetchToolResultTypedDict(TypedDict): + caller: AnthropicCallerTypedDict + content: AnthropicWebFetchContentTypedDict + tool_use_id: str + type: AnthropicWebFetchToolResultType + + +class AnthropicWebFetchToolResult(BaseModel): + caller: AnthropicCaller + + content: AnthropicWebFetchContent + + tool_use_id: str + + type: AnthropicWebFetchToolResultType diff --git a/src/openrouter/components/anthropicwebfetchtoolresulterror.py b/src/openrouter/components/anthropicwebfetchtoolresulterror.py new file mode 100644 index 00000000..3bfb959c --- /dev/null +++ b/src/openrouter/components/anthropicwebfetchtoolresulterror.py @@ -0,0 +1,35 @@ +"""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 + + +AnthropicWebFetchToolResultErrorErrorCode = Union[ + Literal[ + "invalid_tool_input", + "url_too_long", + "url_not_allowed", + "url_not_accessible", + "unsupported_content_type", + "too_many_requests", + "max_uses_exceeded", + "unavailable", + ], + UnrecognizedStr, +] + + +AnthropicWebFetchToolResultErrorType = Literal["web_fetch_tool_result_error",] + + +class AnthropicWebFetchToolResultErrorTypedDict(TypedDict): + error_code: AnthropicWebFetchToolResultErrorErrorCode + type: AnthropicWebFetchToolResultErrorType + + +class AnthropicWebFetchToolResultError(BaseModel): + error_code: AnthropicWebFetchToolResultErrorErrorCode + + type: AnthropicWebFetchToolResultErrorType diff --git a/src/openrouter/components/anthropicwebsearchresult.py b/src/openrouter/components/anthropicwebsearchresult.py new file mode 100644 index 00000000..5f0542f3 --- /dev/null +++ b/src/openrouter/components/anthropicwebsearchresult.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal +from typing_extensions import TypedDict + + +AnthropicWebSearchResultType = Literal["web_search_result",] + + +class AnthropicWebSearchResultTypedDict(TypedDict): + encrypted_content: str + page_age: Nullable[str] + title: str + type: AnthropicWebSearchResultType + url: str + + +class AnthropicWebSearchResult(BaseModel): + encrypted_content: str + + page_age: Nullable[str] + + title: str + + type: AnthropicWebSearchResultType + + url: str + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/anthropicwebsearchtoolresult.py b/src/openrouter/components/anthropicwebsearchtoolresult.py new file mode 100644 index 00000000..8983eeb1 --- /dev/null +++ b/src/openrouter/components/anthropicwebsearchtoolresult.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccaller import AnthropicCaller, AnthropicCallerTypedDict +from .anthropicwebsearchresult import ( + AnthropicWebSearchResult, + AnthropicWebSearchResultTypedDict, +) +from .anthropicwebsearchtoolresulterror import ( + AnthropicWebSearchToolResultError, + AnthropicWebSearchToolResultErrorTypedDict, +) +from openrouter.types import BaseModel +from typing import List, Literal, Union +from typing_extensions import TypeAliasType, TypedDict + + +AnthropicWebSearchToolResultContentTypedDict = TypeAliasType( + "AnthropicWebSearchToolResultContentTypedDict", + Union[ + AnthropicWebSearchToolResultErrorTypedDict, + List[AnthropicWebSearchResultTypedDict], + ], +) + + +AnthropicWebSearchToolResultContent = TypeAliasType( + "AnthropicWebSearchToolResultContent", + Union[AnthropicWebSearchToolResultError, List[AnthropicWebSearchResult]], +) + + +AnthropicWebSearchToolResultType = Literal["web_search_tool_result",] + + +class AnthropicWebSearchToolResultTypedDict(TypedDict): + caller: AnthropicCallerTypedDict + content: AnthropicWebSearchToolResultContentTypedDict + tool_use_id: str + type: AnthropicWebSearchToolResultType + + +class AnthropicWebSearchToolResult(BaseModel): + caller: AnthropicCaller + + content: AnthropicWebSearchToolResultContent + + tool_use_id: str + + type: AnthropicWebSearchToolResultType diff --git a/src/openrouter/components/anthropicwebsearchtoolresulterror.py b/src/openrouter/components/anthropicwebsearchtoolresulterror.py new file mode 100644 index 00000000..0b912b79 --- /dev/null +++ b/src/openrouter/components/anthropicwebsearchtoolresulterror.py @@ -0,0 +1,33 @@ +"""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 + + +AnthropicWebSearchToolResultErrorErrorCode = Union[ + Literal[ + "invalid_tool_input", + "unavailable", + "max_uses_exceeded", + "too_many_requests", + "query_too_long", + "request_too_large", + ], + UnrecognizedStr, +] + + +AnthropicWebSearchToolResultErrorType = Literal["web_search_tool_result_error",] + + +class AnthropicWebSearchToolResultErrorTypedDict(TypedDict): + error_code: AnthropicWebSearchToolResultErrorErrorCode + type: AnthropicWebSearchToolResultErrorType + + +class AnthropicWebSearchToolResultError(BaseModel): + error_code: AnthropicWebSearchToolResultErrorErrorCode + + type: AnthropicWebSearchToolResultErrorType diff --git a/src/openrouter/components/batchdeletedobject.py b/src/openrouter/components/batchdeletedobject.py new file mode 100644 index 00000000..354ba046 --- /dev/null +++ b/src/openrouter/components/batchdeletedobject.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .batchdeletiontargets import BatchDeletionTargets, BatchDeletionTargetsTypedDict +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +BatchDeletedObjectObject = Literal["batch",] + + +class BatchDeletedObjectTypedDict(TypedDict): + r"""Confirms a terminal batch was removed from the API and its OpenRouter-held artifacts purged. Deletion is not cancellation and does not erase billing or audit records.""" + + deletion: BatchDeletionTargetsTypedDict + r"""OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome.""" + id: str + object: BatchDeletedObjectObject + + +class BatchDeletedObject(BaseModel): + r"""Confirms a terminal batch was removed from the API and its OpenRouter-held artifacts purged. Deletion is not cancellation and does not erase billing or audit records.""" + + deletion: BatchDeletionTargets + r"""OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome.""" + + id: str + + object: BatchDeletedObjectObject diff --git a/src/openrouter/components/batchdeletionoutcome.py b/src/openrouter/components/batchdeletionoutcome.py new file mode 100644 index 00000000..f2c29536 --- /dev/null +++ b/src/openrouter/components/batchdeletionoutcome.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 + + +BatchDeletionOutcome = Union[ + Literal[ + "deleted", + "unsupported", + "not_applicable", + ], + UnrecognizedStr, +] +r"""Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).""" diff --git a/src/openrouter/components/batchdeletiontargets.py b/src/openrouter/components/batchdeletiontargets.py new file mode 100644 index 00000000..b76991ca --- /dev/null +++ b/src/openrouter/components/batchdeletiontargets.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .batchdeletionoutcome import BatchDeletionOutcome +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +Openrouter = Literal["deleted",] +r"""OpenRouter-held request and result artifacts were purged.""" + + +class UpstreamTypedDict(TypedDict): + r"""The upstream batch deletion outcome; omitted when no provider was assigned.""" + + provider: str + r"""The provider name stored on the batch.""" + status: BatchDeletionOutcome + r"""Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).""" + + +class Upstream(BaseModel): + r"""The upstream batch deletion outcome; omitted when no provider was assigned.""" + + provider: str + r"""The provider name stored on the batch.""" + + status: BatchDeletionOutcome + r"""Outcome for one deletion target: `deleted` (removed), `unsupported` (the provider has no batch-delete API; supported file cleanup still runs), or `not_applicable` (the batch never reached that target).""" + + +class BatchDeletionTargetsTypedDict(TypedDict): + r"""OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome.""" + + openrouter: Openrouter + r"""OpenRouter-held request and result artifacts were purged.""" + upstream: NotRequired[UpstreamTypedDict] + r"""The upstream batch deletion outcome; omitted when no provider was assigned.""" + + +class BatchDeletionTargets(BaseModel): + r"""OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome.""" + + openrouter: Openrouter + r"""OpenRouter-held request and result artifacts were purged.""" + + upstream: Optional[Upstream] = None + r"""The upstream batch deletion outcome; omitted when no provider was assigned.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["upstream"]) + 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/batcherrorresponse.py b/src/openrouter/components/batcherrorresponse.py new file mode 100644 index 00000000..8c105d9b --- /dev/null +++ b/src/openrouter/components/batcherrorresponse.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 BatchErrorResponseErrorTypedDict(TypedDict): + code: int + message: str + + +class BatchErrorResponseError(BaseModel): + code: int + + message: str diff --git a/src/openrouter/components/batchlistitem.py b/src/openrouter/components/batchlistitem.py new file mode 100644 index 00000000..7fafb9f9 --- /dev/null +++ b/src/openrouter/components/batchlistitem.py @@ -0,0 +1,419 @@ +"""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, + AnthropicUsageIterationTypedDict, +) +from .costdetails import CostDetails, CostDetailsTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import Any, List, Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +BatchListItemCompletionWindow = Literal["24h",] + + +class BatchListItemErrorTypedDict(TypedDict): + message: str + + +class BatchListItemError(BaseModel): + message: str + + +BatchListItemObject = Literal["batch",] + + +class BatchListItemRequestCountsTypedDict(TypedDict): + completed: int + failed: int + total: int + + +class BatchListItemRequestCounts(BaseModel): + completed: int + + failed: int + + total: int + + +BatchListItemStatus = Union[ + Literal[ + "validating", + "in_progress", + "finalizing", + "completed", + "failed", + "expired", + "cancelling", + "cancelled", + ], + UnrecognizedStr, +] + + +class BatchListItemCompletionTokensDetailsTypedDict(TypedDict): + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for audio output.""" + image_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for image output.""" + reasoning_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for reasoning.""" + + +class BatchListItemCompletionTokensDetails(BaseModel): + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for audio output.""" + + image_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for image output.""" + + reasoning_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for reasoning.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["audio_tokens", "image_tokens", "reasoning_tokens"]) + nullable_fields = set(["audio_tokens", "image_tokens", "reasoning_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 BatchListItemPromptTokensDetailsTypedDict(TypedDict): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input audio.""" + cache_write_tokens: NotRequired[Nullable[int]] + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + cached_tokens: NotRequired[Nullable[int]] + r"""Tokens cached by the endpoint.""" + file_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input files/documents.""" + video_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input video.""" + + +class BatchListItemPromptTokensDetails(BaseModel): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input audio.""" + + cache_write_tokens: OptionalNullable[int] = UNSET + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + + cached_tokens: OptionalNullable[int] = UNSET + r"""Tokens cached by the endpoint.""" + + file_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input files/documents.""" + + video_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input video.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_tokens", + ] + ) + nullable_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_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 BatchListItemServerToolUseTypedDict(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 BatchListItemServerToolUse(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 BatchListItemUsageTypedDict(TypedDict): + completion_tokens: int + r"""The tokens generated""" + prompt_tokens: int + 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[BatchListItemCompletionTokensDetailsTypedDict] + ] + cost: NotRequired[Nullable[float]] + r"""Cost of the completion""" + cost_details: NotRequired[Nullable[CostDetailsTypedDict]] + r"""Breakdown of upstream inference costs""" + is_byok: NotRequired[bool] + r"""Whether a request was made using a Bring Your Own Key configuration""" + iterations: NotRequired[Nullable[List[AnthropicUsageIterationTypedDict]]] + prompt_tokens_details: NotRequired[ + Nullable[BatchListItemPromptTokensDetailsTypedDict] + ] + r"""Breakdown of tokens used in the prompt.""" + server_tool_use: NotRequired[Nullable[BatchListItemServerToolUseTypedDict]] + r"""Usage for server-side tool execution (e.g., web search)""" + service_tier: NotRequired[Nullable[str]] + r"""The service tier used by the upstream provider for this request""" + speed: NotRequired[Nullable[AnthropicSpeed]] + + +class BatchListItemUsage(BaseModel): + completion_tokens: int + r"""The tokens generated""" + + prompt_tokens: int + r"""Including images, input audio, and tools if any""" + + total_tokens: int + r"""Sum of the above two fields""" + + cache_creation: OptionalNullable[AnthropicCacheCreation] = UNSET + + completion_tokens_details: OptionalNullable[ + BatchListItemCompletionTokensDetails + ] = UNSET + + cost: OptionalNullable[float] = UNSET + r"""Cost of the completion""" + + cost_details: OptionalNullable[CostDetails] = UNSET + r"""Breakdown of upstream inference costs""" + + is_byok: Optional[bool] = None + r"""Whether a request was made using a Bring Your Own Key configuration""" + + iterations: OptionalNullable[List[AnthropicUsageIteration]] = UNSET + + prompt_tokens_details: OptionalNullable[BatchListItemPromptTokensDetails] = UNSET + r"""Breakdown of tokens used in the prompt.""" + + server_tool_use: OptionalNullable[BatchListItemServerToolUse] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + + service_tier: OptionalNullable[str] = UNSET + r"""The service tier used by the upstream provider for this request""" + + speed: OptionalNullable[AnthropicSpeed] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "cache_creation", + "completion_tokens_details", + "cost", + "cost_details", + "is_byok", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + ) + nullable_fields = set( + [ + "cache_creation", + "completion_tokens_details", + "cost", + "cost_details", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + ) + 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 BatchListItemTypedDict(TypedDict): + r"""Metadata-only batch object. `results` is always `null` in list responses.""" + + completion_window: BatchListItemCompletionWindow + created_at: int + endpoint: str + error: Nullable[BatchListItemErrorTypedDict] + finalized_at: Nullable[int] + id: str + model: str + object: BatchListItemObject + request_counts: BatchListItemRequestCountsTypedDict + results: Nullable[Any] + r"""Always null: retrieve the batch with `GET /batches/{id}` to access its results.""" + status: BatchListItemStatus + usage: Nullable[BatchListItemUsageTypedDict] + + +class BatchListItem(BaseModel): + r"""Metadata-only batch object. `results` is always `null` in list responses.""" + + completion_window: BatchListItemCompletionWindow + + created_at: int + + endpoint: str + + error: Nullable[BatchListItemError] + + finalized_at: Nullable[int] + + id: str + + model: str + + object: BatchListItemObject + + request_counts: BatchListItemRequestCounts + + results: Nullable[Any] + r"""Always null: retrieve the batch with `GET /batches/{id}` to access its results.""" + + status: BatchListItemStatus + + usage: Nullable[BatchListItemUsage] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/batchlistresponse.py b/src/openrouter/components/batchlistresponse.py new file mode 100644 index 00000000..baaee7b7 --- /dev/null +++ b/src/openrouter/components/batchlistresponse.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .batchlistitem import BatchListItem, BatchListItemTypedDict +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Literal +from typing_extensions import TypedDict + + +BatchListResponseObject = Literal["list",] + + +class BatchListResponseTypedDict(TypedDict): + r"""A newest-first page of metadata-only batch objects.""" + + data: List[BatchListItemTypedDict] + first_id: Nullable[str] + has_more: bool + last_id: Nullable[str] + object: BatchListResponseObject + + +class BatchListResponse(BaseModel): + r"""A newest-first page of metadata-only batch objects.""" + + data: List[BatchListItem] + + first_id: Nullable[str] + + has_more: bool + + last_id: Nullable[str] + + object: BatchListResponseObject + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/openrouter/components/batchliststatus.py b/src/openrouter/components/batchliststatus.py new file mode 100644 index 00000000..86509573 --- /dev/null +++ b/src/openrouter/components/batchliststatus.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +BatchListStatus = Union[ + Literal[ + "validating", + "in_progress", + "completed", + "failed", + "expired", + "cancelled", + ], + UnrecognizedStr, +] +r"""A batch status that is durably represented by the list data source. `finalizing` and `cancelling` are not accepted because stored jobs collapse those phases into `in_progress`.""" diff --git a/src/openrouter/components/batchlisttimestamp.py b/src/openrouter/components/batchlisttimestamp.py new file mode 100644 index 00000000..4c81a5f7 --- /dev/null +++ b/src/openrouter/components/batchlisttimestamp.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import date +from typing import Union +from typing_extensions import TypeAliasType + + +BatchListTimestampTypedDict = TypeAliasType( + "BatchListTimestampTypedDict", Union[str, date] +) +r"""Only include batches created strictly after this timestamp.""" + + +BatchListTimestamp = TypeAliasType("BatchListTimestamp", Union[str, date]) +r"""Only include batches created strictly after this timestamp.""" diff --git a/src/openrouter/components/batchobject.py b/src/openrouter/components/batchobject.py new file mode 100644 index 00000000..25473b53 --- /dev/null +++ b/src/openrouter/components/batchobject.py @@ -0,0 +1,2042 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccachecreation import ( + AnthropicCacheCreation, + AnthropicCacheCreationTypedDict, +) +from .anthropiccontainer import AnthropicContainer, AnthropicContainerTypedDict +from .anthropicinputtransformation import ( + AnthropicInputTransformation, + AnthropicInputTransformationTypedDict, +) +from .anthropicoutputtokensdetails import ( + AnthropicOutputTokensDetails, + AnthropicOutputTokensDetailsTypedDict, +) +from .anthropicrefusalstopdetails import ( + AnthropicRefusalStopDetails, + AnthropicRefusalStopDetailsTypedDict, +) +from .anthropicservertoolusage import ( + AnthropicServerToolUsage, + AnthropicServerToolUsageTypedDict, +) +from .anthropicservicetier import AnthropicServiceTier +from .anthropicspeed import AnthropicSpeed +from .anthropicusageiteration import ( + AnthropicUsageIteration, + AnthropicUsageIterationTypedDict, +) +from .apierrortype import APIErrorType +from .costdetails import CostDetails, CostDetailsTypedDict +from .finishreason import FinishReason +from .openresponsesresult import OpenResponsesResult, OpenResponsesResultTypedDict +from .openroutermetadata import OpenRouterMetadata, OpenRouterMetadataTypedDict +from .oranthropiccontentblock import ( + ORAnthropicContentBlock, + ORAnthropicContentBlockTypedDict, +) +from .oranthropicstopreason import ORAnthropicStopReason +from .reasoningdetailencrypted import ( + ReasoningDetailEncrypted, + ReasoningDetailEncryptedTypedDict, +) +from .reasoningdetailservertoolcall import ( + ReasoningDetailServerToolCall, + ReasoningDetailServerToolCallTypedDict, +) +from .reasoningdetailsummary import ( + ReasoningDetailSummary, + ReasoningDetailSummaryTypedDict, +) +from .reasoningdetailtext import ReasoningDetailText, ReasoningDetailTextTypedDict +from functools import partial +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils.unions import parse_open_union +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import BeforeValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +BatchObjectCompletionWindow = Literal["24h",] + + +class BatchObjectErrorTypedDict(TypedDict): + message: str + + +class BatchObjectError(BaseModel): + message: str + + +BatchObjectObjectBatch = Literal["batch",] + + +class BatchObjectRequestCountsTypedDict(TypedDict): + completed: int + failed: int + total: int + + +class BatchObjectRequestCounts(BaseModel): + completed: int + + failed: int + + total: int + + +class ResultErrorTypedDict(TypedDict): + message: str + param: Nullable[str] + type: str + error_type: NotRequired[APIErrorType] + r"""Canonical OpenRouter error type, stable across all API formats""" + + +class ResultError(BaseModel): + message: str + + param: Nullable[str] + + type: str + + error_type: Optional[APIErrorType] = None + r"""Canonical OpenRouter error type, stable across all API formats""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["error_type"]) + nullable_fields = set(["param"]) + 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 + + +EmbeddingTypedDict = TypeAliasType("EmbeddingTypedDict", Union[List[float], str]) +r"""Embedding vector as an array of floats or a base64 string""" + + +Embedding = TypeAliasType("Embedding", Union[List[float], str]) +r"""Embedding vector as an array of floats or a base64 string""" + + +ObjectEmbedding = Literal["embedding",] + + +class BatchObjectDataTypedDict(TypedDict): + r"""A single embedding object""" + + embedding: EmbeddingTypedDict + r"""Embedding vector as an array of floats or a base64 string""" + object: ObjectEmbedding + index: NotRequired[int] + r"""Index of the embedding in the input list""" + + +class BatchObjectData(BaseModel): + r"""A single embedding object""" + + embedding: Embedding + r"""Embedding vector as an array of floats or a base64 string""" + + object: ObjectEmbedding + + index: Optional[int] = None + r"""Index of the embedding in the input list""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["index"]) + 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 + + +BodyObjectList = Literal["list",] + + +class BodyPromptTokensDetails2TypedDict(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.""" + + audio_tokens: NotRequired[int] + r"""Number of audio tokens in the input""" + file_tokens: NotRequired[int] + r"""Number of file/document tokens in the input""" + image_tokens: NotRequired[int] + r"""Number of image tokens in the input""" + text_tokens: NotRequired[int] + r"""Number of text tokens in the input""" + video_tokens: NotRequired[int] + r"""Number of video tokens in the input""" + + +class BodyPromptTokensDetails2(BaseModel): + 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.""" + + audio_tokens: Optional[int] = None + r"""Number of audio tokens in the input""" + + file_tokens: Optional[int] = None + r"""Number of file/document tokens in the input""" + + image_tokens: Optional[int] = None + r"""Number of image tokens in the input""" + + text_tokens: Optional[int] = None + r"""Number of text tokens in the input""" + + video_tokens: Optional[int] = None + r"""Number of video tokens in the input""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "audio_tokens", + "file_tokens", + "image_tokens", + "text_tokens", + "video_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 + + +class BodyUsage3TypedDict(TypedDict): + r"""Token usage statistics""" + + prompt_tokens: int + r"""Number of tokens in the input""" + total_tokens: int + r"""Total number of tokens used""" + cost: NotRequired[float] + r"""Cost of the request in credits""" + cost_details: NotRequired[Nullable[CostDetailsTypedDict]] + r"""Breakdown of upstream inference costs""" + is_byok: NotRequired[bool] + r"""Whether a request was made using a Bring Your Own Key configuration""" + prompt_tokens_details: NotRequired[BodyPromptTokensDetails2TypedDict] + 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.""" + + +class BodyUsage3(BaseModel): + r"""Token usage statistics""" + + prompt_tokens: int + r"""Number of tokens in the input""" + + total_tokens: int + r"""Total number of tokens used""" + + cost: Optional[float] = None + r"""Cost of the request in credits""" + + cost_details: OptionalNullable[CostDetails] = UNSET + r"""Breakdown of upstream inference costs""" + + is_byok: Optional[bool] = None + r"""Whether a request was made using a Bring Your Own Key configuration""" + + prompt_tokens_details: Optional[BodyPromptTokensDetails2] = None + 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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["cost", "cost_details", "is_byok", "prompt_tokens_details"] + ) + nullable_fields = set(["cost_details"]) + 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 BodyListTypedDict(TypedDict): + r"""Embeddings response containing embedding vectors""" + + data: List[BatchObjectDataTypedDict] + r"""List of embedding objects""" + model: str + r"""The model used for embeddings""" + object: BodyObjectList + id: NotRequired[str] + r"""Unique identifier for the embeddings response""" + usage: NotRequired[BodyUsage3TypedDict] + r"""Token usage statistics""" + + +class BodyList(BaseModel): + r"""Embeddings response containing embedding vectors""" + + data: List[BatchObjectData] + r"""List of embedding objects""" + + model: str + r"""The model used for embeddings""" + + object: BodyObjectList + + id: Optional[str] = None + r"""Unique identifier for the embeddings response""" + + usage: Optional[BodyUsage3] = None + r"""Token usage statistics""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id", "usage"]) + 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 + + +BatchObjectRole = Literal["assistant",] + + +BatchObjectTypeMessage = Literal["message",] + + +class BodyUsage2TypedDict(TypedDict): + cache_creation: Nullable[AnthropicCacheCreationTypedDict] + cache_creation_input_tokens: Nullable[int] + cache_read_input_tokens: Nullable[int] + inference_geo: Nullable[str] + input_tokens: int + output_tokens: int + output_tokens_details: Nullable[AnthropicOutputTokensDetailsTypedDict] + server_tool_use: Nullable[AnthropicServerToolUsageTypedDict] + service_tier: Nullable[AnthropicServiceTier] + iterations: NotRequired[List[AnthropicUsageIterationTypedDict]] + speed: NotRequired[Nullable[AnthropicSpeed]] + + +class BodyUsage2(BaseModel): + cache_creation: Nullable[AnthropicCacheCreation] + + cache_creation_input_tokens: Nullable[int] + + cache_read_input_tokens: Nullable[int] + + inference_geo: Nullable[str] + + input_tokens: int + + output_tokens: int + + output_tokens_details: Nullable[AnthropicOutputTokensDetails] + + server_tool_use: Nullable[AnthropicServerToolUsage] + + service_tier: Nullable[AnthropicServiceTier] + + iterations: Optional[List[AnthropicUsageIteration]] = None + + speed: OptionalNullable[AnthropicSpeed] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["iterations", "speed"]) + nullable_fields = set( + [ + "cache_creation", + "cache_creation_input_tokens", + "cache_read_input_tokens", + "inference_geo", + "output_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + ) + 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 BodyMessageTypedDict(TypedDict): + container: Nullable[AnthropicContainerTypedDict] + content: List[ORAnthropicContentBlockTypedDict] + id: str + model: str + role: BatchObjectRole + stop_details: Nullable[AnthropicRefusalStopDetailsTypedDict] + r"""Structured information about a refusal""" + stop_reason: Nullable[ORAnthropicStopReason] + stop_sequence: Nullable[str] + type: BatchObjectTypeMessage + usage: BodyUsage2TypedDict + input_transformations: NotRequired[ + Nullable[List[AnthropicInputTransformationTypedDict]] + ] + + +class BodyMessage(BaseModel): + container: Nullable[AnthropicContainer] + + content: List[ORAnthropicContentBlock] + + id: str + + model: str + + role: BatchObjectRole + + stop_details: Nullable[AnthropicRefusalStopDetails] + r"""Structured information about a refusal""" + + stop_reason: Nullable[ORAnthropicStopReason] + + stop_sequence: Nullable[str] + + type: BatchObjectTypeMessage + + usage: BodyUsage2 + + input_transformations: OptionalNullable[List[AnthropicInputTransformation]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input_transformations"]) + nullable_fields = set( + [ + "container", + "input_transformations", + "stop_details", + "stop_reason", + "stop_sequence", + ] + ) + 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 ContentTopLogprobTypedDict(TypedDict): + bytes_: Nullable[List[int]] + logprob: float + token: str + + +class ContentTopLogprob(BaseModel): + bytes_: Annotated[Nullable[List[int]], pydantic.Field(alias="bytes")] + + logprob: float + + token: str + + @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 LogprobsContentTypedDict(TypedDict): + bytes_: Nullable[List[int]] + logprob: float + token: str + top_logprobs: List[ContentTopLogprobTypedDict] + + +class LogprobsContent(BaseModel): + bytes_: Annotated[Nullable[List[int]], pydantic.Field(alias="bytes")] + + logprob: float + + token: str + + top_logprobs: List[ContentTopLogprob] + + @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 RefusalTopLogprobTypedDict(TypedDict): + bytes_: Nullable[List[int]] + logprob: float + token: str + + +class RefusalTopLogprob(BaseModel): + bytes_: Annotated[Nullable[List[int]], pydantic.Field(alias="bytes")] + + logprob: float + + token: str + + @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 RefusalTypedDict(TypedDict): + bytes_: Nullable[List[int]] + logprob: float + token: str + top_logprobs: List[RefusalTopLogprobTypedDict] + + +class Refusal(BaseModel): + bytes_: Annotated[Nullable[List[int]], pydantic.Field(alias="bytes")] + + logprob: float + + token: str + + top_logprobs: List[RefusalTopLogprob] + + @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 LogprobsTypedDict(TypedDict): + content: Nullable[List[LogprobsContentTypedDict]] + refusal: NotRequired[Nullable[List[RefusalTypedDict]]] + + +class Logprobs(BaseModel): + content: Nullable[List[LogprobsContent]] + + refusal: OptionalNullable[List[Refusal]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["refusal"]) + nullable_fields = set(["content", "refusal"]) + 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 + + +TypeWebSearchCitation = Literal["web_search_citation",] + + +class WebSearchCitationTypedDict(TypedDict): + title: Nullable[str] + url: str + cited_text: NotRequired[str] + encrypted_index: NotRequired[str] + + +class WebSearchCitation(BaseModel): + title: Nullable[str] + + url: str + + cited_text: Optional[str] = None + + encrypted_index: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["cited_text", "encrypted_index"]) + nullable_fields = set(["title"]) + 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 AnnotationWebSearchCitationTypedDict(TypedDict): + type: TypeWebSearchCitation + web_search_citation: WebSearchCitationTypedDict + + +class AnnotationWebSearchCitation(BaseModel): + type: TypeWebSearchCitation + + web_search_citation: WebSearchCitation + + +AnnotationTypeURLCitation = Literal["url_citation",] + + +class BatchObjectURLCitationTypedDict(TypedDict): + end_index: int + start_index: int + title: str + url: str + content: NotRequired[str] + + +class BatchObjectURLCitation(BaseModel): + end_index: int + + start_index: int + + title: str + + url: str + + content: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["content"]) + 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 AnnotationURLCitationTypedDict(TypedDict): + type: AnnotationTypeURLCitation + url_citation: BatchObjectURLCitationTypedDict + + +class AnnotationURLCitation(BaseModel): + type: AnnotationTypeURLCitation + + url_citation: BatchObjectURLCitation + + +class ContentImageURLImageURLTypedDict(TypedDict): + url: str + + +class ContentImageURLImageURL(BaseModel): + url: str + + +FileTypeImageURL = Literal["image_url",] + + +class ContentImageURLTypedDict(TypedDict): + image_url: ContentImageURLImageURLTypedDict + type: FileTypeImageURL + + +class ContentImageURL(BaseModel): + image_url: ContentImageURLImageURL + + type: FileTypeImageURL + + +FileTypeText = Literal["text",] + + +class ContentTextTypedDict(TypedDict): + text: str + type: FileTypeText + + +class ContentText(BaseModel): + text: str + + type: FileTypeText + + +AnnotationContentUnionTypedDict = TypeAliasType( + "AnnotationContentUnionTypedDict", + Union[ContentTextTypedDict, ContentImageURLTypedDict], +) + + +class UnknownAnnotationContentUnion(BaseModel): + r"""A AnnotationContentUnion variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANNOTATION_CONTENT_UNION_VARIANTS: dict[str, Any] = { + "text": ContentText, + "image_url": ContentImageURL, +} + + +AnnotationContentUnion = Annotated[ + Union[ContentText, ContentImageURL, UnknownAnnotationContentUnion], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANNOTATION_CONTENT_UNION_VARIANTS, + unknown_cls=UnknownAnnotationContentUnion, + union_name="AnnotationContentUnion", + ) + ), +] + + +class BatchObjectFileTypedDict(TypedDict): + content: List[AnnotationContentUnionTypedDict] + hash: str + name: NotRequired[str] + + +class BatchObjectFile(BaseModel): + content: List[AnnotationContentUnion] + + hash: str + + name: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name"]) + 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 + + +AnnotationTypeFile = Literal["file",] + + +class AnnotationFileTypedDict(TypedDict): + file: BatchObjectFileTypedDict + type: AnnotationTypeFile + + +class AnnotationFile(BaseModel): + file: BatchObjectFile + + type: AnnotationTypeFile + + +AnnotationTypedDict = TypeAliasType( + "AnnotationTypedDict", + Union[ + AnnotationFileTypedDict, + AnnotationURLCitationTypedDict, + AnnotationWebSearchCitationTypedDict, + ], +) + + +class UnknownAnnotation(BaseModel): + r"""A Annotation variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_ANNOTATION_VARIANTS: dict[str, Any] = { + "file": AnnotationFile, + "url_citation": AnnotationURLCitation, + "web_search_citation": AnnotationWebSearchCitation, +} + + +Annotation = Annotated[ + Union[ + AnnotationFile, + AnnotationURLCitation, + AnnotationWebSearchCitation, + UnknownAnnotation, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_ANNOTATION_VARIANTS, + unknown_cls=UnknownAnnotation, + union_name="Annotation", + ) + ), +] + + +class BatchObjectImageURLTypedDict(TypedDict): + url: str + + +class BatchObjectImageURL(BaseModel): + url: str + + +ChoiceTypeImageURL = Literal["image_url",] + + +class ImageTypedDict(TypedDict): + image_url: BatchObjectImageURLTypedDict + type: ChoiceTypeImageURL + + +class Image(BaseModel): + image_url: BatchObjectImageURL + + type: ChoiceTypeImageURL + + +ReasoningDetailTypedDict = TypeAliasType( + "ReasoningDetailTypedDict", + Union[ + ReasoningDetailSummaryTypedDict, + ReasoningDetailEncryptedTypedDict, + ReasoningDetailTextTypedDict, + ReasoningDetailServerToolCallTypedDict, + ], +) + + +class UnknownReasoningDetail(BaseModel): + r"""A ReasoningDetail variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_REASONING_DETAIL_VARIANTS: dict[str, Any] = { + "reasoning.summary": ReasoningDetailSummary, + "reasoning.encrypted": ReasoningDetailEncrypted, + "reasoning.text": ReasoningDetailText, + "reasoning.server_tool_call": ReasoningDetailServerToolCall, +} + + +ReasoningDetail = Annotated[ + Union[ + ReasoningDetailSummary, + ReasoningDetailEncrypted, + ReasoningDetailText, + ReasoningDetailServerToolCall, + UnknownReasoningDetail, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_REASONING_DETAIL_VARIANTS, + unknown_cls=UnknownReasoningDetail, + union_name="ReasoningDetail", + ) + ), +] + + +ChoiceRole = Literal["assistant",] + + +class BatchObjectFunctionTypedDict(TypedDict): + arguments: str + name: str + + +class BatchObjectFunction(BaseModel): + arguments: str + + name: str + + +ChoiceTypeFunction = Literal["function",] + + +class ToolCallTypedDict(TypedDict): + function: BatchObjectFunctionTypedDict + id: str + index: int + type: ChoiceTypeFunction + + +class ToolCall(BaseModel): + function: BatchObjectFunction + + id: str + + index: int + + type: ChoiceTypeFunction + + +class MessageTypedDict(TypedDict): + content: Nullable[str] + refusal: Nullable[str] + role: ChoiceRole + annotations: NotRequired[List[AnnotationTypedDict]] + images: NotRequired[Nullable[List[ImageTypedDict]]] + reasoning: NotRequired[Nullable[str]] + reasoning_details: NotRequired[Nullable[List[Nullable[ReasoningDetailTypedDict]]]] + tool_calls: NotRequired[List[ToolCallTypedDict]] + + +class Message(BaseModel): + content: Nullable[str] + + refusal: Nullable[str] + + role: ChoiceRole + + annotations: Optional[List[Annotation]] = None + + images: OptionalNullable[List[Image]] = UNSET + + reasoning: OptionalNullable[str] = UNSET + + reasoning_details: OptionalNullable[List[Nullable[ReasoningDetail]]] = UNSET + + tool_calls: Optional[List[ToolCall]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["annotations", "images", "reasoning", "reasoning_details", "tool_calls"] + ) + nullable_fields = set( + ["content", "images", "reasoning", "reasoning_details", "refusal"] + ) + 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 ChoiceTypedDict(TypedDict): + finish_reason: FinishReason + index: int + logprobs: Nullable[LogprobsTypedDict] + message: MessageTypedDict + native_finish_reason: Nullable[str] + + +class Choice(BaseModel): + finish_reason: FinishReason + + index: int + + logprobs: Nullable[Logprobs] + + message: Message + + native_finish_reason: Nullable[str] + + @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 + + +BatchObjectEvent = Union[ + Literal[ + "adapter_request", + "upstream_headers_received", + "first_token_received", + "upstream_body_ended", + ], + UnrecognizedStr, +] + + +class BatchObjectTimingsTypedDict(TypedDict): + epoch_ms: int + event: BatchObjectEvent + start_ms: int + + +class BatchObjectTimings(BaseModel): + epoch_ms: int + + event: BatchObjectEvent + + start_ms: int + + +class BatchObjectDebugTypedDict(TypedDict): + echo_upstream_body: NotRequired[Dict[str, Any]] + timings: NotRequired[BatchObjectTimingsTypedDict] + + +class BatchObjectDebug(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + echo_upstream_body: Optional[Dict[str, Any]] = None + + timings: Optional[BatchObjectTimings] = None + + @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(["echo_upstream_body", "timings"]) + 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)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +BodyObjectChatCompletion = Literal["chat.completion",] + + +class BodyCompletionTokensDetailsTypedDict(TypedDict): + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for audio output.""" + image_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for image output.""" + reasoning_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for reasoning.""" + + +class BodyCompletionTokensDetails(BaseModel): + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for audio output.""" + + image_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for image output.""" + + reasoning_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for reasoning.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["audio_tokens", "image_tokens", "reasoning_tokens"]) + nullable_fields = set(["audio_tokens", "image_tokens", "reasoning_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 BodyPromptTokensDetails1TypedDict(TypedDict): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input audio.""" + cache_write_tokens: NotRequired[Nullable[int]] + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + cached_tokens: NotRequired[Nullable[int]] + r"""Tokens cached by the endpoint.""" + file_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input files/documents.""" + video_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input video.""" + + +class BodyPromptTokensDetails1(BaseModel): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input audio.""" + + cache_write_tokens: OptionalNullable[int] = UNSET + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + + cached_tokens: OptionalNullable[int] = UNSET + r"""Tokens cached by the endpoint.""" + + file_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input files/documents.""" + + video_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input video.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_tokens", + ] + ) + nullable_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_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 BodyServerToolUseTypedDict(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 BodyServerToolUse(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 BatchObjectServerToolUseDetailsTypedDict(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 BatchObjectServerToolUseDetails(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 BodyUsage1TypedDict(TypedDict): + completion_tokens: int + r"""The tokens generated""" + prompt_tokens: int + r"""Including images, input audio, and tools if any""" + total_tokens: int + r"""Sum of the above two fields""" + completion_tokens_details: NotRequired[ + Nullable[BodyCompletionTokensDetailsTypedDict] + ] + prompt_tokens_details: NotRequired[Nullable[BodyPromptTokensDetails1TypedDict]] + r"""Breakdown of tokens used in the prompt.""" + server_tool_use: NotRequired[Nullable[BodyServerToolUseTypedDict]] + r"""Usage for server-side tool execution (e.g., web search)""" + server_tool_use_details: NotRequired[ + Nullable[BatchObjectServerToolUseDetailsTypedDict] + ] + r"""Usage for server-side tool execution (e.g., web search)""" + + +class BodyUsage1(BaseModel): + completion_tokens: int + r"""The tokens generated""" + + prompt_tokens: int + r"""Including images, input audio, and tools if any""" + + total_tokens: int + r"""Sum of the above two fields""" + + completion_tokens_details: OptionalNullable[BodyCompletionTokensDetails] = UNSET + + prompt_tokens_details: OptionalNullable[BodyPromptTokensDetails1] = UNSET + r"""Breakdown of tokens used in the prompt.""" + + server_tool_use: OptionalNullable[BodyServerToolUse] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + + server_tool_use_details: OptionalNullable[BatchObjectServerToolUseDetails] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "completion_tokens_details", + "prompt_tokens_details", + "server_tool_use", + "server_tool_use_details", + ] + ) + nullable_fields = set( + [ + "completion_tokens_details", + "prompt_tokens_details", + "server_tool_use", + "server_tool_use_details", + ] + ) + 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 BodyChatCompletionTypedDict(TypedDict): + choices: List[ChoiceTypedDict] + created: int + id: str + model: str + object: BodyObjectChatCompletion + debug: NotRequired[BatchObjectDebugTypedDict] + openrouter_metadata: NotRequired[OpenRouterMetadataTypedDict] + provider: NotRequired[Nullable[str]] + service_tier: NotRequired[Nullable[str]] + system_fingerprint: NotRequired[Nullable[str]] + usage: NotRequired[BodyUsage1TypedDict] + + +class BodyChatCompletion(BaseModel): + choices: List[Choice] + + created: int + + id: str + + model: str + + object: BodyObjectChatCompletion + + debug: Optional[BatchObjectDebug] = None + + openrouter_metadata: Optional[OpenRouterMetadata] = None + + provider: OptionalNullable[str] = UNSET + + service_tier: OptionalNullable[str] = UNSET + + system_fingerprint: OptionalNullable[str] = UNSET + + usage: Optional[BodyUsage1] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "debug", + "openrouter_metadata", + "provider", + "service_tier", + "system_fingerprint", + "usage", + ] + ) + nullable_fields = set(["provider", "service_tier", "system_fingerprint"]) + 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 + + +BodyTypedDict = TypeAliasType( + "BodyTypedDict", + Union[ + BodyListTypedDict, + BodyChatCompletionTypedDict, + BodyMessageTypedDict, + OpenResponsesResultTypedDict, + ], +) + + +Body = TypeAliasType( + "Body", Union[BodyList, BodyChatCompletion, BodyMessage, OpenResponsesResult] +) + + +class BatchObjectResponseTypedDict(TypedDict): + body: BodyTypedDict + request_id: Nullable[str] + status_code: int + + +class BatchObjectResponse(BaseModel): + body: Body + + request_id: Nullable[str] + + status_code: int + + @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 ResultTypedDict(TypedDict): + custom_id: str + error: Nullable[ResultErrorTypedDict] + id: str + response: Nullable[BatchObjectResponseTypedDict] + + +class Result(BaseModel): + custom_id: str + + error: Nullable[ResultError] + + id: str + + response: Nullable[BatchObjectResponse] + + @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 + + +BatchObjectStatus = Union[ + Literal[ + "validating", + "in_progress", + "finalizing", + "completed", + "failed", + "expired", + "cancelling", + "cancelled", + ], + UnrecognizedStr, +] + + +class BatchObjectCompletionTokensDetailsTypedDict(TypedDict): + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for audio output.""" + image_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for image output.""" + reasoning_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for reasoning.""" + + +class BatchObjectCompletionTokensDetails(BaseModel): + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for audio output.""" + + image_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for image output.""" + + reasoning_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for reasoning.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["audio_tokens", "image_tokens", "reasoning_tokens"]) + nullable_fields = set(["audio_tokens", "image_tokens", "reasoning_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 BatchObjectPromptTokensDetailsTypedDict(TypedDict): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input audio.""" + cache_write_tokens: NotRequired[Nullable[int]] + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + cached_tokens: NotRequired[Nullable[int]] + r"""Tokens cached by the endpoint.""" + file_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input files/documents.""" + video_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input video.""" + + +class BatchObjectPromptTokensDetails(BaseModel): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input audio.""" + + cache_write_tokens: OptionalNullable[int] = UNSET + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + + cached_tokens: OptionalNullable[int] = UNSET + r"""Tokens cached by the endpoint.""" + + file_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input files/documents.""" + + video_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input video.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_tokens", + ] + ) + nullable_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_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 BatchObjectServerToolUseTypedDict(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 BatchObjectServerToolUse(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 BatchObjectUsageTypedDict(TypedDict): + completion_tokens: int + r"""The tokens generated""" + prompt_tokens: int + 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[BatchObjectCompletionTokensDetailsTypedDict] + ] + cost: NotRequired[Nullable[float]] + r"""Cost of the completion""" + cost_details: NotRequired[Nullable[CostDetailsTypedDict]] + r"""Breakdown of upstream inference costs""" + is_byok: NotRequired[bool] + r"""Whether a request was made using a Bring Your Own Key configuration""" + iterations: NotRequired[Nullable[List[AnthropicUsageIterationTypedDict]]] + prompt_tokens_details: NotRequired[ + Nullable[BatchObjectPromptTokensDetailsTypedDict] + ] + r"""Breakdown of tokens used in the prompt.""" + server_tool_use: NotRequired[Nullable[BatchObjectServerToolUseTypedDict]] + r"""Usage for server-side tool execution (e.g., web search)""" + service_tier: NotRequired[Nullable[str]] + r"""The service tier used by the upstream provider for this request""" + speed: NotRequired[Nullable[AnthropicSpeed]] + + +class BatchObjectUsage(BaseModel): + completion_tokens: int + r"""The tokens generated""" + + prompt_tokens: int + r"""Including images, input audio, and tools if any""" + + total_tokens: int + r"""Sum of the above two fields""" + + cache_creation: OptionalNullable[AnthropicCacheCreation] = UNSET + + completion_tokens_details: OptionalNullable[BatchObjectCompletionTokensDetails] = ( + UNSET + ) + + cost: OptionalNullable[float] = UNSET + r"""Cost of the completion""" + + cost_details: OptionalNullable[CostDetails] = UNSET + r"""Breakdown of upstream inference costs""" + + is_byok: Optional[bool] = None + r"""Whether a request was made using a Bring Your Own Key configuration""" + + iterations: OptionalNullable[List[AnthropicUsageIteration]] = UNSET + + prompt_tokens_details: OptionalNullable[BatchObjectPromptTokensDetails] = UNSET + r"""Breakdown of tokens used in the prompt.""" + + server_tool_use: OptionalNullable[BatchObjectServerToolUse] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + + service_tier: OptionalNullable[str] = UNSET + r"""The service tier used by the upstream provider for this request""" + + speed: OptionalNullable[AnthropicSpeed] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "cache_creation", + "completion_tokens_details", + "cost", + "cost_details", + "is_byok", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + ) + nullable_fields = set( + [ + "cache_creation", + "completion_tokens_details", + "cost", + "cost_details", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + ) + 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 BatchObjectTypedDict(TypedDict): + completion_window: BatchObjectCompletionWindow + created_at: int + endpoint: str + error: Nullable[BatchObjectErrorTypedDict] + finalized_at: Nullable[int] + id: str + model: str + object: BatchObjectObjectBatch + request_counts: BatchObjectRequestCountsTypedDict + results: Nullable[List[ResultTypedDict]] + status: BatchObjectStatus + usage: Nullable[BatchObjectUsageTypedDict] + + +class BatchObject(BaseModel): + completion_window: BatchObjectCompletionWindow + + created_at: int + + endpoint: str + + error: Nullable[BatchObjectError] + + finalized_at: Nullable[int] + + id: str + + model: str + + object: BatchObjectObjectBatch + + request_counts: BatchObjectRequestCounts + + results: Nullable[List[Result]] + + status: BatchObjectStatus + + usage: Nullable[BatchObjectUsage] + + @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 + + +try: + ContentTopLogprob.model_rebuild() +except NameError: + pass +try: + LogprobsContent.model_rebuild() +except NameError: + pass +try: + RefusalTopLogprob.model_rebuild() +except NameError: + pass +try: + Refusal.model_rebuild() +except NameError: + pass diff --git a/src/openrouter/components/batchpaymentrequiredresponse_error.py b/src/openrouter/components/batchpaymentrequiredresponse_error.py new file mode 100644 index 00000000..19b704e4 --- /dev/null +++ b/src/openrouter/components/batchpaymentrequiredresponse_error.py @@ -0,0 +1,365 @@ +"""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, + AnthropicUsageIterationTypedDict, +) +from .costdetails import CostDetails, CostDetailsTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +BatchPaymentRequiredResponseCompletionWindow = Literal["24h",] + + +class BatchPaymentRequiredResponseErrorTypedDict(TypedDict): + code: int + message: str + + +class BatchPaymentRequiredResponseError(BaseModel): + code: int + + message: str + + +BatchPaymentRequiredResponseObject = Literal["batch",] + + +class BatchPaymentRequiredResponseRequestCountsTypedDict(TypedDict): + completed: int + failed: int + total: int + + +class BatchPaymentRequiredResponseRequestCounts(BaseModel): + completed: int + + failed: int + + total: int + + +BatchPaymentRequiredResponseStatus = Union[ + Literal[ + "validating", + "in_progress", + "finalizing", + "completed", + "failed", + "expired", + "cancelling", + "cancelled", + ], + UnrecognizedStr, +] + + +class BatchPaymentRequiredResponseCompletionTokensDetailsTypedDict(TypedDict): + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for audio output.""" + image_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for image output.""" + reasoning_tokens: NotRequired[Nullable[int]] + r"""Tokens generated by the model for reasoning.""" + + +class BatchPaymentRequiredResponseCompletionTokensDetails(BaseModel): + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for audio output.""" + + image_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for image output.""" + + reasoning_tokens: OptionalNullable[int] = UNSET + r"""Tokens generated by the model for reasoning.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["audio_tokens", "image_tokens", "reasoning_tokens"]) + nullable_fields = set(["audio_tokens", "image_tokens", "reasoning_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 BatchPaymentRequiredResponsePromptTokensDetailsTypedDict(TypedDict): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input audio.""" + cache_write_tokens: NotRequired[Nullable[int]] + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + cached_tokens: NotRequired[Nullable[int]] + r"""Tokens cached by the endpoint.""" + file_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input files/documents.""" + video_tokens: NotRequired[Nullable[int]] + r"""Tokens used for input video.""" + + +class BatchPaymentRequiredResponsePromptTokensDetails(BaseModel): + r"""Breakdown of tokens used in the prompt.""" + + audio_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input audio.""" + + cache_write_tokens: OptionalNullable[int] = UNSET + r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing.""" + + cached_tokens: OptionalNullable[int] = UNSET + r"""Tokens cached by the endpoint.""" + + file_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input files/documents.""" + + video_tokens: OptionalNullable[int] = UNSET + r"""Tokens used for input video.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_tokens", + ] + ) + nullable_fields = set( + [ + "audio_tokens", + "cache_write_tokens", + "cached_tokens", + "file_tokens", + "video_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 BatchPaymentRequiredResponseServerToolUseTypedDict(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 BatchPaymentRequiredResponseServerToolUse(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 BatchPaymentRequiredResponseUsageTypedDict(TypedDict): + completion_tokens: int + r"""The tokens generated""" + prompt_tokens: int + 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[BatchPaymentRequiredResponseCompletionTokensDetailsTypedDict] + ] + cost: NotRequired[Nullable[float]] + r"""Cost of the completion""" + cost_details: NotRequired[Nullable[CostDetailsTypedDict]] + r"""Breakdown of upstream inference costs""" + is_byok: NotRequired[bool] + r"""Whether a request was made using a Bring Your Own Key configuration""" + iterations: NotRequired[Nullable[List[AnthropicUsageIterationTypedDict]]] + prompt_tokens_details: NotRequired[ + Nullable[BatchPaymentRequiredResponsePromptTokensDetailsTypedDict] + ] + r"""Breakdown of tokens used in the prompt.""" + server_tool_use: NotRequired[ + Nullable[BatchPaymentRequiredResponseServerToolUseTypedDict] + ] + r"""Usage for server-side tool execution (e.g., web search)""" + service_tier: NotRequired[Nullable[str]] + r"""The service tier used by the upstream provider for this request""" + speed: NotRequired[Nullable[AnthropicSpeed]] + + +class BatchPaymentRequiredResponseUsage(BaseModel): + completion_tokens: int + r"""The tokens generated""" + + prompt_tokens: int + r"""Including images, input audio, and tools if any""" + + total_tokens: int + r"""Sum of the above two fields""" + + cache_creation: OptionalNullable[AnthropicCacheCreation] = UNSET + + completion_tokens_details: OptionalNullable[ + BatchPaymentRequiredResponseCompletionTokensDetails + ] = UNSET + + cost: OptionalNullable[float] = UNSET + r"""Cost of the completion""" + + cost_details: OptionalNullable[CostDetails] = UNSET + r"""Breakdown of upstream inference costs""" + + is_byok: Optional[bool] = None + r"""Whether a request was made using a Bring Your Own Key configuration""" + + iterations: OptionalNullable[List[AnthropicUsageIteration]] = UNSET + + prompt_tokens_details: OptionalNullable[ + BatchPaymentRequiredResponsePromptTokensDetails + ] = UNSET + r"""Breakdown of tokens used in the prompt.""" + + server_tool_use: OptionalNullable[BatchPaymentRequiredResponseServerToolUse] = UNSET + r"""Usage for server-side tool execution (e.g., web search)""" + + service_tier: OptionalNullable[str] = UNSET + r"""The service tier used by the upstream provider for this request""" + + speed: OptionalNullable[AnthropicSpeed] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "cache_creation", + "completion_tokens_details", + "cost", + "cost_details", + "is_byok", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + ) + nullable_fields = set( + [ + "cache_creation", + "completion_tokens_details", + "cost", + "cost_details", + "iterations", + "prompt_tokens_details", + "server_tool_use", + "service_tier", + "speed", + ] + ) + 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/batchproviderpreferences.py b/src/openrouter/components/batchproviderpreferences.py new file mode 100644 index 00000000..527b6983 --- /dev/null +++ b/src/openrouter/components/batchproviderpreferences.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .providername import ProviderName +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +BatchProviderPreferencesOnlyTypedDict = TypeAliasType( + "BatchProviderPreferencesOnlyTypedDict", Union[ProviderName, str] +) + + +BatchProviderPreferencesOnly = TypeAliasType( + "BatchProviderPreferencesOnly", Union[ProviderName, str] +) + + +class BatchProviderPreferencesTypedDict(TypedDict): + r"""Batch provider routing preferences. Only `provider.only` is supported.""" + + only: NotRequired[Nullable[List[BatchProviderPreferencesOnlyTypedDict]]] + r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" + + +class BatchProviderPreferences(BaseModel): + r"""Batch provider routing preferences. Only `provider.only` is supported.""" + + only: OptionalNullable[List[BatchProviderPreferencesOnly]] = UNSET + r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["only"]) + nullable_fields = set(["only"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + 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/batchsubmitbody.py b/src/openrouter/components/batchsubmitbody.py new file mode 100644 index 00000000..a84174b5 --- /dev/null +++ b/src/openrouter/components/batchsubmitbody.py @@ -0,0 +1,96 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .batchproviderpreferences import ( + BatchProviderPreferences, + BatchProviderPreferencesTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +BatchSubmitBodyCompletionWindow = Literal["24h",] + + +Endpoint = Union[ + Literal[ + "/v1/chat/completions", + "/v1/responses", + "/v1/messages", + "/v1/embeddings", + ], + UnrecognizedStr, +] + + +class RequestTypedDict(TypedDict): + body: Dict[str, Any] + r"""Request payload for the batch `endpoint`.""" + custom_id: str + + +class Request(BaseModel): + body: Dict[str, Any] + r"""Request payload for the batch `endpoint`.""" + + custom_id: str + + +class BatchSubmitBodyTypedDict(TypedDict): + r"""Batch submit request body.""" + + endpoint: Endpoint + model: str + requests: List[RequestTypedDict] + completion_window: NotRequired[BatchSubmitBodyCompletionWindow] + provider: NotRequired[Nullable[BatchProviderPreferencesTypedDict]] + r"""Batch provider routing preferences. Only `provider.only` is supported.""" + + +class BatchSubmitBody(BaseModel): + r"""Batch submit request body.""" + + endpoint: Endpoint + + model: str + + requests: List[Request] + + completion_window: Optional[BatchSubmitBodyCompletionWindow] = "24h" + + provider: OptionalNullable[BatchProviderPreferences] = UNSET + r"""Batch provider routing preferences. Only `provider.only` is supported.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["completion_window", "provider"]) + nullable_fields = set(["provider"]) + 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/debugevent.py b/src/openrouter/components/debugevent.py index dd463df8..07e98d54 100644 --- a/src/openrouter/components/debugevent.py +++ b/src/openrouter/components/debugevent.py @@ -7,7 +7,7 @@ from typing_extensions import NotRequired, TypedDict -Event = Union[ +DebugEventEvent = Union[ Literal[ "adapter_request", "upstream_headers_received", @@ -18,29 +18,29 @@ ] -class TimingsTypedDict(TypedDict): +class DebugEventTimingsTypedDict(TypedDict): epoch_ms: int - event: Event + event: DebugEventEvent start_ms: int -class Timings(BaseModel): +class DebugEventTimings(BaseModel): epoch_ms: int - event: Event + event: DebugEventEvent start_ms: int -class DebugTypedDict(TypedDict): +class DebugEventDebugTypedDict(TypedDict): echo_upstream_body: NotRequired[Dict[str, Any]] - timings: NotRequired[TimingsTypedDict] + timings: NotRequired[DebugEventTimingsTypedDict] -class Debug(BaseModel): +class DebugEventDebug(BaseModel): echo_upstream_body: Optional[Dict[str, Any]] = None - timings: Optional[Timings] = None + timings: Optional[DebugEventTimings] = None @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -65,7 +65,7 @@ def serialize_model(self, handler): class DebugEventTypedDict(TypedDict): r"""Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones.""" - debug: DebugTypedDict + debug: DebugEventDebugTypedDict sequence_number: int type: DebugEventType @@ -73,7 +73,7 @@ class DebugEventTypedDict(TypedDict): class DebugEvent(BaseModel): r"""Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones.""" - debug: Debug + debug: DebugEventDebug sequence_number: int diff --git a/src/openrouter/components/finishreason.py b/src/openrouter/components/finishreason.py new file mode 100644 index 00000000..3356f85c --- /dev/null +++ b/src/openrouter/components/finishreason.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 + + +FinishReason = Union[ + Literal[ + "stop", + "length", + "tool_calls", + "content_filter", + "function_call", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/imagegenerationusage.py b/src/openrouter/components/imagegenerationusage.py index 089d12ed..3c064a51 100644 --- a/src/openrouter/components/imagegenerationusage.py +++ b/src/openrouter/components/imagegenerationusage.py @@ -143,7 +143,7 @@ def serialize_model(self, handler): return m -class ServerToolUseTypedDict(TypedDict): +class ImageGenerationUsageServerToolUseTypedDict(TypedDict): r"""Usage for server-side tool execution (e.g., web search)""" tool_calls_executed: NotRequired[Nullable[int]] @@ -154,7 +154,7 @@ class ServerToolUseTypedDict(TypedDict): 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 ServerToolUse(BaseModel): +class ImageGenerationUsageServerToolUse(BaseModel): r"""Usage for server-side tool execution (e.g., web search)""" tool_calls_executed: OptionalNullable[int] = UNSET @@ -220,7 +220,7 @@ class ImageGenerationUsageTypedDict(TypedDict): Nullable[ImageGenerationUsagePromptTokensDetailsTypedDict] ] r"""Breakdown of tokens used in the prompt.""" - server_tool_use: NotRequired[Nullable[ServerToolUseTypedDict]] + server_tool_use: NotRequired[Nullable[ImageGenerationUsageServerToolUseTypedDict]] r"""Usage for server-side tool execution (e.g., web search)""" service_tier: NotRequired[Nullable[str]] r"""The service tier used by the upstream provider for this request""" @@ -261,7 +261,7 @@ class ImageGenerationUsage(BaseModel): ) r"""Breakdown of tokens used in the prompt.""" - server_tool_use: OptionalNullable[ServerToolUse] = UNSET + server_tool_use: OptionalNullable[ImageGenerationUsageServerToolUse] = UNSET r"""Usage for server-side tool execution (e.g., web search)""" service_tier: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/internchatchoice.py b/src/openrouter/components/internchatchoice.py index 54ccff74..f3851f63 100644 --- a/src/openrouter/components/internchatchoice.py +++ b/src/openrouter/components/internchatchoice.py @@ -8,7 +8,7 @@ from typing_extensions import TypedDict -FinishReason = Union[ +InternChatChoiceFinishReason = Union[ Literal[ "error", "stop", @@ -24,7 +24,7 @@ class InternChatChoiceTypedDict(TypedDict): delta: InternChatDeltaTypedDict r"""The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry.""" - finish_reason: Nullable[FinishReason] + finish_reason: Nullable[InternChatChoiceFinishReason] r"""`null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk.""" index: int @@ -35,7 +35,7 @@ class InternChatChoice(BaseModel): delta: InternChatDelta r"""The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry.""" - finish_reason: Nullable[FinishReason] + finish_reason: Nullable[InternChatChoiceFinishReason] r"""`null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk.""" index: int diff --git a/src/openrouter/components/messagesbashtoolresultblock.py b/src/openrouter/components/messagesbashtoolresultblock.py index 23d014f0..7b44e51e 100644 --- a/src/openrouter/components/messagesbashtoolresultblock.py +++ b/src/openrouter/components/messagesbashtoolresultblock.py @@ -35,7 +35,9 @@ class MessagesBashToolResultBlockFile(BaseModel): type: MessagesBashToolResultBlockTypeContainerFileCitation -TypeOpenrouterBashToolResult = Literal["openrouter_bash_tool_result",] +MessagesBashToolResultBlockTypeOpenrouterBashToolResult = Literal[ + "openrouter_bash_tool_result", +] class MessagesBashToolResultBlockTypedDict(TypedDict): @@ -43,7 +45,7 @@ class MessagesBashToolResultBlockTypedDict(TypedDict): content: Dict[str, Any] tool_use_id: str - type: TypeOpenrouterBashToolResult + type: MessagesBashToolResultBlockTypeOpenrouterBashToolResult container_id: NotRequired[str] r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" files: NotRequired[List[MessagesBashToolResultBlockFileTypedDict]] @@ -57,7 +59,7 @@ class MessagesBashToolResultBlock(BaseModel): tool_use_id: str - type: TypeOpenrouterBashToolResult + type: MessagesBashToolResultBlockTypeOpenrouterBashToolResult container_id: Optional[str] = None r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" diff --git a/src/openrouter/components/messagesmessageparam.py b/src/openrouter/components/messagesmessageparam.py index 3c5b5b28..d587cc01 100644 --- a/src/openrouter/components/messagesmessageparam.py +++ b/src/openrouter/components/messagesmessageparam.py @@ -111,7 +111,7 @@ def serialize_model(self, handler): return m -ErrorCode = Union[ +MessagesMessageParamErrorCode = Union[ Literal[ "invalid_tool_input", "unavailable", @@ -123,18 +123,20 @@ def serialize_model(self, handler): ] -TypeWebSearchToolResultError = Literal["web_search_tool_result_error",] +MessagesMessageParamTypeWebSearchToolResultError = Literal[ + "web_search_tool_result_error", +] class ContentWebSearchToolResultErrorTypedDict(TypedDict): - error_code: ErrorCode - type: TypeWebSearchToolResultError + error_code: MessagesMessageParamErrorCode + type: MessagesMessageParamTypeWebSearchToolResultError class ContentWebSearchToolResultError(BaseModel): - error_code: ErrorCode + error_code: MessagesMessageParamErrorCode - type: TypeWebSearchToolResultError + type: MessagesMessageParamTypeWebSearchToolResultError MessagesMessageParamContentUnion3TypedDict = TypeAliasType( @@ -152,13 +154,13 @@ class ContentWebSearchToolResultError(BaseModel): ) -TypeWebSearchToolResult = Literal["web_search_tool_result",] +MessagesMessageParamTypeWebSearchToolResult = Literal["web_search_tool_result",] class ContentWebSearchToolResultTypedDict(TypedDict): content: MessagesMessageParamContentUnion3TypedDict tool_use_id: str - type: TypeWebSearchToolResult + type: MessagesMessageParamTypeWebSearchToolResult 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. 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.""" @@ -168,7 +170,7 @@ class ContentWebSearchToolResult(BaseModel): tool_use_id: str - type: TypeWebSearchToolResult + type: MessagesMessageParamTypeWebSearchToolResult 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. 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.""" @@ -190,13 +192,13 @@ def serialize_model(self, handler): return m -TypeServerToolUse = Literal["server_tool_use",] +MessagesMessageParamTypeServerToolUse = Literal["server_tool_use",] class ContentServerToolUseTypedDict(TypedDict): id: str name: str - type: TypeServerToolUse + type: MessagesMessageParamTypeServerToolUse 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. 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[Any] @@ -207,7 +209,7 @@ class ContentServerToolUse(BaseModel): name: str - type: TypeServerToolUse + type: MessagesMessageParamTypeServerToolUse 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. 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.""" @@ -231,27 +233,27 @@ def serialize_model(self, handler): return m -TypeRedactedThinking = Literal["redacted_thinking",] +MessagesMessageParamTypeRedactedThinking = Literal["redacted_thinking",] class ContentRedactedThinkingTypedDict(TypedDict): data: str - type: TypeRedactedThinking + type: MessagesMessageParamTypeRedactedThinking class ContentRedactedThinking(BaseModel): data: str - type: TypeRedactedThinking + type: MessagesMessageParamTypeRedactedThinking -TypeThinking = Literal["thinking",] +MessagesMessageParamTypeThinking = Literal["thinking",] class ContentThinkingTypedDict(TypedDict): signature: str thinking: str - type: TypeThinking + type: MessagesMessageParamTypeThinking class ContentThinking(BaseModel): @@ -259,7 +261,7 @@ class ContentThinking(BaseModel): thinking: str - type: TypeThinking + type: MessagesMessageParamTypeThinking MessagesMessageParamTypeToolReference = Literal["tool_reference",] @@ -353,13 +355,13 @@ def serialize_model(self, handler): return m -TypeToolUse = Literal["tool_use",] +MessagesMessageParamTypeToolUse = Literal["tool_use",] class ContentToolUseTypedDict(TypedDict): id: str name: str - type: TypeToolUse + type: MessagesMessageParamTypeToolUse 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. 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[Any] @@ -370,7 +372,7 @@ class ContentToolUse(BaseModel): name: str - type: TypeToolUse + type: MessagesMessageParamTypeToolUse 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. 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.""" diff --git a/src/openrouter/components/messagesshelltoolresultblock.py b/src/openrouter/components/messagesshelltoolresultblock.py index d228d763..fb9a1ad8 100644 --- a/src/openrouter/components/messagesshelltoolresultblock.py +++ b/src/openrouter/components/messagesshelltoolresultblock.py @@ -35,7 +35,9 @@ class MessagesShellToolResultBlockFile(BaseModel): type: MessagesShellToolResultBlockTypeContainerFileCitation -TypeOpenrouterShellToolResult = Literal["openrouter_shell_tool_result",] +MessagesShellToolResultBlockTypeOpenrouterShellToolResult = Literal[ + "openrouter_shell_tool_result", +] class MessagesShellToolResultBlockTypedDict(TypedDict): @@ -43,7 +45,7 @@ class MessagesShellToolResultBlockTypedDict(TypedDict): content: Dict[str, Any] tool_use_id: str - type: TypeOpenrouterShellToolResult + type: MessagesShellToolResultBlockTypeOpenrouterShellToolResult container_id: NotRequired[str] r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" files: NotRequired[List[MessagesShellToolResultBlockFileTypedDict]] @@ -57,7 +59,7 @@ class MessagesShellToolResultBlock(BaseModel): tool_use_id: str - type: TypeOpenrouterShellToolResult + type: MessagesShellToolResultBlockTypeOpenrouterShellToolResult container_id: Optional[str] = None r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" diff --git a/src/openrouter/components/oranthropicbashtoolresult.py b/src/openrouter/components/oranthropicbashtoolresult.py new file mode 100644 index 00000000..73157d2a --- /dev/null +++ b/src/openrouter/components/oranthropicbashtoolresult.py @@ -0,0 +1,82 @@ +"""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 Any, Dict, List, Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +ORAnthropicBashToolResultTypeContainerFileCitation = Literal["container_file_citation",] + + +class ORAnthropicBashToolResultFileTypedDict(TypedDict): + container_id: str + end_index: int + file_id: str + filename: str + start_index: int + type: ORAnthropicBashToolResultTypeContainerFileCitation + + +class ORAnthropicBashToolResultFile(BaseModel): + container_id: str + + end_index: int + + file_id: str + + filename: str + + start_index: int + + type: ORAnthropicBashToolResultTypeContainerFileCitation + + +ORAnthropicBashToolResultTypeOpenrouterBashToolResult = Literal[ + "openrouter_bash_tool_result", +] + + +class ORAnthropicBashToolResultTypedDict(TypedDict): + r"""Output of an `openrouter:bash` call executed in the OpenRouter sandbox (`engine: 'openrouter'`)""" + + content: Dict[str, Any] + tool_use_id: str + type: ORAnthropicBashToolResultTypeOpenrouterBashToolResult + container_id: NotRequired[str] + r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" + files: NotRequired[List[ORAnthropicBashToolResultFileTypedDict]] + r"""Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.""" + + +class ORAnthropicBashToolResult(BaseModel): + r"""Output of an `openrouter:bash` call executed in the OpenRouter sandbox (`engine: 'openrouter'`)""" + + content: Dict[str, Any] + + tool_use_id: str + + type: ORAnthropicBashToolResultTypeOpenrouterBashToolResult + + container_id: Optional[str] = None + r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" + + files: Optional[List[ORAnthropicBashToolResultFile]] = None + r"""Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["container_id", "files"]) + 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/oranthropiccontentblock.py b/src/openrouter/components/oranthropiccontentblock.py new file mode 100644 index 00000000..9eb54176 --- /dev/null +++ b/src/openrouter/components/oranthropiccontentblock.py @@ -0,0 +1,153 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropicadvisortoolresult import ( + AnthropicAdvisorToolResult, + AnthropicAdvisorToolResultTypedDict, +) +from .anthropicbashcodeexecutiontoolresult import ( + AnthropicBashCodeExecutionToolResult, + AnthropicBashCodeExecutionToolResultTypedDict, +) +from .anthropiccodeexecutiontoolresult import ( + AnthropicCodeExecutionToolResult, + AnthropicCodeExecutionToolResultTypedDict, +) +from .anthropiccompactionblock import ( + AnthropicCompactionBlock, + AnthropicCompactionBlockTypedDict, +) +from .anthropiccontainerupload import ( + AnthropicContainerUpload, + AnthropicContainerUploadTypedDict, +) +from .anthropicredactedthinkingblock import ( + AnthropicRedactedThinkingBlock, + AnthropicRedactedThinkingBlockTypedDict, +) +from .anthropictextblock import AnthropicTextBlock, AnthropicTextBlockTypedDict +from .anthropictexteditorcodeexecutiontoolresult import ( + AnthropicTextEditorCodeExecutionToolResult, + AnthropicTextEditorCodeExecutionToolResultTypedDict, +) +from .anthropicthinkingblock import ( + AnthropicThinkingBlock, + AnthropicThinkingBlockTypedDict, +) +from .anthropictoolsearchtoolresult import ( + AnthropicToolSearchToolResult, + AnthropicToolSearchToolResultTypedDict, +) +from .anthropictooluseblock import AnthropicToolUseBlock, AnthropicToolUseBlockTypedDict +from .anthropicwebfetchtoolresult import ( + AnthropicWebFetchToolResult, + AnthropicWebFetchToolResultTypedDict, +) +from .anthropicwebsearchtoolresult import ( + AnthropicWebSearchToolResult, + AnthropicWebSearchToolResultTypedDict, +) +from .oranthropicbashtoolresult import ( + ORAnthropicBashToolResult, + ORAnthropicBashToolResultTypedDict, +) +from .oranthropicservertooluseblock import ( + ORAnthropicServerToolUseBlock, + ORAnthropicServerToolUseBlockTypedDict, +) +from .oranthropicshelltoolresult import ( + ORAnthropicShellToolResult, + ORAnthropicShellToolResultTypedDict, +) +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +ORAnthropicContentBlockTypedDict = TypeAliasType( + "ORAnthropicContentBlockTypedDict", + Union[ + AnthropicRedactedThinkingBlockTypedDict, + AnthropicContainerUploadTypedDict, + AnthropicCompactionBlockTypedDict, + AnthropicTextBlockTypedDict, + AnthropicAdvisorToolResultTypedDict, + AnthropicThinkingBlockTypedDict, + AnthropicToolSearchToolResultTypedDict, + AnthropicCodeExecutionToolResultTypedDict, + AnthropicBashCodeExecutionToolResultTypedDict, + AnthropicTextEditorCodeExecutionToolResultTypedDict, + AnthropicWebFetchToolResultTypedDict, + AnthropicWebSearchToolResultTypedDict, + AnthropicToolUseBlockTypedDict, + ORAnthropicServerToolUseBlockTypedDict, + ORAnthropicShellToolResultTypedDict, + ORAnthropicBashToolResultTypedDict, + ], +) + + +class UnknownORAnthropicContentBlock(BaseModel): + r"""A ORAnthropicContentBlock variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_OR_ANTHROPIC_CONTENT_BLOCK_VARIANTS: dict[str, Any] = { + "advisor_tool_result": AnthropicAdvisorToolResult, + "bash_code_execution_tool_result": AnthropicBashCodeExecutionToolResult, + "code_execution_tool_result": AnthropicCodeExecutionToolResult, + "compaction": AnthropicCompactionBlock, + "container_upload": AnthropicContainerUpload, + "openrouter_bash_tool_result": ORAnthropicBashToolResult, + "openrouter_shell_tool_result": ORAnthropicShellToolResult, + "redacted_thinking": AnthropicRedactedThinkingBlock, + "server_tool_use": ORAnthropicServerToolUseBlock, + "text": AnthropicTextBlock, + "text_editor_code_execution_tool_result": AnthropicTextEditorCodeExecutionToolResult, + "thinking": AnthropicThinkingBlock, + "tool_search_tool_result": AnthropicToolSearchToolResult, + "tool_use": AnthropicToolUseBlock, + "web_fetch_tool_result": AnthropicWebFetchToolResult, + "web_search_tool_result": AnthropicWebSearchToolResult, +} + + +ORAnthropicContentBlock = Annotated[ + Union[ + AnthropicAdvisorToolResult, + AnthropicBashCodeExecutionToolResult, + AnthropicCodeExecutionToolResult, + AnthropicCompactionBlock, + AnthropicContainerUpload, + ORAnthropicBashToolResult, + ORAnthropicShellToolResult, + AnthropicRedactedThinkingBlock, + ORAnthropicServerToolUseBlock, + AnthropicTextBlock, + AnthropicTextEditorCodeExecutionToolResult, + AnthropicThinkingBlock, + AnthropicToolSearchToolResult, + AnthropicToolUseBlock, + AnthropicWebFetchToolResult, + AnthropicWebSearchToolResult, + UnknownORAnthropicContentBlock, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_OR_ANTHROPIC_CONTENT_BLOCK_VARIANTS, + unknown_cls=UnknownORAnthropicContentBlock, + union_name="ORAnthropicContentBlock", + ) + ), +] diff --git a/src/openrouter/components/oranthropicnullablecaller.py b/src/openrouter/components/oranthropicnullablecaller.py new file mode 100644 index 00000000..b6b1da17 --- /dev/null +++ b/src/openrouter/components/oranthropicnullablecaller.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .anthropiccodeexecution20250825caller import ( + AnthropicCodeExecution20250825Caller, + AnthropicCodeExecution20250825CallerTypedDict, +) +from .anthropiccodeexecution20260120caller import ( + AnthropicCodeExecution20260120Caller, + AnthropicCodeExecution20260120CallerTypedDict, +) +from .anthropicdirectcaller import AnthropicDirectCaller, AnthropicDirectCallerTypedDict +from functools import partial +from openrouter.types import BaseModel +from openrouter.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +ORAnthropicNullableCallerTypedDict = TypeAliasType( + "ORAnthropicNullableCallerTypedDict", + Union[ + AnthropicDirectCallerTypedDict, + AnthropicCodeExecution20250825CallerTypedDict, + AnthropicCodeExecution20260120CallerTypedDict, + ], +) + + +class UnknownORAnthropicNullableCaller(BaseModel): + r"""A ORAnthropicNullableCaller variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_OR_ANTHROPIC_NULLABLE_CALLER_VARIANTS: dict[str, Any] = { + "code_execution_20250825": AnthropicCodeExecution20250825Caller, + "code_execution_20260120": AnthropicCodeExecution20260120Caller, + "direct": AnthropicDirectCaller, +} + + +ORAnthropicNullableCaller = Annotated[ + Union[ + AnthropicCodeExecution20250825Caller, + AnthropicCodeExecution20260120Caller, + AnthropicDirectCaller, + UnknownORAnthropicNullableCaller, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_OR_ANTHROPIC_NULLABLE_CALLER_VARIANTS, + unknown_cls=UnknownORAnthropicNullableCaller, + union_name="ORAnthropicNullableCaller", + ) + ), +] diff --git a/src/openrouter/components/oranthropicservertooluseblock.py b/src/openrouter/components/oranthropicservertooluseblock.py new file mode 100644 index 00000000..5d90e196 --- /dev/null +++ b/src/openrouter/components/oranthropicservertooluseblock.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .oranthropicnullablecaller import ( + ORAnthropicNullableCaller, + ORAnthropicNullableCallerTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +ORAnthropicServerToolUseBlockType = Literal["server_tool_use",] + + +class ORAnthropicServerToolUseBlockTypedDict(TypedDict): + id: str + name: str + type: ORAnthropicServerToolUseBlockType + caller: NotRequired[Nullable[ORAnthropicNullableCallerTypedDict]] + input: NotRequired[Any] + + +class ORAnthropicServerToolUseBlock(BaseModel): + id: str + + name: str + + type: ORAnthropicServerToolUseBlockType + + caller: OptionalNullable[ORAnthropicNullableCaller] = UNSET + + input: Optional[Any] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["caller", "input"]) + nullable_fields = set(["caller"]) + 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/oranthropicshelltoolresult.py b/src/openrouter/components/oranthropicshelltoolresult.py new file mode 100644 index 00000000..6c409926 --- /dev/null +++ b/src/openrouter/components/oranthropicshelltoolresult.py @@ -0,0 +1,84 @@ +"""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 Any, Dict, List, Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +ORAnthropicShellToolResultTypeContainerFileCitation = Literal[ + "container_file_citation", +] + + +class ORAnthropicShellToolResultFileTypedDict(TypedDict): + container_id: str + end_index: int + file_id: str + filename: str + start_index: int + type: ORAnthropicShellToolResultTypeContainerFileCitation + + +class ORAnthropicShellToolResultFile(BaseModel): + container_id: str + + end_index: int + + file_id: str + + filename: str + + start_index: int + + type: ORAnthropicShellToolResultTypeContainerFileCitation + + +ORAnthropicShellToolResultTypeOpenrouterShellToolResult = Literal[ + "openrouter_shell_tool_result", +] + + +class ORAnthropicShellToolResultTypedDict(TypedDict): + r"""Output of an `openrouter:shell` call executed in the OpenRouter sandbox""" + + content: Dict[str, Any] + tool_use_id: str + type: ORAnthropicShellToolResultTypeOpenrouterShellToolResult + container_id: NotRequired[str] + r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" + files: NotRequired[List[ORAnthropicShellToolResultFileTypedDict]] + r"""Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.""" + + +class ORAnthropicShellToolResult(BaseModel): + r"""Output of an `openrouter:shell` call executed in the OpenRouter sandbox""" + + content: Dict[str, Any] + + tool_use_id: str + + type: ORAnthropicShellToolResultTypeOpenrouterShellToolResult + + container_id: Optional[str] = None + r"""The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.""" + + files: Optional[List[ORAnthropicShellToolResultFile]] = None + r"""Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["container_id", "files"]) + 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/oranthropicstopreason.py b/src/openrouter/components/oranthropicstopreason.py new file mode 100644 index 00000000..65f68b13 --- /dev/null +++ b/src/openrouter/components/oranthropicstopreason.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ORAnthropicStopReason = Union[ + Literal[ + "end_turn", + "max_tokens", + "model_context_window_exceeded", + "stop_sequence", + "tool_use", + "pause_turn", + "refusal", + "compaction", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/outputfusionservertoolitem.py b/src/openrouter/components/outputfusionservertoolitem.py index 38f428f3..6fceee37 100644 --- a/src/openrouter/components/outputfusionservertoolitem.py +++ b/src/openrouter/components/outputfusionservertoolitem.py @@ -46,12 +46,12 @@ def serialize_model(self, handler): return m -class ResponseTypedDict(TypedDict): +class OutputFusionServerToolItemResponseTypedDict(TypedDict): model: str content: NotRequired[str] -class Response(BaseModel): +class OutputFusionServerToolItemResponse(BaseModel): model: str content: Optional[str] = None @@ -90,7 +90,7 @@ class OutputFusionServerToolItemTypedDict(TypedDict): failure_reason: NotRequired[str] r"""Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, invalid_model, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion. The four analysis-stage codes keep their pre-rename `judge_` spelling so existing consumers keep matching. The consumer-cancellation code is `cancelled`.""" id: NotRequired[str] - responses: NotRequired[List[ResponseTypedDict]] + responses: NotRequired[List[OutputFusionServerToolItemResponseTypedDict]] r"""Analysis models that produced a response in this fusion run, with each model's full panel content.""" sources: NotRequired[List[FusionSourceTypedDict]] r"""Web pages the analysis panels and analyst retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source.""" @@ -117,7 +117,7 @@ class OutputFusionServerToolItem(BaseModel): id: Optional[str] = None - responses: Optional[List[Response]] = None + responses: Optional[List[OutputFusionServerToolItemResponse]] = None r"""Analysis models that produced a response in this fusion run, with each model's full panel content.""" sources: Optional[List[FusionSource]] = None diff --git a/src/openrouter/components/submitgenerationfeedbackrequest.py b/src/openrouter/components/submitgenerationfeedbackrequest.py index c73cccc8..fbcc171f 100644 --- a/src/openrouter/components/submitgenerationfeedbackrequest.py +++ b/src/openrouter/components/submitgenerationfeedbackrequest.py @@ -7,7 +7,7 @@ from typing_extensions import NotRequired, TypedDict -Category = Union[ +SubmitGenerationFeedbackRequestCategory = Union[ Literal[ "latency", "incoherence", @@ -25,7 +25,7 @@ class SubmitGenerationFeedbackRequestTypedDict(TypedDict): r"""Structured feedback about a specific generation""" - category: Category + category: SubmitGenerationFeedbackRequestCategory r"""The category of feedback being reported""" generation_id: str r"""The generation to submit feedback on""" @@ -36,7 +36,7 @@ class SubmitGenerationFeedbackRequestTypedDict(TypedDict): class SubmitGenerationFeedbackRequest(BaseModel): r"""Structured feedback about a specific generation""" - category: Category + category: SubmitGenerationFeedbackRequestCategory r"""The category of feedback being reported""" generation_id: str diff --git a/src/openrouter/errors/__init__.py b/src/openrouter/errors/__init__.py index 21a81e55..736f0a15 100644 --- a/src/openrouter/errors/__init__.py +++ b/src/openrouter/errors/__init__.py @@ -14,6 +14,11 @@ BadRequestResponseError, BadRequestResponseErrorData, ) + from .batcherrorresponse import BatchErrorResponse, BatchErrorResponseData + from .batchpaymentrequiredresponse_error import ( + BatchPaymentRequiredResponseError, + BatchPaymentRequiredResponseErrorData, + ) from .conflictresponse_error import ConflictResponseError, ConflictResponseErrorData from .edgenetworktimeoutresponse_error import ( EdgeNetworkTimeoutResponseError, @@ -80,6 +85,10 @@ "BadGatewayResponseErrorData", "BadRequestResponseError", "BadRequestResponseErrorData", + "BatchErrorResponse", + "BatchErrorResponseData", + "BatchPaymentRequiredResponseError", + "BatchPaymentRequiredResponseErrorData", "ConflictResponseError", "ConflictResponseErrorData", "EdgeNetworkTimeoutResponseError", @@ -127,6 +136,10 @@ "BadGatewayResponseErrorData": ".badgatewayresponse_error", "BadRequestResponseError": ".badrequestresponse_error", "BadRequestResponseErrorData": ".badrequestresponse_error", + "BatchErrorResponse": ".batcherrorresponse", + "BatchErrorResponseData": ".batcherrorresponse", + "BatchPaymentRequiredResponseError": ".batchpaymentrequiredresponse_error", + "BatchPaymentRequiredResponseErrorData": ".batchpaymentrequiredresponse_error", "ConflictResponseError": ".conflictresponse_error", "ConflictResponseErrorData": ".conflictresponse_error", "EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error", diff --git a/src/openrouter/errors/batcherrorresponse.py b/src/openrouter/errors/batcherrorresponse.py new file mode 100644 index 00000000..9ce16f01 --- /dev/null +++ b/src/openrouter/errors/batcherrorresponse.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from openrouter.components import batcherrorresponse as components_batcherrorresponse +from openrouter.errors import OpenRouterError +from openrouter.types import BaseModel +from typing import Optional + + +class BatchErrorResponseData(BaseModel): + error: components_batcherrorresponse.BatchErrorResponseError + + +@dataclass(unsafe_hash=True) +class BatchErrorResponse(OpenRouterError): + data: BatchErrorResponseData = field(hash=False) + + def __init__( + self, + data: BatchErrorResponseData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.error.message) or fallback + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/openrouter/errors/batchpaymentrequiredresponse_error.py b/src/openrouter/errors/batchpaymentrequiredresponse_error.py new file mode 100644 index 00000000..7a1d8bfd --- /dev/null +++ b/src/openrouter/errors/batchpaymentrequiredresponse_error.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from openrouter.components import ( + batchpaymentrequiredresponse_error as components_batchpaymentrequiredresponse_error, +) +from openrouter.errors import OpenRouterError +from openrouter.types import BaseModel, Nullable +from typing import Any, Optional + + +class BatchPaymentRequiredResponseErrorData(BaseModel): + completion_window: components_batchpaymentrequiredresponse_error.BatchPaymentRequiredResponseCompletionWindow + created_at: int + endpoint: str + error: ( + components_batchpaymentrequiredresponse_error.BatchPaymentRequiredResponseError + ) + finalized_at: Nullable[int] + id: str + model: str + object: ( + components_batchpaymentrequiredresponse_error.BatchPaymentRequiredResponseObject + ) + request_counts: components_batchpaymentrequiredresponse_error.BatchPaymentRequiredResponseRequestCounts + results: Nullable[Any] + r"""Always null: results are withheld until the batch charge is covered.""" + status: ( + components_batchpaymentrequiredresponse_error.BatchPaymentRequiredResponseStatus + ) + usage: Nullable[ + components_batchpaymentrequiredresponse_error.BatchPaymentRequiredResponseUsage + ] + + +@dataclass(unsafe_hash=True) +class BatchPaymentRequiredResponseError(OpenRouterError): + r"""Batch metadata with results withheld (results: null) plus the standard error envelope. Add credits to unlock the already-computed results; the batch is not re-run.""" + + data: BatchPaymentRequiredResponseErrorData = field(hash=False) + + def __init__( + self, + data: BatchPaymentRequiredResponseErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.error.message) or fallback + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/openrouter/generations.py b/src/openrouter/generations.py index d5990c42..c520287c 100644 --- a/src/openrouter/generations.py +++ b/src/openrouter/generations.py @@ -623,7 +623,7 @@ async def list_generation_content_async( def submit_feedback( self, *, - category: components.Category, + category: components.SubmitGenerationFeedbackRequestCategory, generation_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, @@ -778,7 +778,7 @@ def submit_feedback( async def submit_feedback_async( self, *, - category: components.Category, + category: components.SubmitGenerationFeedbackRequestCategory, generation_id: str, http_referer: Optional[str] = None, x_open_router_title: Optional[str] = None, diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index f8521696..bfbb96de 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -92,6 +92,12 @@ CreateAuthKeysCodeResponseTypedDict, UsageLimitType, ) + from .createbatches import ( + CreateBatchesGlobals, + CreateBatchesGlobalsTypedDict, + CreateBatchesRequest, + CreateBatchesRequestTypedDict, + ) from .createbyokkey import ( CreateBYOKKeyGlobals, CreateBYOKKeyGlobalsTypedDict, @@ -272,6 +278,12 @@ CreateWorkspaceRequest, CreateWorkspaceRequestTypedDict, ) + from .deletebatch import ( + DeleteBatchGlobals, + DeleteBatchGlobalsTypedDict, + DeleteBatchRequest, + DeleteBatchRequestTypedDict, + ) from .deletebyokkey import ( DeleteBYOKKeyGlobals, DeleteBYOKKeyGlobalsTypedDict, @@ -399,6 +411,12 @@ GetAppRankingsSort, Subcategory, ) + from .getbatches import ( + GetBatchesGlobals, + GetBatchesGlobalsTypedDict, + GetBatchesRequest, + GetBatchesRequestTypedDict, + ) from .getbenchmarks import ( Arena, BenchmarkType, @@ -604,6 +622,14 @@ ListResponse, ListResponseTypedDict, ) + from .listbatches import ( + ListBatchesGlobals, + ListBatchesGlobalsTypedDict, + ListBatchesRequest, + ListBatchesRequestTypedDict, + ListBatchesResponse, + ListBatchesResponseTypedDict, + ) from .listbyokkeys import ( ListBYOKKeysGlobals, ListBYOKKeysGlobalsTypedDict, @@ -1080,6 +1106,10 @@ "CreateBYOKKeyGlobalsTypedDict", "CreateBYOKKeyRequest", "CreateBYOKKeyRequestTypedDict", + "CreateBatchesGlobals", + "CreateBatchesGlobalsTypedDict", + "CreateBatchesRequest", + "CreateBatchesRequestTypedDict", "CreateEmbeddingsData", "CreateEmbeddingsDataTypedDict", "CreateEmbeddingsGlobals", @@ -1192,6 +1222,10 @@ "DeleteBYOKKeyGlobalsTypedDict", "DeleteBYOKKeyRequest", "DeleteBYOKKeyRequestTypedDict", + "DeleteBatchGlobals", + "DeleteBatchGlobalsTypedDict", + "DeleteBatchRequest", + "DeleteBatchRequestTypedDict", "DeleteFileGlobals", "DeleteFileGlobalsTypedDict", "DeleteFileRequest", @@ -1289,6 +1323,10 @@ "GetBYOKKeyGlobalsTypedDict", "GetBYOKKeyRequest", "GetBYOKKeyRequestTypedDict", + "GetBatchesGlobals", + "GetBatchesGlobalsTypedDict", + "GetBatchesRequest", + "GetBatchesRequestTypedDict", "GetBenchmarksGlobals", "GetBenchmarksGlobalsTypedDict", "GetBenchmarksRequest", @@ -1431,6 +1469,12 @@ "ListBYOKKeysRequestTypedDict", "ListBYOKKeysResponse", "ListBYOKKeysResponseTypedDict", + "ListBatchesGlobals", + "ListBatchesGlobalsTypedDict", + "ListBatchesRequest", + "ListBatchesRequestTypedDict", + "ListBatchesResponse", + "ListBatchesResponseTypedDict", "ListContainerFilesGlobals", "ListContainerFilesGlobalsTypedDict", "ListContainerFilesRequest", @@ -1809,6 +1853,10 @@ "CreateAuthKeysCodeResponse": ".createauthkeyscode", "CreateAuthKeysCodeResponseTypedDict": ".createauthkeyscode", "UsageLimitType": ".createauthkeyscode", + "CreateBatchesGlobals": ".createbatches", + "CreateBatchesGlobalsTypedDict": ".createbatches", + "CreateBatchesRequest": ".createbatches", + "CreateBatchesRequestTypedDict": ".createbatches", "CreateBYOKKeyGlobals": ".createbyokkey", "CreateBYOKKeyGlobalsTypedDict": ".createbyokkey", "CreateBYOKKeyRequest": ".createbyokkey", @@ -1951,6 +1999,10 @@ "CreateWorkspaceGlobalsTypedDict": ".createworkspace", "CreateWorkspaceRequest": ".createworkspace", "CreateWorkspaceRequestTypedDict": ".createworkspace", + "DeleteBatchGlobals": ".deletebatch", + "DeleteBatchGlobalsTypedDict": ".deletebatch", + "DeleteBatchRequest": ".deletebatch", + "DeleteBatchRequestTypedDict": ".deletebatch", "DeleteBYOKKeyGlobals": ".deletebyokkey", "DeleteBYOKKeyGlobalsTypedDict": ".deletebyokkey", "DeleteBYOKKeyRequest": ".deletebyokkey", @@ -2046,6 +2098,10 @@ "GetAppRankingsResponseTypedDict": ".getapprankings", "GetAppRankingsSort": ".getapprankings", "Subcategory": ".getapprankings", + "GetBatchesGlobals": ".getbatches", + "GetBatchesGlobalsTypedDict": ".getbatches", + "GetBatchesRequest": ".getbatches", + "GetBatchesRequestTypedDict": ".getbatches", "Arena": ".getbenchmarks", "BenchmarkType": ".getbenchmarks", "GetBenchmarksGlobals": ".getbenchmarks", @@ -2197,6 +2253,12 @@ "ListRequestTypedDict": ".list", "ListResponse": ".list", "ListResponseTypedDict": ".list", + "ListBatchesGlobals": ".listbatches", + "ListBatchesGlobalsTypedDict": ".listbatches", + "ListBatchesRequest": ".listbatches", + "ListBatchesRequestTypedDict": ".listbatches", + "ListBatchesResponse": ".listbatches", + "ListBatchesResponseTypedDict": ".listbatches", "ListBYOKKeysGlobals": ".listbyokkeys", "ListBYOKKeysGlobalsTypedDict": ".listbyokkeys", "ListBYOKKeysRequest": ".listbyokkeys", diff --git a/src/openrouter/operations/createbatches.py b/src/openrouter/operations/createbatches.py new file mode 100644 index 00000000..b1bb2048 --- /dev/null +++ b/src/openrouter/operations/createbatches.py @@ -0,0 +1,146 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import batchsubmitbody as components_batchsubmitbody +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 CreateBatchesGlobalsTypedDict(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 CreateBatchesGlobals(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 CreateBatchesRequestTypedDict(TypedDict): + batch_submit_body: components_batchsubmitbody.BatchSubmitBodyTypedDict + r"""The batch to create. Each item in `requests` has a unique `custom_id` and a `body` in the request format of the chosen `endpoint`.""" + http_referer: NotRequired[str] + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + x_open_router_title: NotRequired[str] + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + +class CreateBatchesRequest(BaseModel): + batch_submit_body: Annotated[ + components_batchsubmitbody.BatchSubmitBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + r"""The batch to create. Each item in `requests` has a unique `custom_id` and a `body` in the request format of the chosen `endpoint`.""" + + http_referer: Annotated[ + Optional[str], + pydantic.Field(alias="HTTP-Referer"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. + This is used to track API usage per application. + + """ + + x_open_router_title: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Title"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/openrouter/operations/deletebatch.py b/src/openrouter/operations/deletebatch.py new file mode 100644 index 00000000..9edaaae8 --- /dev/null +++ b/src/openrouter/operations/deletebatch.py @@ -0,0 +1,144 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DeleteBatchGlobalsTypedDict(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 DeleteBatchGlobals(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 DeleteBatchRequestTypedDict(TypedDict): + id: str + r"""The batch job id returned from submit.""" + 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 DeleteBatchRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The batch job id returned from submit.""" + + 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/getbatches.py b/src/openrouter/operations/getbatches.py new file mode 100644 index 00000000..2e824057 --- /dev/null +++ b/src/openrouter/operations/getbatches.py @@ -0,0 +1,144 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetBatchesGlobalsTypedDict(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 GetBatchesGlobals(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 GetBatchesRequestTypedDict(TypedDict): + id: str + r"""The batch job id returned from submit.""" + 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 GetBatchesRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The batch job id returned from submit.""" + + 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/listbatches.py b/src/openrouter/operations/listbatches.py new file mode 100644 index 00000000..6f60496e --- /dev/null +++ b/src/openrouter/operations/listbatches.py @@ -0,0 +1,208 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.components import ( + batchlistresponse as components_batchlistresponse, + batchliststatus as components_batchliststatus, + batchlisttimestamp as components_batchlisttimestamp, +) +from openrouter.types import BaseModel, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Awaitable, Callable, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListBatchesGlobalsTypedDict(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 ListBatchesGlobals(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 ListBatchesRequestTypedDict(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. + + """ + limit: NotRequired[int] + r"""Maximum number of batches to return, from 1 through 100.""" + after: NotRequired[str] + r"""Batch id from the previous page's `last_id`.""" + status: NotRequired[List[components_batchliststatus.BatchListStatus]] + r"""Repeat this parameter to include more than one status.""" + created_after: NotRequired[ + components_batchlisttimestamp.BatchListTimestampTypedDict + ] + r"""Only include batches created strictly after this timestamp.""" + created_before: NotRequired[ + components_batchlisttimestamp.BatchListTimestampTypedDict + ] + r"""Only include batches created strictly before this timestamp.""" + + +class ListBatchesRequest(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. + + """ + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of batches to return, from 1 through 100.""" + + after: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Batch id from the previous page's `last_id`.""" + + status: Annotated[ + Optional[List[components_batchliststatus.BatchListStatus]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Repeat this parameter to include more than one status.""" + + created_after: Annotated[ + Optional[components_batchlisttimestamp.BatchListTimestamp], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Only include batches created strictly after this timestamp.""" + + created_before: Annotated[ + Optional[components_batchlisttimestamp.BatchListTimestamp], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Only include batches created strictly before this timestamp.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "HTTP-Referer", + "X-OpenRouter-Title", + "X-OpenRouter-Categories", + "limit", + "after", + "status", + "created_after", + "created_before", + ] + ) + 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 ListBatchesResponseTypedDict(TypedDict): + result: components_batchlistresponse.BatchListResponseTypedDict + + +class ListBatchesResponse(BaseModel): + next: Union[ + Callable[[], Optional[ListBatchesResponse]], + Callable[[], Awaitable[Optional[ListBatchesResponse]]], + ] + + result: components_batchlistresponse.BatchListResponse diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py index 28ea1b39..8e874115 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -19,6 +19,7 @@ from openrouter.alpha import Alpha from openrouter.analytics import Analytics from openrouter.api_keys import APIKeys + from openrouter.batch import Batch from openrouter.benchmarks import Benchmarks from openrouter.beta import Beta from openrouter.byok import BYOK @@ -65,6 +66,8 @@ class OpenRouter(BaseSDK): r"""Speech-to-text endpoints""" o_auth: "OAuth" r"""OAuth authentication endpoints""" + batch: "Batch" + r"""Submit, list, poll, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart.""" benchmarks: "Benchmarks" r"""Benchmarks endpoints""" byok: "BYOK" @@ -125,6 +128,7 @@ class OpenRouter(BaseSDK): "tts": ("openrouter.tts", "TTS"), "stt": ("openrouter.stt", "STT"), "o_auth": ("openrouter.oauth", "OAuth"), + "batch": ("openrouter.batch", "Batch"), "benchmarks": ("openrouter.benchmarks", "Benchmarks"), "byok": ("openrouter.byok", "BYOK"), "chat": ("openrouter.chat", "Chat"), diff --git a/uv.lock b/uv.lock index 0f644753..65d9fb69 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.2.28" +version = "1.2.29" source = { editable = "." } dependencies = [ { name = "httpcore" },