diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5cae47c77..62c56ebc4 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 4162460b4e4c0ad3640d7ef614732117 + docChecksum: ba82888840e08d34bfb16fd3eb4a1faa docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.29 - configChecksum: 691cf13390450c7b27d1758ff9904045 + releaseVersion: 1.3.30 + configChecksum: 92781223b52769fec6ebbe3cefff371a repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: 75a4fbcd-178d-4d65-9e31-a7648fa6de61 - pristine_commit_hash: 33f456ce6d73d27204af6f589637c84233c03d9b - pristine_tree_hash: dcbe4d107655a18be7144f87f0578944315c793e + generation_id: 66ccbb4b-246b-42f3-b549-9522d78fb666 + pristine_commit_hash: d87fe1be0e0c99d67b7f3b892a694a4e6e411b5c + pristine_tree_hash: e26e9c40b13ea693975ead2a8c3f5c05696b3ada features: typescript: acceptHeaders: 2.81.2 @@ -294,6 +294,10 @@ trackedFiles: last_write_checksum: sha1:50f9b708005344c386c27341926257fb1fb08491 pristine_git_object: 48b2cd837ae453021bc146bde4669ffd6e11ee90 deleted: true + docs/models/annotation.mdx: + id: 239ba919d957 + last_write_checksum: sha1:a55a7643dfcdb6a4cbca9f4ea5b3521604aadcb7 + pristine_git_object: 5748c04fb261e9b537d22c34bb1f1f3b4790ccd3 docs/models/annotationaddedevent.md: id: 1d604076bb55 last_write_checksum: sha1:787168d345b8bf4cc60ce56e4fbfe9c9985ba2c2 @@ -303,6 +307,22 @@ trackedFiles: id: 5647a6bd8c75 last_write_checksum: sha1:bf741567a12c9422d539d001277186d9d607a62f pristine_git_object: 81eeb238d415cbba02e37584090710f69b9dbfd2 + docs/models/annotationcontentunion.mdx: + id: c03776be833a + last_write_checksum: sha1:51cd74fb2b3c3fa4978fed6e72bb3e297e74b3ae + pristine_git_object: 7c1a6a11566a0471ed2e543a857315e86eca162f + docs/models/annotationfile.mdx: + id: dac9ff2411ae + last_write_checksum: sha1:aaf4b5b56cd4da0de9e241e70fdd189016b94c23 + pristine_git_object: 58791a4d062bba991c4dae046922f483e7e2e248 + docs/models/annotationurlcitation.mdx: + id: f356a786018d + last_write_checksum: sha1:47a4ff3bf7020ddce07d4f1eb24135e800a537e5 + pristine_git_object: de1d1ad0adafc54c95cce5e16fd8d0159ae0a7b7 + docs/models/annotationwebsearchcitation.mdx: + id: 572268d1df8b + last_write_checksum: sha1:e37c0cd9f17dabf34c3be9dac0d67f4c746c977c + pristine_git_object: 48dbf9fdfcc4200a5f91d233287a290d5c41d4fa docs/models/answers.mdx: id: 40dc1d48c58b last_write_checksum: sha1:c8517990d071c1487390c581cdd8aff6a30fdc92 @@ -325,6 +345,10 @@ trackedFiles: id: 0884353db805 last_write_checksum: sha1:b9578815591e44fed81d890e574d6c618f60f6e8 pristine_git_object: 6f130288df5d85f202dc3f96e10dca9bb11fabc7 + docs/models/anthropicadvisortoolresult.mdx: + id: 3ba3fc578cb6 + last_write_checksum: sha1:bdffd69bf5a379ab3687efaeebc13a0f1c3596dc + pristine_git_object: 6bee1d1cbacdf24477c749b6465ae465adae78f7 docs/models/anthropicallowedcallers.md: id: "03935532e028" last_write_checksum: sha1:6ec7172282f3d42bdc027b31d65139c952cd0027 @@ -350,8 +374,8 @@ trackedFiles: deleted: true docs/models/anthropicbase64pdfsource.mdx: id: a0c680a5044a - last_write_checksum: sha1:f1580edb2a78c6b0e1205239bbe7c4f0dcd47ef1 - pristine_git_object: 86918e684eb53f09a297026327c293aa0aa67bee + last_write_checksum: sha1:e542cd8b0399ab05cf725318e1c3c10d2ba2d46c + pristine_git_object: 2a3716ba88cc4ee223f7cc39f60507013a760d50 docs/models/anthropicbase64pdfsourcemediatype.md: id: 621dee01d0ef last_write_checksum: sha1:abf09659099073e69fd6e0f487275da4ca19692b @@ -361,6 +385,38 @@ trackedFiles: id: 8355452e50d9 last_write_checksum: sha1:8209c4c0b1bd1b41a5d348d2320b00d0b9e1295c pristine_git_object: d61bd3c429f3100806467a99afa57a05da262871 + docs/models/anthropicbase64pdfsourcetype.mdx: + id: 951711cffe22 + last_write_checksum: sha1:d0b3550817780054d139c6c1037d902572927078 + pristine_git_object: 2df8b5f1e12858a04c44bfde0eab55229950dcd5 + docs/models/anthropicbashcodeexecutioncontent.mdx: + id: b368ffe950d0 + last_write_checksum: sha1:5e74cf148c7e8d45459ae11f0447f28f8070cc26 + pristine_git_object: a296d9e59d677dcdc4dbb82fe95d2b8727ed0545 + docs/models/anthropicbashcodeexecutionoutput.mdx: + id: f3f5a2e05690 + last_write_checksum: sha1:25c71c8d64419bc95493bfd72c05fc24991e10ed + pristine_git_object: c9bbfbec2bd01601e183131771a3a56089329106 + docs/models/anthropicbashcodeexecutionoutputtype.mdx: + id: 2a928cdca134 + last_write_checksum: sha1:62221084f625fab33e29fb1407d21159dafc708c + pristine_git_object: c9f3425147cb134fa2ab9bec78b6ef6150bf9890 + docs/models/anthropicbashcodeexecutionresult.mdx: + id: e5c275fff5b7 + last_write_checksum: sha1:68ef8b779b07f9b23c574de3ae5b7b45cdd88773 + pristine_git_object: 027d6b3ec24f9e41484fc8335909f847acc23f5d + docs/models/anthropicbashcodeexecutiontoolresult.mdx: + id: 19bea7582485 + last_write_checksum: sha1:aea28c9a77440bfb1cb13cf73003b1066e327d7f + pristine_git_object: 451d63464d9df860920cb0c94451ce5b27861e6a + docs/models/anthropicbashcodeexecutiontoolresulterror.mdx: + id: b81c23a12d83 + last_write_checksum: sha1:aedf38df01f693bdbe61e8697860eb940c2b5d44 + pristine_git_object: 460cd8e08d97d45d7a78b9819b1d4fd078a85813 + docs/models/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx: + id: 3a36fe9de011 + last_write_checksum: sha1:ae0ff3f55f37f21c3ec01778c76d4b2805780726 + pristine_git_object: 4a1dc93583704d84b69b6f9dcac781cb89ee89a8 docs/models/anthropiccachecontroldirective.md: id: e5e1a8c6dc4f last_write_checksum: sha1:ad813917348008c8e1017a92f632a64ad23e69b9 @@ -392,6 +448,14 @@ trackedFiles: id: 5535d679b43c last_write_checksum: sha1:d2499dd0efd7d88d41bd8742ca20f737cfde3d7c pristine_git_object: fff3213d0a9d52a58924ecdea74242b85c638e0c + docs/models/anthropiccaller.mdx: + id: 0c83a12c914e + last_write_checksum: sha1:bc750e4271a8369363a17cd2a1e349350f193643 + pristine_git_object: 436027388aaacc8f4f12dfa4497d1e88f12e67cd + docs/models/anthropiccitationcharlocation.mdx: + id: 5bf4134c1c7a + last_write_checksum: sha1:4ab44c8f0513d8312b70744db0436cca9edd3f5d + pristine_git_object: 8627c012ead0479eb6380d45d43e1554611eba2f docs/models/anthropiccitationcharlocationparam.md: id: 5a33c2cc933a last_write_checksum: sha1:8cdb5f36ac5266a2fe929e8caad77110e8ac514d @@ -401,6 +465,10 @@ trackedFiles: id: b0c3b5464a25 last_write_checksum: sha1:1a95aeed864975a2f6e874b58ee982ef784d8685 pristine_git_object: 47e6bbb65fa8b9463b2bca326ebe9ec47c172543 + docs/models/anthropiccitationcontentblocklocation.mdx: + id: e4b7a81e3a23 + last_write_checksum: sha1:9798c5a025d492abc0a5b4ee18c54d5b3261e532 + pristine_git_object: 979cc8f45172e3c66dcaddcef1aa1e2f3dca9db9 docs/models/anthropiccitationcontentblocklocationparam.md: id: f58a3fc1b6a1 last_write_checksum: sha1:4a2df101e6a70c7ddeff1067a50bb2763e1964f1 @@ -410,6 +478,10 @@ trackedFiles: id: 914d5e7aa1bf last_write_checksum: sha1:2ee663413ac4dd55860fe3c2e9075882ebfef8ca pristine_git_object: c1f26928cd5c89123eb2ae068f0727a5aac330f9 + docs/models/anthropiccitationpagelocation.mdx: + id: 1bee884fea53 + last_write_checksum: sha1:f2850a2530562fa061791dda3f79ce147b86141b + pristine_git_object: 33e9c4e71d581aeb3d0f5d61df3a0e585e49e9ff docs/models/anthropiccitationpagelocationparam.md: id: ba766aa60bf6 last_write_checksum: sha1:75b55586013dfd658cc8fc076f7ff1f79a7756e4 @@ -419,11 +491,19 @@ trackedFiles: id: 9b2f14cb350e last_write_checksum: sha1:661be4f6549d5319e782a53320a98ec3b0e6acec pristine_git_object: 2fc698d2db602f0b25e098ed86f4ae7a8fc54115 + docs/models/anthropiccitationsconfig.mdx: + id: 60b574ae7989 + last_write_checksum: sha1:5cb4956622f24dc6d61c4a4c5ae2588fc49ae197 + pristine_git_object: 8137478b73bca46ff809db2bbceb23568146edcf docs/models/anthropiccitationsearchresultlocation.md: id: 64f77f7c72f5 last_write_checksum: sha1:3b5c14d76a6234843630034bf564b0dff91150b6 pristine_git_object: 05c0a171b3a150fcd170590806953b7843114e2c deleted: true + docs/models/anthropiccitationsearchresultlocation.mdx: + id: 07840708bb81 + last_write_checksum: sha1:e8f57a8468c409a0ea850d981160b71ef27683a3 + pristine_git_object: acfe445994af4796848536f554e15bc1cde85406 docs/models/anthropiccitationsearchresultlocationparam.mdx: id: 89fe1b167162 last_write_checksum: sha1:3def38bce3d9cc3d2319f58f6c33518705e00226 @@ -433,10 +513,50 @@ trackedFiles: last_write_checksum: sha1:6bd79341a7bff347f7b9d4d566ecba79b9e4dae6 pristine_git_object: 0e053cda82609101bb71f23d0fc809e4cc2f8626 deleted: true + docs/models/anthropiccitationwebsearchresultlocation.mdx: + id: f9bb7ac9d52c + last_write_checksum: sha1:63e69d54381752ac4f227e66892f1ef6e9e8e0b5 + pristine_git_object: 33c1992f95d896d10c853e47b6cc5476ebd35e79 docs/models/anthropiccitationwebsearchresultlocationparam.mdx: id: 78d801949af7 last_write_checksum: sha1:5f9c0404e68efeb3b0ab2dce4c88712deba1e06e pristine_git_object: 6cc7b9677e47d52f078659e8da94cc851b22a40b + docs/models/anthropiccodeexecution20250825caller.mdx: + id: 5901ce2a62e9 + last_write_checksum: sha1:1718e64aff249defdb3abb90d22246825ee4e83e + pristine_git_object: b24a197355cbc43e46f0b57d07a7bd8df8dc88fc + docs/models/anthropiccodeexecution20260120caller.mdx: + id: d0829b1998f7 + last_write_checksum: sha1:44dc1e01b44c932a310a35a22825b77db770df90 + pristine_git_object: e99ae9e7406f78a1981cb74a2a9faa501773b3d2 + docs/models/anthropiccodeexecutioncontent.mdx: + id: "333207342904" + last_write_checksum: sha1:7ce0b174316b9f1a3aac37cd038e3fadbb54c23d + pristine_git_object: ce189549f4655fc83c7ea6622bc4f51c2c8d413e + docs/models/anthropiccodeexecutionoutput.mdx: + id: 07448b828d62 + last_write_checksum: sha1:836374a8f0c1b47f7690cbd99df539ea6791588f + pristine_git_object: a23674e057ab8c2846a12783f4ee49035dc39153 + docs/models/anthropiccodeexecutionoutputtype.mdx: + id: 96c2ee4d2d91 + last_write_checksum: sha1:7cbf0ab628744f29f494548ff0f932beac6dbc07 + pristine_git_object: f598874823b37661bc9299c8c5985ea3af375d00 + docs/models/anthropiccodeexecutionresult.mdx: + id: 448fa25ad6c6 + last_write_checksum: sha1:52bac796ebc0d3f899fe8b446b2beed112646f82 + pristine_git_object: 1c8bf52c5fd8be67abc993cc488d630f5791ed5a + docs/models/anthropiccodeexecutiontoolresult.mdx: + id: a5057852642d + last_write_checksum: sha1:b4fbee4a0e1e966a517607b2bbc058fbef1fb3ac + pristine_git_object: 901a84cf316f689f8c28cdf1cec2cca4b40a1c60 + docs/models/anthropiccodeexecutiontoolresulterror.mdx: + id: 02bf7af3b7fd + last_write_checksum: sha1:eacd4859ce724d9ace33e65909d728fba80ae816 + pristine_git_object: 4183e0113eb8371b13856c126933ba8e95ceb691 + docs/models/anthropiccompactionblock.mdx: + id: d076b5be1941 + last_write_checksum: sha1:9fd739878080aefba88cbbffdee9fc5608ae0666 + pristine_git_object: c609e97d56ec8303bed47ce5afc7bd53bcf49e10 docs/models/anthropiccompactionusageiteration.md: id: 809148a56416 last_write_checksum: sha1:6bd0cd2661faa09a13bf7cbb21ef35d0bc7371ce @@ -455,6 +575,30 @@ trackedFiles: id: 236f50339eed last_write_checksum: sha1:1c50e8e82d0bc1b5eb9b6c4d765d254913e33cc7 pristine_git_object: 764137a7575b0009979667296457afa5c8fb674f + docs/models/anthropiccontainer.mdx: + id: 23896a7e7944 + last_write_checksum: sha1:73154786570e464da3ae7b0d72dc5d03665b9fad + pristine_git_object: 694abc320796cb2c8555ebde7829a9efb4c1f0e6 + docs/models/anthropiccontainerskill.mdx: + id: e8dc252dfed4 + last_write_checksum: sha1:965648995d8858ce7751b586210176de41805281 + pristine_git_object: 9ae6d9117fa25cef98c199cd104d1ffbff5a08a8 + docs/models/anthropiccontainerskilltype.mdx: + id: fd53541cf027 + last_write_checksum: sha1:8e25965ac2774af5922a75b917d56302444262a4 + pristine_git_object: dd45051ded74a61cb8e6c5a31adfd3e7f688386a + docs/models/anthropiccontainerupload.mdx: + id: 3a78f73b27c3 + last_write_checksum: sha1:4979351242fe7ec9ec28bffef344ba9a23fc045c + pristine_git_object: 556ea75c1096da11899bb815285110372780a381 + docs/models/anthropicdirectcaller.mdx: + id: a5c1e624e302 + last_write_checksum: sha1:386da11c767366776fa8dbaee5e2302b50165579 + pristine_git_object: 79c4f2e5d1bdaef5d97d84148a3110b1686a1274 + docs/models/anthropicdocumentblock.mdx: + id: 98543673013f + last_write_checksum: sha1:387c8368290bf325644eb4e149192b012f1d0b56 + pristine_git_object: 186bda94ce22505db5b327ab1dec5225d900ebdc docs/models/anthropicdocumentblockparam.md: id: acc0ba1b047c last_write_checksum: sha1:fdb444b124ff1f3cfb52df400e19129a8c5b1fc7 @@ -500,6 +644,18 @@ trackedFiles: id: d55cd47d251e last_write_checksum: sha1:1953cda32ddd13fd738644ffa8e4bf5807bc0391 pristine_git_object: e8c4464fa4b73e8e94029801646e3d807c7b2a1d + docs/models/anthropicdocumentblocksource.mdx: + id: 3f4be6718c0a + last_write_checksum: sha1:e1490eb3b1db1d4d38dc6fce103ce50e5a6864e3 + pristine_git_object: 6bef68fad9051cc4293002d2680f2ed181679858 + docs/models/anthropicdocumentblocktype.mdx: + id: 4d6981e04b1a + last_write_checksum: sha1:1169693d80e3af00bb76af1ef41cc5565c5038d8 + pristine_git_object: cac3e9c5b9e49cc37d93bb74b5c9e9b88e4ee20a + docs/models/anthropicencryptedcodeexecutionresult.mdx: + id: 37436cad65f9 + last_write_checksum: sha1:47892b996962e7c5fee5c3d5bef585fba06a376a + pristine_git_object: b944dd5dcad6f8e35ade8fc180b3ec4b5cecf365 docs/models/anthropicfile.mdx: id: 7e0e4ef60785 last_write_checksum: sha1:3cd34d5d5bfb3153006929023f5ef2a7c40afb43 @@ -587,6 +743,10 @@ trackedFiles: id: 183d69c83252 last_write_checksum: sha1:05489d2f58278ce099497b50919caa5c64a08460 pristine_git_object: 6af2bd1fe0ba9a3cd7ef7dbc316e24cbbf2b5e78 + docs/models/anthropicinputtransformation.mdx: + id: 3ad5ca645b36 + last_write_checksum: sha1:3763006092b0538889370477ac20277c63264145 + pristine_git_object: bfba8c5d4e82fbb4e8a8087349b9b33b617b0a2b docs/models/anthropiciterationcachecreation.md: id: a62e54fd3dd7 last_write_checksum: sha1:42896624872f943c5001f60e168de77c19fcf95c @@ -622,6 +782,10 @@ trackedFiles: id: 6740ae95b45c last_write_checksum: sha1:41ec386d3932519c3a35b62d92282a7619322c28 pristine_git_object: 11ac853d1f0546c40cfcf53ec9fc5cd58ff05e95 + docs/models/anthropicoutputtokensdetails.mdx: + id: d5e9c10592aa + last_write_checksum: sha1:469b5b11ecfc4c9353543513ff9d5783d21aeae2 + pristine_git_object: f1862c6b991a8dbb57be1922b34f3e6fb83e8be0 docs/models/anthropicplaintextsource.md: id: 0904ea4a0d8f last_write_checksum: sha1:ce5319d51a06862d49a38f5f69fc69b1a0afa826 @@ -629,8 +793,8 @@ trackedFiles: deleted: true docs/models/anthropicplaintextsource.mdx: id: 83030e395ba8 - last_write_checksum: sha1:20559daccb248a333393c06fac1ae9c5edfadac8 - pristine_git_object: 0539b7a4a8a7aa42bfbca66672dc9b0647d35b14 + last_write_checksum: sha1:8382d3839896e3f66d9c79a942394611b020e272 + pristine_git_object: b591d27bca6be35b4547cc4a479f76f4c544d95d docs/models/anthropicplaintextsourcemediatype.md: id: 791643193b85 last_write_checksum: sha1:ac21e87b10abacf19e8417cc21aa55d4011b06d8 @@ -640,6 +804,26 @@ trackedFiles: id: f95bbb936bd8 last_write_checksum: sha1:8d00e8befc933d0fac92cbadd1d2d3f95049bf6b pristine_git_object: 47117174f0f747fa399deef9fe517ff6402f2250 + docs/models/anthropicplaintextsourcetype.mdx: + id: 2e0f96f7a1bf + last_write_checksum: sha1:6a1be082007566a3c8ad1d9a9198de7d0a9a6c80 + pristine_git_object: 4f421c1d084cc9f9635bb478afc698a078cd6b6e + docs/models/anthropicredactedthinkingblock.mdx: + id: 0c65b2f6ed5d + last_write_checksum: sha1:6acea3a1a0a768cb6e6002b751da55de9ccf5584 + pristine_git_object: 887c61b1db8380b502885a60b887e6e93de1c8ec + docs/models/anthropicrefusalstopdetails.mdx: + id: af06312e342a + last_write_checksum: sha1:e0d9d0a3298ef5c20c8a6116a4aad84e2bd38b3f + pristine_git_object: 4701d209e7ce52e33e5ecb6135535df3b01894fd + docs/models/anthropicrefusalstopdetailscategory.mdx: + id: 4344de75701c + last_write_checksum: sha1:a75f36f25795c1daf9621b3e5361c0e1b8481f88 + pristine_git_object: f4bcc025772f23a5bd12dbf014bba274e1563d6d + docs/models/anthropicrefusalstopdetailstype.mdx: + id: b9aa0932233b + last_write_checksum: sha1:6db1144c4ca5998fd37112506fadc02efc0cb80e + pristine_git_object: 5cde916be0b80a3cb598d4fa4680e039d264fcbb docs/models/anthropicsafeguard.mdx: id: dcadd086658f last_write_checksum: sha1:eb4a0ad229520ab7c8aadefef1369a1c4a40224f @@ -662,6 +846,18 @@ trackedFiles: id: ef31894ca699 last_write_checksum: sha1:6d6317ef76ba31d1f2b8724e82f8622dcb153cd1 pristine_git_object: f0bc6827f91aa9493ab2ec247dc0e5d253ddf169 + docs/models/anthropicservertoolerrorcode.mdx: + id: bcc937766e1c + last_write_checksum: sha1:260fe79d4a2c05448257d4469e481a1d691638cc + pristine_git_object: acf46df623ca3563ccc489e95e935cc08c47b1c9 + docs/models/anthropicservertoolusage.mdx: + id: 9c710dc37072 + last_write_checksum: sha1:6d299923f2c484881d6b8a7ae67814d4c776eae5 + pristine_git_object: a2af3124fe54009afabfec7a81ec0728a5123a29 + docs/models/anthropicservicetier.mdx: + id: 8fef0965080c + last_write_checksum: sha1:0ad6e1304271c848a38da4f7f3a7fce2621d8dc4 + pristine_git_object: 6a3e1664add5de188ee4b03599bf29f609c4b61b docs/models/anthropicspeed.md: id: 017b6766d56b last_write_checksum: sha1:2622bacc9bd808f2bdf3d918bbd66795f833617c @@ -675,6 +871,10 @@ trackedFiles: id: 634c27e9a1dc last_write_checksum: sha1:d984ba1782ffa85d3fe49c5284a68bc023c4a7d0 pristine_git_object: f21d942a508caf7eb95165dcbf6c0af14dc3b049 + docs/models/anthropictextblock.mdx: + id: 718bb2406cdd + last_write_checksum: sha1:1d6362a0c59d11898b58b1d5c2ad30a29e62d009 + pristine_git_object: 4397e7346078ea6a667d8b316674d605ff6fb79b docs/models/anthropictextblockparam.md: id: 704ed0604b61 last_write_checksum: sha1:30b6af62ebaa63a47b4ed095152ca703cd9d0136 @@ -684,6 +884,42 @@ trackedFiles: id: 1485be58b64c last_write_checksum: sha1:9dad83452a97cb38785dc482b33356fba851b5e0 pristine_git_object: df34fd1a267fe91036007b15b1b0572174b384f8 + docs/models/anthropictextcitation.mdx: + id: e0776c0bfe42 + last_write_checksum: sha1:dcb0e954d3cc6623d36bfc11e28462d6ed1ff154 + pristine_git_object: 12065200df4289a5572212773275ae9a5c5fdfd9 + docs/models/anthropictexteditorcodeexecutioncontent.mdx: + id: aaf86cdf28aa + last_write_checksum: sha1:44bac33a96919dd87971e7988888af9c2ae65184 + pristine_git_object: f3e5849ae14dd27d1e05e921335395213316b822 + docs/models/anthropictexteditorcodeexecutioncreateresult.mdx: + id: aee59f69e330 + last_write_checksum: sha1:cd3a2b6ba36bc08153c2b757d3b8e06544de010c + pristine_git_object: f645f5715ddbd97cee36843012c0e4da7a400a3d + docs/models/anthropictexteditorcodeexecutionstrreplaceresult.mdx: + id: dd2bdea53a4d + last_write_checksum: sha1:ffd4c3cbf925de04fbf1018e1401eb50bf2743fd + pristine_git_object: 9131976da130d8a38be704f9b25d8fef17794806 + docs/models/anthropictexteditorcodeexecutiontoolresult.mdx: + id: 0d20a5feea5f + last_write_checksum: sha1:7a7fa7e94016385d6875f7a97ec78fb43139c4df + pristine_git_object: 9c1d6a7e3cdd4b5c116958724acaca7d4ee3d9e5 + docs/models/anthropictexteditorcodeexecutiontoolresulterror.mdx: + id: 4e755ba43ad9 + last_write_checksum: sha1:34c8fd511f172325fee9d0b4fb12e484a625765c + pristine_git_object: 434f11435c4be2d04cd0d748f670c9530d54cdd6 + docs/models/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx: + id: b1cd44a21c28 + last_write_checksum: sha1:012d36b22eae43d3af5681ba2ddbf2259eacd16a + pristine_git_object: 282be51c81629b3d247e005e94af45cdffd8a11e + docs/models/anthropictexteditorcodeexecutionviewresult.mdx: + id: 442da259aad7 + last_write_checksum: sha1:215db9708bf42ede4650d84198ab161243a14670 + pristine_git_object: d721c5b74da5b7553b4ae3bbe0a0e39d303903c5 + docs/models/anthropicthinkingblock.mdx: + id: 4716e6b235b7 + last_write_checksum: sha1:48903cd106afce3f5a3efee12d972ee980907fe0 + pristine_git_object: 9e42fcaaeef52caccd460bf77f4abd40820c2723 docs/models/anthropicthinkingblockbinding.mdx: id: a958eb316eb7 last_write_checksum: sha1:a475336df3ebd7aa47f29a93da03a9dc22d9e76f @@ -715,6 +951,26 @@ trackedFiles: id: 268ba8097d6f last_write_checksum: sha1:dc40dc014e7e6707cf8e3459968b6dcf6ef77e52 pristine_git_object: 34614f4e5d06caf08a7fc27c11b91f4d1ac351ea + docs/models/anthropictoolreference.mdx: + id: f156f94c00e2 + last_write_checksum: sha1:e290d214c0927e2baf72e9066ec00342fe4254c5 + pristine_git_object: 68537c49444fc8cd9a9dca5d754c3f57d07949b1 + docs/models/anthropictoolreferencetype.mdx: + id: 831bbf4c49d2 + last_write_checksum: sha1:195e21271544a13d18112599634e4f64684597e0 + pristine_git_object: 54719588ba3775b6e24b9e7ae064e1dbd4d51b37 + docs/models/anthropictoolsearchcontent.mdx: + id: fa591f379e2f + last_write_checksum: sha1:b6497ad8fe1072b2ec8b85c0948d877a445cf377 + pristine_git_object: 34715d4c0c8929803b0eb17516199118f59c81e5 + docs/models/anthropictoolsearchresult.mdx: + id: f9490052a86a + last_write_checksum: sha1:4d736e5d112e6a1cd61fbabba74d399da319d3a7 + pristine_git_object: 3bc89797d4cc552e64f0b80e3a2ca86cde636a7a + docs/models/anthropictoolsearchresulterror.mdx: + id: cada546c5dca + last_write_checksum: sha1:279cbb197e9df20d86ef5b16b7ff160a87c870f0 + pristine_git_object: cfe6365d1e866ab99b7d208d09cc4013cfce754a docs/models/anthropictoolsearchtoolbm25.mdx: id: 2dec2b9092de last_write_checksum: sha1:8c30833fcf9f50a0ad76bb6459ddce9d4667f5c1 @@ -739,6 +995,14 @@ trackedFiles: id: ed7694fe4425 last_write_checksum: sha1:83acad70e4ec49f58d550b06b5da2c5a31ad47c8 pristine_git_object: c64441ca9f14493772f565773d63a0df1b30ee85 + docs/models/anthropictoolsearchtoolresult.mdx: + id: 74e77cc9cf60 + last_write_checksum: sha1:5dda4c1ccb3f389a2352244249e00a63abe540e0 + pristine_git_object: 897196bd83327786127262fe2147c8aff8686837 + docs/models/anthropictooluseblock.mdx: + id: b04bc0c8dbe0 + last_write_checksum: sha1:0c1f2d584152ebbd20f4c02edae81e3df24c2297 + pristine_git_object: e3e3ddc31c9229ddbe0ffba85e91ee7cc80e55bd docs/models/anthropictooluseskeep.md: id: bde618e00e20 last_write_checksum: sha1:9c24a5dda8a7a746f12176a948602c0cf824b17e @@ -802,6 +1066,30 @@ trackedFiles: id: 951e92eafc27 last_write_checksum: sha1:b9811b835d10f93bcf42761050696d93337252cf pristine_git_object: d92453528d998a6cb1431ad97f265d3b610e9893 + docs/models/anthropicwebfetchblock.mdx: + id: 50077a5e9859 + last_write_checksum: sha1:d6c187d69b27744d793df1470f273148def58464 + pristine_git_object: ac0e6d3f270317fe417ae2d00f6df7b030bf1556 + docs/models/anthropicwebfetchcontent.mdx: + id: ffbf30c127f5 + last_write_checksum: sha1:ec4695a007bf7d6b0c5d8aa9bc90c9e7c4383e6a + pristine_git_object: 543e4b8b730274b3d0d9151908df2ba22ea02e26 + docs/models/anthropicwebfetchtoolresult.mdx: + id: 6ee088fd01b4 + last_write_checksum: sha1:93b39a3b03c77f2114b969c61363bb9374db98d1 + pristine_git_object: 3f0652bde0cd43ac9ec74bcadaa6ec0f72ec3918 + docs/models/anthropicwebfetchtoolresulterror.mdx: + id: 5eccabfaff5b + last_write_checksum: sha1:2c29b9d44d00369874a5fc729631811c5681bf80 + pristine_git_object: 552e27153b36ab7bba869ac1f8d29895e5317ea1 + docs/models/anthropicwebfetchtoolresulterrorerrorcode.mdx: + id: feb416ca7f84 + last_write_checksum: sha1:d0820beadf5438caddb922c76465fdd33b5fe896 + pristine_git_object: dae86fcab2923c6edca9322d3b36893de0dd04c9 + docs/models/anthropicwebsearchresult.mdx: + id: 6303470f4c67 + last_write_checksum: sha1:9c0d2f1470920f21a3352fb23e01953314731cbe + pristine_git_object: 55c8f774ec3378e24965401a641c968fcfc999e2 docs/models/anthropicwebsearchresultblockparam.md: id: 530bb8721819 last_write_checksum: sha1:ab2089bb5ad0433f0692c15ffbaa8c565fd48734 @@ -820,6 +1108,30 @@ trackedFiles: id: df54d9b291fe last_write_checksum: sha1:bf456bd9de2ec5715cc308c34d81bd1675ff541b pristine_git_object: c18709ba48e339c555e3b8017b8fef169c87b304 + docs/models/anthropicwebsearchresulttype.mdx: + id: 48bc2cba9d30 + last_write_checksum: sha1:e4d6d85a77994e6ea49df4168169803968f9819b + pristine_git_object: 741cf1ffd22201fd0b1df3128f7e48d11360cebd + docs/models/anthropicwebsearchtoolresult.mdx: + id: 208498c8afd0 + last_write_checksum: sha1:3ea13ddbd2721b3f5cd36bccd3c7f607af094348 + pristine_git_object: 3204479a8f783be5b425e3176af10d2198844f3d + docs/models/anthropicwebsearchtoolresultcontent.mdx: + id: df677b1f3655 + last_write_checksum: sha1:37fea0c0af1389ee560145fe4ada1c03faea762c + pristine_git_object: af6d224a4dea9ace852f67984bba6e1ac54c7e4c + docs/models/anthropicwebsearchtoolresulterror.mdx: + id: aed8bb18a3f7 + last_write_checksum: sha1:f49036c5b93fc8dbf01908189665f43c3ecfd3f1 + pristine_git_object: fe42514e87316bd5bde069f9b83e411176b1d518 + docs/models/anthropicwebsearchtoolresulterrorerrorcode.mdx: + id: 10e444be06f6 + last_write_checksum: sha1:1599c241e0c7795d8569f958e008646c92dc81ed + pristine_git_object: fd50cd56cbeabb3b57c22a508317135a23e6fb26 + docs/models/anthropicwebsearchtoolresulterrortype.mdx: + id: af258b2948f3 + last_write_checksum: sha1:0cceaca4fa92e08f644172aae3ed062c0dd7b0a2 + pristine_git_object: eb7780a9ba622c1dde063ddd7d5a0f4d62caa440 docs/models/anthropicwebsearchtooluserlocation.md: id: 88ec348f50e4 last_write_checksum: sha1:a78d1d5d104a657da050403573edc896aa9cffc2 @@ -1393,6 +1705,222 @@ trackedFiles: id: 1151fec73a7f last_write_checksum: sha1:df9b908034c72131be7731b3e2fd7686980337fa pristine_git_object: 1c07ac6f0b49d3fb023ba69680da7749cc4c4ed7 + docs/models/batchdeletedobject.mdx: + id: ae251ce176da + last_write_checksum: sha1:052a861c9c31a2f4ed2c16dbe23e84a9623fdcda + pristine_git_object: 45d5fd1e60348325424fd4e112fc3afffc6e0733 + docs/models/batchdeletedobjectobject.mdx: + id: e61d2711849e + last_write_checksum: sha1:e100166f4e329b254cc66f202c15c399cf7bb789 + pristine_git_object: c342a9009e4694e0d4887431dd24a10e1accb727 + docs/models/batchdeletionoutcome.mdx: + id: fac5567ecd0f + last_write_checksum: sha1:00052f7add83286a79b161e8d6fe60366bd8909c + pristine_git_object: 5febaa7a2c436c4d22b349bc5933b924c24aa392 + docs/models/batchdeletiontargets.mdx: + id: 138b4fb98093 + last_write_checksum: sha1:bf437541ce62007c50361fa60e22ffffdf19ed40 + pristine_git_object: 952196ec9fdd3c19c9236831ae865d41fba36185 + docs/models/batcherrorresponseerror.mdx: + id: 2a1312a38f2a + last_write_checksum: sha1:45429bbbeaebf6612a6aacdeb2631cf242bb5bfd + pristine_git_object: a12aad15c804073b724bc051dea8142ba2cca272 + docs/models/batchlistitem.mdx: + id: a023561aadf2 + last_write_checksum: sha1:c9b804d5f479d64661d9dbc3cf4d3c31ff6c51bd + pristine_git_object: 76a521fd4abfcd1037ba9c234e82980eb4a997b3 + docs/models/batchlistitemcompletiontokensdetails.mdx: + id: 23249e9c1342 + last_write_checksum: sha1:33ac80881022d4be02fc21a454da5584880bf890 + pristine_git_object: 3b2bc2b4f909e6c379edbf7cf6f76a858ca66740 + docs/models/batchlistitemcompletionwindow.mdx: + id: 13c7113afb34 + last_write_checksum: sha1:eb5774e9cfeba629085b1a86c4c5f46eed85a5f0 + pristine_git_object: eb79ad1a8de7b2899bfaac6e44a924bf6046c64d + docs/models/batchlistitemerror.mdx: + id: 8fbbe93d8642 + last_write_checksum: sha1:3db37adb67126db86161162e51cc51710e856fbc + pristine_git_object: 4ed49094d34c4aa967b7fc2f69e4d3b4aa691f34 + docs/models/batchlistitemobject.mdx: + id: 68cc482f900c + last_write_checksum: sha1:5e2d673af2d6db0b23d0834796a718a1416ab9e7 + pristine_git_object: b77e96d96ee5a5d04ef9db5213ce850ce121715c + docs/models/batchlistitemprompttokensdetails.mdx: + id: badf4501aa2b + last_write_checksum: sha1:af165a45e07a82aaa5fcb9f799d624965c641a6e + pristine_git_object: 8e7119e4e3a8ed4e9173f9ef12da9015abd3a773 + docs/models/batchlistitemrequestcounts.mdx: + id: 748d2d2e24e3 + last_write_checksum: sha1:015ecd01249c21e0bc6621e4ade5e6f8c635a31e + pristine_git_object: d629f5d5445905cc4463284f8cae7c879a902baa + docs/models/batchlistitemservertooluse.mdx: + id: d12ceb54c278 + last_write_checksum: sha1:880e2ea7146715918a312ca2efd71ff18d5e4fee + pristine_git_object: a7a5fddd3d7a0641bcb0bd03f42e6107a8110e9a + docs/models/batchlistitemstatus.mdx: + id: 41c444e6911b + last_write_checksum: sha1:7d2214ab217b0f814e552b7f74079fc519b7062b + pristine_git_object: 99742ac96b9ffb4a727c5c4ddb2de67420e06823 + docs/models/batchlistitemusage.mdx: + id: b6040b9f2272 + last_write_checksum: sha1:874fa871b9e51b81b63e5c1665b3fd2050303d21 + pristine_git_object: f55b50c6bfd9c21beef5e2696480e180e5044f55 + docs/models/batchlistresponse.mdx: + id: 8b414b6492e8 + last_write_checksum: sha1:6b38a4527386bfc2280a4387e6ab90c684fe4103 + pristine_git_object: d2f407d36c7140ca767d5af431b5019a9ecef74e + docs/models/batchlistresponseobject.mdx: + id: 7b392120057c + last_write_checksum: sha1:1da477649826e8fcf9e33c8e287da360a5983c8c + pristine_git_object: 92837b47bcae05aaaf0e27d15ea323529a9de524 + docs/models/batchliststatus.mdx: + id: 583cbb12e304 + last_write_checksum: sha1:3a6db400183e9e80e1b9b0a87ffb4de3cf8a3d1f + pristine_git_object: ee049ee18f96cd7a9b0aa0c052384052268e280a + docs/models/batchlisttimestamp.mdx: + id: 386e2a73f862 + last_write_checksum: sha1:546c7256764da8d2f6d47ba6bc4a2fe2ed1a438a + pristine_git_object: 14f8bade68cda6c0f21a0546942c897ab8191e1f + docs/models/batchobject.mdx: + id: c06403eed7f8 + last_write_checksum: sha1:cc24a08f7f66d5eb885515182ccc6586d27b0d73 + pristine_git_object: fa86b627a97a66b2b1fb745771dcbf530f2cde38 + docs/models/batchobjectcompletiontokensdetails.mdx: + id: e2b3ec8653b7 + last_write_checksum: sha1:24ebb8bb64bf4ec8205fff09927915e9f31ad0b1 + pristine_git_object: 11de4dd57ede61082025f59edcadc0a017881ea0 + docs/models/batchobjectcompletionwindow.mdx: + id: 3f633d535e48 + last_write_checksum: sha1:b17a69f6db84f2a1ffdc841fc2e73b4efc539aaa + pristine_git_object: 027894894098a9376931bc0d0a3de01aa475a99d + docs/models/batchobjectdata.mdx: + id: 2cef408f944f + last_write_checksum: sha1:f0c64c297e0ae3206d8c8e6d939696ef29e2543c + pristine_git_object: c42c0e206814feec27dbe2569d32f50938eef799 + docs/models/batchobjectdebug.mdx: + id: 93df2434648d + last_write_checksum: sha1:7b5e269cbe44ca721d504a4ab3801c307c4a7046 + pristine_git_object: 602a00d55518a3083b1f6abd885eec8c2094c085 + docs/models/batchobjecterror.mdx: + id: 5d913d93ef88 + last_write_checksum: sha1:dada6f2918eb7534f052f5bcb5c5b3eb1b469965 + pristine_git_object: cb908988e77e2bfdf2357ff979ca06d04223553b + docs/models/batchobjectevent.mdx: + id: d1a2b3f0e932 + last_write_checksum: sha1:5bd4e141e0c0f499bf921c3223c1bde8a54a27b9 + pristine_git_object: 118d16f134197dd356615357884cbfdd2980da4e + docs/models/batchobjectfile.mdx: + id: d8c535ccecc1 + last_write_checksum: sha1:9c602d9eba64bc4b55711a6406a02b1c53d21564 + pristine_git_object: eb9510fbae53fdad1d3cd8fc5dfb98d8f923a0d8 + docs/models/batchobjectfunction.mdx: + id: 220d9adb5a44 + last_write_checksum: sha1:9f8a739be824ed079a9a37113792beb89cf05384 + pristine_git_object: f9b0300544b6cf578538c75d7f9514488d756c0f + docs/models/batchobjectimageurl.mdx: + id: 95f0991f56d4 + last_write_checksum: sha1:358510c29e01f757063f131aad0fbe9afc263acb + pristine_git_object: a747c2b3ed9ed038375d63c4d1dfb377e13b548e + docs/models/batchobjectobjectbatch.mdx: + id: 143a3dd37e1c + last_write_checksum: sha1:e5de82501807c60e44c56c5a4b83a62f473be5bb + pristine_git_object: f2832d02e3abbc146c5a8065abb6ce53a7746c15 + docs/models/batchobjectprompttokensdetails.mdx: + id: bbbe224085dd + last_write_checksum: sha1:abae7d05d63af8568b58203938885d38814fc8ed + pristine_git_object: 41118dcf3be604eed7bcbedf74f19a4ae8450f8b + docs/models/batchobjectrequestcounts.mdx: + id: 59bfb324208a + last_write_checksum: sha1:0c7d6608b75dda7726959d123dfaf8dfad2e8b95 + pristine_git_object: 7adf623db239d2627973b0a7ed1714e772696138 + docs/models/batchobjectresponse.mdx: + id: 0609ea4f5701 + last_write_checksum: sha1:08d8325b5255420c029c1141ea54e4ff439facd8 + pristine_git_object: fc24db93f83073155b14eb3a904f44b37510283d + docs/models/batchobjectrole.mdx: + id: 8da336aedc6c + last_write_checksum: sha1:f6d57108dbd8ff2809f26e46683002fe3c562b78 + pristine_git_object: d5731fe7345338faeeac4cadbecf892f73208f77 + docs/models/batchobjectservertooluse.mdx: + id: 5b702203afe4 + last_write_checksum: sha1:ac39f46666d8b6e32d28760df3e9a7e81d552150 + pristine_git_object: 5fbfec252cd73bef5d48cdff1ea15743eb0dc451 + docs/models/batchobjectservertoolusedetails.mdx: + id: 77f27390bec7 + last_write_checksum: sha1:b3ea00365ed9fe16905652da6425bec8b69af9b3 + pristine_git_object: 6a4fba9312b105d5104bc322d74f2cfbea907a95 + docs/models/batchobjectstatus.mdx: + id: 5c7c7a3047ee + last_write_checksum: sha1:a7e10a838dee8fb144c1696e59d411ba1090047e + pristine_git_object: 59e3c79f6b7eb8c2d92703238fcd9769cca75c06 + docs/models/batchobjecttimings.mdx: + id: 7c008d5868d8 + last_write_checksum: sha1:2de91255d82a3703ef079708b8fec5af37984196 + pristine_git_object: c3b9cf6627994c1b29c20a1405343b2a603079ed + docs/models/batchobjecttypemessage.mdx: + id: 2c71a69fa887 + last_write_checksum: sha1:db6d6ab58ee8c852dbe2b7dd36e05757508d9708 + pristine_git_object: 356ebd0e29b4406248d1d5b4c80e89fc56a4d73e + docs/models/batchobjecturlcitation.mdx: + id: ec50e95c0dc4 + last_write_checksum: sha1:3897b41d8a6661aa6d3650ec40175c363c89af44 + pristine_git_object: 828e9f10a06f85cf20d934f60a780bbfedcffd1d + docs/models/batchobjectusage.mdx: + id: 83a126a5d105 + last_write_checksum: sha1:ac64e40d7a53c48f0c49984ae45bf59eda022c21 + pristine_git_object: bdb3cecd356f15d4ca4aac1a9a23ba817a5dd4f3 + docs/models/batchpaymentrequiredresponsecompletiontokensdetails.mdx: + id: a1ff93de1c53 + last_write_checksum: sha1:d4b2db0449aee2d355ab84fe62fe29ea656016d5 + pristine_git_object: b35744787dc604a3985966ced571cda925e804e2 + docs/models/batchpaymentrequiredresponsecompletionwindow.mdx: + id: eacedfefdcf2 + last_write_checksum: sha1:690d394c0a96aad73fd65903834df8e483222cc7 + pristine_git_object: 8581c214b1e8e6e7603d5f152c1d48c1d54d0954 + docs/models/batchpaymentrequiredresponseerror.mdx: + id: f4cf3343c647 + last_write_checksum: sha1:f77291c3885e85f7ba6487ab26c20d0c6b19992e + pristine_git_object: 35b873041a83a25bffd21513e23404dcf75e3e24 + docs/models/batchpaymentrequiredresponseobject.mdx: + id: f462f25fc3d5 + last_write_checksum: sha1:2f157e70ac2a81f786882510f28d4e0e670fd309 + pristine_git_object: 51a3224e6e229f52fa51a0da451bfc94d3066862 + docs/models/batchpaymentrequiredresponseprompttokensdetails.mdx: + id: 511577e107a2 + last_write_checksum: sha1:9386c0a30c1ebb5373e42c02097b694efb14ba47 + pristine_git_object: ff0c2459faafdcc845b2bc5f10057e6447d78b5d + docs/models/batchpaymentrequiredresponserequestcounts.mdx: + id: 5269052f95ae + last_write_checksum: sha1:31ead9f780e711058f71eed3f8e4d09bab14b1f2 + pristine_git_object: 72d4a797d582b1490bfe2ef17705da0516411af1 + docs/models/batchpaymentrequiredresponseservertooluse.mdx: + id: bb4ba2ab5507 + last_write_checksum: sha1:a73802d33bf13372e93db1a425b9abfd314ee0f0 + pristine_git_object: 56a87f0ec8cc77ba202d5458afb0e55d37208aa5 + docs/models/batchpaymentrequiredresponsestatus.mdx: + id: f6bf0c4e28ea + last_write_checksum: sha1:a62fa21155807a335971f4d8af708e8d00bb854d + pristine_git_object: a8ffd58ecf14170c60065b001a3cf102ceb66b8b + docs/models/batchpaymentrequiredresponseusage.mdx: + id: 7c5fa14a71a4 + last_write_checksum: sha1:79716d30c27ef9550489c492e5f04bae060e8583 + pristine_git_object: e6cb27126842162d4c461a2cefeec775706cd860 + docs/models/batchproviderpreferences.mdx: + id: d39d3c04a4d6 + last_write_checksum: sha1:5749c0358f9aad31e56c37394712af4779d68016 + pristine_git_object: 5f13935d56250c9f4c2a5c92d25620c3654e2e43 + docs/models/batchproviderpreferencesonly.mdx: + id: 58199a87fd92 + last_write_checksum: sha1:3ed7b2c400d77e8caea35848972fc06d0968c9da + pristine_git_object: ce374dff4e452599c5f3e2d962aae653e3bbda29 + docs/models/batchsubmitbody.mdx: + id: 113c1c833017 + last_write_checksum: sha1:8f38a5e5836e4b2fc13ccbb708551e5f4c4bf756 + pristine_git_object: 4e49ead236b280d1fb84f7ff17fbe05746c7aa72 + docs/models/batchsubmitbodycompletionwindow.mdx: + id: 76f438d6eb6e + last_write_checksum: sha1:f2f10f32e5bc0d2a2e0dce659d54111a65ba003e + pristine_git_object: 09dda2f1db7e766c729782a3291af8a5ac2610d2 docs/models/benchmarkpricing.md: id: e9f72a636992 last_write_checksum: sha1:cd6f4b8ffad69e4b1c67ea5a8de025a13c21018b @@ -1467,6 +1995,58 @@ trackedFiles: id: 91f14a38f76b last_write_checksum: sha1:9bb07934c0636693b354dc12766e5f79d601c936 pristine_git_object: 9e1a518c17def479ce1a4a3435609c6e0993fae7 + docs/models/body.mdx: + id: fe33e4b0af52 + last_write_checksum: sha1:f663ebfd1608b548ce74bb9c4aa4ef2812ca1c8a + pristine_git_object: 4f20da15964d89a16ae6344c862f08287eea8f0b + docs/models/bodychatcompletion.mdx: + id: 2810adc22232 + last_write_checksum: sha1:005267caf7e30a6cf140fc6805c6ba1d520e5122 + pristine_git_object: bd363a9a26e05e0f4905f76ef2b6b5ce409186bd + docs/models/bodycompletiontokensdetails.mdx: + id: 9132c0897711 + last_write_checksum: sha1:ee2d0287ab891a867d9314aa295ce7cadfcf18ce + pristine_git_object: 20ce8aebd1c750b70b7f37dfb99babf0cb02d24e + docs/models/bodylist.mdx: + id: 89d34bb7b053 + last_write_checksum: sha1:66b2e082d446820000ff5e66ecf9673215847fbf + pristine_git_object: f3b790ea1d15819d20fdb93c42c7a7033d95f9be + docs/models/bodymessage.mdx: + id: fd8ac33c186f + last_write_checksum: sha1:ef845338e9354e1d11956312cb2329543c06ccbe + pristine_git_object: c64543a3516fa7a3afbc4cd208207af9626202f5 + docs/models/bodyobjectchatcompletion.mdx: + id: afd039f7dbcd + last_write_checksum: sha1:8996dbaa6ecf7d8f6a40894f2f16544b8e7b8822 + pristine_git_object: 269a1f59c2846a1bc2f680405f1ba715b5cf5740 + docs/models/bodyobjectlist.mdx: + id: da98e77f96c2 + last_write_checksum: sha1:074eae5b2123deda7da5f0622912324ff0a023cd + pristine_git_object: 48db49d1be5ed63c4639bcebef96bfabe6463dc6 + docs/models/bodyprompttokensdetails1.mdx: + id: 4c60eb4124d8 + last_write_checksum: sha1:259532327c9cf3ace3df1f0ec113d5d37537aa63 + pristine_git_object: 5b0ba7034d03a33d953a77d3b755607fe7475bc1 + docs/models/bodyprompttokensdetails2.mdx: + id: 71d896372e51 + last_write_checksum: sha1:14a0300b8d1552ac87ba91a7f8821d6537a3838d + pristine_git_object: 1c8b402cf6594f93b5b629bfaca9175a7d9de8c5 + docs/models/bodyservertooluse.mdx: + id: 01a0c65db182 + last_write_checksum: sha1:36ce77f0050a21d33f0565581d0e6e257301056a + pristine_git_object: 010d51dee98c882ec7b63bdb0c639461c53320d3 + docs/models/bodyusage1.mdx: + id: 570eee144e62 + last_write_checksum: sha1:8f40fc1eed37182ce1cb20a739018011a29d38f9 + pristine_git_object: cf36c712be0ee3389af21d84cc04d589cd2e9466 + docs/models/bodyusage2.mdx: + id: bad2ef12604f + last_write_checksum: sha1:31ce25714c47e689a19876ba3dafecd057cad10e + pristine_git_object: fd40d76c50140c8f38b722d86d6db4856747cd0a + docs/models/bodyusage3.mdx: + id: 2bebb4d73181 + last_write_checksum: sha1:30318a8c8be34cd9652cff4d28651f7e171d0d28 + pristine_git_object: 34b21cd14580ef22ff13a0fdc8428c96bd2ddb1b docs/models/booleancapability.md: id: 7e7d64d5a817 last_write_checksum: sha1:c7066bd2a82e8bc98e024fff369f5d1ca546a763 @@ -1625,10 +2205,6 @@ trackedFiles: id: 9300b066dc6b last_write_checksum: sha1:9d62e056a21c27fa37b2b1af85738065ad0f0af6 pristine_git_object: 9caa6e69bb99158cb99c2c3f49dc562bc9a55617 - docs/models/category.mdx: - id: c018ace2a57c - last_write_checksum: sha1:fed5ada19225cd05b0e1518bcce573868def6c90 - pristine_git_object: b5abb9ccc08a8e0320d0629ec951fdd75f3c162e docs/models/chatassistantimages.md: id: c09d51959fbd last_write_checksum: sha1:ea0718a3034d9112be91f6829a0a94d531935b7a @@ -2607,6 +3183,22 @@ trackedFiles: last_write_checksum: sha1:160613d65968661a04d20916988df40e35144428 pristine_git_object: d1dc8b72233e239f357f994d0ca8040303b12ea0 deleted: true + docs/models/choice.mdx: + id: a184d6f05aeb + last_write_checksum: sha1:92fee6a3ea582755a4ccae2ba8d1ef74c5561fe4 + pristine_git_object: 217deba3f5484f6ed9d9968cdef22627189632d0 + docs/models/choicerole.mdx: + id: 08a32c02ad4b + last_write_checksum: sha1:0f5ed9f602d681389a0a898668dfb1771a7bd2ad + pristine_git_object: c38561a2efc053d7e7831f5226a29158257be24c + docs/models/choicetypefunction.mdx: + id: b79cfd3ef1a9 + last_write_checksum: sha1:f7907aa874687e86a67f3a8eb96baa76f4ca92cc + pristine_git_object: c1e9f2b0b7f79c3b52c9769a48b916004fb7d5cf + docs/models/choicetypeimageurlenum.mdx: + id: 2f7a6b350f47 + last_write_checksum: sha1:252e8ddfa7a3f46a89275e6dacaf9735c9a92de4 + pristine_git_object: 1a7c795f1096add84dd73bfd514d7fec9ced7871 docs/models/citation.md: id: 25f48534d6bc last_write_checksum: sha1:b7781f3d0b63f799635bf7beb901a6ae049d62df @@ -2923,6 +3515,14 @@ trackedFiles: id: 645178b115ce last_write_checksum: sha1:87fe954080ae52456f6a8e7fc581a32abee69b10 pristine_git_object: 658343787c8ff4c68cd36fa4400bbc75920bf213 + docs/models/contentimageurl.mdx: + id: fb086ec08fcc + last_write_checksum: sha1:60ceba761f4ee536111b5470b609ef4789e49d97 + pristine_git_object: 39623dadef7fa7dd6d386726d45996d27fefaadf + docs/models/contentimageurlimageurl.mdx: + id: decd7bce6453 + last_write_checksum: sha1:5341807ac3152dda943be4554fbdd70f241c635e + pristine_git_object: f3c3ccee59c185a968bf9027f8ba9e4e958cb7e5 docs/models/contentpartaddedevent.md: id: 9b321cdad488 last_write_checksum: sha1:b02768fc94a9754644fc2d84d5b6630af1214516 @@ -3049,6 +3649,10 @@ trackedFiles: id: 21e52461fa51 last_write_checksum: sha1:22936ec5b1773eebea0b7e8a58e5df9aad24c020 pristine_git_object: 0039c0459aede87bda24bbe51452818f49fb25d9 + docs/models/contenttext.mdx: + id: f1befc594449 + last_write_checksum: sha1:fd1b4ed65f9d2b76a58956d7f4b40e76dbe083fa + pristine_git_object: 85fd43eae287fb77fd1ef720892cea201ee76483 docs/models/contentthinking.md: id: 1ff6df3afd20 last_write_checksum: sha1:a2953ec3c636067a803fa96490bb0c5dffcf7148 @@ -3085,6 +3689,10 @@ trackedFiles: id: 96a065b0c33a last_write_checksum: sha1:376151d301f1a5e343834eaf66f83f222b572f33 pristine_git_object: b957b4de9c269236c06e20091745db3e76436a81 + docs/models/contenttoplogprob.mdx: + id: 685d16a030bc + last_write_checksum: sha1:b44f964fc87f88abae1c504cb229488a8fdc3cd4 + pristine_git_object: 6673dcba73ff552fb3cfa303064b261074c6664b docs/models/contentwebsearchtoolresult.md: id: 80f560f13bda last_write_checksum: sha1:0a731a33df5432e1cf692279bdd32178ce432dea @@ -3101,8 +3709,8 @@ trackedFiles: deleted: true docs/models/contentwebsearchtoolresulterror.mdx: id: 1ffbba807795 - last_write_checksum: sha1:7918c2ee7cd25b8e6f5f5f6586c6900e9ea868e0 - pristine_git_object: 09f35fed57de8f9b3402530510d0c20badc75097 + last_write_checksum: sha1:b954c99e269a635f6c01cd5c266b44f29af1436a + pristine_git_object: 1082ba6add87a2f71892b252c49e5935f0fe9501 docs/models/contextcompactionitem.mdx: id: 6713db41107b last_write_checksum: sha1:21ceb41fedb9c4aae1353f90164bc7359541ee0a @@ -3439,10 +4047,6 @@ trackedFiles: last_write_checksum: sha1:eeed1935fd127b22f15b07df408e9d634dc716b1 pristine_git_object: 0c67e844055a27a235fcae2b605c50fa95b4e611 deleted: true - docs/models/debug.mdx: - id: 16841239066e - last_write_checksum: sha1:02b9adef63a146438dc9e3395bacfbd0bb7f2a97 - pristine_git_object: 81a9d62044a919106d65fb97deac6f17a63fa7b5 docs/models/debugevent.md: id: ccfd502c4ead last_write_checksum: sha1:213a3cc5840e3e5fbb1da10f6dcf175bfc1f769b @@ -3450,8 +4054,20 @@ trackedFiles: deleted: true docs/models/debugevent.mdx: id: 44b971f43500 - last_write_checksum: sha1:990fdf9029ed60be834e04dacc1ba7782d48a457 - pristine_git_object: e97d11f40075ef2b8b1374aa9ac4e5fe82d7e3f2 + last_write_checksum: sha1:101e5e8ffcb951878b93da560821095771c0e16c + pristine_git_object: 9a76591e0c6b73b42c6f2cf9c13f4fe58ffb26e8 + docs/models/debugeventdebug.mdx: + id: a0f7607bf7ba + last_write_checksum: sha1:ea84d2b7b0055fbed84689cf98cfdbd084317b30 + pristine_git_object: 2bf8f4069cc7e705fc1680f6d3919cb5cad56cc2 + docs/models/debugeventevent.mdx: + id: ed5c5a68c0f4 + last_write_checksum: sha1:08f1e16d6be24642d4055e296b8746251e68d691 + pristine_git_object: f04d50995967c22febee2c800a9c88223e1c8bf2 + docs/models/debugeventtimings.mdx: + id: 6f916a2838d2 + last_write_checksum: sha1:ac61380979d28ff9ca44e128c2b36ae1296285de + pristine_git_object: 2e71aac798a1b6157931a1ee12eeb81faae0620b docs/models/decisions.mdx: id: 9ccaabe24004 last_write_checksum: sha1:7b936e82e338ab4feca199f6ab099855c681c0a6 @@ -3758,10 +4374,18 @@ trackedFiles: last_write_checksum: sha1:fff45e43f831bc360346053557562e701b9f61ec pristine_git_object: 8b9e37e2460dce657aee57b31bacad9d5f2ee429 deleted: true + docs/models/embedding.mdx: + id: 9300f1a46969 + last_write_checksum: sha1:7a3872a55e7a3c78bdf1bc824d03e739c687de14 + pristine_git_object: f3567b6f337e6834fcc83efa8a60a5a420eca882 docs/models/embeddings.mdx: id: df42a9d5279e last_write_checksum: sha1:f2e6bce1536925c9632e240a3ffe4f61aa72b8f8 pristine_git_object: 5e280dd486e4b5ca984f333f9d242a576be37e90 + docs/models/endpoint.mdx: + id: c46337ca39db + last_write_checksum: sha1:6ae51f43ef457d07133ed950a4858a868b42d6d6 + pristine_git_object: 7038b7f628c122a4fd4e70c431cfe174c4eac7d8 docs/models/endpointinfo.md: id: f7b3d465a4f5 last_write_checksum: sha1:a7d5f680e50f1c0188feb8d174ea01f59eb162a8 @@ -3807,10 +4431,6 @@ trackedFiles: last_write_checksum: sha1:22c289b950a0ec28a2e646e971a6561cbe429653 pristine_git_object: f11f6e3802eb371c45d1413d2a976db7f7d0e486 deleted: true - docs/models/errorcode.mdx: - id: c85c37a8238e - last_write_checksum: sha1:e5a75b81d5f17926937ffd7c0a91dd558ba685b1 - pristine_git_object: 149046466f470644ccf57d02ca1a434185ef6c09 docs/models/errorenum.mdx: id: 101ea3f524b6 last_write_checksum: sha1:8df7892b89989ecf3a10c7a7faf16fcdbf5595e9 @@ -3832,6 +4452,14 @@ trackedFiles: id: 39cc7103ae42 last_write_checksum: sha1:312a146ba4af3a1f7c1115ddaeb0c3eed3a95b4f pristine_git_object: 7bf21fec75c5497dfa3813355477e46149052717 + docs/models/errors/batcherrorresponse.mdx: + id: 5402bcd0ce6e + last_write_checksum: sha1:89302ac01c471df8352bf12191df10ed923fc68c + pristine_git_object: 76992444de1e58cab619c18eb0e7027f2aed7585 + docs/models/errors/batchpaymentrequiredresponseerror.mdx: + id: 6bbc01c5cb1e + last_write_checksum: sha1:2d2370224d361d5cbdd42a45a52982d874f6453b + pristine_git_object: 6b20230a44b12fcd8a543b01fc4dc77ca3e92c66 docs/models/errors/conflictresponseerror.md: id: dfa7a1e4c341 last_write_checksum: sha1:d53f5f938627d044a770dae613abd3d59c834484 @@ -3914,10 +4542,6 @@ trackedFiles: last_write_checksum: sha1:c3b3c9fb98f3bdff6e99c2c44df39bcb00bc4055 pristine_git_object: e48b32d3dea4552db729aa82baf8d8b444b46ded deleted: true - docs/models/event.mdx: - id: c8d1bb20b084 - last_write_checksum: sha1:1b6dd7dafde97cef69e4bad044e3ca2c4c3d02c8 - pristine_git_object: 5fce6f8dad8f1d27690ca65b075bfc8377252c40 docs/models/failabletoolcallstatus.mdx: id: f44595f5c09a last_write_checksum: sha1:6df525458ab4baebf7191aa748e4bb031b2bff99 @@ -4051,6 +4675,10 @@ trackedFiles: last_write_checksum: sha1:a24284687f9cb271852b26a4e2b9e4be3cd0c597 pristine_git_object: 5a179500118afed0663a9d98323d84fbf1c15052 deleted: true + docs/models/filetype.mdx: + id: cdf6ffc13758 + last_write_checksum: sha1:9b55619d682366955a255a219f2e2bcce2808369 + pristine_git_object: 40c684106df8ee2b0b22201845956d9de7ffed6b docs/models/filters.md: id: 1370bfdd2199 last_write_checksum: sha1:97587cdb3f68df634389225016a7146d7b1f555a @@ -4080,8 +4708,8 @@ trackedFiles: pristine_git_object: b4cfbe5186bce58d903a13b1943d1729e49ab5bb docs/models/finishreason.mdx: id: 11845fe0e040 - last_write_checksum: sha1:3ca550d47355a7a86d1e346b4364e5992d8cfed6 - pristine_git_object: 403e61020c5fd6ef5fbba832ad051969f8822240 + last_write_checksum: sha1:7e82082e35411d748582ecae0a7cb1f494b730bc + pristine_git_object: 3a5795ba746c2f4adb31c909fd4cf8dc06defc2f docs/models/forbiddenresponseerrordata.mdx: id: 65a7871b5134 last_write_checksum: sha1:8b81570613f73ae072d2c0e7564ef016f9028fa1 @@ -4626,6 +5254,10 @@ trackedFiles: last_write_checksum: sha1:7a8cc427b44e4a856a9bbcc9792c143602b7d975 pristine_git_object: de9c31d0011f3289444fcedac3c33a113d512cf9 deleted: true + docs/models/image.mdx: + id: 8f1a66f752e2 + last_write_checksum: sha1:bc3f1a264f6d3cc1348ce66812ce8287bebcffa8 + pristine_git_object: 7d3607ddba712a5f062443dd819d1b834773f0ad docs/models/imageconfig.md: id: 3c4411257faf last_write_checksum: sha1:38eae75bc8b34c91933a5c9106228a4e7cb8730f @@ -4886,8 +5518,8 @@ trackedFiles: deleted: true docs/models/imagegenerationusage.mdx: id: "607217109e15" - last_write_checksum: sha1:f5eea5987dc7f53a9defe45afa44bd56e376e839 - pristine_git_object: 694f2529fba61777bdb5174dbb523498591cb0fd + last_write_checksum: sha1:c360a9635fc994a7f51cbc6ca1c0d55f044e8501 + pristine_git_object: 2a830af7ebe57de4a413739dd01b919883af37a5 docs/models/imagegenerationusagecompletiontokensdetails.md: id: a2d59e0dafbb last_write_checksum: sha1:860a5b547207fe171c8af394d0bf131379541187 @@ -4906,6 +5538,10 @@ trackedFiles: id: 4da3d6781ab3 last_write_checksum: sha1:7891fa04413bdccd2e35f7de05e6d6101e2d2a3b pristine_git_object: 9dd4d28c8b2cc16541473866be9221190ff7d6bc + docs/models/imagegenerationusageservertooluse.mdx: + id: 8c8b608a0992 + last_write_checksum: sha1:bec68a97476c3276fd5eefc0166ac864166271d6 + pristine_git_object: 2964920852b9647bd98e3273fe2594b044757b8b docs/models/imagegenpartialimageevent.md: id: 82f6a2a1a485 last_write_checksum: sha1:8e529d86eafc560e44408df053b1a34a66cf8d1c @@ -5411,8 +6047,8 @@ trackedFiles: deleted: true docs/models/inputsunion1.mdx: id: 73179e3011e7 - last_write_checksum: sha1:711aa1e2cc26709b076300e4892291ac640c9d22 - pristine_git_object: e99fe68008aa343dfeac5b7c5c3affc3c43f6320 + last_write_checksum: sha1:7fa4c7710a8fde33d19d179af9db7fb3e2aa2979 + pristine_git_object: 6a7a4a7dbca96e9674c50f7336da558acde46e94 docs/models/inputtext.md: id: bc941fd800e1 last_write_checksum: sha1:3b6f4c9eb68c3769cc71805d63a2997c54551130 @@ -5470,8 +6106,12 @@ trackedFiles: pristine_git_object: edd6a443ea120ebcc1f30a4b2cdb3a349ce8c9ac docs/models/internchatchoice.mdx: id: 06823c26e5de - last_write_checksum: sha1:96d1985670c94f1e1d9eb09d4dee400f192204b8 - pristine_git_object: 499465b7f8a297d0212ee2f20cbad1b6bde01fa6 + last_write_checksum: sha1:de72dfa1c69b2608c71732f40d0b9db20413d14d + pristine_git_object: cd425bd929199d35a2c04029b29d5a6a02f66036 + docs/models/internchatchoicefinishreason.mdx: + id: 0771fbc4a9ee + last_write_checksum: sha1:3370c50c3a398dc1168215119092547e0061cd98 + pristine_git_object: e0358f51eb85384aaca74dc03ac62b7a9d1a3f99 docs/models/internchatcompletionchunk.mdx: id: 0068460f12e3 last_write_checksum: sha1:58bc0b9071d5140d15fee66f24c402b88edfa6df @@ -5895,6 +6535,14 @@ trackedFiles: id: 5a6718a80028 last_write_checksum: sha1:d0c9228de956250d9f4a1a8d7e4ef63a7efdfe5e pristine_git_object: 22564067b9fb23b0e375944f52930dff02c389e4 + docs/models/logprobs.mdx: + id: 9df7afbfa280 + last_write_checksum: sha1:c5394a86f04d91e45ffd0833642bfb08d4cd6847 + pristine_git_object: 978ad70102068f9a887f8cb3a953371d2f75fd73 + docs/models/logprobscontent.mdx: + id: 10d27dd0dc00 + last_write_checksum: sha1:e4a0aacbe52bb2182af73bc458ddd7ea452877b1 + pristine_git_object: 0173d0ed6d6bef6a31de2a261fb2eb811dce0ba5 docs/models/maxprice.md: id: 7c7c9e7845a0 last_write_checksum: sha1:41f27034d453b56df8d89e75f43e0585320f7aa7 @@ -6044,6 +6692,10 @@ trackedFiles: id: a96f635b15b1 last_write_checksum: sha1:24b8e7b00b0140c730da0fc9c5ae206f67366387 pristine_git_object: 8f6970c191fe5869b501c84fcd8721e7624c0d87 + docs/models/message.mdx: + id: 1df789e464e8 + last_write_checksum: sha1:05e78ef585d9efe2cbb14d48ae6bbda1202c8a32 + pristine_git_object: 8da1c6b028bd44a1ad0fb779d1ac03392b77dcfc docs/models/messagesadvisortoolresultblock.md: id: dc32c25e08d5 last_write_checksum: sha1:63760d9327637ee58d1f6f9a41858410335dfe52 @@ -6128,6 +6780,10 @@ trackedFiles: id: 03d41256472d last_write_checksum: sha1:2a0afd82ccb63cc3a6b8b00ac0869c12e0c6cc24 pristine_git_object: 0aa714432bb8186b4c7e5170aa618ae83653d529 + docs/models/messagesmessageparamerrorcode.mdx: + id: 8fdc20eb1775 + last_write_checksum: sha1:6112e8dc0d4c0c719c9291c98f4efcfb685f5676 + pristine_git_object: 4dc562e0d96c96e83803a3c26aa0750f4787806c docs/models/messagesmessageparamrole.md: id: 865e82a1cf24 last_write_checksum: sha1:4ea3d013506fd6234dca251b181bd7e4db9da69c @@ -6137,6 +6793,10 @@ trackedFiles: id: 5cc49499358f last_write_checksum: sha1:cfca4eee184489f27a99146e8d8421072cc4796b pristine_git_object: 398d543f221d3e6d442c48df5df2e60b3f62e5a6 + docs/models/messagesmessageparamtypewebsearchtoolresulterror.mdx: + id: 60f9118de135 + last_write_checksum: sha1:e01fa6c7d16e9f9582c7e519b5ac8613cf5bc125 + pristine_git_object: f4bc2d58bbae1f47843cfdf5432bbbccf040e748 docs/models/messagesoutputconfig.md: id: dc7a9e7b177c last_write_checksum: sha1:87a54181ec5cb94188f9e93b1734682891f2d524 @@ -6535,6 +7195,10 @@ trackedFiles: id: ec012151e8af last_write_checksum: sha1:56f2d9c0b5e4b5d25c4b80f00e3a64f0afab843e pristine_git_object: f9e1e6e34b9c114fe7df5992b399a6aa35d1a7ae + docs/models/objectembedding.mdx: + id: 1ea61ee1efe3 + last_write_checksum: sha1:41c0c64f21435c65339550e20932f9eaeab67e24 + pristine_git_object: ae6556e54f7436a11f82b3aa1403f33f6626111b docs/models/observabilityarizedestination.md: id: 85e55efe48b2 last_write_checksum: sha1:9ad86f1cc0292e25358b86cb0649328af7053b14 @@ -7243,6 +7907,10 @@ trackedFiles: id: 8e5e73dc034e last_write_checksum: sha1:f93ac3716696bc7fca9c7d32b10c3d11ce3c5cd9 pristine_git_object: ad79f93c9a7b131db6c4979099f806d13c14c68e + docs/models/openrouter.mdx: + id: 04be8f1e20d3 + last_write_checksum: sha1:45c4211e592ced6293cd0c412aa1fb0b087de7a8 + pristine_git_object: 67a0afa578d9ad0d57efa7866888efcd0af9806c docs/models/openrouterfile.mdx: id: 81fb5b69256f last_write_checksum: sha1:f00f36490773db3b2ebb0ab6ebb696804009700d @@ -7523,6 +8191,14 @@ trackedFiles: id: 3b8b0b8a4e84 last_write_checksum: sha1:871ac57d6b03b4d40f666926a26d588a9bc71de3 pristine_git_object: 789491e6137ba5876acd7bf92d8e8d4503451d46 + docs/models/operations/createbatchesglobals.mdx: + id: 8e1b5a1473bd + last_write_checksum: sha1:5863b7907e7c8405655715e83d6d4ea0e7e87d8f + pristine_git_object: 6dd5e63f604073c73ff61a151bfe0a757df36ea0 + docs/models/operations/createbatchesrequest.mdx: + id: 52cba981a736 + last_write_checksum: sha1:666dbf7967289c1a0d6a55818babdc5425eff966 + pristine_git_object: 2fb4addfa736634e6212b7dd3306c2f26dd2869c docs/models/operations/createbyokkeyglobals.md: id: 3a2bc24cfe3a last_write_checksum: sha1:cd3db316828a93d820e5bd3b8cf7c5407675b093 @@ -7891,6 +8567,14 @@ trackedFiles: id: 321881851bf6 last_write_checksum: sha1:d7f9183c7b25f6d15a6dd9f378866193934a61d1 pristine_git_object: 8789cc2ce8fb24802d15d8b4c3ba443aa3972483 + docs/models/operations/deletebatchglobals.mdx: + id: 1a88e54764f2 + last_write_checksum: sha1:d0428e061f0dc91e4512efe9582995e88bcb592f + pristine_git_object: 5365459af059c9fe1eb8d69aa4d18a02c7e47d8a + docs/models/operations/deletebatchrequest.mdx: + id: bd48a81e48cc + last_write_checksum: sha1:0c068eb7062964aa8cf60c71849a7f3d94063a95 + pristine_git_object: 18928c99eeaac92dfb40ba4ce2e6cbb8e3b8dc8d docs/models/operations/deletebyokkeyglobals.md: id: e69132264b84 last_write_checksum: sha1:6babac91f8a976a790034f24619affed059eba43 @@ -8249,6 +8933,14 @@ trackedFiles: id: 34f74892b17f last_write_checksum: sha1:266e74bfb4c6529e73e11f128b222662eaf05782 pristine_git_object: 202cc06e5ed2723db0f5594e9a3477fd7bea3e08 + docs/models/operations/getbatchesglobals.mdx: + id: 2697e5f87df2 + last_write_checksum: sha1:f888b31180b04b43ee2c1a278af99d23c5f3d78f + pristine_git_object: 6d432a7c4fbad4d607288fa8a58664c65b524929 + docs/models/operations/getbatchesrequest.mdx: + id: 97da7277a41c + last_write_checksum: sha1:3824be6fa7d695a04595bb0060f85ee156b8a3b9 + pristine_git_object: 94bd6f94d280e0670f905e37210232c6350c4f2f docs/models/operations/getbenchmarksartificialanalysisglobals.md: id: 242f09d6c648 last_write_checksum: sha1:7d385f94f18fd51ec4e47322ea4e9f1c30b602e2 @@ -8700,6 +9392,18 @@ trackedFiles: id: 086bdbefa10c last_write_checksum: sha1:66c73ffc67d8de172550360167f4aae12bf86bc1 pristine_git_object: cd6ab5f62f5aa6bacc0f3251b2cd48c359a29c04 + docs/models/operations/listbatchesglobals.mdx: + id: fabce200b4ff + last_write_checksum: sha1:c73565e9fda20b15d70e4e8473434885d827d3c4 + pristine_git_object: 24476bcc5fb03aa1b584e5c1c8f44a8437276806 + docs/models/operations/listbatchesrequest.mdx: + id: 3bef8c195310 + last_write_checksum: sha1:d8c6593c2b803b1be1670821148ab7d7e90e8cb3 + pristine_git_object: b9b185e0daa69e35f2c400998672b34d9d17f341 + docs/models/operations/listbatchesresponse.mdx: + id: 1c953e5a9b3e + last_write_checksum: sha1:9999fddbb5562b5ec342a9994bcc10ecd36dfd32 + pristine_git_object: c858d132444b6c6806a5fa7e1587ca0663250878 docs/models/operations/listbyokkeysglobals.md: id: 2ec47afa72f6 last_write_checksum: sha1:e21b7823b008931df19053631eec0af403c92d66 @@ -9765,6 +10469,46 @@ trackedFiles: last_write_checksum: sha1:fd0f88eeb9293f9297f53e92ca1d36af166d1349 pristine_git_object: 604852f3937db97f7e23104522c4123fae0b3200 deleted: true + docs/models/oranthropicbashtoolresult.mdx: + id: 1d056e16980b + last_write_checksum: sha1:13f698481860e63358366d983d76d814cee391f9 + pristine_git_object: 8fc96b2fc266390ab3067d127a6311b1a5e85eef + docs/models/oranthropicbashtoolresultfile.mdx: + id: bb004dd5a51a + last_write_checksum: sha1:170abdbbb4c9390753d8047ea22c580546d592ee + pristine_git_object: 9cd8bb363a6a0b2c470d216d66f854edf51626ba + docs/models/oranthropicbashtoolresulttypecontainerfilecitation.mdx: + id: 74a4da44fea6 + last_write_checksum: sha1:16407289cd57384501ecf8db89d706277ac1dee4 + pristine_git_object: 2540636c7f8081eb3833c63e6d6739775e99c22f + docs/models/oranthropiccontentblock.mdx: + id: 4057b00973bb + last_write_checksum: sha1:2dcb371082e25cbdb3e6b6d3aea7ccb434403fdc + pristine_git_object: cee3944aaabe2ff7bad0ed6abbc28c9942613ae8 + docs/models/oranthropicnullablecaller.mdx: + id: f2253c04c59b + last_write_checksum: sha1:dc874a686d660eb6a2f08e970275ad9ecf63c109 + pristine_git_object: baa587da661a8fda6a1591ed29a2b98528e8a83d + docs/models/oranthropicservertooluseblock.mdx: + id: 852dea9c6933 + last_write_checksum: sha1:d5d50b11cfa2ae7f0ddb07a87accadcc7c099d19 + pristine_git_object: 68769f71552a3f534a7003d6d96d553a8cd313f9 + docs/models/oranthropicshelltoolresult.mdx: + id: 47812b6fe858 + last_write_checksum: sha1:375575889b4b66b27c95914c6341923e8174191e + pristine_git_object: 08317a8143905ef76e5bd20abb6d766f39c36149 + docs/models/oranthropicshelltoolresultfile.mdx: + id: cc5faa0c79dd + last_write_checksum: sha1:616d0632e9233fa530159b8a6e0eaaf64fa2c528 + pristine_git_object: 40d24e1bb17c9b826bd429409b25acdd0954b44f + docs/models/oranthropicshelltoolresulttypecontainerfilecitation.mdx: + id: 14148024cd14 + last_write_checksum: sha1:1f879af0512f2f9e402dcd9618b5a13afb6e3720 + pristine_git_object: f88372a260be92e63ce489d6bbcbf5f457a684e8 + docs/models/oranthropicstopreason.mdx: + id: a753240a06cb + last_write_checksum: sha1:4596a338266b6ccbf83d8639eb8213c76509b3da + pristine_git_object: 2886220679d8fa978c179ae1c8b0d28f83b63072 docs/models/order.md: id: 5d2682daf79b last_write_checksum: sha1:a2171967c9823ddb7138ba4981a96b9ad7d42e63 @@ -9893,8 +10637,8 @@ trackedFiles: deleted: true docs/models/outputcodeinterpretercallitem.mdx: id: 4817b866194c - last_write_checksum: sha1:99daae9530f23ec2edf1043a7d352fd7077a5beb - pristine_git_object: 35912f5c521364733870721f4299868682d28d91 + last_write_checksum: sha1:1924e287138bd35bbdbdbfd98f9586a61c89d123 + pristine_git_object: d38449c5e3e53b4175adc87ff1ff2ecece29b6f2 docs/models/outputcodeinterpretercallitemoutput.mdx: id: 111a77644da2 last_write_checksum: sha1:6fdac858012c502c0c2339de7d6605ea9eeb57b2 @@ -9937,8 +10681,8 @@ trackedFiles: deleted: true docs/models/outputcomputercallitem.mdx: id: f26deab9cea8 - last_write_checksum: sha1:0e7147eca4218ae9c83682274ed677af78f5dfa5 - pristine_git_object: 8b85ef07dd706cdfa80848662b95001e5be53fa9 + last_write_checksum: sha1:7969e384b0227df1c1716005f1ba9865afb1a5cf + pristine_git_object: 507d34ec3083f592d34d7615aaca826a6598b8b8 docs/models/outputcomputercallitemstatus.md: id: 54e141a5b0ce last_write_checksum: sha1:b12bb4eaaa3372bced5cb9e64473becb8bdd9eec @@ -9982,8 +10726,8 @@ trackedFiles: deleted: true docs/models/outputdatetimeitem.mdx: id: 42acda46e3a7 - last_write_checksum: sha1:59d3c8871cc19365c4f1ecb66868542355625ad0 - pristine_git_object: 7d8c5bd4fe8600efa07d881b1922c1e18f5aabc3 + last_write_checksum: sha1:af66f83ff2dc725fdb35dc7a867b1261b795ec4e + pristine_git_object: a779929452fb52596bf95470c76539afb9754f60 docs/models/outputdatetimeitemstatus.md: id: 7cc9f23255e3 last_write_checksum: sha1:0311bf99a8c761e5fae4b40fbbb9147a7ee4e447 @@ -10005,8 +10749,8 @@ trackedFiles: deleted: true docs/models/outputfilesearchcallitem.mdx: id: fd2c046f2091 - last_write_checksum: sha1:69cc34844bdf1a4cb5100adf868475c11660e08a - pristine_git_object: 1bea84a5734f7168ef7f3619cfb52b669e2641e0 + last_write_checksum: sha1:06523b7537d807024d03040ca825f5bdcd6022e3 + pristine_git_object: a4b69149f8311b15c04af6de10c3332015b23040 docs/models/outputfilesearchcallitemtype.md: id: 116d15acfdd2 last_write_checksum: sha1:a32ae965f4ff2c6cd5b3544c787c28a2ce0c0f17 @@ -10108,8 +10852,12 @@ trackedFiles: deleted: true docs/models/outputfusionservertoolitem.mdx: id: 3a8a257c7b48 - last_write_checksum: sha1:8ff29c3421c9b501231c2535d1faf673b665db99 - pristine_git_object: 27f18f901a7ed2f9f5f4f3b0e56cb1834b9fef8d + last_write_checksum: sha1:15432a6be27f9b5791b579a0aca7f35a97c5de55 + pristine_git_object: 8a70606ef5c18026c5c38f2a7457724ac66cfe11 + docs/models/outputfusionservertoolitemresponse.mdx: + id: dcbed43a3ad7 + last_write_checksum: sha1:1a0fd880e507ca579b1beb7ca8476a58c481ee88 + pristine_git_object: ec84f788a664d7e9752651b381433be127904bef docs/models/outputfusionservertoolitemtype.md: id: eafd1611f253 last_write_checksum: sha1:1a7f9abf5428e4d2b4881609da95ab3f215aa035 @@ -10131,8 +10879,8 @@ trackedFiles: deleted: true docs/models/outputimagegenerationcallitem.mdx: id: f4944a37452c - last_write_checksum: sha1:eb9e4aa598bb42e05bcd94460b880958666388a3 - pristine_git_object: fb6f5e8f3ac7321fe249d2ee9696fab4d04443fe + last_write_checksum: sha1:7bb37d6438a162297fde4c6757284a0cbe182d7a + pristine_git_object: cc220ac92a2b8202a58bc28ee52f12a33d4ded9b docs/models/outputimagegenerationcallitemtype.md: id: 0230b362a729 last_write_checksum: sha1:ea2368cb8831fc4fa9884ff6059b3bb36f9cf18e @@ -10180,8 +10928,8 @@ trackedFiles: deleted: true docs/models/outputitems.mdx: id: 7e0bdbedd384 - last_write_checksum: sha1:2868b0b0029913568d4ac6acac4afd668299fcbd - pristine_git_object: 819d41a4187f07437fda65e1d9a676c871011373 + last_write_checksum: sha1:00e8e47bc6743fc78764397989ea5fb27bf90dbd + pristine_git_object: c70d6f5eddcb57322e910ebe1612ff80f7dad6a5 docs/models/outputlogs.md: id: ad270f2dd1a9 last_write_checksum: sha1:a51670ded278546d8c604b19047f946ad8bf83d1 @@ -10616,8 +11364,8 @@ trackedFiles: deleted: true docs/models/outputwebsearchcallitem.mdx: id: f84719cfbda2 - last_write_checksum: sha1:2ec1b2515af1b3f7ef2f783f193c4f63807c7acc - pristine_git_object: 34e6702d643598ce1976ce056dbaac1f485b35c4 + last_write_checksum: sha1:947f6ad9f385cbc9050f93a39529d7a77e2f83e3 + pristine_git_object: 7df5d46f21d03049dbda199fdc5484734e5dbbfc docs/models/outputwebsearchcallitemactionsearch.md: id: 59d246a34cd0 last_write_checksum: sha1:9497c4b466be1ddedc09ee0b3a3eca002a01f121 @@ -11188,14 +11936,18 @@ trackedFiles: id: e897f0d17975 last_write_checksum: sha1:ee8dd39bb497f90101a95e613683a5e010b94fb1 pristine_git_object: 304d9943beabafc32f02e7c6ffa06ef0cd0ee784 + docs/models/reasoningdetail.mdx: + id: 8e7a56f27ee2 + last_write_checksum: sha1:146d2495aa998b84cffe68ea583988c6f87491a8 + pristine_git_object: 2c9b92446ebf129462293ca924155eb42caf8948 docs/models/reasoningdetailencrypted.mdx: id: 2c8efb052d8b - last_write_checksum: sha1:183ac912beb0770ecf5e2a9e74df2d51bcb62c1f - pristine_git_object: 572ab15046975be6e314b9f3d94a40050a61c0ff + last_write_checksum: sha1:7f6e2d91fecbbedeab854053fe10a3443ad6ed1b + pristine_git_object: ddd3862da104cc46db7dc3743f73212a70577ae4 docs/models/reasoningdetailservertoolcall.mdx: id: e1678bb4fb06 - last_write_checksum: sha1:679dcc490e5536c96ae1833877d48c32b9ced846 - pristine_git_object: 9760743b736eee18f65beff83545d1612a3f6d15 + last_write_checksum: sha1:57f19c7c98dabd7529990e3d26991cb39d074223 + pristine_git_object: 62f969f7a3a633421c9f492e88b97c77aea16d7f docs/models/reasoningdetailsummary.mdx: id: cf55180d9ba0 last_write_checksum: sha1:1f3c90edc9335fe32311cf7c6d891173bf66c7d1 @@ -11206,8 +11958,8 @@ trackedFiles: pristine_git_object: e69e16d29da0ddf5876b3f5a6e58aaf6283cad2a docs/models/reasoningdetailunion.mdx: id: f6aa932f69d4 - last_write_checksum: sha1:7f4bf020282c0b377110f881dc45f5b09005ebdf - pristine_git_object: 84d9c9fcb25ba5b79dcbe31966da922edafd282a + last_write_checksum: sha1:f811197307b4da98248b47dfe859e684f374259c + pristine_git_object: f2293fcdeee3d2ed80cbd95a4ed398b1b8c58244 docs/models/reasoningdoneevent.md: id: eb8f7bcce8d5 last_write_checksum: sha1:f5d26cd89a65f5b5370b97bdb82c708240de02a8 @@ -11369,6 +12121,10 @@ trackedFiles: id: 450315b2c045 last_write_checksum: sha1:90ef64558ba6f849ed78bc302343c495d5f7fe93 pristine_git_object: ff3e1c81a8982cbed6b1fabe651920ed3097ec55 + docs/models/refusal.mdx: + id: 61ec67c5c83f + last_write_checksum: sha1:7eb739b3a7295c85ef7121377e33aa1189461c3a + pristine_git_object: 78e6568f6e9afd7752391dcab4c29288e67f9bb4 docs/models/refusaldeltaevent.md: id: 0abec2d1df62 last_write_checksum: sha1:8c93f32c52a831384c54095ed049025e0f6818b7 @@ -11387,6 +12143,10 @@ trackedFiles: id: 91d04705d06c last_write_checksum: sha1:8bd36415a9d39cf084a9a50f1d1e7df2a372819d pristine_git_object: 58c2d8dbd1bf84a67c42f8b0aedc75be13711f66 + docs/models/refusaltoplogprob.mdx: + id: 045136ec4e5d + last_write_checksum: sha1:5d203944cf01ec3026d996f80888613de19f5d77 + pristine_git_object: 3967762629b098944525472867e6a07e0b75c409 docs/models/region.md: id: 79be579f21a7 last_write_checksum: sha1:d794ef937613ed73978be9c0f38a54e3962741ef @@ -11400,6 +12160,10 @@ trackedFiles: id: 212e31c08300 last_write_checksum: sha1:c9f72b4dcfa44d074b8d4cad6d521f38d091f0f7 pristine_git_object: 2a8d8e2c5e88a0ae4a9cde72008996c36b4732c5 + docs/models/requestt.mdx: + id: 81f811d574c5 + last_write_checksum: sha1:6e009cd259298bd69b9bff8c9a5579c685936907 + pristine_git_object: b449e05c2dc0ba758e9af3ab58e4a9dcfce37b36 docs/models/requesttimeoutresponseerrordata.mdx: id: 85853ade9a50 last_write_checksum: sha1:974f2e6635fd692ab627ec46f4f75672b3806147 @@ -11636,10 +12400,14 @@ trackedFiles: last_write_checksum: sha1:d255dff78371645a7803af8e1235ba77b59206d7 pristine_git_object: cc3dc9b3fc9b6bf0282f244431113c93b89058c5 deleted: true - docs/models/responset.mdx: - id: 32669d1583a7 - last_write_checksum: sha1:40fb6f06d111ead6f74e447e161e6a4b45d4337c - pristine_git_object: e5f9caf13771f6b37c6292e4f7ac98586429035c + docs/models/result.mdx: + id: cdd8d4e179fb + last_write_checksum: sha1:e137916a3f78ced489710d4b614ac9ac7ff261e5 + pristine_git_object: 26640c9258675d9b316659ae2722143d5d937c20 + docs/models/resulterror.mdx: + id: 57a1e1258c52 + last_write_checksum: sha1:96083f6c14273c9b5e0a3fef7c9100e74a374e9e + pristine_git_object: 46ae380dc1149f897149f72ba3a026482e4bb513 docs/models/routedservicetier.mdx: id: fd7b0f1d910c last_write_checksum: sha1:80867edc9f5bd48b535009bbbd5d38630298d444 @@ -11752,10 +12520,6 @@ trackedFiles: last_write_checksum: sha1:bf42a3dc0d1b69375beb7367d5c22294654b0f3b pristine_git_object: 8652d039d362bf10ab37401476c57aefbe14f3af deleted: true - docs/models/servertooluse.mdx: - id: aa64f2123cbb - last_write_checksum: sha1:d49de21a6e6155aed2767a355b6a030a461928b9 - pristine_git_object: c7abeb3b94f458a6dd13f60b3598ce9cd28ab641 docs/models/servertoolusedetails.md: id: 107a1c8059ac last_write_checksum: sha1:7dedbce7c8451e808de788504c91e69037b62e9f @@ -12305,8 +13069,12 @@ trackedFiles: pristine_git_object: 26567cec56888dba46ae45e36ed34dee50e0791a docs/models/submitgenerationfeedbackrequest.mdx: id: 1a020564b935 - last_write_checksum: sha1:7a95f7ba5c5519086a470f7172e203e7972fb31c - pristine_git_object: db7043f72763aad6ceab0eeb003c5a962ae76643 + last_write_checksum: sha1:408ba1dfc9bf177f3188bd310960c98212d4d96b + pristine_git_object: 92aa35e5386948b81bcf4bb0a3e0ac78211f2a9c + docs/models/submitgenerationfeedbackrequestcategory.mdx: + id: e39356e39043 + last_write_checksum: sha1:43e831751d27609a34960f9eac5a6fa47f7625b1 + pristine_git_object: dfe82bb8164e96aa301330148118f30ed82d8cbc docs/models/submitgenerationfeedbackresponse.mdx: id: 85551b5bcc39 last_write_checksum: sha1:4ce035dd0d5817e81ae0c47a727d84969e49cf13 @@ -12538,10 +13306,6 @@ trackedFiles: last_write_checksum: sha1:43ecebedd106bbffffaaa1d7d7656a4ec6a58b95 pristine_git_object: 6787bd7ce86211ce0c89055de47421d9c949e2bd deleted: true - docs/models/timings.mdx: - id: 03843048b560 - last_write_checksum: sha1:1f75072f4a5239e307c91805e828199668a97ec4 - pristine_git_object: d4887bbdf22a4531b7fd33dcf7c90492a65984ac docs/models/tokenexchangerequest.mdx: id: 20223978500d last_write_checksum: sha1:e6de0f3e1084ffa011464a3b2cb54c9b9ba6124b @@ -12572,6 +13336,10 @@ trackedFiles: id: 793772e562b0 last_write_checksum: sha1:6242e84f6536a3098c4859452b352bb649d827d3 pristine_git_object: 78b8519529a59e62de1bbb9791e0a4c15adfbd9a + docs/models/toolcall.mdx: + id: d849e8a82670 + last_write_checksum: sha1:0bd94b907131128aa7ed5366762f95ca7867b7e2 + pristine_git_object: 02b95fb1a4a60a1e8972820b5d939b03d963261d docs/models/toolcallstatus.md: id: 0eab420fb379 last_write_checksum: sha1:629d281b98874d122c4afea78805d6795785638b @@ -12906,10 +13674,6 @@ trackedFiles: last_write_checksum: sha1:60088a0e5139af268850162bd1625cd247562635 pristine_git_object: f72dea1fd4caddab90598ee09992bc0a8e9cea12 deleted: true - docs/models/typewebsearchtoolresulterror.mdx: - id: 0a11344f7f07 - last_write_checksum: sha1:a50e429b5042660d3dd1bf14ac0c8c434b7c5955 - pristine_git_object: 9d4c672ed2cc3646330578aa9e00519c62af4aa1 docs/models/unauthorizedresponseerrordata.mdx: id: b8c99d5c1add last_write_checksum: sha1:7b94db83175f79e60f63919027d3e5b41ff76d5f @@ -13157,6 +13921,10 @@ trackedFiles: id: d0b8bdfada64 last_write_checksum: sha1:ae17cded731b94b286ffdfa8acb32a7800651643 pristine_git_object: 05e4329cb213baafe6874b1f040c9204455c5d24 + docs/models/upstream.mdx: + id: 7238e3d48202 + last_write_checksum: sha1:0a8bf654f15f0ea34e008b1b1661c098b387e630 + pristine_git_object: 630daad07acebba7be22ac7e7f8cb08e9a74256c docs/models/urlcitation.mdx: id: aecfc7ae641e last_write_checksum: sha1:b62283c180a1f550656c9edcb5cd8959d46af706 @@ -13423,6 +14191,10 @@ trackedFiles: id: 6d9990c6cc48 last_write_checksum: sha1:58ab9dd515d9252e36bcd7fba0572b73f62437f5 pristine_git_object: feb69b6261f59c3c285896005a0b3244868e8f47 + docs/models/websearchcitation.mdx: + id: 63f96b38526e + last_write_checksum: sha1:dce240ffb8822f216439adb19d748eac07a4ea15 + pristine_git_object: 90a6c9d0963d7869581ea7ae2657c367954a08ea docs/models/websearchconfig.md: id: 9db26eaa5afc last_write_checksum: sha1:3dcb1b8a533c013e96d670af5fc4519f2a26bd6f @@ -13641,6 +14413,10 @@ trackedFiles: id: 27fcaae1c346 last_write_checksum: sha1:a1cb4fab7f31bcf8597520dad9290d3ede3be19a pristine_git_object: 5003dfe082082b968b6d20a2e0020d8c6bae06fb + docs/sdks/batch/README.mdx: + id: e367aa4f4295 + last_write_checksum: sha1:8a5228f41b48d49da0d1166e957bd928563008ed + pristine_git_object: 5321bbffbae9866c06edced1185f6abb408e0123 docs/sdks/benchmarks/README.md: id: 61c16262af9b last_write_checksum: sha1:17fd0e4aa4c358c6298ee9a434a14ff68ce83dbf @@ -13866,12 +14642,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:102ba02c930fcb4cc9ccbce36e0b164914c314e3 - pristine_git_object: a3abc6d47cc8be200d20aa141c9ad66aca4e7cb3 + last_write_checksum: sha1:8d2b6864741ad4e60a26e203d814d248641e063f + pristine_git_object: 8ce62f33bc92270a2826baedfb87d10fe1a523f0 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:b8ef604edeabb5d9243a401e136fcc8c8efc0180 - pristine_git_object: 565aa641c954336d780802a6a6c59846532fe5f6 + last_write_checksum: sha1:3835232a8cd4ae30fce12474cf5cf081c57531cc + pristine_git_object: bce51426bb1624c0c97100d2c4cad5020c5c9c87 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -13916,6 +14692,22 @@ trackedFiles: id: 05700884934b last_write_checksum: sha1:6724255025710798b8169f2db96ea2ac23392875 pristine_git_object: b236ec536229e23a813c2c9683072417c3a9ea47 + src/funcs/batchCreateBatches.ts: + id: 8796df347125 + last_write_checksum: sha1:bbf2369387e8922cdf18a33b28840c40e2b79c4e + pristine_git_object: 3c03a47c64d55a71ba97176578ff493bf698d63c + src/funcs/batchDelete.ts: + id: c86d26d514be + last_write_checksum: sha1:44a815310b2664f02ff821d63e38e1ec19d4e2f2 + pristine_git_object: 67513fd42436ab5f4cebd899a0eb8d531df0cefd + src/funcs/batchGetBatches.ts: + id: d4804b94cd90 + last_write_checksum: sha1:08e019a10597410e9150e3a0b64c5a4de1797a5e + pristine_git_object: c18c552d93a4b872c476cf5823ee0fd3d1574f51 + src/funcs/batchList.ts: + id: 8709844813ac + last_write_checksum: sha1:50a34174bad5bdf1b47e1361a3cc676dd26cc7b0 + pristine_git_object: 62fca7b354f13e8022fd6b57c929af15bde99c38 src/funcs/benchmarksGetBenchmarks.ts: id: 1b5fbe93cea7 last_write_checksum: sha1:fd12c45ff61e5a5eeaa7bf53a97444c0c5b71b4f @@ -14390,8 +15182,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:98ab23fb46b946cfc5e61f10f6c6cd92c39ce97a - pristine_git_object: 07bcda2597e762b55cdd24d9f17a9c1b61483227 + last_write_checksum: sha1:8d504b4e43f4803f0114fe0596f3603ec3359788 + pristine_git_object: 51d9534baedbce1d434216e75f04205e7cbc254d src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -14494,6 +15286,10 @@ trackedFiles: id: ff2ce164571e last_write_checksum: sha1:f43bb689a58850f35a60e22998808c0d192b2535 pristine_git_object: f12adaba28ed00d42c0f19970a2b3d058741f731 + src/models/anthropicadvisortoolresult.ts: + id: e8832cf2f4c5 + last_write_checksum: sha1:a0e9d5efb016f67da94457104cd8863b06535376 + pristine_git_object: ea5b5c9cf62f066f8f8186c97dcd78a1b67368e2 src/models/anthropicallowedcallers.ts: id: eb986e460cfe last_write_checksum: sha1:4882a04a935c81bf8b68771324ea68756baf15a1 @@ -14504,8 +15300,28 @@ trackedFiles: pristine_git_object: 2ad09d402c1eb621c1ef269abe15350a44e86e19 src/models/anthropicbase64pdfsource.ts: id: 8027cdf012a1 - last_write_checksum: sha1:6ae9294d29923c973bb40d2d1abb3a40ffe6324a - pristine_git_object: 4c010cca9d0f2e96ba0c982b300397648cf5085f + last_write_checksum: sha1:ae7dd84d1c30f598ecba97e26e16e425ed4a22ff + pristine_git_object: a26ac9732435ff8572dc5b12258048b4b9ec2aac + src/models/anthropicbashcodeexecutioncontent.ts: + id: 2cbd7b2f90c2 + last_write_checksum: sha1:f1d6a322cc89076dfbaa56907a3f85079bf79976 + pristine_git_object: 9a6965e122ffddf491dd5ce3c0158885b66679e3 + src/models/anthropicbashcodeexecutionoutput.ts: + id: 58a93663b57a + last_write_checksum: sha1:6ef01a49c9c1a657655a7383dd169cc069ed19f5 + pristine_git_object: da22ef33073ae9f2bf4a6218806e1dc79b6ddb62 + src/models/anthropicbashcodeexecutionresult.ts: + id: 556789aa061d + last_write_checksum: sha1:ce940047fd813ad7748cd87feaaea99e03e15c90 + pristine_git_object: 5362483e261d89fca16df464efcd85bdb29fbd95 + src/models/anthropicbashcodeexecutiontoolresult.ts: + id: 5d55d5213281 + last_write_checksum: sha1:2e5d5f7d399f1c3cf0d8206033df55d7c336d5ed + pristine_git_object: 8b514dead945dd8ec3f277fbff6c7f27f53b55d0 + src/models/anthropicbashcodeexecutiontoolresulterror.ts: + id: 8028d67ee728 + last_write_checksum: sha1:f1e8dfc9af5be9cab1e62a819085b9885f520ed1 + pristine_git_object: 0d62afba53d6b5624698822d91cc6e1d50fd6e99 src/models/anthropiccachecontroldirective.ts: id: e8b49d71cdd5 last_write_checksum: sha1:f266bcb16ba835bd842b181320ea24f23da29303 @@ -14518,34 +15334,118 @@ trackedFiles: id: 6772980a7ab5 last_write_checksum: sha1:3ac919417247ea6f324ab7194f5a7658e4997805 pristine_git_object: 603ca745f4c5bee415f484811953e016ce85cc32 + src/models/anthropiccaller.ts: + id: bc8afb0ba329 + last_write_checksum: sha1:5c23942f99165c7b8091f32309ccde88babf7210 + pristine_git_object: 7e99e18d37ff5d36ca5b75af127f9646ef2b429d + src/models/anthropiccitationcharlocation.ts: + id: 49bb1c6c0a00 + last_write_checksum: sha1:75da68d41d7c0a61706d4730c81d90c018f47645 + pristine_git_object: 46c5e2c8b1f82a9fded0d17ec2dd40285d7a649e src/models/anthropiccitationcharlocationparam.ts: id: 453c0a0bfdd4 last_write_checksum: sha1:32232e3bb44d9d45fa7525e939cee7a2b347792f pristine_git_object: 2404398e91555e0673f83fb63a65528df0310173 + src/models/anthropiccitationcontentblocklocation.ts: + id: 2e23fb62209c + last_write_checksum: sha1:f6e9606b30af5d3cd87f8f0e0c8b1bc32a5146d3 + pristine_git_object: ebe3d438710a6a43c45a4878fc31570c3cfff48f src/models/anthropiccitationcontentblocklocationparam.ts: id: 1a2db0e73f5d last_write_checksum: sha1:4c8a7cce47d1c005b7f0dace100843680fde3a1e pristine_git_object: 500b67c045f258b35f120eae030be107c10e5255 + src/models/anthropiccitationpagelocation.ts: + id: e9776d496704 + last_write_checksum: sha1:4194e09177b506e9187c24280e24e943d3fb04c2 + pristine_git_object: ec77e8b8706edd72eb03454393ac5b84c78c2fc7 src/models/anthropiccitationpagelocationparam.ts: id: a85ef27d808e last_write_checksum: sha1:56590e6392789de28390d05a20e45441861664b4 pristine_git_object: 13bf95851614ac3b02e47be3e0964f2d2ba32a10 + src/models/anthropiccitationsconfig.ts: + id: 980808a865ed + last_write_checksum: sha1:5bcf6272935e91a1e1f35c2d0403a94925c1207c + pristine_git_object: 43e134155614ac5cf3821e914fa480317de6b5f2 + src/models/anthropiccitationsearchresultlocation.ts: + id: 3e456a65667d + last_write_checksum: sha1:aabe6cfb47c4bf0646004750392d28d1d0ccbdf1 + pristine_git_object: 40a77d94acbfb1596922ac81f8cd3c3a41bb27e1 src/models/anthropiccitationsearchresultlocationparam.ts: id: 8713c849c708 last_write_checksum: sha1:ba7137a2ed6842d8e31b265534406f5af49716d8 pristine_git_object: 44ab75f20473bd11e197918524fb4fa9b24ccb2c + src/models/anthropiccitationwebsearchresultlocation.ts: + id: 5c08200bb3d1 + last_write_checksum: sha1:2107a84a37e371a4ed902c42896a1ec4113271fb + pristine_git_object: 9032397057cedbbe9ea2984726975ff2205774ca src/models/anthropiccitationwebsearchresultlocationparam.ts: id: d0d7a90d9642 last_write_checksum: sha1:0fa6b805ae1891a9311eab45e4435dc7b35bba86 pristine_git_object: f4d0eafbf1729c6b4b92bf5393c0197cf65370d7 + src/models/anthropiccodeexecution20250825caller.ts: + id: 1fe1afcb6365 + last_write_checksum: sha1:40d83aaad4a222a8c9a834daf7059fb56a3fb21f + pristine_git_object: 70187ea1e3b144de620f86cf32f1447679ccf0ac + src/models/anthropiccodeexecution20260120caller.ts: + id: 3cf51aa80659 + last_write_checksum: sha1:ed46c988ffbed194e2693249f6a8fe8ffa168e33 + pristine_git_object: 5bd53f2ad9f811c9bd3b83e0cb9a0e869a7173d4 + src/models/anthropiccodeexecutioncontent.ts: + id: f4f46d300ed2 + last_write_checksum: sha1:e6054f231a87da8ec529a6d5723a971b832f1c84 + pristine_git_object: d75187199f3dbb320758a3abf76cc1512132467f + src/models/anthropiccodeexecutionoutput.ts: + id: b7d015976558 + last_write_checksum: sha1:4ddb95716f1dd034100a30fa87bf61cabde19aa9 + pristine_git_object: e0dcf8abf53ae84193dbf10f823dce6fa4acdb1b + src/models/anthropiccodeexecutionresult.ts: + id: a35c5b19103f + last_write_checksum: sha1:c3244a05cfed8343fcf6b8c66bc49f7c75a0f8c7 + pristine_git_object: eb1f20132e5465d0c37e205456241c93b40dcd31 + src/models/anthropiccodeexecutiontoolresult.ts: + id: b65091190ef2 + last_write_checksum: sha1:bfa97af0fc59e815848bc00dc261d1eae386641c + pristine_git_object: 45445203c4250fa422ec0050a2e91e670dcbbdf2 + src/models/anthropiccodeexecutiontoolresulterror.ts: + id: bf9694582afc + last_write_checksum: sha1:c5c767d0de81534e343d1605abd77fbebcf71d6f + pristine_git_object: d194095274994d97b2a8ca6d7c21ec51192f0af9 + src/models/anthropiccompactionblock.ts: + id: 2e8c7492d352 + last_write_checksum: sha1:a6741be7b7b5a59d42e48d53f9ed10370206ccbe + pristine_git_object: a3526169596c0579ff58fbdf9688883057f7dcdb src/models/anthropiccompactionusageiteration.ts: id: 5982ebca6c31 last_write_checksum: sha1:fb5bf3421b2d917b18edf37fd9a00586b1bc27fe pristine_git_object: fc4ac02f6793b640bd76cd732ce65ec4a4f8f320 + src/models/anthropiccontainer.ts: + id: e824c8443a90 + last_write_checksum: sha1:2a52d309b9cf2f90daa87117051a4f53e7cfd3b9 + pristine_git_object: 4c946d2a654b534cad244592a6e1b68b7a0660fe + src/models/anthropiccontainerskill.ts: + id: 5235f5b38850 + last_write_checksum: sha1:48b6c63a4610500f23f58a04a13dee7ab028acee + pristine_git_object: e703b01dcc46a003d87da35d18def3b9a0d87f13 + src/models/anthropiccontainerupload.ts: + id: 7c9967fcbcec + last_write_checksum: sha1:15b338f5059030b3fb2d3abefaa8a1b8981df229 + pristine_git_object: c191819a50cb97287d53847e8a39eab6e8ee1add + src/models/anthropicdirectcaller.ts: + id: c1dba2541585 + last_write_checksum: sha1:18cb5e2f63482151eb2330038cbd626c3e8dc1fa + pristine_git_object: 749901bc0cfee02521e0b023c2692a525b1fa6f2 + src/models/anthropicdocumentblock.ts: + id: 6aec49691162 + last_write_checksum: sha1:8e1d9f757dbf053dda9f4e086351abf943b77c12 + pristine_git_object: 8df8dcb5317cdbe76659c59279dc4c196d4daaa4 src/models/anthropicdocumentblockparam.ts: id: da62cae77bdf - last_write_checksum: sha1:cff17b970e967f6dcecda3e286f6a3a6198a1ee7 - pristine_git_object: e1b93a7cc7f837ef75e63662315fcd1a41e3a6bf + last_write_checksum: sha1:ba991575aeb5436e3335a62a3fe0042b4b2f7542 + pristine_git_object: 8297be79c77f518e9271e02e6867c251fe7bf0d2 + src/models/anthropicencryptedcodeexecutionresult.ts: + id: 1e1762f68df1 + last_write_checksum: sha1:d8b5a002476ed66e74542100f09c3ec41977c2b2 + pristine_git_object: 4c72a2ba65c3dee3bf362f137f5315254d1006f1 src/models/anthropicfile.ts: id: ef320fa3557d last_write_checksum: sha1:0a18ea3cee5a7736a1f19beed0372a0bc7e6688d @@ -14578,6 +15478,10 @@ trackedFiles: id: 24d82ce75c3e last_write_checksum: sha1:5239e7321e4a251e2463714f1ec80e7f04ac5154 pristine_git_object: c1d740d47bfa54129bb4fa64e22e26def35bd887 + src/models/anthropicinputtransformation.ts: + id: 02d29ed9a0c4 + last_write_checksum: sha1:28ef26607f05449d7fc9dc4d5e880e7c277c8ba0 + pristine_git_object: a85d8d35246a97139f73f0d25e2c8393b3bce6ef src/models/anthropiciterationcachecreation.ts: id: eafcf72fb51c last_write_checksum: sha1:0446afd89963dad3452602ea6a46df2eb454bb8c @@ -14594,10 +15498,22 @@ trackedFiles: id: 148cf525912e last_write_checksum: sha1:b24e8d1af1adf5cb8c9d0adcd449aac71be4aa06 pristine_git_object: 87750c47ee40099aca9fbbdc9d5ea7f66c643cfa + src/models/anthropicoutputtokensdetails.ts: + id: 1c1cbd5cc017 + last_write_checksum: sha1:1b5b4bafa005e6790b9a06c865e77f0537799499 + pristine_git_object: 9b34d2600011ed1753ad730e0f838a9b4d680496 src/models/anthropicplaintextsource.ts: id: 6f9fad0eec61 - last_write_checksum: sha1:7fe384f73e8a0d76944a45998bb9c9fa443acb89 - pristine_git_object: 2f7f00e0f783034ef83bdac592d560b77e69686c + last_write_checksum: sha1:8a0f11172ccee02140a8c065e695b6956b64fc6b + pristine_git_object: 348bf2838e7e16820cc23c9570de78ff179260a7 + src/models/anthropicredactedthinkingblock.ts: + id: 9217d8bb8656 + last_write_checksum: sha1:05b1861c59290e3d252460e42dfedaac9a729aab + pristine_git_object: 5d2304a40f1aabf5a5e56b8ccd0653b5cfc422ce + src/models/anthropicrefusalstopdetails.ts: + id: 62e4a3cb8de1 + last_write_checksum: sha1:73ef79ff47e8eee82c45f58e3ef41bbdb3c7bcaa + pristine_git_object: efe4175c303071c91433376e39ad03ef805b2bc5 src/models/anthropicsafeguard.ts: id: "607549785460" last_write_checksum: sha1:be48b962f7ccbf1fa45d8641516efe9bd00a4411 @@ -14606,6 +15522,18 @@ trackedFiles: id: db204b792de1 last_write_checksum: sha1:db7826dc29d9157eb1692d7fd28059185a7e89f2 pristine_git_object: 1d40e36058c0c921469c19ae047d6ccf057833eb + src/models/anthropicservertoolerrorcode.ts: + id: 822c5d079562 + last_write_checksum: sha1:2853d8ce9aa50bb3a442edee05c07f268d62e623 + pristine_git_object: d00ed9ffc537aa244467307ef498b41e8d93c516 + src/models/anthropicservertoolusage.ts: + id: 71a8b24aad61 + last_write_checksum: sha1:0d840bdf672c51994ae1bb3d895d75317b6a73ba + pristine_git_object: a31b99473ab175d03d4e62bbaab8b2e1bc271c2b + src/models/anthropicservicetier.ts: + id: 414847377bd6 + last_write_checksum: sha1:641d3643d18592dfd407f71dc042cdfe9aaead0c + pristine_git_object: f3d2f0c4f2ea7ad78fa556e8475528c6ac2f38ee src/models/anthropicspeed.ts: id: 8c545705b9ae last_write_checksum: sha1:0865be48b1c03315b0eda9264c227cef6b92543d @@ -14614,10 +15542,46 @@ trackedFiles: id: 68161235f0d9 last_write_checksum: sha1:213a4c60d1827ad8e2630298a6e3dd7ab78a7a1e pristine_git_object: 4df86f2f0d3762fed6e29c83bdc93b41ddd40261 + src/models/anthropictextblock.ts: + id: 92842709fc4d + last_write_checksum: sha1:35f442f407a8fce01d731f4df37acf4d9feeafb4 + pristine_git_object: 80f275c9aa68ad1b1f88881ed505a81cac8d34e2 src/models/anthropictextblockparam.ts: id: 81e2e56dbe5c last_write_checksum: sha1:fb16b81fc910d65f25433c22f62d6afd2103daa6 pristine_git_object: b4d01dbca8f515a050ea730848316cc22bd860b3 + src/models/anthropictextcitation.ts: + id: fe7e58a48729 + last_write_checksum: sha1:0ee11d927285b46a97eb783bb57d042983ccc05f + pristine_git_object: f2def0310a4460ac04eb5375096997a03ae55adc + src/models/anthropictexteditorcodeexecutioncontent.ts: + id: 832ee7a5e28a + last_write_checksum: sha1:c3c62483f403da28b1781edff31556cabaa6e0ca + pristine_git_object: e098c4ea8a4801a3ab163597df5da7130507dc4c + src/models/anthropictexteditorcodeexecutioncreateresult.ts: + id: 86635cf190c0 + last_write_checksum: sha1:87beac43b4faf3dfeca01e2608980c32e02af5ed + pristine_git_object: e0296f69ea24ef03b697b3027081a388bd57407f + src/models/anthropictexteditorcodeexecutionstrreplaceresult.ts: + id: fed740239a98 + last_write_checksum: sha1:a6109f3bf68dcd450e2b940b4c91b53acf36ac19 + pristine_git_object: 133371f4544f10b98b1abda3fae22a98467204c9 + src/models/anthropictexteditorcodeexecutiontoolresult.ts: + id: aec07db74637 + last_write_checksum: sha1:4685f8b5881513f1e0b9ddf61ada815701dea3e8 + pristine_git_object: e512e1e25c0675281e3ebadae5fdfcca34b2338c + src/models/anthropictexteditorcodeexecutiontoolresulterror.ts: + id: ccf083ba6bce + last_write_checksum: sha1:de4dbe50701b1a25af7282a3bbe2f828f1d76a0c + pristine_git_object: 68176537a364b6337b38f51de99ccdd2e5c49477 + src/models/anthropictexteditorcodeexecutionviewresult.ts: + id: d22abd4b2e55 + last_write_checksum: sha1:20b264f027600ecb29719c12d47374942666a97f + pristine_git_object: de265b372bb2f84cd01e6cc0c922d76b0191d9c9 + src/models/anthropicthinkingblock.ts: + id: 3d517d0c0ebc + last_write_checksum: sha1:8212555718c5b422466a918c8180145fbdff9956 + pristine_git_object: 2cb40f67a550424cd36711e3e92575d34fa3c16a src/models/anthropicthinkingblockbinding.ts: id: b71a9eb413ec last_write_checksum: sha1:89cd963a3b0a004c413e452de1aa56611d64479a @@ -14630,6 +15594,22 @@ trackedFiles: id: 7c39c94b7e4f last_write_checksum: sha1:66a2bc40e7ac544375da2967243a7fc4f9de6fd4 pristine_git_object: d00d7b5c195a8b5f9930cc97ebdaba18cd2e864d + src/models/anthropictoolreference.ts: + id: 106efa7085a7 + last_write_checksum: sha1:fe57806e08b0bb956c7a5bccce5daeaaa9f3d45f + pristine_git_object: f4c72a0aa145b186a7d85d1565b10f9ddcde445f + src/models/anthropictoolsearchcontent.ts: + id: 3a2d3e60694f + last_write_checksum: sha1:9914aee34c645987c76cedecc7e0fb1e033ff9ce + pristine_git_object: d3ad6d4b93c1a21efb4f4c7a0d5f8a84972f59eb + src/models/anthropictoolsearchresult.ts: + id: 465ebc45a91c + last_write_checksum: sha1:d19a5be246a32d7d8d1f5794da9cd6ead3824756 + pristine_git_object: be2f3748778ad282e4cd76e1fc6d38cae44059a9 + src/models/anthropictoolsearchresulterror.ts: + id: fdf5a0f6072b + last_write_checksum: sha1:6cbd2ee95ef7705ac3b4bb984cf9be95e5650466 + pristine_git_object: 5a0b3223cd8328d14497ffeae93af0621f31613d src/models/anthropictoolsearchtoolbm25.ts: id: d06d81d905be last_write_checksum: sha1:531706511d9161d26bb5a34d0e77ff939aca8c47 @@ -14638,6 +15618,14 @@ trackedFiles: id: 70c2d1fd66ec last_write_checksum: sha1:fe7cbe6c80bb5e9993641a6f2c193910113a1874 pristine_git_object: 9c5aaf3ccbcb98a0a3db711f3cef120edeb5de9f + src/models/anthropictoolsearchtoolresult.ts: + id: 0c393b072147 + last_write_checksum: sha1:35851084d67d43cce953159eb1a00dae0d74e4db + pristine_git_object: 5b0c5be275adccc4f1ef5dc79a8b198a6795cb3c + src/models/anthropictooluseblock.ts: + id: 6c9a5a6224a4 + last_write_checksum: sha1:aadd31f14187d3fd194df5e5f44bcf7633c6ceba + pristine_git_object: df1ba5667d1379cf9fd0f00793cc1f5fff1cb349 src/models/anthropictooluseskeep.ts: id: 2a4fd7da8884 last_write_checksum: sha1:45b05297126ff011fc35abe349c5c10fef4e12dd @@ -14662,10 +15650,38 @@ trackedFiles: id: 8daa16a72772 last_write_checksum: sha1:b4a1d2bc22303a90aba7ca9f1588ffa7f1c02867 pristine_git_object: 3d38ee585eca63a97ff19c7c6a4041aaea075dd6 + src/models/anthropicwebfetchblock.ts: + id: 0e3236a6988b + last_write_checksum: sha1:caf19b9662cdf7c45c650da653de79315e5fb0b1 + pristine_git_object: c6ad74300281ed2dbdfd079de669dc43ebe8bcd7 + src/models/anthropicwebfetchcontent.ts: + id: ef77960724b3 + last_write_checksum: sha1:253e38cef2e9cb95674f900711c0742aed455513 + pristine_git_object: 0a75a0e8cfcf51e779d7fa0fb2fab589772e3b41 + src/models/anthropicwebfetchtoolresult.ts: + id: 12d2ff014a57 + last_write_checksum: sha1:9c171feed4018de01016dc988de4ddd0626e5d8c + pristine_git_object: 70f8c7e9e6171fed19a68e2d034e1ef75ea4e72f + src/models/anthropicwebfetchtoolresulterror.ts: + id: 51ade5a2476e + last_write_checksum: sha1:15caaec35420824bb0ee12f33f051531326d4f95 + pristine_git_object: 92484f15f7ce82627ca726d5c403b35165a1d307 + src/models/anthropicwebsearchresult.ts: + id: 8e1525a04bc3 + last_write_checksum: sha1:b6fda82cccdbb013bfc7d333373f91eb7cb7759b + pristine_git_object: 6c2280dd7f2939c2ec8ac26e7391afa8e02909f4 src/models/anthropicwebsearchresultblockparam.ts: id: b8fe75186751 last_write_checksum: sha1:6566be2da70fd80e7874c431b094f97a699d1be0 pristine_git_object: 7ad3bbcabe6a3eedfcf66a244503994bdc73acd5 + src/models/anthropicwebsearchtoolresult.ts: + id: ba1707269043 + last_write_checksum: sha1:94221eb983b79740230a7a2dde99ec4814e36d78 + pristine_git_object: 5c3688cce98ef2054d60d80b8ce3d873866bd080 + src/models/anthropicwebsearchtoolresulterror.ts: + id: b1465ff3b43c + last_write_checksum: sha1:e5e9c809dcdc0e2ba615b63135d37acd4f94afe1 + pristine_git_object: 5038420dcc7da4fa35607190ffd889e0bd975ded src/models/anthropicwebsearchtooluserlocation.ts: id: e9ba7619b5e0 last_write_checksum: sha1:efa21b4df2fe7f4e4c9463c3185ce9b1866abe38 @@ -14774,6 +15790,54 @@ trackedFiles: id: 61289ac69d53 last_write_checksum: sha1:72c2589843687ac2d3f38e6796d333ed1ccfc4db pristine_git_object: 04093e855ff637f0f53758e7eb842c5a8bda4a21 + src/models/batchdeletedobject.ts: + id: 142fca04702c + last_write_checksum: sha1:70df7a736c309e33c6ae2326bc29c49aefab87f9 + pristine_git_object: 098a1d74f82df2ca65eb915ee4b9869d28ee097c + src/models/batchdeletionoutcome.ts: + id: d8b27b19149c + last_write_checksum: sha1:2635e167e6421c9e131a11d47ba691458d09bb96 + pristine_git_object: fe41415c18cedae57213466f03b9cc828bcb07a8 + src/models/batchdeletiontargets.ts: + id: 031cd7aaeaa3 + last_write_checksum: sha1:a71f5e519f338c25b6d492057231db592e2b0509 + pristine_git_object: afc19f67d9d70b12a4c11ddda9e7815e9ec4f911 + src/models/batcherrorresponse.ts: + id: 61c415402d74 + last_write_checksum: sha1:b5cdfde3050d682da61f018a5b3dd683eb0235e5 + pristine_git_object: 1b8bf7795089ff1d8333b03619792739db4bbce5 + src/models/batchlistitem.ts: + id: 7032c65d52eb + last_write_checksum: sha1:4e55af89080f083783d9055c7b1f474334e9ede8 + pristine_git_object: eceedcc015292bdf25dbd2af524a088ee0fb1241 + src/models/batchlistresponse.ts: + id: 951626e2dafe + last_write_checksum: sha1:d57c3c7d0d67d1a17496c0c17e3d2449190b14c4 + pristine_git_object: da2cb850cde9a38296a7422340e1cb47da81e72e + src/models/batchliststatus.ts: + id: "153016536e91" + last_write_checksum: sha1:408e2fd922cc53696d11edbc5216372ca8781260 + pristine_git_object: 4e0a13eca780e3b9bf44c3bc61b2338f69a4d007 + src/models/batchlisttimestamp.ts: + id: 55ff60a4c180 + last_write_checksum: sha1:562ecbe171d73e118b3672835315482eac58b727 + pristine_git_object: e61bcceeb1654192271bbe425febbfa05f031d04 + src/models/batchobject.ts: + id: 8103bc5f4aeb + last_write_checksum: sha1:356cae206d1748d67130b7142a7b473c61ab4a59 + pristine_git_object: 2408f4b72c5bdb67916701e7124245db888ee0fc + src/models/batchpaymentrequiredresponseerror.ts: + id: 9e233f8dd38a + last_write_checksum: sha1:c649fcdeab97a015fa155cc51540163c469ab871 + pristine_git_object: d2118a94ab764bf6bcecc1740b7eb117ff5b1f23 + src/models/batchproviderpreferences.ts: + id: 250964898edb + last_write_checksum: sha1:24a801bd423bbb9ffe39797913ac4e380319582d + pristine_git_object: 789f4aa379bfab526d84a71a17633c48380e88b8 + src/models/batchsubmitbody.ts: + id: ae38a7f7eb9d + last_write_checksum: sha1:b2f0ad1d9c397d1978ac1f59fe7a0af9e7b2f68c + pristine_git_object: 89bd7bfc06154a309e88b35a639b0bd83b0d01d0 src/models/booleancapability.ts: id: b920d99cecda last_write_checksum: sha1:d699ec6e03a7bad0aa439bdf4e2094f1bff5cca3 @@ -15256,8 +16320,8 @@ trackedFiles: pristine_git_object: 058ae695e4059db823c78b1110030ce4030fccef src/models/debugevent.ts: id: 8afa2111f54c - last_write_checksum: sha1:058b6eee52fc44cf721e342e9f218ed4feb7f0b9 - pristine_git_object: c67510d2db5d1af6cebbf66170cf5f1fb3da7f30 + last_write_checksum: sha1:e33a4610eeee17efa29b0d9732770bb976b76ff9 + pristine_git_object: ce8ac06d43540e4774a711f9453f5ee56002bf8a src/models/decisionschoiceanswer.ts: id: 430db809b823 last_write_checksum: sha1:7c4f6eee06f2ec6e41def53fe652cbbc8a51d50a @@ -15362,6 +16426,14 @@ trackedFiles: id: beddfd22a313 last_write_checksum: sha1:243a634383653e41d606d0fbe078ec5417681e89 pristine_git_object: b1485c88411a351b3b93b9b9ec4cdd96c163123f + src/models/errors/batcherrorresponse.ts: + id: f2cce3eb05df + last_write_checksum: sha1:d46cbefd9af57b24a0146c176b91f04d27fc05f7 + pristine_git_object: 1e0c611694f58cf13291bf37a01f78a0ef12c563 + src/models/errors/batchpaymentrequiredresponseerror.ts: + id: 2d141acc5a71 + last_write_checksum: sha1:84d3cbb0c6a1a0610efac5bff80e0dbe6db9b1a7 + pristine_git_object: 1b0fa09510d5c4bddb3bdedd040261643ef083d1 src/models/errors/conflictresponseerror.ts: id: 3d49b17cca5f last_write_checksum: sha1:6a00de58c6ba80ea6bc64b708bd482a827e60562 @@ -15388,8 +16460,8 @@ trackedFiles: pristine_git_object: 53bb3cfae157b89fda8e4a5b0f1dd709da82c1c9 src/models/errors/index.ts: id: c4e22507cb83 - last_write_checksum: sha1:0559f44570504564383993755e99d500f0df7be2 - pristine_git_object: c66b75f08b93f8d3da76b9b2c5f1712d3c77b39e + last_write_checksum: sha1:ee23779618533a7bbf0836c59b26da331ef623ba + pristine_git_object: 3afbbe438cbceb71b2352aefc6e1c56107856761 src/models/errors/internalserverresponseerror.ts: id: 02b76cec85f0 last_write_checksum: sha1:18ef8306c531d997e7f560018498aeccddd0bbee @@ -15502,6 +16574,10 @@ trackedFiles: id: 9e169d1b0b62 last_write_checksum: sha1:5bb6078118ad9978f983a04d2cf4f1f472c10cdc pristine_git_object: 48c95b6fa6f4879cb25e212af26b5aaaa55bfad9 + src/models/finishreason.ts: + id: ceaee02b253a + last_write_checksum: sha1:90440278a5ad521300686a5817ec791ec0f554d4 + pristine_git_object: ba8ef86ac5a1c8358ba0e8aeb500ce4c626c2fd2 src/models/forbiddenresponseerrordata.ts: id: cc3fdc45a2fd last_write_checksum: sha1:75b4d7533aa1e3730f1d8c8341798947aa4ff51b @@ -15740,8 +16816,8 @@ trackedFiles: pristine_git_object: db61647cd182502b2b3b5333ee3a0bba66542645 src/models/imagegenerationusage.ts: id: 4f128ace6b39 - last_write_checksum: sha1:9b32233d5d0797168aa3e5283eb225283258a676 - pristine_git_object: 4f4e7dd2e3640facf9d68a278529060e892806b1 + last_write_checksum: sha1:ea08238489ed09918856d75bdc2fecc090a96a1d + pristine_git_object: e5db32dcbae57947da6348643b8a5c45badb3e15 src/models/imagegenpartialimageevent.ts: id: ee4283390600 last_write_checksum: sha1:0e059239eee8cb3d77ece47bf6f28ef29bd1692c @@ -15792,8 +16868,8 @@ trackedFiles: pristine_git_object: 7abdfe096d3adff317db6837dc689c69db92e127 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:970d0f9bfa1b668f99598a66d856a87c3c4d7740 - pristine_git_object: 930bfcc8382cd3b5df96c16c187db3335b7aa90f + last_write_checksum: sha1:676099c62a7ed941a213d56d36f66f86c30a0ea6 + pristine_git_object: a9452658a5d1829db89e3b8e4918851dd3bc6fda src/models/inputaudio.ts: id: 9bdc14c7565f last_write_checksum: sha1:2f8dc4c1d6a9c2927d9eb186e0ecedf7b81838e6 @@ -15852,8 +16928,8 @@ trackedFiles: pristine_git_object: b3232079aa2232b57cd35086958ae176f9879d3f src/models/internchatchoice.ts: id: f10a43356b30 - last_write_checksum: sha1:f06925cc5babec1b766080983fb8fb19c330775a - pristine_git_object: 4f49443ce50fa0f7c73c91ecc9aaeffff1e4ddb7 + last_write_checksum: sha1:0947c50a72bb7fa4263e5a9b7e6d7bbec7e51468 + pristine_git_object: 1bc35fdcdc4e99671287a9b09ef38466200b8498 src/models/internchatcompletionchunk.ts: id: 3492df914b61 last_write_checksum: sha1:0c5514d22a8bcc152dc27add29b6af1e9ce7b2d3 @@ -16092,8 +17168,8 @@ trackedFiles: pristine_git_object: 73a70df30602cf12003bc64edfd5ff146c12a030 src/models/messagesmessageparam.ts: id: 0a3ea5a7e049 - last_write_checksum: sha1:72d34eccdb0c1052e18c56a43b70cc8dc95d2f97 - pristine_git_object: a165b1a4f817bfc2a558a1bfd683fefec7c06828 + last_write_checksum: sha1:cf825cd0c2435bb5fa4d16a6ec1a939bb692a24d + pristine_git_object: 46bd5d8d1ea0a7c08b78336277878cab5df55369 src/models/messagesoutputconfig.ts: id: aad3082eb908 last_write_checksum: sha1:1fac9f50fb7c0c94de2d5f3aa0b74bb607f10f51 @@ -16414,6 +17490,10 @@ trackedFiles: id: 1443f6afbf40 last_write_checksum: sha1:59be6a15c34f2855d2328c8ce15a70037a243d01 pristine_git_object: f5c85d4340881eb733f51197cd69afff2dfe5380 + src/models/operations/createbatches.ts: + id: ebc64cef17ca + last_write_checksum: sha1:d3fffa19377a11e9b3895d07c89b99aeb260fecd + pristine_git_object: e8e29a484250f5a35e316e6f114d8a09b0a00dd4 src/models/operations/createbyokkey.ts: id: 1725e1bba8d8 last_write_checksum: sha1:218c27ee6adbf07092c7511fc3f9a09d71b2e8ba @@ -16490,6 +17570,10 @@ trackedFiles: id: 27fe97979faa last_write_checksum: sha1:c0201a1d5cede0ef4ca8a0f94ad41991de9c8fa6 pristine_git_object: 1e6b38b10079b654538becf02afe716ee54ed4f0 + src/models/operations/deletebatch.ts: + id: f2c0c45a0e0b + last_write_checksum: sha1:0fcdf0e3b1f743245d7efdbfa71ecfccd4eff493 + pristine_git_object: 96e3fabf0d59c625c97d32eff4bb8a2b6ea67b41 src/models/operations/deletebyokkey.ts: id: 948bcb0fbfc1 last_write_checksum: sha1:ef8e8608d2a775b4fef69e01fc91eb12075c9ac7 @@ -16554,6 +17638,10 @@ trackedFiles: id: edd3364e84c1 last_write_checksum: sha1:3368aad033c01d34f611ba291e8cd555a107310a pristine_git_object: 18f090439648b6fbd98936558a3669df06d9bbc1 + src/models/operations/getbatches.ts: + id: 25fcdd59c2f1 + last_write_checksum: sha1:2f8ca38e2ac760475575f35709cdd1380d583beb + pristine_git_object: 2d75b6d2d23238cf449d6b373c111185a9b530fa src/models/operations/getbenchmarks.ts: id: 52eb1eb063ae last_write_checksum: sha1:0b411937f5f99c6bbe9cac02754c22437bedb8ed @@ -16656,8 +17744,8 @@ trackedFiles: pristine_git_object: a052ed42bd123e79be1f05dc823c808f8c32b383 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:9720e7bba10a523dbafadbe64069e928d66c5c20 - pristine_git_object: dcf5f911b0fa233c9da73a64984df06704819edc + last_write_checksum: sha1:3f8bfdb04f18d63d2b4986519de0323e239ef2ed + pristine_git_object: 19e2b028c9553906c7853ee60bd04beb88c49da2 src/models/operations/invokeintern.ts: id: f2b19fbd8a96 last_write_checksum: sha1:55f0d7c3a2020919fbf3e92c2c7524a75a412504 @@ -16666,6 +17754,10 @@ trackedFiles: id: ce11386ad30f last_write_checksum: sha1:357fb735d77e377eba5fec5742d7a4dca6747f47 pristine_git_object: 1b025b64611d7dfc01df57b52dec8342b4777def + src/models/operations/listbatches.ts: + id: ed6b34dc34af + last_write_checksum: sha1:57a05fa9c33984c047311de6e18b4cf225019cb9 + pristine_git_object: 78a90943275900fffb84968900c040d743744806 src/models/operations/listbyokkeys.ts: id: 953de50b8d0e last_write_checksum: sha1:64fbd0337aef5c69d0c524ad0b822dc9709e5456 @@ -16862,6 +17954,30 @@ trackedFiles: id: f2bb866e828c last_write_checksum: sha1:9bc85cc6e33775e22b52af52fbfb14f2dda816ed pristine_git_object: e03c5c2da7ba12d97a414a9af7347e3d3c1a4c83 + src/models/oranthropicbashtoolresult.ts: + id: 13070e32efe3 + last_write_checksum: sha1:097525bdec2eb64b1eca30509a31f9c7127c6537 + pristine_git_object: 418edd3935b3b6a3b979759fdb53158d10d941da + src/models/oranthropiccontentblock.ts: + id: 29775b270fae + last_write_checksum: sha1:000bf2df526eb617ddd15b27be724edf8ecb6848 + pristine_git_object: 170f844456d3ba3589638b9c9b6057bbd81f1681 + src/models/oranthropicnullablecaller.ts: + id: ecf0849a25c1 + last_write_checksum: sha1:bde57b49fa8263e54a270ccf930e842bf6e3cdc0 + pristine_git_object: 8a6fc4654f5198cc427bb9546bca2143ece6b153 + src/models/oranthropicservertooluseblock.ts: + id: 6dab967e4db6 + last_write_checksum: sha1:cdb9f266eef50cf5df39520d1cbc2fd9b6da3ebd + pristine_git_object: 9234a171c4fb12b62e6fee7cd460acc1e38edf74 + src/models/oranthropicshelltoolresult.ts: + id: 6c0f19243a3e + last_write_checksum: sha1:d8b000b71724f5f456a44cccbd3e35c1347030d1 + pristine_git_object: 5370623c04ab66a9328c2db687abeeb4c3d0b423 + src/models/oranthropicstopreason.ts: + id: 2f8990149810 + last_write_checksum: sha1:e945d14b189d8a80ea10d3a0bce2a986d0b699a5 + pristine_git_object: 4cec58cadbead08e57243fc33f47eb50d1b0c322 src/models/outputadvisorservertoolitem.ts: id: 0c9d6ff77975 last_write_checksum: sha1:ad258b7f79ccbd005042a66708f25e51adbc2a62 @@ -16920,8 +18036,8 @@ trackedFiles: pristine_git_object: 7ceca95161626a8148c05eca0ad540640f1907c4 src/models/outputfusionservertoolitem.ts: id: 30bcfe965217 - last_write_checksum: sha1:9f08b458689579fa8750eccebe104da10a05c6d9 - pristine_git_object: e4613f4cd3cef386271dfb7ed5550b3a1e4a55ac + last_write_checksum: sha1:fa22a981b43ae4d6bf59d387967bab87bdd73631 + pristine_git_object: 7673b9524737febdeef1a3424f57e1fe79a13e64 src/models/outputimagegenerationcallitem.ts: id: 618bac10713d last_write_checksum: sha1:41413c2fbfebe62fa16d6aa61fd51aa48fcaef00 @@ -17520,8 +18636,8 @@ trackedFiles: pristine_git_object: f6de011913ddbcfcfb49b990a7d0c7590357a0cd src/models/submitgenerationfeedbackrequest.ts: id: c8bd4306e20e - last_write_checksum: sha1:8dc24d487bacdbaa24f5ebda7b83b2c217bab3d9 - pristine_git_object: b0896f9cad9b90eb269579f559a99f9556c62641 + last_write_checksum: sha1:cbaff653ba802fabdc746961dc8c51b09518dc3b + pristine_git_object: 8c12e4ae744e4e463e46c05e5d10769f28f26d04 src/models/submitgenerationfeedbackresponse.ts: id: 16760a92290d last_write_checksum: sha1:2d3d37aaa12752b49e418d47a37fdbf114ad776c @@ -17858,6 +18974,10 @@ trackedFiles: id: 5dda931501e1 last_write_checksum: sha1:5703cc8f8b2aa6c33d491e2319eae43753bf5ba1 pristine_git_object: afff539f0e658b5ecf98eef83184aaae83def189 + src/sdk/batch.ts: + id: 254a218f7d6b + last_write_checksum: sha1:060fefc69e19501be3cabe381e44091a14f36c12 + pristine_git_object: 5d9705d9fbbff7991fd783993a21b8c840f6af4b src/sdk/benchmarks.ts: id: 72ce7b70fba8 last_write_checksum: sha1:4e243ac5896b6f8dae4ca47e467830c658d5fd65 @@ -17968,8 +19088,8 @@ trackedFiles: pristine_git_object: 8e9b4047e476a17451b5feb7e9d4a32eec7f61f8 src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:45eb0c06159c711db01045e7c5f9d798a3ad9a7c - pristine_git_object: d15ef3c72127a043a25e40474d479b750d44d523 + last_write_checksum: sha1:cd9b0964c8fc1dd4700d9330b5de6c74f21f4a91 + pristine_git_object: b83fbcaad80bee4591d0227fd390c3ef4bf9d295 src/sdk/stt.ts: id: fd9e88c22d1f last_write_checksum: sha1:baa74a0310eb8b465dea302495e744e3f3ea1ca5 @@ -21313,5 +22433,91 @@ 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: "## Typescript SDK Changes:\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.inputReferences[]` **Changed**\n* `openrouter.endpoints.listZdrEndpoints()`: `response.data[]` **Changed**\n* `openrouter.endpoints.list()`: `response.data.endpoints[]` **Changed**\n" +releaseNotes: "## Typescript SDK Changes:\n* `openrouter.presets.createPresetsMessages()`: \n * `request.messagesRequest.messages[].content.union(Array<>)[].union(document).source` **Changed** (Breaking ⚠️)\n* `openrouter.batch.list()`: **Added**\n* `openrouter.batch.createBatches()`: **Added**\n* `openrouter.batch.delete()`: **Added**\n* `openrouter.batch.getBatches()`: **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 26e5dd314..09e415ce3 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.3.29 + version: 1.3.30 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index e24df630b..f9e3599d4 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -4418,6 +4418,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: @@ -9248,6 +10735,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: @@ -31605,6 +33102,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.' @@ -47548,6 +49517,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 1a141dda9..7dd075235 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:7a95ff3051101de85dd0b3ac09cad39c61622cfead6d13a21d455528e6fa608b - sourceBlobDigest: sha256:f894a0b4777222e7bbc223cc2ca6061ff83979edcb0cb148212130eca09c9bad + sourceRevisionDigest: sha256:8ee4048d069b24eb09ddfc6875afdf9c3b4879d99e0b04f34248767e20ae437a + sourceBlobDigest: sha256:e380d1b76e9e3793a2c3119b4876fb6174356fff377ff686c8663762f6c310c2 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:7a95ff3051101de85dd0b3ac09cad39c61622cfead6d13a21d455528e6fa608b - sourceBlobDigest: sha256:f894a0b4777222e7bbc223cc2ca6061ff83979edcb0cb148212130eca09c9bad + sourceRevisionDigest: sha256:8ee4048d069b24eb09ddfc6875afdf9c3b4879d99e0b04f34248767e20ae437a + sourceBlobDigest: sha256:e380d1b76e9e3793a2c3119b4876fb6174356fff377ff686c8663762f6c310c2 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:c4007623380dcf6916f452db2244ffec65bebace120e52c563576675793b1b79 + codeSamplesRevisionDigest: sha256:e05611d273879a4e4d99c0b7e7f5a79ab44d6ae8c9459c7293e940e4337a0d1e workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/README.md b/README.md index 7411a9be6..6948df72b 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ const openRouter = new OpenRouter({ }); async function run() { - const result = await openRouter.byok.list(); + const result = await openRouter.batch.list(); for await (const page of result) { console.log(page); diff --git a/RELEASES.md b/RELEASES.md index 5e09fdbc3..624fe7842 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4076,4 +4076,14 @@ Based on: ### Generated - [typescript v1.3.29] . ### Releases -- [NPM v1.3.29] https://www.npmjs.com/package/@openrouter/sdk/v/1.3.29 - . \ No newline at end of file +- [NPM v1.3.29] https://www.npmjs.com/package/@openrouter/sdk/v/1.3.29 - . + +## 2026-09-25 20:54:47 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.3.30] . +### Releases +- [NPM v1.3.30] https://www.npmjs.com/package/@openrouter/sdk/v/1.3.30 - . \ No newline at end of file diff --git a/docs/docs.json b/docs/docs.json index 2f08b62f3..50902456e 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/models/annotation.mdx b/docs/models/annotation.mdx new file mode 100644 index 000000000..5748c04fb --- /dev/null +++ b/docs/models/annotation.mdx @@ -0,0 +1,44 @@ +--- +title: "Annotation" +--- + +## Supported Types + +### `models.AnnotationFile` + +```typescript +const value: models.AnnotationFile = { + file: { + content: [], + hash: "", + }, + type: "file", +}; +``` + +### `models.AnnotationURLCitation` + +```typescript +const value: models.AnnotationURLCitation = { + type: "url_citation", + urlCitation: { + endIndex: 95056, + startIndex: 185867, + title: "", + url: "https://mindless-in-joke.name/", + }, +}; +``` + +### `models.AnnotationWebSearchCitation` + +```typescript +const value: models.AnnotationWebSearchCitation = { + type: "web_search_citation", + webSearchCitation: { + title: "", + url: "https://favorite-issue.info", + }, +}; +``` + diff --git a/docs/models/annotationcontentunion.mdx b/docs/models/annotationcontentunion.mdx new file mode 100644 index 000000000..7c1a6a115 --- /dev/null +++ b/docs/models/annotationcontentunion.mdx @@ -0,0 +1,26 @@ +--- +title: "AnnotationContentUnion" +--- + +## Supported Types + +### `models.ContentText` + +```typescript +const value: models.ContentText = { + text: "", + type: "text", +}; +``` + +### `models.ContentImageURL` + +```typescript +const value: models.ContentImageURL = { + imageUrl: { + url: "https://zealous-march.biz/", + }, + type: "image_url", +}; +``` + diff --git a/docs/models/annotationfile.mdx b/docs/models/annotationfile.mdx new file mode 100644 index 000000000..58791a4d0 --- /dev/null +++ b/docs/models/annotationfile.mdx @@ -0,0 +1,24 @@ +--- +title: "AnnotationFile" +--- + +## Example Usage + +```typescript +import { AnnotationFile } from "@openrouter/sdk/models"; + +let value: AnnotationFile = { + file: { + content: [], + hash: "", + }, + type: "file", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `file` | [models.BatchObjectFile](../models/batchobjectfile.mdx) | :heavy_check_mark: | N/A | +| `type` | *"file"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/annotationurlcitation.mdx b/docs/models/annotationurlcitation.mdx new file mode 100644 index 000000000..de1d1ad0a --- /dev/null +++ b/docs/models/annotationurlcitation.mdx @@ -0,0 +1,26 @@ +--- +title: "AnnotationURLCitation" +--- + +## Example Usage + +```typescript +import { AnnotationURLCitation } from "@openrouter/sdk/models"; + +let value: AnnotationURLCitation = { + type: "url_citation", + urlCitation: { + endIndex: 95056, + startIndex: 185867, + title: "", + url: "https://mindless-in-joke.name/", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *"url_citation"* | :heavy_check_mark: | N/A | +| `urlCitation` | [models.BatchObjectUrlCitation](../models/batchobjecturlcitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/annotationwebsearchcitation.mdx b/docs/models/annotationwebsearchcitation.mdx new file mode 100644 index 000000000..48dbf9fdf --- /dev/null +++ b/docs/models/annotationwebsearchcitation.mdx @@ -0,0 +1,24 @@ +--- +title: "AnnotationWebSearchCitation" +--- + +## Example Usage + +```typescript +import { AnnotationWebSearchCitation } from "@openrouter/sdk/models"; + +let value: AnnotationWebSearchCitation = { + type: "web_search_citation", + webSearchCitation: { + title: "", + url: "https://favorite-issue.info", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `type` | *"web_search_citation"* | :heavy_check_mark: | N/A | +| `webSearchCitation` | [models.WebSearchCitation](../models/websearchcitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicadvisortoolresult.mdx b/docs/models/anthropicadvisortoolresult.mdx new file mode 100644 index 000000000..6bee1d1cb --- /dev/null +++ b/docs/models/anthropicadvisortoolresult.mdx @@ -0,0 +1,25 @@ +--- +title: "AnthropicAdvisorToolResult" +--- + +## Example Usage + +```typescript +import { AnthropicAdvisorToolResult } from "@openrouter/sdk/models"; + +let value: AnthropicAdvisorToolResult = { + content: { + "key": "", + }, + toolUseId: "", + type: "advisor_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `content` | Record\ | :heavy_check_mark: | N/A | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | +| `type` | *"advisor_tool_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicbase64pdfsource.mdx b/docs/models/anthropicbase64pdfsource.mdx index 86918e684..2a3716ba8 100644 --- a/docs/models/anthropicbase64pdfsource.mdx +++ b/docs/models/anthropicbase64pdfsource.mdx @@ -20,4 +20,4 @@ let value: AnthropicBase64PdfSource = { | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `data` | *string* | :heavy_check_mark: | N/A | | `mediaType` | [models.AnthropicBase64PdfSourceMediaType](../models/anthropicbase64pdfsourcemediatype.mdx) | :heavy_check_mark: | N/A | -| `type` | *"base64"* | :heavy_check_mark: | N/A | \ No newline at end of file +| `type` | [models.AnthropicBase64PdfSourceType](../models/anthropicbase64pdfsourcetype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicbase64pdfsourcetype.mdx b/docs/models/anthropicbase64pdfsourcetype.mdx new file mode 100644 index 000000000..2df8b5f1e --- /dev/null +++ b/docs/models/anthropicbase64pdfsourcetype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicBase64PdfSourceType" +--- + +## Example Usage + +```typescript +import { AnthropicBase64PdfSourceType } from "@openrouter/sdk/models"; + +let value: AnthropicBase64PdfSourceType = "base64"; +``` + +## Values + +```typescript +"base64" +``` \ No newline at end of file diff --git a/docs/models/anthropicbashcodeexecutioncontent.mdx b/docs/models/anthropicbashcodeexecutioncontent.mdx new file mode 100644 index 000000000..a296d9e59 --- /dev/null +++ b/docs/models/anthropicbashcodeexecutioncontent.mdx @@ -0,0 +1,27 @@ +--- +title: "AnthropicBashCodeExecutionContent" +--- + +## Supported Types + +### `models.AnthropicBashCodeExecutionResult` + +```typescript +const value: models.AnthropicBashCodeExecutionResult = { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "bash_code_execution_result", +}; +``` + +### `models.AnthropicBashCodeExecutionToolResultError` + +```typescript +const value: models.AnthropicBashCodeExecutionToolResultError = { + errorCode: "execution_time_exceeded", + type: "bash_code_execution_tool_result_error", +}; +``` + diff --git a/docs/models/anthropicbashcodeexecutionoutput.mdx b/docs/models/anthropicbashcodeexecutionoutput.mdx new file mode 100644 index 000000000..c9bbfbec2 --- /dev/null +++ b/docs/models/anthropicbashcodeexecutionoutput.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicBashCodeExecutionOutput" +--- + +## Example Usage + +```typescript +import { AnthropicBashCodeExecutionOutput } from "@openrouter/sdk/models"; + +let value: AnthropicBashCodeExecutionOutput = { + fileId: "file_01abc", + type: "bash_code_execution_output", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `type` | [models.AnthropicBashCodeExecutionOutputType](../models/anthropicbashcodeexecutionoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicbashcodeexecutionoutputtype.mdx b/docs/models/anthropicbashcodeexecutionoutputtype.mdx new file mode 100644 index 000000000..c9f342514 --- /dev/null +++ b/docs/models/anthropicbashcodeexecutionoutputtype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicBashCodeExecutionOutputType" +--- + +## Example Usage + +```typescript +import { AnthropicBashCodeExecutionOutputType } from "@openrouter/sdk/models"; + +let value: AnthropicBashCodeExecutionOutputType = "bash_code_execution_output"; +``` + +## Values + +```typescript +"bash_code_execution_output" +``` \ No newline at end of file diff --git a/docs/models/anthropicbashcodeexecutionresult.mdx b/docs/models/anthropicbashcodeexecutionresult.mdx new file mode 100644 index 000000000..027d6b3ec --- /dev/null +++ b/docs/models/anthropicbashcodeexecutionresult.mdx @@ -0,0 +1,27 @@ +--- +title: "AnthropicBashCodeExecutionResult" +--- + +## Example Usage + +```typescript +import { AnthropicBashCodeExecutionResult } from "@openrouter/sdk/models"; + +let value: AnthropicBashCodeExecutionResult = { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "bash_code_execution_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `content` | [models.AnthropicBashCodeExecutionOutput](../models/anthropicbashcodeexecutionoutput.mdx)[] | :heavy_check_mark: | N/A | +| `returnCode` | *number* | :heavy_check_mark: | N/A | +| `stderr` | *string* | :heavy_check_mark: | N/A | +| `stdout` | *string* | :heavy_check_mark: | N/A | +| `type` | *"bash_code_execution_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicbashcodeexecutiontoolresult.mdx b/docs/models/anthropicbashcodeexecutiontoolresult.mdx new file mode 100644 index 000000000..451d63464 --- /dev/null +++ b/docs/models/anthropicbashcodeexecutiontoolresult.mdx @@ -0,0 +1,29 @@ +--- +title: "AnthropicBashCodeExecutionToolResult" +--- + +## Example Usage + +```typescript +import { AnthropicBashCodeExecutionToolResult } from "@openrouter/sdk/models"; + +let value: AnthropicBashCodeExecutionToolResult = { + content: { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "bash_code_execution_result", + }, + toolUseId: "", + type: "bash_code_execution_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `content` | *models.AnthropicBashCodeExecutionContent* | :heavy_check_mark: | N/A | \{
"content": [],
"return_code": 0,
"stderr": "",
"stdout": "Hello",
"type": "bash_code_execution_result"
} | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"bash_code_execution_tool_result"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropicbashcodeexecutiontoolresulterror.mdx b/docs/models/anthropicbashcodeexecutiontoolresulterror.mdx new file mode 100644 index 000000000..460cd8e08 --- /dev/null +++ b/docs/models/anthropicbashcodeexecutiontoolresulterror.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicBashCodeExecutionToolResultError" +--- + +## Example Usage + +```typescript +import { AnthropicBashCodeExecutionToolResultError } from "@openrouter/sdk/models"; + +let value: AnthropicBashCodeExecutionToolResultError = { + errorCode: "output_file_too_large", + type: "bash_code_execution_tool_result_error", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `errorCode` | [models.AnthropicBashCodeExecutionToolResultErrorErrorCode](../models/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | *"bash_code_execution_tool_result_error"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx b/docs/models/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx new file mode 100644 index 000000000..4a1dc9358 --- /dev/null +++ b/docs/models/anthropicbashcodeexecutiontoolresulterrorerrorcode.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicBashCodeExecutionToolResultErrorErrorCode" +--- + +## Example Usage + +```typescript +import { AnthropicBashCodeExecutionToolResultErrorErrorCode } from "@openrouter/sdk/models"; + +let value: AnthropicBashCodeExecutionToolResultErrorErrorCode = "unavailable"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"invalid_tool_input" | "unavailable" | "too_many_requests" | "execution_time_exceeded" | "output_file_too_large" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropiccaller.mdx b/docs/models/anthropiccaller.mdx new file mode 100644 index 000000000..436027388 --- /dev/null +++ b/docs/models/anthropiccaller.mdx @@ -0,0 +1,32 @@ +--- +title: "AnthropicCaller" +--- + +## Supported Types + +### `models.AnthropicCodeExecution20250825Caller` + +```typescript +const value: models.AnthropicCodeExecution20250825Caller = { + toolId: "", + type: "code_execution_20250825", +}; +``` + +### `models.AnthropicCodeExecution20260120Caller` + +```typescript +const value: models.AnthropicCodeExecution20260120Caller = { + toolId: "", + type: "code_execution_20260120", +}; +``` + +### `models.AnthropicDirectCaller` + +```typescript +const value: models.AnthropicDirectCaller = { + type: "direct", +}; +``` + diff --git a/docs/models/anthropiccitationcharlocation.mdx b/docs/models/anthropiccitationcharlocation.mdx new file mode 100644 index 000000000..8627c012e --- /dev/null +++ b/docs/models/anthropiccitationcharlocation.mdx @@ -0,0 +1,31 @@ +--- +title: "AnthropicCitationCharLocation" +--- + +## Example Usage + +```typescript +import { AnthropicCitationCharLocation } from "@openrouter/sdk/models"; + +let value: AnthropicCitationCharLocation = { + citedText: "Example text", + documentIndex: 0, + documentTitle: null, + endCharIndex: 10, + fileId: null, + startCharIndex: 0, + type: "char_location", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `citedText` | *string* | :heavy_check_mark: | N/A | +| `documentIndex` | *number* | :heavy_check_mark: | N/A | +| `documentTitle` | *string* | :heavy_check_mark: | N/A | +| `endCharIndex` | *number* | :heavy_check_mark: | N/A | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `startCharIndex` | *number* | :heavy_check_mark: | N/A | +| `type` | *"char_location"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccitationcontentblocklocation.mdx b/docs/models/anthropiccitationcontentblocklocation.mdx new file mode 100644 index 000000000..979cc8f45 --- /dev/null +++ b/docs/models/anthropiccitationcontentblocklocation.mdx @@ -0,0 +1,31 @@ +--- +title: "AnthropicCitationContentBlockLocation" +--- + +## Example Usage + +```typescript +import { AnthropicCitationContentBlockLocation } from "@openrouter/sdk/models"; + +let value: AnthropicCitationContentBlockLocation = { + citedText: "Example text", + documentIndex: 0, + documentTitle: null, + endBlockIndex: 492861, + fileId: null, + startBlockIndex: 521210, + type: "content_block_location", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `citedText` | *string* | :heavy_check_mark: | N/A | +| `documentIndex` | *number* | :heavy_check_mark: | N/A | +| `documentTitle` | *string* | :heavy_check_mark: | N/A | +| `endBlockIndex` | *number* | :heavy_check_mark: | N/A | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `startBlockIndex` | *number* | :heavy_check_mark: | N/A | +| `type` | *"content_block_location"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccitationpagelocation.mdx b/docs/models/anthropiccitationpagelocation.mdx new file mode 100644 index 000000000..33e9c4e71 --- /dev/null +++ b/docs/models/anthropiccitationpagelocation.mdx @@ -0,0 +1,31 @@ +--- +title: "AnthropicCitationPageLocation" +--- + +## Example Usage + +```typescript +import { AnthropicCitationPageLocation } from "@openrouter/sdk/models"; + +let value: AnthropicCitationPageLocation = { + citedText: "Example text", + documentIndex: 0, + documentTitle: null, + endPageNumber: 366265, + fileId: null, + startPageNumber: 736223, + type: "page_location", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `citedText` | *string* | :heavy_check_mark: | N/A | +| `documentIndex` | *number* | :heavy_check_mark: | N/A | +| `documentTitle` | *string* | :heavy_check_mark: | N/A | +| `endPageNumber` | *number* | :heavy_check_mark: | N/A | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `startPageNumber` | *number* | :heavy_check_mark: | N/A | +| `type` | *"page_location"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccitationsconfig.mdx b/docs/models/anthropiccitationsconfig.mdx new file mode 100644 index 000000000..8137478b7 --- /dev/null +++ b/docs/models/anthropiccitationsconfig.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicCitationsConfig" +--- + +## Example Usage + +```typescript +import { AnthropicCitationsConfig } from "@openrouter/sdk/models"; + +let value: AnthropicCitationsConfig = { + enabled: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `enabled` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccitationsearchresultlocation.mdx b/docs/models/anthropiccitationsearchresultlocation.mdx new file mode 100644 index 000000000..acfe44599 --- /dev/null +++ b/docs/models/anthropiccitationsearchresultlocation.mdx @@ -0,0 +1,31 @@ +--- +title: "AnthropicCitationSearchResultLocation" +--- + +## Example Usage + +```typescript +import { AnthropicCitationSearchResultLocation } from "@openrouter/sdk/models"; + +let value: AnthropicCitationSearchResultLocation = { + citedText: "Example text", + endBlockIndex: 946820, + searchResultIndex: 428212, + source: "", + startBlockIndex: 652748, + title: "", + type: "search_result_location", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `citedText` | *string* | :heavy_check_mark: | N/A | +| `endBlockIndex` | *number* | :heavy_check_mark: | N/A | +| `searchResultIndex` | *number* | :heavy_check_mark: | N/A | +| `source` | *string* | :heavy_check_mark: | N/A | +| `startBlockIndex` | *number* | :heavy_check_mark: | N/A | +| `title` | *string* | :heavy_check_mark: | N/A | +| `type` | *"search_result_location"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccitationwebsearchresultlocation.mdx b/docs/models/anthropiccitationwebsearchresultlocation.mdx new file mode 100644 index 000000000..33c1992f9 --- /dev/null +++ b/docs/models/anthropiccitationwebsearchresultlocation.mdx @@ -0,0 +1,27 @@ +--- +title: "AnthropicCitationWebSearchResultLocation" +--- + +## Example Usage + +```typescript +import { AnthropicCitationWebSearchResultLocation } from "@openrouter/sdk/models"; + +let value: AnthropicCitationWebSearchResultLocation = { + citedText: "Example text", + encryptedIndex: "", + title: "", + type: "web_search_result_location", + url: "https://admired-hundred.biz", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `citedText` | *string* | :heavy_check_mark: | N/A | +| `encryptedIndex` | *string* | :heavy_check_mark: | N/A | +| `title` | *string* | :heavy_check_mark: | N/A | +| `type` | *"web_search_result_location"* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccodeexecution20250825caller.mdx b/docs/models/anthropiccodeexecution20250825caller.mdx new file mode 100644 index 000000000..b24a19735 --- /dev/null +++ b/docs/models/anthropiccodeexecution20250825caller.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicCodeExecution20250825Caller" +--- + +## Example Usage + +```typescript +import { AnthropicCodeExecution20250825Caller } from "@openrouter/sdk/models"; + +let value: AnthropicCodeExecution20250825Caller = { + toolId: "", + type: "code_execution_20250825", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `toolId` | *string* | :heavy_check_mark: | N/A | +| `type` | *"code_execution_20250825"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccodeexecution20260120caller.mdx b/docs/models/anthropiccodeexecution20260120caller.mdx new file mode 100644 index 000000000..e99ae9e74 --- /dev/null +++ b/docs/models/anthropiccodeexecution20260120caller.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicCodeExecution20260120Caller" +--- + +## Example Usage + +```typescript +import { AnthropicCodeExecution20260120Caller } from "@openrouter/sdk/models"; + +let value: AnthropicCodeExecution20260120Caller = { + toolId: "", + type: "code_execution_20260120", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `toolId` | *string* | :heavy_check_mark: | N/A | +| `type` | *"code_execution_20260120"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccodeexecutioncontent.mdx b/docs/models/anthropiccodeexecutioncontent.mdx new file mode 100644 index 000000000..ce189549f --- /dev/null +++ b/docs/models/anthropiccodeexecutioncontent.mdx @@ -0,0 +1,39 @@ +--- +title: "AnthropicCodeExecutionContent" +--- + +## Supported Types + +### `models.AnthropicCodeExecutionResult` + +```typescript +const value: models.AnthropicCodeExecutionResult = { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "code_execution_result", +}; +``` + +### `models.AnthropicCodeExecutionToolResultError` + +```typescript +const value: models.AnthropicCodeExecutionToolResultError = { + errorCode: "unavailable", + type: "code_execution_tool_result_error", +}; +``` + +### `models.AnthropicEncryptedCodeExecutionResult` + +```typescript +const value: models.AnthropicEncryptedCodeExecutionResult = { + content: [], + encryptedStdout: "", + returnCode: 0, + stderr: "", + type: "encrypted_code_execution_result", +}; +``` + diff --git a/docs/models/anthropiccodeexecutionoutput.mdx b/docs/models/anthropiccodeexecutionoutput.mdx new file mode 100644 index 000000000..a23674e05 --- /dev/null +++ b/docs/models/anthropiccodeexecutionoutput.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicCodeExecutionOutput" +--- + +## Example Usage + +```typescript +import { AnthropicCodeExecutionOutput } from "@openrouter/sdk/models"; + +let value: AnthropicCodeExecutionOutput = { + fileId: "file_01abc", + type: "code_execution_output", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `type` | [models.AnthropicCodeExecutionOutputType](../models/anthropiccodeexecutionoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccodeexecutionoutputtype.mdx b/docs/models/anthropiccodeexecutionoutputtype.mdx new file mode 100644 index 000000000..f59887482 --- /dev/null +++ b/docs/models/anthropiccodeexecutionoutputtype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicCodeExecutionOutputType" +--- + +## Example Usage + +```typescript +import { AnthropicCodeExecutionOutputType } from "@openrouter/sdk/models"; + +let value: AnthropicCodeExecutionOutputType = "code_execution_output"; +``` + +## Values + +```typescript +"code_execution_output" +``` \ No newline at end of file diff --git a/docs/models/anthropiccodeexecutionresult.mdx b/docs/models/anthropiccodeexecutionresult.mdx new file mode 100644 index 000000000..1c8bf52c5 --- /dev/null +++ b/docs/models/anthropiccodeexecutionresult.mdx @@ -0,0 +1,27 @@ +--- +title: "AnthropicCodeExecutionResult" +--- + +## Example Usage + +```typescript +import { AnthropicCodeExecutionResult } from "@openrouter/sdk/models"; + +let value: AnthropicCodeExecutionResult = { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "code_execution_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `content` | [models.AnthropicCodeExecutionOutput](../models/anthropiccodeexecutionoutput.mdx)[] | :heavy_check_mark: | N/A | +| `returnCode` | *number* | :heavy_check_mark: | N/A | +| `stderr` | *string* | :heavy_check_mark: | N/A | +| `stdout` | *string* | :heavy_check_mark: | N/A | +| `type` | *"code_execution_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccodeexecutiontoolresult.mdx b/docs/models/anthropiccodeexecutiontoolresult.mdx new file mode 100644 index 000000000..901a84cf3 --- /dev/null +++ b/docs/models/anthropiccodeexecutiontoolresult.mdx @@ -0,0 +1,29 @@ +--- +title: "AnthropicCodeExecutionToolResult" +--- + +## Example Usage + +```typescript +import { AnthropicCodeExecutionToolResult } from "@openrouter/sdk/models"; + +let value: AnthropicCodeExecutionToolResult = { + content: { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "code_execution_result", + }, + toolUseId: "", + type: "code_execution_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `content` | *models.AnthropicCodeExecutionContent* | :heavy_check_mark: | N/A | \{
"content": [],
"return_code": 0,
"stderr": "",
"stdout": "Hello",
"type": "code_execution_result"
} | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"code_execution_tool_result"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropiccodeexecutiontoolresulterror.mdx b/docs/models/anthropiccodeexecutiontoolresulterror.mdx new file mode 100644 index 000000000..4183e0113 --- /dev/null +++ b/docs/models/anthropiccodeexecutiontoolresulterror.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicCodeExecutionToolResultError" +--- + +## Example Usage + +```typescript +import { AnthropicCodeExecutionToolResultError } from "@openrouter/sdk/models"; + +let value: AnthropicCodeExecutionToolResultError = { + errorCode: "unavailable", + type: "code_execution_tool_result_error", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `errorCode` | [models.AnthropicServerToolErrorCode](../models/anthropicservertoolerrorcode.mdx) | :heavy_check_mark: | N/A | unavailable | +| `type` | *"code_execution_tool_result_error"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropiccompactionblock.mdx b/docs/models/anthropiccompactionblock.mdx new file mode 100644 index 000000000..c609e97d5 --- /dev/null +++ b/docs/models/anthropiccompactionblock.mdx @@ -0,0 +1,22 @@ +--- +title: "AnthropicCompactionBlock" +--- + +## Example Usage + +```typescript +import { AnthropicCompactionBlock } from "@openrouter/sdk/models"; + +let value: AnthropicCompactionBlock = { + content: "", + type: "compaction", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `content` | *string* | :heavy_check_mark: | N/A | +| `encryptedContent` | *string* | :heavy_minus_sign: | N/A | +| `type` | *"compaction"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccontainer.mdx b/docs/models/anthropiccontainer.mdx new file mode 100644 index 000000000..694abc320 --- /dev/null +++ b/docs/models/anthropiccontainer.mdx @@ -0,0 +1,22 @@ +--- +title: "AnthropicContainer" +--- + +## Example Usage + +```typescript +import { AnthropicContainer } from "@openrouter/sdk/models"; + +let value: AnthropicContainer = { + expiresAt: "2026-04-08T00:00:00Z", + id: "ctr_01abc", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `expiresAt` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `skills` | [models.AnthropicContainerSkill](../models/anthropiccontainerskill.mdx)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccontainerskill.mdx b/docs/models/anthropiccontainerskill.mdx new file mode 100644 index 000000000..9ae6d9117 --- /dev/null +++ b/docs/models/anthropiccontainerskill.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicContainerSkill" +--- + +## Example Usage + +```typescript +import { AnthropicContainerSkill } from "@openrouter/sdk/models"; + +let value: AnthropicContainerSkill = { + skillId: "pdf", + type: "anthropic", + version: "latest", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `skillId` | *string* | :heavy_check_mark: | N/A | +| `type` | [models.AnthropicContainerSkillType](../models/anthropiccontainerskilltype.mdx) | :heavy_check_mark: | N/A | +| `version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropiccontainerskilltype.mdx b/docs/models/anthropiccontainerskilltype.mdx new file mode 100644 index 000000000..dd45051de --- /dev/null +++ b/docs/models/anthropiccontainerskilltype.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicContainerSkillType" +--- + +## Example Usage + +```typescript +import { AnthropicContainerSkillType } from "@openrouter/sdk/models"; + +let value: AnthropicContainerSkillType = "custom"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"anthropic" | "custom" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropiccontainerupload.mdx b/docs/models/anthropiccontainerupload.mdx new file mode 100644 index 000000000..556ea75c1 --- /dev/null +++ b/docs/models/anthropiccontainerupload.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicContainerUpload" +--- + +## Example Usage + +```typescript +import { AnthropicContainerUpload } from "@openrouter/sdk/models"; + +let value: AnthropicContainerUpload = { + fileId: "", + type: "container_upload", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `type` | *"container_upload"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicdirectcaller.mdx b/docs/models/anthropicdirectcaller.mdx new file mode 100644 index 000000000..79c4f2e5d --- /dev/null +++ b/docs/models/anthropicdirectcaller.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicDirectCaller" +--- + +## Example Usage + +```typescript +import { AnthropicDirectCaller } from "@openrouter/sdk/models"; + +let value: AnthropicDirectCaller = { + type: "direct", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *"direct"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicdocumentblock.mdx b/docs/models/anthropicdocumentblock.mdx new file mode 100644 index 000000000..186bda94c --- /dev/null +++ b/docs/models/anthropicdocumentblock.mdx @@ -0,0 +1,28 @@ +--- +title: "AnthropicDocumentBlock" +--- + +## Example Usage + +```typescript +import { AnthropicDocumentBlock } from "@openrouter/sdk/models"; + +let value: AnthropicDocumentBlock = { + source: { + data: "Hello, world!", + mediaType: "text/plain", + type: "text", + }, + title: null, + type: "document", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `citations` | [models.AnthropicCitationsConfig](../models/anthropiccitationsconfig.mdx) | :heavy_minus_sign: | N/A | \{
"enabled": true
} | +| `source` | *models.AnthropicDocumentBlockSource* | :heavy_check_mark: | N/A | | +| `title` | *string* | :heavy_check_mark: | N/A | | +| `type` | [models.AnthropicDocumentBlockType](../models/anthropicdocumentblocktype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropicdocumentblocksource.mdx b/docs/models/anthropicdocumentblocksource.mdx new file mode 100644 index 000000000..6bef68fad --- /dev/null +++ b/docs/models/anthropicdocumentblocksource.mdx @@ -0,0 +1,26 @@ +--- +title: "AnthropicDocumentBlockSource" +--- + +## Supported Types + +### `models.AnthropicBase64PdfSource` + +```typescript +const value: models.AnthropicBase64PdfSource = { + data: "JVBERi0x...", + mediaType: "application/pdf", + type: "base64", +}; +``` + +### `models.AnthropicPlainTextSource` + +```typescript +const value: models.AnthropicPlainTextSource = { + data: "Hello, world!", + mediaType: "text/plain", + type: "text", +}; +``` + diff --git a/docs/models/anthropicdocumentblocktype.mdx b/docs/models/anthropicdocumentblocktype.mdx new file mode 100644 index 000000000..cac3e9c5b --- /dev/null +++ b/docs/models/anthropicdocumentblocktype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicDocumentBlockType" +--- + +## Example Usage + +```typescript +import { AnthropicDocumentBlockType } from "@openrouter/sdk/models"; + +let value: AnthropicDocumentBlockType = "document"; +``` + +## Values + +```typescript +"document" +``` \ No newline at end of file diff --git a/docs/models/anthropicencryptedcodeexecutionresult.mdx b/docs/models/anthropicencryptedcodeexecutionresult.mdx new file mode 100644 index 000000000..b944dd5dc --- /dev/null +++ b/docs/models/anthropicencryptedcodeexecutionresult.mdx @@ -0,0 +1,27 @@ +--- +title: "AnthropicEncryptedCodeExecutionResult" +--- + +## Example Usage + +```typescript +import { AnthropicEncryptedCodeExecutionResult } from "@openrouter/sdk/models"; + +let value: AnthropicEncryptedCodeExecutionResult = { + content: [], + encryptedStdout: "", + returnCode: 0, + stderr: "", + type: "encrypted_code_execution_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `content` | [models.AnthropicCodeExecutionOutput](../models/anthropiccodeexecutionoutput.mdx)[] | :heavy_check_mark: | N/A | +| `encryptedStdout` | *string* | :heavy_check_mark: | N/A | +| `returnCode` | *number* | :heavy_check_mark: | N/A | +| `stderr` | *string* | :heavy_check_mark: | N/A | +| `type` | *"encrypted_code_execution_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicinputtransformation.mdx b/docs/models/anthropicinputtransformation.mdx new file mode 100644 index 000000000..bfba8c5d4 --- /dev/null +++ b/docs/models/anthropicinputtransformation.mdx @@ -0,0 +1,24 @@ +--- +title: "AnthropicInputTransformation" +--- + +A server-side transformation Anthropic applied to the request input + +## Example Usage + +```typescript +import { AnthropicInputTransformation } from "@openrouter/sdk/models"; + +let value: AnthropicInputTransformation = { + type: "thinking_dropped", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `path` | *string* | :heavy_minus_sign: | N/A | | +| `reason` | *string* | :heavy_minus_sign: | N/A | | +| `type` | *string* | :heavy_check_mark: | N/A | | +| `additionalProperties` | Record\ | :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/models/anthropicoutputtokensdetails.mdx b/docs/models/anthropicoutputtokensdetails.mdx new file mode 100644 index 000000000..f1862c6b9 --- /dev/null +++ b/docs/models/anthropicoutputtokensdetails.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicOutputTokensDetails" +--- + +## Example Usage + +```typescript +import { AnthropicOutputTokensDetails } from "@openrouter/sdk/models"; + +let value: AnthropicOutputTokensDetails = { + thinkingTokens: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `thinkingTokens` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicplaintextsource.mdx b/docs/models/anthropicplaintextsource.mdx index 0539b7a4a..b591d27bc 100644 --- a/docs/models/anthropicplaintextsource.mdx +++ b/docs/models/anthropicplaintextsource.mdx @@ -20,4 +20,4 @@ let value: AnthropicPlainTextSource = { | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `data` | *string* | :heavy_check_mark: | N/A | | `mediaType` | [models.AnthropicPlainTextSourceMediaType](../models/anthropicplaintextsourcemediatype.mdx) | :heavy_check_mark: | N/A | -| `type` | *"text"* | :heavy_check_mark: | N/A | \ No newline at end of file +| `type` | [models.AnthropicPlainTextSourceType](../models/anthropicplaintextsourcetype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicplaintextsourcetype.mdx b/docs/models/anthropicplaintextsourcetype.mdx new file mode 100644 index 000000000..4f421c1d0 --- /dev/null +++ b/docs/models/anthropicplaintextsourcetype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicPlainTextSourceType" +--- + +## Example Usage + +```typescript +import { AnthropicPlainTextSourceType } from "@openrouter/sdk/models"; + +let value: AnthropicPlainTextSourceType = "text"; +``` + +## Values + +```typescript +"text" +``` \ No newline at end of file diff --git a/docs/models/anthropicredactedthinkingblock.mdx b/docs/models/anthropicredactedthinkingblock.mdx new file mode 100644 index 000000000..887c61b1d --- /dev/null +++ b/docs/models/anthropicredactedthinkingblock.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicRedactedThinkingBlock" +--- + +## Example Usage + +```typescript +import { AnthropicRedactedThinkingBlock } from "@openrouter/sdk/models"; + +let value: AnthropicRedactedThinkingBlock = { + data: "", + type: "redacted_thinking", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `data` | *string* | :heavy_check_mark: | N/A | +| `type` | *"redacted_thinking"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicrefusalstopdetails.mdx b/docs/models/anthropicrefusalstopdetails.mdx new file mode 100644 index 000000000..4701d209e --- /dev/null +++ b/docs/models/anthropicrefusalstopdetails.mdx @@ -0,0 +1,25 @@ +--- +title: "AnthropicRefusalStopDetails" +--- + +Structured information about a refusal + +## Example Usage + +```typescript +import { AnthropicRefusalStopDetails } from "@openrouter/sdk/models"; + +let value: AnthropicRefusalStopDetails = { + category: "cyber", + explanation: "The request was refused due to policy.", + type: "refusal", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `category` | [models.AnthropicRefusalStopDetailsCategory](../models/anthropicrefusalstopdetailscategory.mdx) | :heavy_check_mark: | N/A | +| `explanation` | *string* | :heavy_check_mark: | N/A | +| `type` | [models.AnthropicRefusalStopDetailsType](../models/anthropicrefusalstopdetailstype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicrefusalstopdetailscategory.mdx b/docs/models/anthropicrefusalstopdetailscategory.mdx new file mode 100644 index 000000000..f4bcc0257 --- /dev/null +++ b/docs/models/anthropicrefusalstopdetailscategory.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicRefusalStopDetailsCategory" +--- + +## Example Usage + +```typescript +import { AnthropicRefusalStopDetailsCategory } from "@openrouter/sdk/models"; + +let value: AnthropicRefusalStopDetailsCategory = "bio"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"cyber" | "bio" | "frontier_llm" | "reasoning_extraction" | "general_harms" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropicrefusalstopdetailstype.mdx b/docs/models/anthropicrefusalstopdetailstype.mdx new file mode 100644 index 000000000..5cde916be --- /dev/null +++ b/docs/models/anthropicrefusalstopdetailstype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicRefusalStopDetailsType" +--- + +## Example Usage + +```typescript +import { AnthropicRefusalStopDetailsType } from "@openrouter/sdk/models"; + +let value: AnthropicRefusalStopDetailsType = "refusal"; +``` + +## Values + +```typescript +"refusal" +``` \ No newline at end of file diff --git a/docs/models/anthropicservertoolerrorcode.mdx b/docs/models/anthropicservertoolerrorcode.mdx new file mode 100644 index 000000000..acf46df62 --- /dev/null +++ b/docs/models/anthropicservertoolerrorcode.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicServerToolErrorCode" +--- + +## Example Usage + +```typescript +import { AnthropicServerToolErrorCode } from "@openrouter/sdk/models"; + +let value: AnthropicServerToolErrorCode = "unavailable"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"invalid_tool_input" | "unavailable" | "too_many_requests" | "execution_time_exceeded" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropicservertoolusage.mdx b/docs/models/anthropicservertoolusage.mdx new file mode 100644 index 000000000..a2af3124f --- /dev/null +++ b/docs/models/anthropicservertoolusage.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicServerToolUsage" +--- + +## Example Usage + +```typescript +import { AnthropicServerToolUsage } from "@openrouter/sdk/models"; + +let value: AnthropicServerToolUsage = { + webFetchRequests: 0, + webSearchRequests: 1, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `webFetchRequests` | *number* | :heavy_check_mark: | N/A | +| `webSearchRequests` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicservicetier.mdx b/docs/models/anthropicservicetier.mdx new file mode 100644 index 000000000..6a3e1664a --- /dev/null +++ b/docs/models/anthropicservicetier.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicServiceTier" +--- + +## Example Usage + +```typescript +import { AnthropicServiceTier } from "@openrouter/sdk/models"; + +let value: AnthropicServiceTier = "standard"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"standard" | "priority" | "batch" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropictextblock.mdx b/docs/models/anthropictextblock.mdx new file mode 100644 index 000000000..4397e7346 --- /dev/null +++ b/docs/models/anthropictextblock.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicTextBlock" +--- + +## Example Usage + +```typescript +import { AnthropicTextBlock } from "@openrouter/sdk/models"; + +let value: AnthropicTextBlock = { + citations: null, + text: "Hello, world!", + type: "text", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `citations` | *models.AnthropicTextCitation*[] | :heavy_check_mark: | N/A | +| `text` | *string* | :heavy_check_mark: | N/A | +| `type` | *"text"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropictextcitation.mdx b/docs/models/anthropictextcitation.mdx new file mode 100644 index 000000000..12065200d --- /dev/null +++ b/docs/models/anthropictextcitation.mdx @@ -0,0 +1,74 @@ +--- +title: "AnthropicTextCitation" +--- + +## Supported Types + +### `models.AnthropicCitationCharLocation` + +```typescript +const value: models.AnthropicCitationCharLocation = { + citedText: "Example text", + documentIndex: 0, + documentTitle: null, + endCharIndex: 10, + fileId: null, + startCharIndex: 0, + type: "char_location", +}; +``` + +### `models.AnthropicCitationContentBlockLocation` + +```typescript +const value: models.AnthropicCitationContentBlockLocation = { + citedText: "Example text", + documentIndex: 0, + documentTitle: null, + endBlockIndex: 604853, + fileId: null, + startBlockIndex: 996471, + type: "content_block_location", +}; +``` + +### `models.AnthropicCitationPageLocation` + +```typescript +const value: models.AnthropicCitationPageLocation = { + citedText: "Example text", + documentIndex: 0, + documentTitle: null, + endPageNumber: 431333, + fileId: null, + startPageNumber: 44719, + type: "page_location", +}; +``` + +### `models.AnthropicCitationSearchResultLocation` + +```typescript +const value: models.AnthropicCitationSearchResultLocation = { + citedText: "Example text", + endBlockIndex: 782840, + searchResultIndex: 96845, + source: "", + startBlockIndex: 145706, + title: "", + type: "search_result_location", +}; +``` + +### `models.AnthropicCitationWebSearchResultLocation` + +```typescript +const value: models.AnthropicCitationWebSearchResultLocation = { + citedText: "Example text", + encryptedIndex: "", + title: "", + type: "web_search_result_location", + url: "https://baggy-disconnection.net", +}; +``` + diff --git a/docs/models/anthropictexteditorcodeexecutioncontent.mdx b/docs/models/anthropictexteditorcodeexecutioncontent.mdx new file mode 100644 index 000000000..f3e5849ae --- /dev/null +++ b/docs/models/anthropictexteditorcodeexecutioncontent.mdx @@ -0,0 +1,54 @@ +--- +title: "AnthropicTextEditorCodeExecutionContent" +--- + +## Supported Types + +### `models.AnthropicTextEditorCodeExecutionCreateResult` + +```typescript +const value: models.AnthropicTextEditorCodeExecutionCreateResult = { + isFileUpdate: false, + type: "text_editor_code_execution_create_result", +}; +``` + +### `models.AnthropicTextEditorCodeExecutionStrReplaceResult` + +```typescript +const value: models.AnthropicTextEditorCodeExecutionStrReplaceResult = { + lines: [ + "", + "", + ], + newLines: null, + newStart: 446855, + oldLines: 449453, + oldStart: 595089, + type: "text_editor_code_execution_str_replace_result", +}; +``` + +### `models.AnthropicTextEditorCodeExecutionToolResultError` + +```typescript +const value: models.AnthropicTextEditorCodeExecutionToolResultError = { + errorCode: "invalid_tool_input", + errorMessage: "", + type: "text_editor_code_execution_tool_result_error", +}; +``` + +### `models.AnthropicTextEditorCodeExecutionViewResult` + +```typescript +const value: models.AnthropicTextEditorCodeExecutionViewResult = { + content: "file content", + fileType: "text", + numLines: 10, + startLine: 1, + totalLines: 10, + type: "text_editor_code_execution_view_result", +}; +``` + diff --git a/docs/models/anthropictexteditorcodeexecutioncreateresult.mdx b/docs/models/anthropictexteditorcodeexecutioncreateresult.mdx new file mode 100644 index 000000000..f645f5715 --- /dev/null +++ b/docs/models/anthropictexteditorcodeexecutioncreateresult.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicTextEditorCodeExecutionCreateResult" +--- + +## Example Usage + +```typescript +import { AnthropicTextEditorCodeExecutionCreateResult } from "@openrouter/sdk/models"; + +let value: AnthropicTextEditorCodeExecutionCreateResult = { + isFileUpdate: false, + type: "text_editor_code_execution_create_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `isFileUpdate` | *boolean* | :heavy_check_mark: | N/A | +| `type` | *"text_editor_code_execution_create_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropictexteditorcodeexecutionstrreplaceresult.mdx b/docs/models/anthropictexteditorcodeexecutionstrreplaceresult.mdx new file mode 100644 index 000000000..9131976da --- /dev/null +++ b/docs/models/anthropictexteditorcodeexecutionstrreplaceresult.mdx @@ -0,0 +1,29 @@ +--- +title: "AnthropicTextEditorCodeExecutionStrReplaceResult" +--- + +## Example Usage + +```typescript +import { AnthropicTextEditorCodeExecutionStrReplaceResult } from "@openrouter/sdk/models"; + +let value: AnthropicTextEditorCodeExecutionStrReplaceResult = { + lines: null, + newLines: 10088, + newStart: null, + oldLines: 655714, + oldStart: 499586, + type: "text_editor_code_execution_str_replace_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `lines` | *string*[] | :heavy_check_mark: | N/A | +| `newLines` | *number* | :heavy_check_mark: | N/A | +| `newStart` | *number* | :heavy_check_mark: | N/A | +| `oldLines` | *number* | :heavy_check_mark: | N/A | +| `oldStart` | *number* | :heavy_check_mark: | N/A | +| `type` | *"text_editor_code_execution_str_replace_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropictexteditorcodeexecutiontoolresult.mdx b/docs/models/anthropictexteditorcodeexecutiontoolresult.mdx new file mode 100644 index 000000000..9c1d6a7e3 --- /dev/null +++ b/docs/models/anthropictexteditorcodeexecutiontoolresult.mdx @@ -0,0 +1,30 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResult" +--- + +## Example Usage + +```typescript +import { AnthropicTextEditorCodeExecutionToolResult } from "@openrouter/sdk/models"; + +let value: AnthropicTextEditorCodeExecutionToolResult = { + content: { + content: "file content", + fileType: "text", + numLines: 10, + startLine: 1, + totalLines: 10, + type: "text_editor_code_execution_view_result", + }, + toolUseId: "", + type: "text_editor_code_execution_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | *models.AnthropicTextEditorCodeExecutionContent* | :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"
} | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"text_editor_code_execution_tool_result"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropictexteditorcodeexecutiontoolresulterror.mdx b/docs/models/anthropictexteditorcodeexecutiontoolresulterror.mdx new file mode 100644 index 000000000..434f11435 --- /dev/null +++ b/docs/models/anthropictexteditorcodeexecutiontoolresulterror.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResultError" +--- + +## Example Usage + +```typescript +import { AnthropicTextEditorCodeExecutionToolResultError } from "@openrouter/sdk/models"; + +let value: AnthropicTextEditorCodeExecutionToolResultError = { + errorCode: "unavailable", + errorMessage: "", + type: "text_editor_code_execution_tool_result_error", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `errorCode` | [models.AnthropicTextEditorCodeExecutionToolResultErrorErrorCode](../models/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `errorMessage` | *string* | :heavy_check_mark: | N/A | +| `type` | *"text_editor_code_execution_tool_result_error"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx b/docs/models/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx new file mode 100644 index 000000000..282be51c8 --- /dev/null +++ b/docs/models/anthropictexteditorcodeexecutiontoolresulterrorerrorcode.mdx @@ -0,0 +1,20 @@ +--- +title: "AnthropicTextEditorCodeExecutionToolResultErrorErrorCode" +--- + +## Example Usage + +```typescript +import { AnthropicTextEditorCodeExecutionToolResultErrorErrorCode } from "@openrouter/sdk/models"; + +let value: AnthropicTextEditorCodeExecutionToolResultErrorErrorCode = + "file_not_found"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"invalid_tool_input" | "unavailable" | "too_many_requests" | "execution_time_exceeded" | "file_not_found" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropictexteditorcodeexecutionviewresult.mdx b/docs/models/anthropictexteditorcodeexecutionviewresult.mdx new file mode 100644 index 000000000..d721c5b74 --- /dev/null +++ b/docs/models/anthropictexteditorcodeexecutionviewresult.mdx @@ -0,0 +1,29 @@ +--- +title: "AnthropicTextEditorCodeExecutionViewResult" +--- + +## Example Usage + +```typescript +import { AnthropicTextEditorCodeExecutionViewResult } from "@openrouter/sdk/models"; + +let value: AnthropicTextEditorCodeExecutionViewResult = { + content: "file content", + fileType: "text", + numLines: 10, + startLine: 1, + totalLines: 10, + type: "text_editor_code_execution_view_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `content` | *string* | :heavy_check_mark: | N/A | +| `fileType` | [models.FileType](../models/filetype.mdx) | :heavy_check_mark: | N/A | +| `numLines` | *number* | :heavy_check_mark: | N/A | +| `startLine` | *number* | :heavy_check_mark: | N/A | +| `totalLines` | *number* | :heavy_check_mark: | N/A | +| `type` | *"text_editor_code_execution_view_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicthinkingblock.mdx b/docs/models/anthropicthinkingblock.mdx new file mode 100644 index 000000000..9e42fcaae --- /dev/null +++ b/docs/models/anthropicthinkingblock.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicThinkingBlock" +--- + +## Example Usage + +```typescript +import { AnthropicThinkingBlock } from "@openrouter/sdk/models"; + +let value: AnthropicThinkingBlock = { + signature: "", + thinking: "", + type: "thinking", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `signature` | *string* | :heavy_check_mark: | N/A | +| `thinking` | *string* | :heavy_check_mark: | N/A | +| `type` | *"thinking"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropictoolreference.mdx b/docs/models/anthropictoolreference.mdx new file mode 100644 index 000000000..68537c494 --- /dev/null +++ b/docs/models/anthropictoolreference.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicToolReference" +--- + +## Example Usage + +```typescript +import { AnthropicToolReference } from "@openrouter/sdk/models"; + +let value: AnthropicToolReference = { + toolName: "my_tool", + type: "tool_reference", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `toolName` | *string* | :heavy_check_mark: | N/A | +| `type` | [models.AnthropicToolReferenceType](../models/anthropictoolreferencetype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropictoolreferencetype.mdx b/docs/models/anthropictoolreferencetype.mdx new file mode 100644 index 000000000..54719588b --- /dev/null +++ b/docs/models/anthropictoolreferencetype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicToolReferenceType" +--- + +## Example Usage + +```typescript +import { AnthropicToolReferenceType } from "@openrouter/sdk/models"; + +let value: AnthropicToolReferenceType = "tool_reference"; +``` + +## Values + +```typescript +"tool_reference" +``` \ No newline at end of file diff --git a/docs/models/anthropictoolsearchcontent.mdx b/docs/models/anthropictoolsearchcontent.mdx new file mode 100644 index 000000000..34715d4c0 --- /dev/null +++ b/docs/models/anthropictoolsearchcontent.mdx @@ -0,0 +1,30 @@ +--- +title: "AnthropicToolSearchContent" +--- + +## Supported Types + +### `models.AnthropicToolSearchResultError` + +```typescript +const value: models.AnthropicToolSearchResultError = { + errorCode: "unavailable", + errorMessage: "", + type: "tool_search_tool_result_error", +}; +``` + +### `models.AnthropicToolSearchResult` + +```typescript +const value: models.AnthropicToolSearchResult = { + toolReferences: [ + { + toolName: "my_tool", + type: "tool_reference", + }, + ], + type: "tool_search_tool_search_result", +}; +``` + diff --git a/docs/models/anthropictoolsearchresult.mdx b/docs/models/anthropictoolsearchresult.mdx new file mode 100644 index 000000000..3bc89797d --- /dev/null +++ b/docs/models/anthropictoolsearchresult.mdx @@ -0,0 +1,26 @@ +--- +title: "AnthropicToolSearchResult" +--- + +## Example Usage + +```typescript +import { AnthropicToolSearchResult } from "@openrouter/sdk/models"; + +let value: AnthropicToolSearchResult = { + toolReferences: [ + { + toolName: "my_tool", + type: "tool_reference", + }, + ], + type: "tool_search_tool_search_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `toolReferences` | [models.AnthropicToolReference](../models/anthropictoolreference.mdx)[] | :heavy_check_mark: | N/A | +| `type` | *"tool_search_tool_search_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropictoolsearchresulterror.mdx b/docs/models/anthropictoolsearchresulterror.mdx new file mode 100644 index 000000000..cfe6365d1 --- /dev/null +++ b/docs/models/anthropictoolsearchresulterror.mdx @@ -0,0 +1,23 @@ +--- +title: "AnthropicToolSearchResultError" +--- + +## Example Usage + +```typescript +import { AnthropicToolSearchResultError } from "@openrouter/sdk/models"; + +let value: AnthropicToolSearchResultError = { + errorCode: "unavailable", + errorMessage: "", + type: "tool_search_tool_result_error", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `errorCode` | [models.AnthropicServerToolErrorCode](../models/anthropicservertoolerrorcode.mdx) | :heavy_check_mark: | N/A | unavailable | +| `errorMessage` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"tool_search_tool_result_error"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropictoolsearchtoolresult.mdx b/docs/models/anthropictoolsearchtoolresult.mdx new file mode 100644 index 000000000..897196bd8 --- /dev/null +++ b/docs/models/anthropictoolsearchtoolresult.mdx @@ -0,0 +1,31 @@ +--- +title: "AnthropicToolSearchToolResult" +--- + +## Example Usage + +```typescript +import { AnthropicToolSearchToolResult } from "@openrouter/sdk/models"; + +let value: AnthropicToolSearchToolResult = { + content: { + toolReferences: [ + { + toolName: "my_tool", + type: "tool_reference", + }, + ], + type: "tool_search_tool_search_result", + }, + toolUseId: "", + type: "tool_search_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `content` | *models.AnthropicToolSearchContent* | :heavy_check_mark: | N/A | \{
"tool_references": [
\{
"tool_name": "my_tool",
"type": "tool_reference"
}
],
"type": "tool_search_tool_search_result"
} | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"tool_search_tool_result"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropictooluseblock.mdx b/docs/models/anthropictooluseblock.mdx new file mode 100644 index 000000000..e3e3ddc31 --- /dev/null +++ b/docs/models/anthropictooluseblock.mdx @@ -0,0 +1,28 @@ +--- +title: "AnthropicToolUseBlock" +--- + +## Example Usage + +```typescript +import { AnthropicToolUseBlock } from "@openrouter/sdk/models"; + +let value: AnthropicToolUseBlock = { + caller: { + type: "direct", + }, + id: "", + name: "", + type: "tool_use", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `caller` | *models.AnthropicCaller* | :heavy_check_mark: | N/A | \{
"type": "direct"
} | +| `id` | *string* | :heavy_check_mark: | N/A | | +| `input` | *any* | :heavy_minus_sign: | N/A | | +| `name` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"tool_use"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropicwebfetchblock.mdx b/docs/models/anthropicwebfetchblock.mdx new file mode 100644 index 000000000..ac0e6d3f2 --- /dev/null +++ b/docs/models/anthropicwebfetchblock.mdx @@ -0,0 +1,33 @@ +--- +title: "AnthropicWebFetchBlock" +--- + +## Example Usage + +```typescript +import { AnthropicWebFetchBlock } from "@openrouter/sdk/models"; + +let value: AnthropicWebFetchBlock = { + content: { + source: { + data: "", + mediaType: "text/plain", + type: "text", + }, + title: null, + type: "document", + }, + retrievedAt: null, + type: "web_fetch_result", + url: "https://example.com", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | [models.AnthropicDocumentBlock](../models/anthropicdocumentblock.mdx) | :heavy_check_mark: | N/A | \{
"citations": null,
"source": \{
"data": "Hello, world!",
"media_type": "text/plain",
"type": "text"
},
"title": null,
"type": "document"
} | +| `retrievedAt` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"web_fetch_result"* | :heavy_check_mark: | N/A | | +| `url` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropicwebfetchcontent.mdx b/docs/models/anthropicwebfetchcontent.mdx new file mode 100644 index 000000000..543e4b8b7 --- /dev/null +++ b/docs/models/anthropicwebfetchcontent.mdx @@ -0,0 +1,34 @@ +--- +title: "AnthropicWebFetchContent" +--- + +## Supported Types + +### `models.AnthropicWebFetchBlock` + +```typescript +const value: models.AnthropicWebFetchBlock = { + content: { + source: { + data: "", + mediaType: "text/plain", + type: "text", + }, + title: null, + type: "document", + }, + retrievedAt: null, + type: "web_fetch_result", + url: "https://example.com", +}; +``` + +### `models.AnthropicWebFetchToolResultError` + +```typescript +const value: models.AnthropicWebFetchToolResultError = { + errorCode: "unsupported_content_type", + type: "web_fetch_tool_result_error", +}; +``` + diff --git a/docs/models/anthropicwebfetchtoolresult.mdx b/docs/models/anthropicwebfetchtoolresult.mdx new file mode 100644 index 000000000..3f0652bde --- /dev/null +++ b/docs/models/anthropicwebfetchtoolresult.mdx @@ -0,0 +1,40 @@ +--- +title: "AnthropicWebFetchToolResult" +--- + +## Example Usage + +```typescript +import { AnthropicWebFetchToolResult } from "@openrouter/sdk/models"; + +let value: AnthropicWebFetchToolResult = { + caller: { + type: "direct", + }, + content: { + content: { + source: { + data: "", + mediaType: "text/plain", + type: "text", + }, + title: null, + type: "document", + }, + retrievedAt: null, + type: "web_fetch_result", + url: "https://example.com", + }, + toolUseId: "", + type: "web_fetch_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `caller` | *models.AnthropicCaller* | :heavy_check_mark: | N/A | \{
"type": "direct"
} | +| `content` | *models.AnthropicWebFetchContent* | :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"
} | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"web_fetch_tool_result"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropicwebfetchtoolresulterror.mdx b/docs/models/anthropicwebfetchtoolresulterror.mdx new file mode 100644 index 000000000..552e27153 --- /dev/null +++ b/docs/models/anthropicwebfetchtoolresulterror.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicWebFetchToolResultError" +--- + +## Example Usage + +```typescript +import { AnthropicWebFetchToolResultError } from "@openrouter/sdk/models"; + +let value: AnthropicWebFetchToolResultError = { + errorCode: "invalid_tool_input", + type: "web_fetch_tool_result_error", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `errorCode` | [models.AnthropicWebFetchToolResultErrorErrorCode](../models/anthropicwebfetchtoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | *"web_fetch_tool_result_error"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicwebfetchtoolresulterrorerrorcode.mdx b/docs/models/anthropicwebfetchtoolresulterrorerrorcode.mdx new file mode 100644 index 000000000..dae86fcab --- /dev/null +++ b/docs/models/anthropicwebfetchtoolresulterrorerrorcode.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicWebFetchToolResultErrorErrorCode" +--- + +## Example Usage + +```typescript +import { AnthropicWebFetchToolResultErrorErrorCode } from "@openrouter/sdk/models"; + +let value: AnthropicWebFetchToolResultErrorErrorCode = "max_uses_exceeded"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"invalid_tool_input" | "url_too_long" | "url_not_allowed" | "url_not_accessible" | "unsupported_content_type" | "too_many_requests" | "max_uses_exceeded" | "unavailable" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropicwebsearchresult.mdx b/docs/models/anthropicwebsearchresult.mdx new file mode 100644 index 000000000..55c8f774e --- /dev/null +++ b/docs/models/anthropicwebsearchresult.mdx @@ -0,0 +1,27 @@ +--- +title: "AnthropicWebSearchResult" +--- + +## Example Usage + +```typescript +import { AnthropicWebSearchResult } from "@openrouter/sdk/models"; + +let value: AnthropicWebSearchResult = { + encryptedContent: "enc_content_0", + pageAge: null, + title: "Example Page", + type: "web_search_result", + url: "https://example.com", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `encryptedContent` | *string* | :heavy_check_mark: | N/A | +| `pageAge` | *string* | :heavy_check_mark: | N/A | +| `title` | *string* | :heavy_check_mark: | N/A | +| `type` | [models.AnthropicWebSearchResultType](../models/anthropicwebsearchresulttype.mdx) | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicwebsearchresulttype.mdx b/docs/models/anthropicwebsearchresulttype.mdx new file mode 100644 index 000000000..741cf1ffd --- /dev/null +++ b/docs/models/anthropicwebsearchresulttype.mdx @@ -0,0 +1,17 @@ +--- +title: "AnthropicWebSearchResultType" +--- + +## Example Usage + +```typescript +import { AnthropicWebSearchResultType } from "@openrouter/sdk/models"; + +let value: AnthropicWebSearchResultType = "web_search_result"; +``` + +## Values + +```typescript +"web_search_result" +``` \ No newline at end of file diff --git a/docs/models/anthropicwebsearchtoolresult.mdx b/docs/models/anthropicwebsearchtoolresult.mdx new file mode 100644 index 000000000..3204479a8 --- /dev/null +++ b/docs/models/anthropicwebsearchtoolresult.mdx @@ -0,0 +1,30 @@ +--- +title: "AnthropicWebSearchToolResult" +--- + +## Example Usage + +```typescript +import { AnthropicWebSearchToolResult } from "@openrouter/sdk/models"; + +let value: AnthropicWebSearchToolResult = { + caller: { + type: "direct", + }, + content: { + errorCode: "unavailable", + type: "web_search_tool_result_error", + }, + toolUseId: "", + type: "web_search_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `caller` | *models.AnthropicCaller* | :heavy_check_mark: | N/A | \{
"type": "direct"
} | +| `content` | *models.AnthropicWebSearchToolResultContent* | :heavy_check_mark: | N/A | | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"web_search_tool_result"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/anthropicwebsearchtoolresultcontent.mdx b/docs/models/anthropicwebsearchtoolresultcontent.mdx new file mode 100644 index 000000000..af6d224a4 --- /dev/null +++ b/docs/models/anthropicwebsearchtoolresultcontent.mdx @@ -0,0 +1,29 @@ +--- +title: "AnthropicWebSearchToolResultContent" +--- + +## Supported Types + +### `models.AnthropicWebSearchResult[]` + +```typescript +const value: models.AnthropicWebSearchResult[] = [ + { + encryptedContent: "enc_content_0", + pageAge: null, + title: "Example Page", + type: "web_search_result", + url: "https://example.com", + }, +]; +``` + +### `models.AnthropicWebSearchToolResultError` + +```typescript +const value: models.AnthropicWebSearchToolResultError = { + errorCode: "unavailable", + type: "web_search_tool_result_error", +}; +``` + diff --git a/docs/models/anthropicwebsearchtoolresulterror.mdx b/docs/models/anthropicwebsearchtoolresulterror.mdx new file mode 100644 index 000000000..fe42514e8 --- /dev/null +++ b/docs/models/anthropicwebsearchtoolresulterror.mdx @@ -0,0 +1,21 @@ +--- +title: "AnthropicWebSearchToolResultError" +--- + +## Example Usage + +```typescript +import { AnthropicWebSearchToolResultError } from "@openrouter/sdk/models"; + +let value: AnthropicWebSearchToolResultError = { + errorCode: "unavailable", + type: "web_search_tool_result_error", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `errorCode` | [models.AnthropicWebSearchToolResultErrorErrorCode](../models/anthropicwebsearchtoolresulterrorerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | [models.AnthropicWebSearchToolResultErrorType](../models/anthropicwebsearchtoolresulterrortype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/anthropicwebsearchtoolresulterrorerrorcode.mdx b/docs/models/anthropicwebsearchtoolresulterrorerrorcode.mdx new file mode 100644 index 000000000..fd50cd56c --- /dev/null +++ b/docs/models/anthropicwebsearchtoolresulterrorerrorcode.mdx @@ -0,0 +1,19 @@ +--- +title: "AnthropicWebSearchToolResultErrorErrorCode" +--- + +## Example Usage + +```typescript +import { AnthropicWebSearchToolResultErrorErrorCode } from "@openrouter/sdk/models"; + +let value: AnthropicWebSearchToolResultErrorErrorCode = "request_too_large"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"invalid_tool_input" | "unavailable" | "max_uses_exceeded" | "too_many_requests" | "query_too_long" | "request_too_large" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/anthropicwebsearchtoolresulterrortype.mdx b/docs/models/anthropicwebsearchtoolresulterrortype.mdx new file mode 100644 index 000000000..eb7780a9b --- /dev/null +++ b/docs/models/anthropicwebsearchtoolresulterrortype.mdx @@ -0,0 +1,18 @@ +--- +title: "AnthropicWebSearchToolResultErrorType" +--- + +## Example Usage + +```typescript +import { AnthropicWebSearchToolResultErrorType } from "@openrouter/sdk/models"; + +let value: AnthropicWebSearchToolResultErrorType = + "web_search_tool_result_error"; +``` + +## Values + +```typescript +"web_search_tool_result_error" +``` \ No newline at end of file diff --git a/docs/models/batchdeletedobject.mdx b/docs/models/batchdeletedobject.mdx new file mode 100644 index 000000000..45d5fd1e6 --- /dev/null +++ b/docs/models/batchdeletedobject.mdx @@ -0,0 +1,27 @@ +--- +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. + +## Example Usage + +```typescript +import { BatchDeletedObject } from "@openrouter/sdk/models"; + +let value: BatchDeletedObject = { + deletion: { + openrouter: "deleted", + }, + id: "batch_abc123", + object: "batch", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `deletion` | [models.BatchDeletionTargets](../models/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` | *string* | :heavy_check_mark: | N/A | batch_abc123 | +| `object` | [models.BatchDeletedObjectObject](../models/batchdeletedobjectobject.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/batchdeletedobjectobject.mdx b/docs/models/batchdeletedobjectobject.mdx new file mode 100644 index 000000000..c342a9009 --- /dev/null +++ b/docs/models/batchdeletedobjectobject.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchDeletedObjectObject" +--- + +## Example Usage + +```typescript +import { BatchDeletedObjectObject } from "@openrouter/sdk/models"; + +let value: BatchDeletedObjectObject = "batch"; +``` + +## Values + +```typescript +"batch" +``` \ No newline at end of file diff --git a/docs/models/batchdeletionoutcome.mdx b/docs/models/batchdeletionoutcome.mdx new file mode 100644 index 000000000..5febaa7a2 --- /dev/null +++ b/docs/models/batchdeletionoutcome.mdx @@ -0,0 +1,21 @@ +--- +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 + +```typescript +import { BatchDeletionOutcome } from "@openrouter/sdk/models"; + +let value: BatchDeletionOutcome = "deleted"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"deleted" | "unsupported" | "not_applicable" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/batchdeletiontargets.mdx b/docs/models/batchdeletiontargets.mdx new file mode 100644 index 000000000..952196ec9 --- /dev/null +++ b/docs/models/batchdeletiontargets.mdx @@ -0,0 +1,22 @@ +--- +title: "BatchDeletionTargets" +--- + +OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome. + +## Example Usage + +```typescript +import { BatchDeletionTargets } from "@openrouter/sdk/models"; + +let value: BatchDeletionTargets = { + openrouter: "deleted", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `openrouter` | [models.Openrouter](../models/openrouter.mdx) | :heavy_check_mark: | OpenRouter-held request and result artifacts were purged. | +| `upstream` | [models.Upstream](../models/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/models/batcherrorresponseerror.mdx b/docs/models/batcherrorresponseerror.mdx new file mode 100644 index 000000000..a12aad15c --- /dev/null +++ b/docs/models/batcherrorresponseerror.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchErrorResponseError" +--- + +## Example Usage + +```typescript +import { BatchErrorResponseError } from "@openrouter/sdk/models"; + +let value: BatchErrorResponseError = { + code: 80684, + message: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `code` | *number* | :heavy_check_mark: | N/A | +| `message` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchlistitem.mdx b/docs/models/batchlistitem.mdx new file mode 100644 index 000000000..76a521fd4 --- /dev/null +++ b/docs/models/batchlistitem.mdx @@ -0,0 +1,53 @@ +--- +title: "BatchListItem" +--- + +Metadata-only batch object. `results` is always `null` in list responses. + +## Example Usage + +```typescript +import { BatchListItem } from "@openrouter/sdk/models"; + +let value: BatchListItem = { + completionWindow: "24h", + createdAt: 818782, + endpoint: "", + error: { + message: "", + }, + finalizedAt: 579660, + id: "", + model: "Durango", + object: "batch", + requestCounts: { + completed: 311945, + failed: 214442, + total: 609620, + }, + results: "", + status: "in_progress", + usage: { + completionTokens: 20018, + promptTokens: 657059, + totalTokens: 490076, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `completionWindow` | [models.BatchListItemCompletionWindow](../models/batchlistitemcompletionwindow.mdx) | :heavy_check_mark: | N/A | +| `createdAt` | *number* | :heavy_check_mark: | N/A | +| `endpoint` | *string* | :heavy_check_mark: | N/A | +| `error` | [models.BatchListItemError](../models/batchlistitemerror.mdx) | :heavy_check_mark: | N/A | +| `finalizedAt` | *number* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_check_mark: | N/A | +| `object` | [models.BatchListItemObject](../models/batchlistitemobject.mdx) | :heavy_check_mark: | N/A | +| `requestCounts` | [models.BatchListItemRequestCounts](../models/batchlistitemrequestcounts.mdx) | :heavy_check_mark: | N/A | +| `results` | *any* | :heavy_check_mark: | Always null: retrieve the batch with `GET /batches/{id}` to access its results. | +| `status` | [models.BatchListItemStatus](../models/batchlistitemstatus.mdx) | :heavy_check_mark: | N/A | +| `usage` | [models.BatchListItemUsage](../models/batchlistitemusage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchlistitemcompletiontokensdetails.mdx b/docs/models/batchlistitemcompletiontokensdetails.mdx new file mode 100644 index 000000000..3b2bc2b4f --- /dev/null +++ b/docs/models/batchlistitemcompletiontokensdetails.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchListItemCompletionTokensDetails" +--- + +## Example Usage + +```typescript +import { BatchListItemCompletionTokensDetails } from "@openrouter/sdk/models"; + +let value: BatchListItemCompletionTokensDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `imageTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoningTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/models/batchlistitemcompletionwindow.mdx b/docs/models/batchlistitemcompletionwindow.mdx new file mode 100644 index 000000000..eb79ad1a8 --- /dev/null +++ b/docs/models/batchlistitemcompletionwindow.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchListItemCompletionWindow" +--- + +## Example Usage + +```typescript +import { BatchListItemCompletionWindow } from "@openrouter/sdk/models"; + +let value: BatchListItemCompletionWindow = "24h"; +``` + +## Values + +```typescript +"24h" +``` \ No newline at end of file diff --git a/docs/models/batchlistitemerror.mdx b/docs/models/batchlistitemerror.mdx new file mode 100644 index 000000000..4ed49094d --- /dev/null +++ b/docs/models/batchlistitemerror.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchListItemError" +--- + +## Example Usage + +```typescript +import { BatchListItemError } from "@openrouter/sdk/models"; + +let value: BatchListItemError = { + message: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `message` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchlistitemobject.mdx b/docs/models/batchlistitemobject.mdx new file mode 100644 index 000000000..b77e96d96 --- /dev/null +++ b/docs/models/batchlistitemobject.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchListItemObject" +--- + +## Example Usage + +```typescript +import { BatchListItemObject } from "@openrouter/sdk/models"; + +let value: BatchListItemObject = "batch"; +``` + +## Values + +```typescript +"batch" +``` \ No newline at end of file diff --git a/docs/models/batchlistitemprompttokensdetails.mdx b/docs/models/batchlistitemprompttokensdetails.mdx new file mode 100644 index 000000000..8e7119e4e --- /dev/null +++ b/docs/models/batchlistitemprompttokensdetails.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchListItemPromptTokensDetails" +--- + +Breakdown of tokens used in the prompt. + +## Example Usage + +```typescript +import { BatchListItemPromptTokensDetails } from "@openrouter/sdk/models"; + +let value: BatchListItemPromptTokensDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens used for input audio. | +| `cacheWriteTokens` | *number* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cachedTokens` | *number* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `fileTokens` | *number* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `videoTokens` | *number* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/models/batchlistitemrequestcounts.mdx b/docs/models/batchlistitemrequestcounts.mdx new file mode 100644 index 000000000..d629f5d54 --- /dev/null +++ b/docs/models/batchlistitemrequestcounts.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchListItemRequestCounts" +--- + +## Example Usage + +```typescript +import { BatchListItemRequestCounts } from "@openrouter/sdk/models"; + +let value: BatchListItemRequestCounts = { + completed: 674174, + failed: 11483, + total: 131515, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `completed` | *number* | :heavy_check_mark: | N/A | +| `failed` | *number* | :heavy_check_mark: | N/A | +| `total` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchlistitemservertooluse.mdx b/docs/models/batchlistitemservertooluse.mdx new file mode 100644 index 000000000..a7a5fddd3 --- /dev/null +++ b/docs/models/batchlistitemservertooluse.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchListItemServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + +## Example Usage + +```typescript +import { BatchListItemServerToolUse } from "@openrouter/sdk/models"; + +let value: BatchListItemServerToolUse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `toolCallsExecuted` | *number* | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result. | +| `toolCallsRequested` | *number* | :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. | +| `webSearchRequests` | *number* | :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/models/batchlistitemstatus.mdx b/docs/models/batchlistitemstatus.mdx new file mode 100644 index 000000000..99742ac96 --- /dev/null +++ b/docs/models/batchlistitemstatus.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchListItemStatus" +--- + +## Example Usage + +```typescript +import { BatchListItemStatus } from "@openrouter/sdk/models"; + +let value: BatchListItemStatus = "finalizing"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"validating" | "in_progress" | "finalizing" | "completed" | "failed" | "expired" | "cancelling" | "cancelled" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/batchlistitemusage.mdx b/docs/models/batchlistitemusage.mdx new file mode 100644 index 000000000..f55b50c6b --- /dev/null +++ b/docs/models/batchlistitemusage.mdx @@ -0,0 +1,33 @@ +--- +title: "BatchListItemUsage" +--- + +## Example Usage + +```typescript +import { BatchListItemUsage } from "@openrouter/sdk/models"; + +let value: BatchListItemUsage = { + completionTokens: 818865, + promptTokens: 213947, + totalTokens: 199138, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `cacheCreation` | [models.AnthropicCacheCreation](../models/anthropiccachecreation.mdx) | :heavy_minus_sign: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} | +| `completionTokens` | *number* | :heavy_check_mark: | The tokens generated | | +| `completionTokensDetails` | [models.BatchListItemCompletionTokensDetails](../models/batchlistitemcompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | | +| `cost` | *number* | :heavy_minus_sign: | Cost of the completion | | +| `costDetails` | [models.CostDetails](../models/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
} | +| `isByok` | *boolean* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `iterations` | *models.AnthropicUsageIteration*[] | :heavy_minus_sign: | N/A | | +| `promptTokens` | *number* | :heavy_check_mark: | Including images, input audio, and tools if any | | +| `promptTokensDetails` | [models.BatchListItemPromptTokensDetails](../models/batchlistitemprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | +| `serverToolUse` | [models.BatchListItemServerToolUse](../models/batchlistitemservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `serviceTier` | *string* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | +| `speed` | [models.AnthropicSpeed](../models/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | +| `totalTokens` | *number* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/models/batchlistresponse.mdx b/docs/models/batchlistresponse.mdx new file mode 100644 index 000000000..d2f407d36 --- /dev/null +++ b/docs/models/batchlistresponse.mdx @@ -0,0 +1,29 @@ +--- +title: "BatchListResponse" +--- + +A newest-first page of metadata-only batch objects. + +## Example Usage + +```typescript +import { BatchListResponse } from "@openrouter/sdk/models"; + +let value: BatchListResponse = { + data: [], + firstId: null, + hasMore: false, + lastId: null, + object: "list", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `data` | [models.BatchListItem](../models/batchlistitem.mdx)[] | :heavy_check_mark: | N/A | +| `firstId` | *string* | :heavy_check_mark: | N/A | +| `hasMore` | *boolean* | :heavy_check_mark: | N/A | +| `lastId` | *string* | :heavy_check_mark: | N/A | +| `object` | [models.BatchListResponseObject](../models/batchlistresponseobject.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchlistresponseobject.mdx b/docs/models/batchlistresponseobject.mdx new file mode 100644 index 000000000..92837b47b --- /dev/null +++ b/docs/models/batchlistresponseobject.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchListResponseObject" +--- + +## Example Usage + +```typescript +import { BatchListResponseObject } from "@openrouter/sdk/models"; + +let value: BatchListResponseObject = "list"; +``` + +## Values + +```typescript +"list" +``` \ No newline at end of file diff --git a/docs/models/batchliststatus.mdx b/docs/models/batchliststatus.mdx new file mode 100644 index 000000000..ee049ee18 --- /dev/null +++ b/docs/models/batchliststatus.mdx @@ -0,0 +1,21 @@ +--- +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 + +```typescript +import { BatchListStatus } from "@openrouter/sdk/models"; + +let value: BatchListStatus = "completed"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"validating" | "in_progress" | "completed" | "failed" | "expired" | "cancelled" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/batchlisttimestamp.mdx b/docs/models/batchlisttimestamp.mdx new file mode 100644 index 000000000..14f8bade6 --- /dev/null +++ b/docs/models/batchlisttimestamp.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchListTimestamp" +--- + +Only include batches created strictly after this timestamp. + + +## Supported Types + +### `string` + +```typescript +const value: string = "2026-08-20T00:00:00Z"; +``` + +### `RFCDate` + +```typescript +const value: RFCDate = new RFCDate("2026-08-20T00:00:00Z"); +``` + diff --git a/docs/models/batchobject.mdx b/docs/models/batchobject.mdx new file mode 100644 index 000000000..fa86b627a --- /dev/null +++ b/docs/models/batchobject.mdx @@ -0,0 +1,97 @@ +--- +title: "BatchObject" +--- + +## Example Usage + +```typescript +import { BatchObject } from "@openrouter/sdk/models"; + +let value: BatchObject = { + completionWindow: "24h", + createdAt: 931790, + endpoint: "", + error: { + message: "", + }, + finalizedAt: 113361, + id: "", + model: "XC90", + object: "batch", + requestCounts: { + completed: 325090, + failed: 387647, + total: 515228, + }, + results: [ + { + customId: "", + error: { + message: "", + param: "", + type: "", + }, + id: "", + response: { + body: { + completedAt: 1704067210, + createdAt: 1704067200, + error: null, + frequencyPenalty: null, + id: "resp-abc123", + incompleteDetails: 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", + }, + ], + parallelToolCalls: true, + presencePenalty: null, + status: "completed", + temperature: null, + toolChoice: "auto", + tools: [], + topP: null, + }, + requestId: "", + statusCode: 170920, + }, + }, + ], + status: "in_progress", + usage: { + completionTokens: 621146, + promptTokens: 401122, + totalTokens: 291986, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `completionWindow` | [models.BatchObjectCompletionWindow](../models/batchobjectcompletionwindow.mdx) | :heavy_check_mark: | N/A | +| `createdAt` | *number* | :heavy_check_mark: | N/A | +| `endpoint` | *string* | :heavy_check_mark: | N/A | +| `error` | [models.BatchObjectError](../models/batchobjecterror.mdx) | :heavy_check_mark: | N/A | +| `finalizedAt` | *number* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_check_mark: | N/A | +| `object` | [models.BatchObjectObjectBatch](../models/batchobjectobjectbatch.mdx) | :heavy_check_mark: | N/A | +| `requestCounts` | [models.BatchObjectRequestCounts](../models/batchobjectrequestcounts.mdx) | :heavy_check_mark: | N/A | +| `results` | [models.Result](../models/result.mdx)[] | :heavy_check_mark: | N/A | +| `status` | [models.BatchObjectStatus](../models/batchobjectstatus.mdx) | :heavy_check_mark: | N/A | +| `usage` | [models.BatchObjectUsage](../models/batchobjectusage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectcompletiontokensdetails.mdx b/docs/models/batchobjectcompletiontokensdetails.mdx new file mode 100644 index 000000000..11de4dd57 --- /dev/null +++ b/docs/models/batchobjectcompletiontokensdetails.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchObjectCompletionTokensDetails" +--- + +## Example Usage + +```typescript +import { BatchObjectCompletionTokensDetails } from "@openrouter/sdk/models"; + +let value: BatchObjectCompletionTokensDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `imageTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoningTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/models/batchobjectcompletionwindow.mdx b/docs/models/batchobjectcompletionwindow.mdx new file mode 100644 index 000000000..027894894 --- /dev/null +++ b/docs/models/batchobjectcompletionwindow.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchObjectCompletionWindow" +--- + +## Example Usage + +```typescript +import { BatchObjectCompletionWindow } from "@openrouter/sdk/models"; + +let value: BatchObjectCompletionWindow = "24h"; +``` + +## Values + +```typescript +"24h" +``` \ No newline at end of file diff --git a/docs/models/batchobjectdata.mdx b/docs/models/batchobjectdata.mdx new file mode 100644 index 000000000..c42c0e206 --- /dev/null +++ b/docs/models/batchobjectdata.mdx @@ -0,0 +1,28 @@ +--- +title: "BatchObjectData" +--- + +A single embedding object + +## Example Usage + +```typescript +import { BatchObjectData } from "@openrouter/sdk/models"; + +let value: BatchObjectData = { + embedding: [ + 0.0023064255, + -0.009327292, + 0.015797347, + ], + object: "embedding", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `embedding` | *models.Embedding* | :heavy_check_mark: | Embedding vector as an array of floats or a base64 string | [
0.0023064255,
-0.009327292,
0.015797347
] | +| `index` | *number* | :heavy_minus_sign: | Index of the embedding in the input list | 0 | +| `object` | [models.ObjectEmbedding](../models/objectembedding.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/batchobjectdebug.mdx b/docs/models/batchobjectdebug.mdx new file mode 100644 index 000000000..602a00d55 --- /dev/null +++ b/docs/models/batchobjectdebug.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchObjectDebug" +--- + +## Example Usage + +```typescript +import { BatchObjectDebug } from "@openrouter/sdk/models"; + +let value: BatchObjectDebug = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `echoUpstreamBody` | Record\ | :heavy_minus_sign: | N/A | +| `timings` | [models.BatchObjectTimings](../models/batchobjecttimings.mdx) | :heavy_minus_sign: | N/A | +| `additionalProperties` | Record\ | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjecterror.mdx b/docs/models/batchobjecterror.mdx new file mode 100644 index 000000000..cb908988e --- /dev/null +++ b/docs/models/batchobjecterror.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchObjectError" +--- + +## Example Usage + +```typescript +import { BatchObjectError } from "@openrouter/sdk/models"; + +let value: BatchObjectError = { + message: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `message` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectevent.mdx b/docs/models/batchobjectevent.mdx new file mode 100644 index 000000000..118d16f13 --- /dev/null +++ b/docs/models/batchobjectevent.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchObjectEvent" +--- + +## Example Usage + +```typescript +import { BatchObjectEvent } from "@openrouter/sdk/models"; + +let value: BatchObjectEvent = "first_token_received"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"adapter_request" | "upstream_headers_received" | "first_token_received" | "upstream_body_ended" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/batchobjectfile.mdx b/docs/models/batchobjectfile.mdx new file mode 100644 index 000000000..eb9510fba --- /dev/null +++ b/docs/models/batchobjectfile.mdx @@ -0,0 +1,29 @@ +--- +title: "BatchObjectFile" +--- + +## Example Usage + +```typescript +import { BatchObjectFile } from "@openrouter/sdk/models"; + +let value: BatchObjectFile = { + content: [ + { + imageUrl: { + url: "https://zealous-march.biz/", + }, + type: "image_url", + }, + ], + hash: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `content` | *models.AnnotationContentUnion*[] | :heavy_check_mark: | N/A | +| `hash` | *string* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectfunction.mdx b/docs/models/batchobjectfunction.mdx new file mode 100644 index 000000000..f9b030054 --- /dev/null +++ b/docs/models/batchobjectfunction.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchObjectFunction" +--- + +## Example Usage + +```typescript +import { BatchObjectFunction } from "@openrouter/sdk/models"; + +let value: BatchObjectFunction = { + arguments: "", + name: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `arguments` | *string* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectimageurl.mdx b/docs/models/batchobjectimageurl.mdx new file mode 100644 index 000000000..a747c2b3e --- /dev/null +++ b/docs/models/batchobjectimageurl.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchObjectImageUrl" +--- + +## Example Usage + +```typescript +import { BatchObjectImageUrl } from "@openrouter/sdk/models"; + +let value: BatchObjectImageUrl = { + url: "https://gray-disposer.info/", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectobjectbatch.mdx b/docs/models/batchobjectobjectbatch.mdx new file mode 100644 index 000000000..f2832d02e --- /dev/null +++ b/docs/models/batchobjectobjectbatch.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchObjectObjectBatch" +--- + +## Example Usage + +```typescript +import { BatchObjectObjectBatch } from "@openrouter/sdk/models"; + +let value: BatchObjectObjectBatch = "batch"; +``` + +## Values + +```typescript +"batch" +``` \ No newline at end of file diff --git a/docs/models/batchobjectprompttokensdetails.mdx b/docs/models/batchobjectprompttokensdetails.mdx new file mode 100644 index 000000000..41118dcf3 --- /dev/null +++ b/docs/models/batchobjectprompttokensdetails.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchObjectPromptTokensDetails" +--- + +Breakdown of tokens used in the prompt. + +## Example Usage + +```typescript +import { BatchObjectPromptTokensDetails } from "@openrouter/sdk/models"; + +let value: BatchObjectPromptTokensDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens used for input audio. | +| `cacheWriteTokens` | *number* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cachedTokens` | *number* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `fileTokens` | *number* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `videoTokens` | *number* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/models/batchobjectrequestcounts.mdx b/docs/models/batchobjectrequestcounts.mdx new file mode 100644 index 000000000..7adf623db --- /dev/null +++ b/docs/models/batchobjectrequestcounts.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchObjectRequestCounts" +--- + +## Example Usage + +```typescript +import { BatchObjectRequestCounts } from "@openrouter/sdk/models"; + +let value: BatchObjectRequestCounts = { + completed: 940359, + failed: 769689, + total: 126218, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `completed` | *number* | :heavy_check_mark: | N/A | +| `failed` | *number* | :heavy_check_mark: | N/A | +| `total` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectresponse.mdx b/docs/models/batchobjectresponse.mdx new file mode 100644 index 000000000..fc24db93f --- /dev/null +++ b/docs/models/batchobjectresponse.mdx @@ -0,0 +1,54 @@ +--- +title: "BatchObjectResponse" +--- + +## Example Usage + +```typescript +import { BatchObjectResponse } from "@openrouter/sdk/models"; + +let value: BatchObjectResponse = { + body: { + completedAt: 1704067210, + createdAt: 1704067200, + error: null, + frequencyPenalty: null, + id: "resp-abc123", + incompleteDetails: 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", + }, + ], + parallelToolCalls: true, + presencePenalty: null, + status: "completed", + temperature: null, + toolChoice: "auto", + tools: [], + topP: null, + }, + requestId: "", + statusCode: 500675, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `body` | *models.Body* | :heavy_check_mark: | N/A | +| `requestId` | *string* | :heavy_check_mark: | N/A | +| `statusCode` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectrole.mdx b/docs/models/batchobjectrole.mdx new file mode 100644 index 000000000..d5731fe73 --- /dev/null +++ b/docs/models/batchobjectrole.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchObjectRole" +--- + +## Example Usage + +```typescript +import { BatchObjectRole } from "@openrouter/sdk/models"; + +let value: BatchObjectRole = "assistant"; +``` + +## Values + +```typescript +"assistant" +``` \ No newline at end of file diff --git a/docs/models/batchobjectservertooluse.mdx b/docs/models/batchobjectservertooluse.mdx new file mode 100644 index 000000000..5fbfec252 --- /dev/null +++ b/docs/models/batchobjectservertooluse.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchObjectServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + +## Example Usage + +```typescript +import { BatchObjectServerToolUse } from "@openrouter/sdk/models"; + +let value: BatchObjectServerToolUse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `toolCallsExecuted` | *number* | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result. | +| `toolCallsRequested` | *number* | :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. | +| `webSearchRequests` | *number* | :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/models/batchobjectservertoolusedetails.mdx b/docs/models/batchobjectservertoolusedetails.mdx new file mode 100644 index 000000000..6a4fba931 --- /dev/null +++ b/docs/models/batchobjectservertoolusedetails.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchObjectServerToolUseDetails" +--- + +Usage for server-side tool execution (e.g., web search) + +## Example Usage + +```typescript +import { BatchObjectServerToolUseDetails } from "@openrouter/sdk/models"; + +let value: BatchObjectServerToolUseDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `toolCallsExecuted` | *number* | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result. | +| `toolCallsRequested` | *number* | :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. | +| `webSearchRequests` | *number* | :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/models/batchobjectstatus.mdx b/docs/models/batchobjectstatus.mdx new file mode 100644 index 000000000..59e3c79f6 --- /dev/null +++ b/docs/models/batchobjectstatus.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchObjectStatus" +--- + +## Example Usage + +```typescript +import { BatchObjectStatus } from "@openrouter/sdk/models"; + +let value: BatchObjectStatus = "cancelled"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"validating" | "in_progress" | "finalizing" | "completed" | "failed" | "expired" | "cancelling" | "cancelled" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/batchobjecttimings.mdx b/docs/models/batchobjecttimings.mdx new file mode 100644 index 000000000..c3b9cf662 --- /dev/null +++ b/docs/models/batchobjecttimings.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchObjectTimings" +--- + +## Example Usage + +```typescript +import { BatchObjectTimings } from "@openrouter/sdk/models"; + +let value: BatchObjectTimings = { + epochMs: 670067, + event: "upstream_headers_received", + startMs: 673098, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `epochMs` | *number* | :heavy_check_mark: | N/A | +| `event` | [models.BatchObjectEvent](../models/batchobjectevent.mdx) | :heavy_check_mark: | N/A | +| `startMs` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjecttypemessage.mdx b/docs/models/batchobjecttypemessage.mdx new file mode 100644 index 000000000..356ebd0e2 --- /dev/null +++ b/docs/models/batchobjecttypemessage.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchObjectTypeMessage" +--- + +## Example Usage + +```typescript +import { BatchObjectTypeMessage } from "@openrouter/sdk/models"; + +let value: BatchObjectTypeMessage = "message"; +``` + +## Values + +```typescript +"message" +``` \ No newline at end of file diff --git a/docs/models/batchobjecturlcitation.mdx b/docs/models/batchobjecturlcitation.mdx new file mode 100644 index 000000000..828e9f10a --- /dev/null +++ b/docs/models/batchobjecturlcitation.mdx @@ -0,0 +1,26 @@ +--- +title: "BatchObjectUrlCitation" +--- + +## Example Usage + +```typescript +import { BatchObjectUrlCitation } from "@openrouter/sdk/models"; + +let value: BatchObjectUrlCitation = { + endIndex: 170010, + startIndex: 529903, + title: "", + url: "https://elderly-pacemaker.net", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `content` | *string* | :heavy_minus_sign: | N/A | +| `endIndex` | *number* | :heavy_check_mark: | N/A | +| `startIndex` | *number* | :heavy_check_mark: | N/A | +| `title` | *string* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchobjectusage.mdx b/docs/models/batchobjectusage.mdx new file mode 100644 index 000000000..bdb3cecd3 --- /dev/null +++ b/docs/models/batchobjectusage.mdx @@ -0,0 +1,33 @@ +--- +title: "BatchObjectUsage" +--- + +## Example Usage + +```typescript +import { BatchObjectUsage } from "@openrouter/sdk/models"; + +let value: BatchObjectUsage = { + completionTokens: 833670, + promptTokens: 277233, + totalTokens: 624977, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `cacheCreation` | [models.AnthropicCacheCreation](../models/anthropiccachecreation.mdx) | :heavy_minus_sign: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} | +| `completionTokens` | *number* | :heavy_check_mark: | The tokens generated | | +| `completionTokensDetails` | [models.BatchObjectCompletionTokensDetails](../models/batchobjectcompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | | +| `cost` | *number* | :heavy_minus_sign: | Cost of the completion | | +| `costDetails` | [models.CostDetails](../models/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
} | +| `isByok` | *boolean* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `iterations` | *models.AnthropicUsageIteration*[] | :heavy_minus_sign: | N/A | | +| `promptTokens` | *number* | :heavy_check_mark: | Including images, input audio, and tools if any | | +| `promptTokensDetails` | [models.BatchObjectPromptTokensDetails](../models/batchobjectprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | +| `serverToolUse` | [models.BatchObjectServerToolUse](../models/batchobjectservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `serviceTier` | *string* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | +| `speed` | [models.AnthropicSpeed](../models/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | +| `totalTokens` | *number* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponsecompletiontokensdetails.mdx b/docs/models/batchpaymentrequiredresponsecompletiontokensdetails.mdx new file mode 100644 index 000000000..b35744787 --- /dev/null +++ b/docs/models/batchpaymentrequiredresponsecompletiontokensdetails.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchPaymentRequiredResponseCompletionTokensDetails" +--- + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseCompletionTokensDetails } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseCompletionTokensDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `imageTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoningTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponsecompletionwindow.mdx b/docs/models/batchpaymentrequiredresponsecompletionwindow.mdx new file mode 100644 index 000000000..8581c214b --- /dev/null +++ b/docs/models/batchpaymentrequiredresponsecompletionwindow.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchPaymentRequiredResponseCompletionWindow" +--- + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseCompletionWindow } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseCompletionWindow = "24h"; +``` + +## Values + +```typescript +"24h" +``` \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponseerror.mdx b/docs/models/batchpaymentrequiredresponseerror.mdx new file mode 100644 index 000000000..35b873041 --- /dev/null +++ b/docs/models/batchpaymentrequiredresponseerror.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchPaymentRequiredResponseError" +--- + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseError } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseError = { + code: 266209, + message: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `code` | *number* | :heavy_check_mark: | N/A | +| `message` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponseobject.mdx b/docs/models/batchpaymentrequiredresponseobject.mdx new file mode 100644 index 000000000..51a3224e6 --- /dev/null +++ b/docs/models/batchpaymentrequiredresponseobject.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchPaymentRequiredResponseObject" +--- + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseObject } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseObject = "batch"; +``` + +## Values + +```typescript +"batch" +``` \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponseprompttokensdetails.mdx b/docs/models/batchpaymentrequiredresponseprompttokensdetails.mdx new file mode 100644 index 000000000..ff0c2459f --- /dev/null +++ b/docs/models/batchpaymentrequiredresponseprompttokensdetails.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchPaymentRequiredResponsePromptTokensDetails" +--- + +Breakdown of tokens used in the prompt. + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponsePromptTokensDetails } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponsePromptTokensDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens used for input audio. | +| `cacheWriteTokens` | *number* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cachedTokens` | *number* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `fileTokens` | *number* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `videoTokens` | *number* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponserequestcounts.mdx b/docs/models/batchpaymentrequiredresponserequestcounts.mdx new file mode 100644 index 000000000..72d4a797d --- /dev/null +++ b/docs/models/batchpaymentrequiredresponserequestcounts.mdx @@ -0,0 +1,23 @@ +--- +title: "BatchPaymentRequiredResponseRequestCounts" +--- + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseRequestCounts } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseRequestCounts = { + completed: 674269, + failed: 950346, + total: 188754, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `completed` | *number* | :heavy_check_mark: | N/A | +| `failed` | *number* | :heavy_check_mark: | N/A | +| `total` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponseservertooluse.mdx b/docs/models/batchpaymentrequiredresponseservertooluse.mdx new file mode 100644 index 000000000..56a87f0ec --- /dev/null +++ b/docs/models/batchpaymentrequiredresponseservertooluse.mdx @@ -0,0 +1,21 @@ +--- +title: "BatchPaymentRequiredResponseServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseServerToolUse } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseServerToolUse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `toolCallsExecuted` | *number* | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result. | +| `toolCallsRequested` | *number* | :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. | +| `webSearchRequests` | *number* | :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/models/batchpaymentrequiredresponsestatus.mdx b/docs/models/batchpaymentrequiredresponsestatus.mdx new file mode 100644 index 000000000..a8ffd58ec --- /dev/null +++ b/docs/models/batchpaymentrequiredresponsestatus.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchPaymentRequiredResponseStatus" +--- + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseStatus } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseStatus = "finalizing"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"validating" | "in_progress" | "finalizing" | "completed" | "failed" | "expired" | "cancelling" | "cancelled" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/batchpaymentrequiredresponseusage.mdx b/docs/models/batchpaymentrequiredresponseusage.mdx new file mode 100644 index 000000000..e6cb27126 --- /dev/null +++ b/docs/models/batchpaymentrequiredresponseusage.mdx @@ -0,0 +1,33 @@ +--- +title: "BatchPaymentRequiredResponseUsage" +--- + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseUsage } from "@openrouter/sdk/models"; + +let value: BatchPaymentRequiredResponseUsage = { + completionTokens: 115077, + promptTokens: 58215, + totalTokens: 340155, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `cacheCreation` | [models.AnthropicCacheCreation](../models/anthropiccachecreation.mdx) | :heavy_minus_sign: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} | +| `completionTokens` | *number* | :heavy_check_mark: | The tokens generated | | +| `completionTokensDetails` | [models.BatchPaymentRequiredResponseCompletionTokensDetails](../models/batchpaymentrequiredresponsecompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | | +| `cost` | *number* | :heavy_minus_sign: | Cost of the completion | | +| `costDetails` | [models.CostDetails](../models/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
} | +| `isByok` | *boolean* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `iterations` | *models.AnthropicUsageIteration*[] | :heavy_minus_sign: | N/A | | +| `promptTokens` | *number* | :heavy_check_mark: | Including images, input audio, and tools if any | | +| `promptTokensDetails` | [models.BatchPaymentRequiredResponsePromptTokensDetails](../models/batchpaymentrequiredresponseprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | +| `serverToolUse` | [models.BatchPaymentRequiredResponseServerToolUse](../models/batchpaymentrequiredresponseservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `serviceTier` | *string* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | +| `speed` | [models.AnthropicSpeed](../models/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | +| `totalTokens` | *number* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/models/batchproviderpreferences.mdx b/docs/models/batchproviderpreferences.mdx new file mode 100644 index 000000000..5f13935d5 --- /dev/null +++ b/docs/models/batchproviderpreferences.mdx @@ -0,0 +1,19 @@ +--- +title: "BatchProviderPreferences" +--- + +Batch provider routing preferences. Only `provider.only` is supported. + +## Example Usage + +```typescript +import { BatchProviderPreferences } from "@openrouter/sdk/models"; + +let value: BatchProviderPreferences = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `only` | *models.BatchProviderPreferencesOnly*[] | :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/models/batchproviderpreferencesonly.mdx b/docs/models/batchproviderpreferencesonly.mdx new file mode 100644 index 000000000..ce374dff4 --- /dev/null +++ b/docs/models/batchproviderpreferencesonly.mdx @@ -0,0 +1,18 @@ +--- +title: "BatchProviderPreferencesOnly" +--- + +## Supported Types + +### `models.ProviderName` + +```typescript +const value: models.ProviderName = "OpenAI"; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/batchsubmitbody.mdx b/docs/models/batchsubmitbody.mdx new file mode 100644 index 000000000..4e49ead23 --- /dev/null +++ b/docs/models/batchsubmitbody.mdx @@ -0,0 +1,27 @@ +--- +title: "BatchSubmitBody" +--- + +Batch submit request body. + +## Example Usage + +```typescript +import { BatchSubmitBody } from "@openrouter/sdk/models"; + +let value: BatchSubmitBody = { + endpoint: "/v1/chat/completions", + model: "Fiesta", + requests: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `completionWindow` | [models.BatchSubmitBodyCompletionWindow](../models/batchsubmitbodycompletionwindow.mdx) | :heavy_minus_sign: | N/A | | +| `endpoint` | [models.Endpoint](../models/endpoint.mdx) | :heavy_check_mark: | N/A | | +| `model` | *string* | :heavy_check_mark: | N/A | | +| `provider` | [models.BatchProviderPreferences](../models/batchproviderpreferences.mdx) | :heavy_minus_sign: | Batch provider routing preferences. Only `provider.only` is supported. | \{
"only": [
"google-vertex"
]
} | +| `requests` | [models.RequestT](../models/requestt.mdx)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/batchsubmitbodycompletionwindow.mdx b/docs/models/batchsubmitbodycompletionwindow.mdx new file mode 100644 index 000000000..09dda2f1d --- /dev/null +++ b/docs/models/batchsubmitbodycompletionwindow.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchSubmitBodyCompletionWindow" +--- + +## Example Usage + +```typescript +import { BatchSubmitBodyCompletionWindow } from "@openrouter/sdk/models"; + +let value: BatchSubmitBodyCompletionWindow = "24h"; +``` + +## Values + +```typescript +"24h" +``` \ No newline at end of file diff --git a/docs/models/body.mdx b/docs/models/body.mdx new file mode 100644 index 000000000..4f20da159 --- /dev/null +++ b/docs/models/body.mdx @@ -0,0 +1,135 @@ +--- +title: "Body" +--- + +## Supported Types + +### `models.BodyChatCompletion` + +```typescript +const value: models.BodyChatCompletion = { + choices: [ + { + finishReason: "stop", + index: 613758, + logprobs: { + content: [ + { + bytes: null, + logprob: 3124.33, + token: "", + topLogprobs: [], + }, + ], + }, + message: { + content: "", + refusal: "", + role: "assistant", + }, + nativeFinishReason: "", + }, + ], + created: 610535, + id: "", + model: "Fortwo", + object: "chat.completion", +}; +``` + +### `models.OpenResponsesResult` + +```typescript +const value: models.OpenResponsesResult = { + completedAt: 1704067210, + createdAt: 1704067200, + error: null, + frequencyPenalty: null, + id: "resp-abc123", + incompleteDetails: 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", + }, + ], + parallelToolCalls: true, + presencePenalty: null, + status: "completed", + temperature: null, + toolChoice: "auto", + tools: [], + topP: null, +}; +``` + +### `models.BodyMessage` + +```typescript +const value: models.BodyMessage = { + container: { + expiresAt: "2026-04-08T00:00:00Z", + id: "ctr_01abc", + }, + content: [ + { + citations: null, + text: "Hello, world!", + type: "text", + }, + ], + id: "", + model: "Expedition", + role: "assistant", + stopDetails: { + category: "cyber", + explanation: "The request was refused due to policy.", + type: "refusal", + }, + stopReason: "end_turn", + stopSequence: "", + type: "message", + usage: { + cacheCreation: null, + cacheCreationInputTokens: null, + cacheReadInputTokens: null, + inferenceGeo: null, + inputTokens: 100, + outputTokens: 50, + outputTokensDetails: null, + serverToolUse: null, + serviceTier: "standard", + }, +}; +``` + +### `models.BodyList` + +```typescript +const value: models.BodyList = { + data: [ + { + embedding: [ + 0.0023064255, + -0.009327292, + 0.015797347, + ], + object: "embedding", + }, + ], + model: "openai/text-embedding-3-small", + object: "list", +}; +``` + diff --git a/docs/models/bodychatcompletion.mdx b/docs/models/bodychatcompletion.mdx new file mode 100644 index 000000000..bd363a9a2 --- /dev/null +++ b/docs/models/bodychatcompletion.mdx @@ -0,0 +1,54 @@ +--- +title: "BodyChatCompletion" +--- + +## Example Usage + +```typescript +import { BodyChatCompletion } from "@openrouter/sdk/models"; + +let value: BodyChatCompletion = { + choices: [ + { + finishReason: "stop", + index: 613758, + logprobs: { + content: [ + { + bytes: null, + logprob: 3124.33, + token: "", + topLogprobs: [], + }, + ], + }, + message: { + content: "", + refusal: "", + role: "assistant", + }, + nativeFinishReason: "", + }, + ], + created: 610535, + id: "", + model: "Fortwo", + object: "chat.completion", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `choices` | [models.Choice](../models/choice.mdx)[] | :heavy_check_mark: | N/A | | +| `created` | *number* | :heavy_check_mark: | N/A | | +| `debug` | [models.BatchObjectDebug](../models/batchobjectdebug.mdx) | :heavy_minus_sign: | N/A | | +| `id` | *string* | :heavy_check_mark: | N/A | | +| `model` | *string* | :heavy_check_mark: | N/A | | +| `object` | [models.BodyObjectChatCompletion](../models/bodyobjectchatcompletion.mdx) | :heavy_check_mark: | N/A | | +| `openrouterMetadata` | [models.OpenRouterMetadata](../models/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` | *string* | :heavy_minus_sign: | N/A | | +| `serviceTier` | *string* | :heavy_minus_sign: | N/A | | +| `systemFingerprint` | *string* | :heavy_minus_sign: | N/A | | +| `usage` | [models.BodyUsage1](../models/bodyusage1.mdx) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/bodycompletiontokensdetails.mdx b/docs/models/bodycompletiontokensdetails.mdx new file mode 100644 index 000000000..20ce8aebd --- /dev/null +++ b/docs/models/bodycompletiontokensdetails.mdx @@ -0,0 +1,19 @@ +--- +title: "BodyCompletionTokensDetails" +--- + +## Example Usage + +```typescript +import { BodyCompletionTokensDetails } from "@openrouter/sdk/models"; + +let value: BodyCompletionTokensDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `imageTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `reasoningTokens` | *number* | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/models/bodylist.mdx b/docs/models/bodylist.mdx new file mode 100644 index 000000000..f3b790ea1 --- /dev/null +++ b/docs/models/bodylist.mdx @@ -0,0 +1,36 @@ +--- +title: "BodyList" +--- + +Embeddings response containing embedding vectors + +## Example Usage + +```typescript +import { BodyList } from "@openrouter/sdk/models"; + +let value: BodyList = { + data: [ + { + embedding: [ + 0.0023064255, + -0.009327292, + 0.015797347, + ], + object: "embedding", + }, + ], + model: "openai/text-embedding-3-small", + object: "list", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `data` | [models.BatchObjectData](../models/batchobjectdata.mdx)[] | :heavy_check_mark: | List of embedding objects | [
\{
"embedding": [
0.0023064255,
-0.009327292,
0.015797347
],
"index": 0,
"object": "embedding"
}
] | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for the embeddings response | embd-1234567890 | +| `model` | *string* | :heavy_check_mark: | The model used for embeddings | openai/text-embedding-3-small | +| `object` | [models.BodyObjectList](../models/bodyobjectlist.mdx) | :heavy_check_mark: | N/A | | +| `usage` | [models.BodyUsage3](../models/bodyusage3.mdx) | :heavy_minus_sign: | Token usage statistics | \{
"prompt_tokens": 8,
"total_tokens": 8
} | \ No newline at end of file diff --git a/docs/models/bodymessage.mdx b/docs/models/bodymessage.mdx new file mode 100644 index 000000000..c64543a35 --- /dev/null +++ b/docs/models/bodymessage.mdx @@ -0,0 +1,61 @@ +--- +title: "BodyMessage" +--- + +## Example Usage + +```typescript +import { BodyMessage } from "@openrouter/sdk/models"; + +let value: BodyMessage = { + container: { + expiresAt: "2026-04-08T00:00:00Z", + id: "ctr_01abc", + }, + content: [ + { + citations: null, + text: "Hello, world!", + type: "text", + }, + ], + id: "", + model: "Expedition", + role: "assistant", + stopDetails: { + category: "cyber", + explanation: "The request was refused due to policy.", + type: "refusal", + }, + stopReason: "end_turn", + stopSequence: "", + type: "message", + usage: { + cacheCreation: null, + cacheCreationInputTokens: null, + cacheReadInputTokens: null, + inferenceGeo: null, + inputTokens: 100, + outputTokens: 50, + outputTokensDetails: null, + serverToolUse: null, + serviceTier: "standard", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `container` | [models.AnthropicContainer](../models/anthropiccontainer.mdx) | :heavy_check_mark: | N/A | \{
"expires_at": "2026-04-08T00:00:00Z",
"id": "ctr_01abc",
"skills": null
} | +| `content` | *models.ORAnthropicContentBlock*[] | :heavy_check_mark: | N/A | | +| `id` | *string* | :heavy_check_mark: | N/A | | +| `inputTransformations` | [models.AnthropicInputTransformation](../models/anthropicinputtransformation.mdx)[] | :heavy_minus_sign: | N/A | | +| `model` | *string* | :heavy_check_mark: | N/A | | +| `role` | [models.BatchObjectRole](../models/batchobjectrole.mdx) | :heavy_check_mark: | N/A | | +| `stopDetails` | [models.AnthropicRefusalStopDetails](../models/anthropicrefusalstopdetails.mdx) | :heavy_check_mark: | Structured information about a refusal | \{
"category": "cyber",
"explanation": "The request was refused due to policy.",
"type": "refusal"
} | +| `stopReason` | [models.ORAnthropicStopReason](../models/oranthropicstopreason.mdx) | :heavy_check_mark: | N/A | end_turn | +| `stopSequence` | *string* | :heavy_check_mark: | N/A | | +| `type` | [models.BatchObjectTypeMessage](../models/batchobjecttypemessage.mdx) | :heavy_check_mark: | N/A | | +| `usage` | [models.BodyUsage2](../models/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/models/bodyobjectchatcompletion.mdx b/docs/models/bodyobjectchatcompletion.mdx new file mode 100644 index 000000000..269a1f59c --- /dev/null +++ b/docs/models/bodyobjectchatcompletion.mdx @@ -0,0 +1,17 @@ +--- +title: "BodyObjectChatCompletion" +--- + +## Example Usage + +```typescript +import { BodyObjectChatCompletion } from "@openrouter/sdk/models"; + +let value: BodyObjectChatCompletion = "chat.completion"; +``` + +## Values + +```typescript +"chat.completion" +``` \ No newline at end of file diff --git a/docs/models/bodyobjectlist.mdx b/docs/models/bodyobjectlist.mdx new file mode 100644 index 000000000..48db49d1b --- /dev/null +++ b/docs/models/bodyobjectlist.mdx @@ -0,0 +1,17 @@ +--- +title: "BodyObjectList" +--- + +## Example Usage + +```typescript +import { BodyObjectList } from "@openrouter/sdk/models"; + +let value: BodyObjectList = "list"; +``` + +## Values + +```typescript +"list" +``` \ No newline at end of file diff --git a/docs/models/bodyprompttokensdetails1.mdx b/docs/models/bodyprompttokensdetails1.mdx new file mode 100644 index 000000000..5b0ba7034 --- /dev/null +++ b/docs/models/bodyprompttokensdetails1.mdx @@ -0,0 +1,23 @@ +--- +title: "BodyPromptTokensDetails1" +--- + +Breakdown of tokens used in the prompt. + +## Example Usage + +```typescript +import { BodyPromptTokensDetails1 } from "@openrouter/sdk/models"; + +let value: BodyPromptTokensDetails1 = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `audioTokens` | *number* | :heavy_minus_sign: | Tokens used for input audio. | +| `cacheWriteTokens` | *number* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `cachedTokens` | *number* | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `fileTokens` | *number* | :heavy_minus_sign: | Tokens used for input files/documents. | +| `videoTokens` | *number* | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/models/bodyprompttokensdetails2.mdx b/docs/models/bodyprompttokensdetails2.mdx new file mode 100644 index 000000000..1c8b402cf --- /dev/null +++ b/docs/models/bodyprompttokensdetails2.mdx @@ -0,0 +1,23 @@ +--- +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. + +## Example Usage + +```typescript +import { BodyPromptTokensDetails2 } from "@openrouter/sdk/models"; + +let value: BodyPromptTokensDetails2 = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `audioTokens` | *number* | :heavy_minus_sign: | Number of audio tokens in the input | | +| `fileTokens` | *number* | :heavy_minus_sign: | Number of file/document tokens in the input | | +| `imageTokens` | *number* | :heavy_minus_sign: | Number of image tokens in the input | 258 | +| `textTokens` | *number* | :heavy_minus_sign: | Number of text tokens in the input | 8 | +| `videoTokens` | *number* | :heavy_minus_sign: | Number of video tokens in the input | | \ No newline at end of file diff --git a/docs/models/servertooluse.mdx b/docs/models/bodyservertooluse.mdx similarity index 97% rename from docs/models/servertooluse.mdx rename to docs/models/bodyservertooluse.mdx index c7abeb3b9..010d51dee 100644 --- a/docs/models/servertooluse.mdx +++ b/docs/models/bodyservertooluse.mdx @@ -1,5 +1,5 @@ --- -title: "ServerToolUse" +title: "BodyServerToolUse" --- Usage for server-side tool execution (e.g., web search) @@ -7,9 +7,9 @@ Usage for server-side tool execution (e.g., web search) ## Example Usage ```typescript -import { ServerToolUse } from "@openrouter/sdk/models"; +import { BodyServerToolUse } from "@openrouter/sdk/models"; -let value: ServerToolUse = {}; +let value: BodyServerToolUse = {}; ``` ## Fields diff --git a/docs/models/bodyusage1.mdx b/docs/models/bodyusage1.mdx new file mode 100644 index 000000000..cf36c712b --- /dev/null +++ b/docs/models/bodyusage1.mdx @@ -0,0 +1,27 @@ +--- +title: "BodyUsage1" +--- + +## Example Usage + +```typescript +import { BodyUsage1 } from "@openrouter/sdk/models"; + +let value: BodyUsage1 = { + completionTokens: 406555, + promptTokens: 855556, + totalTokens: 244239, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `completionTokens` | *number* | :heavy_check_mark: | The tokens generated | +| `completionTokensDetails` | [models.BodyCompletionTokensDetails](../models/bodycompletiontokensdetails.mdx) | :heavy_minus_sign: | N/A | +| `promptTokens` | *number* | :heavy_check_mark: | Including images, input audio, and tools if any | +| `promptTokensDetails` | [models.BodyPromptTokensDetails1](../models/bodyprompttokensdetails1.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | +| `serverToolUse` | [models.BodyServerToolUse](../models/bodyservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | +| `serverToolUseDetails` | [models.BatchObjectServerToolUseDetails](../models/batchobjectservertoolusedetails.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | +| `totalTokens` | *number* | :heavy_check_mark: | Sum of the above two fields | \ No newline at end of file diff --git a/docs/models/bodyusage2.mdx b/docs/models/bodyusage2.mdx new file mode 100644 index 000000000..fd40d76c5 --- /dev/null +++ b/docs/models/bodyusage2.mdx @@ -0,0 +1,37 @@ +--- +title: "BodyUsage2" +--- + +## Example Usage + +```typescript +import { BodyUsage2 } from "@openrouter/sdk/models"; + +let value: BodyUsage2 = { + cacheCreation: null, + cacheCreationInputTokens: null, + cacheReadInputTokens: null, + inferenceGeo: null, + inputTokens: 100, + outputTokens: 50, + outputTokensDetails: null, + serverToolUse: null, + serviceTier: "standard", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `cacheCreation` | [models.AnthropicCacheCreation](../models/anthropiccachecreation.mdx) | :heavy_check_mark: | N/A | \{
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
} | +| `cacheCreationInputTokens` | *number* | :heavy_check_mark: | N/A | | +| `cacheReadInputTokens` | *number* | :heavy_check_mark: | N/A | | +| `inferenceGeo` | *string* | :heavy_check_mark: | N/A | | +| `inputTokens` | *number* | :heavy_check_mark: | N/A | | +| `outputTokens` | *number* | :heavy_check_mark: | N/A | | +| `outputTokensDetails` | [models.AnthropicOutputTokensDetails](../models/anthropicoutputtokensdetails.mdx) | :heavy_check_mark: | N/A | \{
"thinking_tokens": 0
} | +| `serverToolUse` | [models.AnthropicServerToolUsage](../models/anthropicservertoolusage.mdx) | :heavy_check_mark: | N/A | \{
"web_fetch_requests": 0,
"web_search_requests": 1
} | +| `serviceTier` | [models.AnthropicServiceTier](../models/anthropicservicetier.mdx) | :heavy_check_mark: | N/A | standard | +| `iterations` | *models.AnthropicUsageIteration*[] | :heavy_minus_sign: | N/A | | +| `speed` | [models.AnthropicSpeed](../models/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | \ No newline at end of file diff --git a/docs/models/bodyusage3.mdx b/docs/models/bodyusage3.mdx new file mode 100644 index 000000000..34b21cd14 --- /dev/null +++ b/docs/models/bodyusage3.mdx @@ -0,0 +1,27 @@ +--- +title: "BodyUsage3" +--- + +Token usage statistics + +## Example Usage + +```typescript +import { BodyUsage3 } from "@openrouter/sdk/models"; + +let value: BodyUsage3 = { + promptTokens: 8, + totalTokens: 8, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cost` | *number* | :heavy_minus_sign: | Cost of the request in credits | 0.0001 | +| `costDetails` | [models.CostDetails](../models/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
} | +| `isByok` | *boolean* | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `promptTokens` | *number* | :heavy_check_mark: | Number of tokens in the input | 8 | +| `promptTokensDetails` | [models.BodyPromptTokensDetails2](../models/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. | | +| `totalTokens` | *number* | :heavy_check_mark: | Total number of tokens used | 8 | \ No newline at end of file diff --git a/docs/models/choice.mdx b/docs/models/choice.mdx new file mode 100644 index 000000000..217deba3f --- /dev/null +++ b/docs/models/choice.mdx @@ -0,0 +1,40 @@ +--- +title: "Choice" +--- + +## Example Usage + +```typescript +import { Choice } from "@openrouter/sdk/models"; + +let value: Choice = { + finishReason: "stop", + index: 225795, + logprobs: { + content: [ + { + bytes: null, + logprob: 3124.33, + token: "", + topLogprobs: [], + }, + ], + }, + message: { + content: "", + refusal: "", + role: "assistant", + }, + nativeFinishReason: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `finishReason` | [models.FinishReason](../models/finishreason.mdx) | :heavy_check_mark: | N/A | stop | +| `index` | *number* | :heavy_check_mark: | N/A | | +| `logprobs` | [models.Logprobs](../models/logprobs.mdx) | :heavy_check_mark: | N/A | | +| `message` | [models.Message](../models/message.mdx) | :heavy_check_mark: | N/A | | +| `nativeFinishReason` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/choicerole.mdx b/docs/models/choicerole.mdx new file mode 100644 index 000000000..c38561a2e --- /dev/null +++ b/docs/models/choicerole.mdx @@ -0,0 +1,17 @@ +--- +title: "ChoiceRole" +--- + +## Example Usage + +```typescript +import { ChoiceRole } from "@openrouter/sdk/models"; + +let value: ChoiceRole = "assistant"; +``` + +## Values + +```typescript +"assistant" +``` \ No newline at end of file diff --git a/docs/models/choicetypefunction.mdx b/docs/models/choicetypefunction.mdx new file mode 100644 index 000000000..c1e9f2b0b --- /dev/null +++ b/docs/models/choicetypefunction.mdx @@ -0,0 +1,17 @@ +--- +title: "ChoiceTypeFunction" +--- + +## Example Usage + +```typescript +import { ChoiceTypeFunction } from "@openrouter/sdk/models"; + +let value: ChoiceTypeFunction = "function"; +``` + +## Values + +```typescript +"function" +``` \ No newline at end of file diff --git a/docs/models/choicetypeimageurlenum.mdx b/docs/models/choicetypeimageurlenum.mdx new file mode 100644 index 000000000..1a7c795f1 --- /dev/null +++ b/docs/models/choicetypeimageurlenum.mdx @@ -0,0 +1,17 @@ +--- +title: "ChoiceTypeImageURLEnum" +--- + +## Example Usage + +```typescript +import { ChoiceTypeImageURLEnum } from "@openrouter/sdk/models"; + +let value: ChoiceTypeImageURLEnum = "image_url"; +``` + +## Values + +```typescript +"image_url" +``` \ No newline at end of file diff --git a/docs/models/contentimageurl.mdx b/docs/models/contentimageurl.mdx new file mode 100644 index 000000000..39623dade --- /dev/null +++ b/docs/models/contentimageurl.mdx @@ -0,0 +1,23 @@ +--- +title: "ContentImageURL" +--- + +## Example Usage + +```typescript +import { ContentImageURL } from "@openrouter/sdk/models"; + +let value: ContentImageURL = { + imageUrl: { + url: "https://zealous-march.biz/", + }, + type: "image_url", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `imageUrl` | [models.ContentImageUrlImageUrl](../models/contentimageurlimageurl.mdx) | :heavy_check_mark: | N/A | +| `type` | *"image_url"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/contentimageurlimageurl.mdx b/docs/models/contentimageurlimageurl.mdx new file mode 100644 index 000000000..f3c3ccee5 --- /dev/null +++ b/docs/models/contentimageurlimageurl.mdx @@ -0,0 +1,19 @@ +--- +title: "ContentImageUrlImageUrl" +--- + +## Example Usage + +```typescript +import { ContentImageUrlImageUrl } from "@openrouter/sdk/models"; + +let value: ContentImageUrlImageUrl = { + url: "https://entire-skean.com/", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/contenttext.mdx b/docs/models/contenttext.mdx new file mode 100644 index 000000000..85fd43eae --- /dev/null +++ b/docs/models/contenttext.mdx @@ -0,0 +1,21 @@ +--- +title: "ContentText" +--- + +## Example Usage + +```typescript +import { ContentText } from "@openrouter/sdk/models"; + +let value: ContentText = { + text: "", + type: "text", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `text` | *string* | :heavy_check_mark: | N/A | +| `type` | *"text"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/contenttoplogprob.mdx b/docs/models/contenttoplogprob.mdx new file mode 100644 index 000000000..6673dcba7 --- /dev/null +++ b/docs/models/contenttoplogprob.mdx @@ -0,0 +1,27 @@ +--- +title: "ContentTopLogprob" +--- + +## Example Usage + +```typescript +import { ContentTopLogprob } from "@openrouter/sdk/models"; + +let value: ContentTopLogprob = { + bytes: [ + 332920, + 541380, + 474715, + ], + logprob: 592.75, + token: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `bytes` | *number*[] | :heavy_check_mark: | N/A | +| `logprob` | *number* | :heavy_check_mark: | N/A | +| `token` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/contentwebsearchtoolresulterror.mdx b/docs/models/contentwebsearchtoolresulterror.mdx index 09f35fed5..1082ba6ad 100644 --- a/docs/models/contentwebsearchtoolresulterror.mdx +++ b/docs/models/contentwebsearchtoolresulterror.mdx @@ -15,7 +15,7 @@ let value: ContentWebSearchToolResultError = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `errorCode` | [models.ErrorCode](../models/errorcode.mdx) | :heavy_check_mark: | N/A | -| `type` | [models.TypeWebSearchToolResultError](../models/typewebsearchtoolresulterror.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `errorCode` | [models.MessagesMessageParamErrorCode](../models/messagesmessageparamerrorcode.mdx) | :heavy_check_mark: | N/A | +| `type` | [models.MessagesMessageParamTypeWebSearchToolResultError](../models/messagesmessageparamtypewebsearchtoolresulterror.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/debug.mdx b/docs/models/debug.mdx deleted file mode 100644 index 81a9d6204..000000000 --- a/docs/models/debug.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "Debug" ---- - -## Example Usage - -```typescript -import { Debug } from "@openrouter/sdk/models"; - -let value: Debug = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `echoUpstreamBody` | Record\ | :heavy_minus_sign: | N/A | -| `timings` | [models.Timings](../models/timings.mdx) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/debugevent.mdx b/docs/models/debugevent.mdx index e97d11f40..9a76591e0 100644 --- a/docs/models/debugevent.mdx +++ b/docs/models/debugevent.mdx @@ -18,8 +18,8 @@ let value: DebugEvent = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `debug` | [models.Debug](../models/debug.mdx) | :heavy_check_mark: | N/A | -| `sequenceNumber` | *number* | :heavy_check_mark: | N/A | -| `type` | *"response.debug"* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `debug` | [models.DebugEventDebug](../models/debugeventdebug.mdx) | :heavy_check_mark: | N/A | +| `sequenceNumber` | *number* | :heavy_check_mark: | N/A | +| `type` | *"response.debug"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/debugeventdebug.mdx b/docs/models/debugeventdebug.mdx new file mode 100644 index 000000000..2bf8f4069 --- /dev/null +++ b/docs/models/debugeventdebug.mdx @@ -0,0 +1,18 @@ +--- +title: "DebugEventDebug" +--- + +## Example Usage + +```typescript +import { DebugEventDebug } from "@openrouter/sdk/models"; + +let value: DebugEventDebug = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `echoUpstreamBody` | Record\ | :heavy_minus_sign: | N/A | +| `timings` | [models.DebugEventTimings](../models/debugeventtimings.mdx) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/event.mdx b/docs/models/debugeventevent.mdx similarity index 66% rename from docs/models/event.mdx rename to docs/models/debugeventevent.mdx index 5fce6f8da..f04d50995 100644 --- a/docs/models/event.mdx +++ b/docs/models/debugeventevent.mdx @@ -1,13 +1,13 @@ --- -title: "Event" +title: "DebugEventEvent" --- ## Example Usage ```typescript -import { Event } from "@openrouter/sdk/models"; +import { DebugEventEvent } from "@openrouter/sdk/models"; -let value: Event = "adapter_request"; +let value: DebugEventEvent = "upstream_body_ended"; // Open enum: unrecognized values are captured as Unrecognized ``` diff --git a/docs/models/debugeventtimings.mdx b/docs/models/debugeventtimings.mdx new file mode 100644 index 000000000..2e71aac79 --- /dev/null +++ b/docs/models/debugeventtimings.mdx @@ -0,0 +1,23 @@ +--- +title: "DebugEventTimings" +--- + +## Example Usage + +```typescript +import { DebugEventTimings } from "@openrouter/sdk/models"; + +let value: DebugEventTimings = { + epochMs: 523365, + event: "first_token_received", + startMs: 240922, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `epochMs` | *number* | :heavy_check_mark: | N/A | +| `event` | [models.DebugEventEvent](../models/debugeventevent.mdx) | :heavy_check_mark: | N/A | +| `startMs` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/embedding.mdx b/docs/models/embedding.mdx new file mode 100644 index 000000000..f3567b6f3 --- /dev/null +++ b/docs/models/embedding.mdx @@ -0,0 +1,25 @@ +--- +title: "Embedding" +--- + +Embedding vector as an array of floats or a base64 string + + +## Supported Types + +### `number[]` + +```typescript +const value: number[] = [ + 0.0023064255, + -0.009327292, + 0.015797347, +]; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/endpoint.mdx b/docs/models/endpoint.mdx new file mode 100644 index 000000000..7038b7f62 --- /dev/null +++ b/docs/models/endpoint.mdx @@ -0,0 +1,19 @@ +--- +title: "Endpoint" +--- + +## Example Usage + +```typescript +import { Endpoint } from "@openrouter/sdk/models"; + +let value: Endpoint = "/v1/embeddings"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"/v1/chat/completions" | "/v1/responses" | "/v1/messages" | "/v1/embeddings" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/errors/batcherrorresponse.mdx b/docs/models/errors/batcherrorresponse.mdx new file mode 100644 index 000000000..76992444d --- /dev/null +++ b/docs/models/errors/batcherrorresponse.mdx @@ -0,0 +1,17 @@ +--- +title: "BatchErrorResponse" +--- + +## Example Usage + +```typescript +import { BatchErrorResponse } from "@openrouter/sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `error` | [models.BatchErrorResponseError](../../models/batcherrorresponseerror.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/batchpaymentrequiredresponseerror.mdx b/docs/models/errors/batchpaymentrequiredresponseerror.mdx new file mode 100644 index 000000000..6b20230a4 --- /dev/null +++ b/docs/models/errors/batchpaymentrequiredresponseerror.mdx @@ -0,0 +1,30 @@ +--- +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. + +## Example Usage + +```typescript +import { BatchPaymentRequiredResponseError } from "@openrouter/sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `completionWindow` | [models.BatchPaymentRequiredResponseCompletionWindow](../../models/batchpaymentrequiredresponsecompletionwindow.mdx) | :heavy_check_mark: | N/A | +| `createdAt` | *number* | :heavy_check_mark: | N/A | +| `endpoint` | *string* | :heavy_check_mark: | N/A | +| `error` | [models.BatchPaymentRequiredResponseError](../../models/batchpaymentrequiredresponseerror.mdx) | :heavy_check_mark: | N/A | +| `finalizedAt` | *number* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_check_mark: | N/A | +| `object` | [models.BatchPaymentRequiredResponseObject](../../models/batchpaymentrequiredresponseobject.mdx) | :heavy_check_mark: | N/A | +| `requestCounts` | [models.BatchPaymentRequiredResponseRequestCounts](../../models/batchpaymentrequiredresponserequestcounts.mdx) | :heavy_check_mark: | N/A | +| `results` | *any* | :heavy_check_mark: | Always null: results are withheld until the batch charge is covered. | +| `status` | [models.BatchPaymentRequiredResponseStatus](../../models/batchpaymentrequiredresponsestatus.mdx) | :heavy_check_mark: | N/A | +| `usage` | [models.BatchPaymentRequiredResponseUsage](../../models/batchpaymentrequiredresponseusage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filetype.mdx b/docs/models/filetype.mdx new file mode 100644 index 000000000..40c684106 --- /dev/null +++ b/docs/models/filetype.mdx @@ -0,0 +1,19 @@ +--- +title: "FileType" +--- + +## Example Usage + +```typescript +import { FileType } from "@openrouter/sdk/models"; + +let value: FileType = "pdf"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"text" | "image" | "pdf" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/finishreason.mdx b/docs/models/finishreason.mdx index 403e61020..3a5795ba7 100644 --- a/docs/models/finishreason.mdx +++ b/docs/models/finishreason.mdx @@ -2,14 +2,12 @@ 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 ```typescript import { FinishReason } from "@openrouter/sdk/models"; -let value: FinishReason = "tool_calls"; +let value: FinishReason = "stop"; // Open enum: unrecognized values are captured as Unrecognized ``` @@ -17,5 +15,5 @@ let value: FinishReason = "tool_calls"; ## Values ```typescript -"error" | "stop" | "tool_calls" | Unrecognized +"stop" | "length" | "tool_calls" | "content_filter" | "function_call" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/image.mdx b/docs/models/image.mdx new file mode 100644 index 000000000..7d3607ddb --- /dev/null +++ b/docs/models/image.mdx @@ -0,0 +1,23 @@ +--- +title: "Image" +--- + +## Example Usage + +```typescript +import { Image } from "@openrouter/sdk/models"; + +let value: Image = { + imageUrl: { + url: "https://inexperienced-derby.org/", + }, + type: "image_url", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `imageUrl` | [models.BatchObjectImageUrl](../models/batchobjectimageurl.mdx) | :heavy_check_mark: | N/A | +| `type` | [models.ChoiceTypeImageURLEnum](../models/choicetypeimageurlenum.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/imagegenerationusage.mdx b/docs/models/imagegenerationusage.mdx index 694f2529f..2a830af7e 100644 --- a/docs/models/imagegenerationusage.mdx +++ b/docs/models/imagegenerationusage.mdx @@ -29,7 +29,7 @@ let value: ImageGenerationUsage = { | `iterations` | *models.AnthropicUsageIteration*[] | :heavy_minus_sign: | N/A | | | `promptTokens` | *number* | :heavy_check_mark: | Including images, input audio, and tools if any | | | `promptTokensDetails` | [models.ImageGenerationUsagePromptTokensDetails](../models/imagegenerationusageprompttokensdetails.mdx) | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | -| `serverToolUse` | [models.ServerToolUse](../models/servertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `serverToolUse` | [models.ImageGenerationUsageServerToolUse](../models/imagegenerationusageservertooluse.mdx) | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | | `serviceTier` | *string* | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | | `speed` | [models.AnthropicSpeed](../models/anthropicspeed.mdx) | :heavy_minus_sign: | N/A | standard | | `totalTokens` | *number* | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/models/imagegenerationusageservertooluse.mdx b/docs/models/imagegenerationusageservertooluse.mdx new file mode 100644 index 000000000..296492085 --- /dev/null +++ b/docs/models/imagegenerationusageservertooluse.mdx @@ -0,0 +1,21 @@ +--- +title: "ImageGenerationUsageServerToolUse" +--- + +Usage for server-side tool execution (e.g., web search) + +## Example Usage + +```typescript +import { ImageGenerationUsageServerToolUse } from "@openrouter/sdk/models"; + +let value: ImageGenerationUsageServerToolUse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `toolCallsExecuted` | *number* | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result. | +| `toolCallsRequested` | *number* | :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. | +| `webSearchRequests` | *number* | :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/models/inputsunion1.mdx b/docs/models/inputsunion1.mdx index e99fe6800..6a7a4a7db 100644 --- a/docs/models/inputsunion1.mdx +++ b/docs/models/inputsunion1.mdx @@ -115,7 +115,7 @@ const value: models.InputsReasoning = { ```typescript const value: models.OutputWebSearchCallItem = { - id: "ws-abc123", + id: "msg-abc123", status: "completed", type: "web_search_call", }; @@ -125,9 +125,9 @@ const value: models.OutputWebSearchCallItem = { ```typescript const value: models.OutputFileSearchCallItem = { - id: "fs-abc123", + id: "msg-abc123", queries: [ - "search term", + "", ], status: "completed", type: "file_search_call", @@ -138,7 +138,7 @@ const value: models.OutputFileSearchCallItem = { ```typescript const value: models.OutputImageGenerationCallItem = { - id: "img-abc123", + id: "msg-abc123", status: "completed", type: "image_generation_call", }; @@ -148,7 +148,7 @@ const value: models.OutputImageGenerationCallItem = { ```typescript const value: models.OutputCodeInterpreterCallItem = { - id: "ci-abc123", + id: "msg-abc123", status: "completed", type: "code_interpreter_call", }; @@ -158,7 +158,7 @@ const value: models.OutputCodeInterpreterCallItem = { ```typescript const value: models.OutputComputerCallItem = { - callId: "call-abc123", + callId: "", pendingSafetyChecks: [], status: "completed", type: "computer_call", @@ -169,9 +169,9 @@ const value: models.OutputComputerCallItem = { ```typescript const value: models.OutputDatetimeItem = { - datetime: "2026-03-12T14:30:00.000Z", + datetime: "2024-12-31T05:26:30.868Z", status: "completed", - timezone: "UTC", + timezone: "Europe/Vatican", type: "openrouter:datetime", }; ``` diff --git a/docs/models/internchatchoice.mdx b/docs/models/internchatchoice.mdx index 499465b7f..cd425bd92 100644 --- a/docs/models/internchatchoice.mdx +++ b/docs/models/internchatchoice.mdx @@ -21,5 +21,5 @@ let value: InternChatChoice = { | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `delta` | [models.InternChatDelta](../models/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"
} | -| `finishReason` | [models.FinishReason](../models/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. | | +| `finishReason` | [models.InternChatChoiceFinishReason](../models/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` | *number* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/internchatchoicefinishreason.mdx b/docs/models/internchatchoicefinishreason.mdx new file mode 100644 index 000000000..e0358f51e --- /dev/null +++ b/docs/models/internchatchoicefinishreason.mdx @@ -0,0 +1,21 @@ +--- +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 + +```typescript +import { InternChatChoiceFinishReason } from "@openrouter/sdk/models"; + +let value: InternChatChoiceFinishReason = "tool_calls"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"error" | "stop" | "tool_calls" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/logprobs.mdx b/docs/models/logprobs.mdx new file mode 100644 index 000000000..978ad7010 --- /dev/null +++ b/docs/models/logprobs.mdx @@ -0,0 +1,20 @@ +--- +title: "Logprobs" +--- + +## Example Usage + +```typescript +import { Logprobs } from "@openrouter/sdk/models"; + +let value: Logprobs = { + content: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `content` | [models.LogprobsContent](../models/logprobscontent.mdx)[] | :heavy_check_mark: | N/A | +| `refusal` | [models.Refusal](../models/refusal.mdx)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/logprobscontent.mdx b/docs/models/logprobscontent.mdx new file mode 100644 index 000000000..0173d0ed6 --- /dev/null +++ b/docs/models/logprobscontent.mdx @@ -0,0 +1,25 @@ +--- +title: "LogprobsContent" +--- + +## Example Usage + +```typescript +import { LogprobsContent } from "@openrouter/sdk/models"; + +let value: LogprobsContent = { + bytes: [], + logprob: 5934.74, + token: "", + topLogprobs: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `bytes` | *number*[] | :heavy_check_mark: | N/A | +| `logprob` | *number* | :heavy_check_mark: | N/A | +| `token` | *string* | :heavy_check_mark: | N/A | +| `topLogprobs` | [models.ContentTopLogprob](../models/contenttoplogprob.mdx)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/message.mdx b/docs/models/message.mdx new file mode 100644 index 000000000..8da1c6b02 --- /dev/null +++ b/docs/models/message.mdx @@ -0,0 +1,28 @@ +--- +title: "Message" +--- + +## Example Usage + +```typescript +import { Message } from "@openrouter/sdk/models"; + +let value: Message = { + content: "", + refusal: "", + role: "assistant", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `annotations` | *models.Annotation*[] | :heavy_minus_sign: | N/A | +| `content` | *string* | :heavy_check_mark: | N/A | +| `images` | [models.Image](../models/image.mdx)[] | :heavy_minus_sign: | N/A | +| `reasoning` | *string* | :heavy_minus_sign: | N/A | +| `reasoningDetails` | *models.ReasoningDetail*[] | :heavy_minus_sign: | N/A | +| `refusal` | *string* | :heavy_check_mark: | N/A | +| `role` | [models.ChoiceRole](../models/choicerole.mdx) | :heavy_check_mark: | N/A | +| `toolCalls` | [models.ToolCall](../models/toolcall.mdx)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/errorcode.mdx b/docs/models/messagesmessageparamerrorcode.mdx similarity index 60% rename from docs/models/errorcode.mdx rename to docs/models/messagesmessageparamerrorcode.mdx index 149046466..4dc562e0d 100644 --- a/docs/models/errorcode.mdx +++ b/docs/models/messagesmessageparamerrorcode.mdx @@ -1,13 +1,13 @@ --- -title: "ErrorCode" +title: "MessagesMessageParamErrorCode" --- ## Example Usage ```typescript -import { ErrorCode } from "@openrouter/sdk/models"; +import { MessagesMessageParamErrorCode } from "@openrouter/sdk/models"; -let value: ErrorCode = "too_many_requests"; +let value: MessagesMessageParamErrorCode = "too_many_requests"; // Open enum: unrecognized values are captured as Unrecognized ``` diff --git a/docs/models/messagesmessageparamtypewebsearchtoolresulterror.mdx b/docs/models/messagesmessageparamtypewebsearchtoolresulterror.mdx new file mode 100644 index 000000000..f4bc2d58b --- /dev/null +++ b/docs/models/messagesmessageparamtypewebsearchtoolresulterror.mdx @@ -0,0 +1,18 @@ +--- +title: "MessagesMessageParamTypeWebSearchToolResultError" +--- + +## Example Usage + +```typescript +import { MessagesMessageParamTypeWebSearchToolResultError } from "@openrouter/sdk/models"; + +let value: MessagesMessageParamTypeWebSearchToolResultError = + "web_search_tool_result_error"; +``` + +## Values + +```typescript +"web_search_tool_result_error" +``` \ No newline at end of file diff --git a/docs/models/objectembedding.mdx b/docs/models/objectembedding.mdx new file mode 100644 index 000000000..ae6556e54 --- /dev/null +++ b/docs/models/objectembedding.mdx @@ -0,0 +1,17 @@ +--- +title: "ObjectEmbedding" +--- + +## Example Usage + +```typescript +import { ObjectEmbedding } from "@openrouter/sdk/models"; + +let value: ObjectEmbedding = "embedding"; +``` + +## Values + +```typescript +"embedding" +``` \ No newline at end of file diff --git a/docs/models/openrouter.mdx b/docs/models/openrouter.mdx new file mode 100644 index 000000000..67a0afa57 --- /dev/null +++ b/docs/models/openrouter.mdx @@ -0,0 +1,19 @@ +--- +title: "Openrouter" +--- + +OpenRouter-held request and result artifacts were purged. + +## Example Usage + +```typescript +import { Openrouter } from "@openrouter/sdk/models"; + +let value: Openrouter = "deleted"; +``` + +## Values + +```typescript +"deleted" +``` \ No newline at end of file diff --git a/docs/models/operations/createbatchesglobals.mdx b/docs/models/operations/createbatchesglobals.mdx new file mode 100644 index 000000000..6dd5e63f6 --- /dev/null +++ b/docs/models/operations/createbatchesglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "CreateBatchesGlobals" +--- + +## Example Usage + +```typescript +import { CreateBatchesGlobals } from "@openrouter/sdk/models/operations"; + +let value: CreateBatchesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :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/models/operations/createbatchesrequest.mdx b/docs/models/operations/createbatchesrequest.mdx new file mode 100644 index 000000000..2fb4addfa --- /dev/null +++ b/docs/models/operations/createbatchesrequest.mdx @@ -0,0 +1,26 @@ +--- +title: "CreateBatchesRequest" +--- + +## Example Usage + +```typescript +import { CreateBatchesRequest } from "@openrouter/sdk/models/operations"; + +let value: CreateBatchesRequest = { + batchSubmitBody: { + endpoint: "/v1/responses", + model: "Roadster", + requests: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| +| `batchSubmitBody` | [models.BatchSubmitBody](../../models/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/models/operations/deletebatchglobals.mdx b/docs/models/operations/deletebatchglobals.mdx new file mode 100644 index 000000000..5365459af --- /dev/null +++ b/docs/models/operations/deletebatchglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "DeleteBatchGlobals" +--- + +## Example Usage + +```typescript +import { DeleteBatchGlobals } from "@openrouter/sdk/models/operations"; + +let value: DeleteBatchGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :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/models/operations/deletebatchrequest.mdx b/docs/models/operations/deletebatchrequest.mdx new file mode 100644 index 000000000..18928c99e --- /dev/null +++ b/docs/models/operations/deletebatchrequest.mdx @@ -0,0 +1,22 @@ +--- +title: "DeleteBatchRequest" +--- + +## Example Usage + +```typescript +import { DeleteBatchRequest } from "@openrouter/sdk/models/operations"; + +let value: DeleteBatchRequest = { + id: "batch_abc123", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| | +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *string* | :heavy_check_mark: | The batch job id returned from submit. | batch_abc123 | \ No newline at end of file diff --git a/docs/models/operations/getbatchesglobals.mdx b/docs/models/operations/getbatchesglobals.mdx new file mode 100644 index 000000000..6d432a7c4 --- /dev/null +++ b/docs/models/operations/getbatchesglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "GetBatchesGlobals" +--- + +## Example Usage + +```typescript +import { GetBatchesGlobals } from "@openrouter/sdk/models/operations"; + +let value: GetBatchesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :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/models/operations/getbatchesrequest.mdx b/docs/models/operations/getbatchesrequest.mdx new file mode 100644 index 000000000..94bd6f94d --- /dev/null +++ b/docs/models/operations/getbatchesrequest.mdx @@ -0,0 +1,22 @@ +--- +title: "GetBatchesRequest" +--- + +## Example Usage + +```typescript +import { GetBatchesRequest } from "@openrouter/sdk/models/operations"; + +let value: GetBatchesRequest = { + id: "batch_abc123", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| | +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `id` | *string* | :heavy_check_mark: | The batch job id returned from submit. | batch_abc123 | \ No newline at end of file diff --git a/docs/models/operations/listbatchesglobals.mdx b/docs/models/operations/listbatchesglobals.mdx new file mode 100644 index 000000000..24476bcc5 --- /dev/null +++ b/docs/models/operations/listbatchesglobals.mdx @@ -0,0 +1,19 @@ +--- +title: "ListBatchesGlobals" +--- + +## Example Usage + +```typescript +import { ListBatchesGlobals } from "@openrouter/sdk/models/operations"; + +let value: ListBatchesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `appCategories` | *string* | :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/models/operations/listbatchesrequest.mdx b/docs/models/operations/listbatchesrequest.mdx new file mode 100644 index 000000000..b9b185e0d --- /dev/null +++ b/docs/models/operations/listbatchesrequest.mdx @@ -0,0 +1,24 @@ +--- +title: "ListBatchesRequest" +--- + +## Example Usage + +```typescript +import { ListBatchesRequest } from "@openrouter/sdk/models/operations"; + +let value: ListBatchesRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :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.
| | +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `limit` | *number* | :heavy_minus_sign: | Maximum number of batches to return, from 1 through 100. | 20 | +| `after` | *string* | :heavy_minus_sign: | Batch id from the previous page's `last_id`. | batch_7a4b02 | +| `status` | [models.BatchListStatus](../../models/batchliststatus.mdx)[] | :heavy_minus_sign: | Repeat this parameter to include more than one status. | [
"completed",
"failed"
] | +| `createdAfter` | *models.BatchListTimestamp* | :heavy_minus_sign: | Only include batches created strictly after this timestamp. | 2026-08-20T00:00:00Z | +| `createdBefore` | *models.BatchListTimestamp* | :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/models/operations/listbatchesresponse.mdx b/docs/models/operations/listbatchesresponse.mdx new file mode 100644 index 000000000..c858d1324 --- /dev/null +++ b/docs/models/operations/listbatchesresponse.mdx @@ -0,0 +1,25 @@ +--- +title: "ListBatchesResponse" +--- + +## Example Usage + +```typescript +import { ListBatchesResponse } from "@openrouter/sdk/models/operations"; + +let value: ListBatchesResponse = { + result: { + data: [], + firstId: null, + hasMore: false, + lastId: null, + object: "list", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `result` | [models.BatchListResponse](../../models/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/models/oranthropicbashtoolresult.mdx b/docs/models/oranthropicbashtoolresult.mdx new file mode 100644 index 000000000..8fc96b2fc --- /dev/null +++ b/docs/models/oranthropicbashtoolresult.mdx @@ -0,0 +1,27 @@ +--- +title: "ORAnthropicBashToolResult" +--- + +Output of an `openrouter:bash` call executed in the OpenRouter sandbox (`engine: 'openrouter'`) + +## Example Usage + +```typescript +import { ORAnthropicBashToolResult } from "@openrouter/sdk/models"; + +let value: ORAnthropicBashToolResult = { + content: {}, + toolUseId: "", + type: "openrouter_bash_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `containerId` | *string* | :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` | Record\ | :heavy_check_mark: | N/A | +| `files` | [models.ORAnthropicBashToolResultFile](../models/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. | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | +| `type` | *"openrouter_bash_tool_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/oranthropicbashtoolresultfile.mdx b/docs/models/oranthropicbashtoolresultfile.mdx new file mode 100644 index 000000000..9cd8bb363 --- /dev/null +++ b/docs/models/oranthropicbashtoolresultfile.mdx @@ -0,0 +1,29 @@ +--- +title: "ORAnthropicBashToolResultFile" +--- + +## Example Usage + +```typescript +import { ORAnthropicBashToolResultFile } from "@openrouter/sdk/models"; + +let value: ORAnthropicBashToolResultFile = { + containerId: "", + endIndex: 749635, + fileId: "", + filename: "example.file", + startIndex: 526892, + type: "container_file_citation", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `containerId` | *string* | :heavy_check_mark: | N/A | +| `endIndex` | *number* | :heavy_check_mark: | N/A | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `filename` | *string* | :heavy_check_mark: | N/A | +| `startIndex` | *number* | :heavy_check_mark: | N/A | +| `type` | [models.ORAnthropicBashToolResultTypeContainerFileCitation](../models/oranthropicbashtoolresulttypecontainerfilecitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/oranthropicbashtoolresulttypecontainerfilecitation.mdx b/docs/models/oranthropicbashtoolresulttypecontainerfilecitation.mdx new file mode 100644 index 000000000..2540636c7 --- /dev/null +++ b/docs/models/oranthropicbashtoolresulttypecontainerfilecitation.mdx @@ -0,0 +1,18 @@ +--- +title: "ORAnthropicBashToolResultTypeContainerFileCitation" +--- + +## Example Usage + +```typescript +import { ORAnthropicBashToolResultTypeContainerFileCitation } from "@openrouter/sdk/models"; + +let value: ORAnthropicBashToolResultTypeContainerFileCitation = + "container_file_citation"; +``` + +## Values + +```typescript +"container_file_citation" +``` \ No newline at end of file diff --git a/docs/models/oranthropiccontentblock.mdx b/docs/models/oranthropiccontentblock.mdx new file mode 100644 index 000000000..cee3944aa --- /dev/null +++ b/docs/models/oranthropiccontentblock.mdx @@ -0,0 +1,225 @@ +--- +title: "ORAnthropicContentBlock" +--- + +## Supported Types + +### `models.AnthropicAdvisorToolResult` + +```typescript +const value: models.AnthropicAdvisorToolResult = { + content: { + "key": "", + "key1": "", + "key2": "", + }, + toolUseId: "", + type: "advisor_tool_result", +}; +``` + +### `models.AnthropicBashCodeExecutionToolResult` + +```typescript +const value: models.AnthropicBashCodeExecutionToolResult = { + content: { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "bash_code_execution_result", + }, + toolUseId: "", + type: "bash_code_execution_tool_result", +}; +``` + +### `models.AnthropicCodeExecutionToolResult` + +```typescript +const value: models.AnthropicCodeExecutionToolResult = { + content: { + content: [], + returnCode: 0, + stderr: "", + stdout: "Hello", + type: "code_execution_result", + }, + toolUseId: "", + type: "code_execution_tool_result", +}; +``` + +### `models.AnthropicCompactionBlock` + +```typescript +const value: models.AnthropicCompactionBlock = { + content: "", + type: "compaction", +}; +``` + +### `models.AnthropicContainerUpload` + +```typescript +const value: models.AnthropicContainerUpload = { + fileId: "", + type: "container_upload", +}; +``` + +### `models.ORAnthropicBashToolResult` + +```typescript +const value: models.ORAnthropicBashToolResult = { + content: { + "key": "", + "key1": "", + "key2": "", + }, + toolUseId: "", + type: "openrouter_bash_tool_result", +}; +``` + +### `models.ORAnthropicShellToolResult` + +```typescript +const value: models.ORAnthropicShellToolResult = { + content: { + "key": "", + }, + toolUseId: "", + type: "openrouter_shell_tool_result", +}; +``` + +### `models.AnthropicRedactedThinkingBlock` + +```typescript +const value: models.AnthropicRedactedThinkingBlock = { + data: "", + type: "redacted_thinking", +}; +``` + +### `models.ORAnthropicServerToolUseBlock` + +```typescript +const value: models.ORAnthropicServerToolUseBlock = { + id: "", + name: "", + type: "server_tool_use", +}; +``` + +### `models.AnthropicTextBlock` + +```typescript +const value: models.AnthropicTextBlock = { + citations: null, + text: "Hello, world!", + type: "text", +}; +``` + +### `models.AnthropicTextEditorCodeExecutionToolResult` + +```typescript +const value: models.AnthropicTextEditorCodeExecutionToolResult = { + content: { + content: "file content", + fileType: "text", + numLines: 10, + startLine: 1, + totalLines: 10, + type: "text_editor_code_execution_view_result", + }, + toolUseId: "", + type: "text_editor_code_execution_tool_result", +}; +``` + +### `models.AnthropicThinkingBlock` + +```typescript +const value: models.AnthropicThinkingBlock = { + signature: "", + thinking: "", + type: "thinking", +}; +``` + +### `models.AnthropicToolSearchToolResult` + +```typescript +const value: models.AnthropicToolSearchToolResult = { + content: { + toolReferences: [ + { + toolName: "my_tool", + type: "tool_reference", + }, + ], + type: "tool_search_tool_search_result", + }, + toolUseId: "", + type: "tool_search_tool_result", +}; +``` + +### `models.AnthropicToolUseBlock` + +```typescript +const value: models.AnthropicToolUseBlock = { + caller: { + type: "direct", + }, + id: "", + name: "", + type: "tool_use", +}; +``` + +### `models.AnthropicWebFetchToolResult` + +```typescript +const value: models.AnthropicWebFetchToolResult = { + caller: { + type: "direct", + }, + content: { + content: { + source: { + data: "", + mediaType: "text/plain", + type: "text", + }, + title: null, + type: "document", + }, + retrievedAt: null, + type: "web_fetch_result", + url: "https://example.com", + }, + toolUseId: "", + type: "web_fetch_tool_result", +}; +``` + +### `models.AnthropicWebSearchToolResult` + +```typescript +const value: models.AnthropicWebSearchToolResult = { + caller: { + type: "direct", + }, + content: { + errorCode: "unavailable", + type: "web_search_tool_result_error", + }, + toolUseId: "", + type: "web_search_tool_result", +}; +``` + diff --git a/docs/models/oranthropicnullablecaller.mdx b/docs/models/oranthropicnullablecaller.mdx new file mode 100644 index 000000000..baa587da6 --- /dev/null +++ b/docs/models/oranthropicnullablecaller.mdx @@ -0,0 +1,32 @@ +--- +title: "ORAnthropicNullableCaller" +--- + +## Supported Types + +### `models.AnthropicCodeExecution20250825Caller` + +```typescript +const value: models.AnthropicCodeExecution20250825Caller = { + toolId: "", + type: "code_execution_20250825", +}; +``` + +### `models.AnthropicCodeExecution20260120Caller` + +```typescript +const value: models.AnthropicCodeExecution20260120Caller = { + toolId: "", + type: "code_execution_20260120", +}; +``` + +### `models.AnthropicDirectCaller` + +```typescript +const value: models.AnthropicDirectCaller = { + type: "direct", +}; +``` + diff --git a/docs/models/oranthropicservertooluseblock.mdx b/docs/models/oranthropicservertooluseblock.mdx new file mode 100644 index 000000000..68769f715 --- /dev/null +++ b/docs/models/oranthropicservertooluseblock.mdx @@ -0,0 +1,25 @@ +--- +title: "ORAnthropicServerToolUseBlock" +--- + +## Example Usage + +```typescript +import { ORAnthropicServerToolUseBlock } from "@openrouter/sdk/models"; + +let value: ORAnthropicServerToolUseBlock = { + id: "", + name: "", + type: "server_tool_use", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `caller` | *models.ORAnthropicNullableCaller* | :heavy_minus_sign: | N/A | \{
"type": "direct"
} | +| `id` | *string* | :heavy_check_mark: | N/A | | +| `input` | *any* | :heavy_minus_sign: | N/A | | +| `name` | *string* | :heavy_check_mark: | N/A | | +| `type` | *"server_tool_use"* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/oranthropicshelltoolresult.mdx b/docs/models/oranthropicshelltoolresult.mdx new file mode 100644 index 000000000..08317a814 --- /dev/null +++ b/docs/models/oranthropicshelltoolresult.mdx @@ -0,0 +1,31 @@ +--- +title: "ORAnthropicShellToolResult" +--- + +Output of an `openrouter:shell` call executed in the OpenRouter sandbox + +## Example Usage + +```typescript +import { ORAnthropicShellToolResult } from "@openrouter/sdk/models"; + +let value: ORAnthropicShellToolResult = { + content: { + "key": "", + "key1": "", + "key2": "", + }, + toolUseId: "", + type: "openrouter_shell_tool_result", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `containerId` | *string* | :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` | Record\ | :heavy_check_mark: | N/A | +| `files` | [models.ORAnthropicShellToolResultFile](../models/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. | +| `toolUseId` | *string* | :heavy_check_mark: | N/A | +| `type` | *"openrouter_shell_tool_result"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/oranthropicshelltoolresultfile.mdx b/docs/models/oranthropicshelltoolresultfile.mdx new file mode 100644 index 000000000..40d24e1bb --- /dev/null +++ b/docs/models/oranthropicshelltoolresultfile.mdx @@ -0,0 +1,29 @@ +--- +title: "ORAnthropicShellToolResultFile" +--- + +## Example Usage + +```typescript +import { ORAnthropicShellToolResultFile } from "@openrouter/sdk/models"; + +let value: ORAnthropicShellToolResultFile = { + containerId: "", + endIndex: 986354, + fileId: "", + filename: "example.file", + startIndex: 481079, + type: "container_file_citation", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `containerId` | *string* | :heavy_check_mark: | N/A | +| `endIndex` | *number* | :heavy_check_mark: | N/A | +| `fileId` | *string* | :heavy_check_mark: | N/A | +| `filename` | *string* | :heavy_check_mark: | N/A | +| `startIndex` | *number* | :heavy_check_mark: | N/A | +| `type` | [models.ORAnthropicShellToolResultTypeContainerFileCitation](../models/oranthropicshelltoolresulttypecontainerfilecitation.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/oranthropicshelltoolresulttypecontainerfilecitation.mdx b/docs/models/oranthropicshelltoolresulttypecontainerfilecitation.mdx new file mode 100644 index 000000000..f88372a26 --- /dev/null +++ b/docs/models/oranthropicshelltoolresulttypecontainerfilecitation.mdx @@ -0,0 +1,18 @@ +--- +title: "ORAnthropicShellToolResultTypeContainerFileCitation" +--- + +## Example Usage + +```typescript +import { ORAnthropicShellToolResultTypeContainerFileCitation } from "@openrouter/sdk/models"; + +let value: ORAnthropicShellToolResultTypeContainerFileCitation = + "container_file_citation"; +``` + +## Values + +```typescript +"container_file_citation" +``` \ No newline at end of file diff --git a/docs/models/oranthropicstopreason.mdx b/docs/models/oranthropicstopreason.mdx new file mode 100644 index 000000000..288622067 --- /dev/null +++ b/docs/models/oranthropicstopreason.mdx @@ -0,0 +1,19 @@ +--- +title: "ORAnthropicStopReason" +--- + +## Example Usage + +```typescript +import { ORAnthropicStopReason } from "@openrouter/sdk/models"; + +let value: ORAnthropicStopReason = "end_turn"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"end_turn" | "max_tokens" | "model_context_window_exceeded" | "stop_sequence" | "tool_use" | "pause_turn" | "refusal" | "compaction" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/outputcodeinterpretercallitem.mdx b/docs/models/outputcodeinterpretercallitem.mdx index 35912f5c5..d38449c5e 100644 --- a/docs/models/outputcodeinterpretercallitem.mdx +++ b/docs/models/outputcodeinterpretercallitem.mdx @@ -10,7 +10,7 @@ A code interpreter execution call with outputs import { OutputCodeInterpreterCallItem } from "@openrouter/sdk/models"; let value: OutputCodeInterpreterCallItem = { - id: "ci-abc123", + id: "msg-abc123", status: "completed", type: "code_interpreter_call", }; @@ -18,12 +18,12 @@ let value: OutputCodeInterpreterCallItem = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `code` | *string* | :heavy_minus_sign: | N/A | | -| `containerId` | *string* | :heavy_minus_sign: | N/A | | -| `id` | *string* | :heavy_check_mark: | N/A | | -| `outputs` | *models.OutputCodeInterpreterCallItemOutput*[] | :heavy_minus_sign: | N/A | | -| `status` | [models.OutputCodeInterpreterCallItemStatus](../models/outputcodeinterpretercallitemstatus.mdx) | :heavy_check_mark: | N/A | | -| `type` | [models.OutputCodeInterpreterCallItemType](../models/outputcodeinterpretercallitemtype.mdx) | :heavy_check_mark: | N/A | | -| `additionalProperties` | Record\ | :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` | *string* | :heavy_minus_sign: | N/A | | +| `containerId` | *string* | :heavy_minus_sign: | N/A | | +| `id` | *string* | :heavy_check_mark: | N/A | | +| `outputs` | *models.OutputCodeInterpreterCallItemOutput*[] | :heavy_minus_sign: | N/A | | +| `status` | [models.OutputCodeInterpreterCallItemStatus](../models/outputcodeinterpretercallitemstatus.mdx) | :heavy_check_mark: | N/A | | +| `type` | [models.OutputCodeInterpreterCallItemType](../models/outputcodeinterpretercallitemtype.mdx) | :heavy_check_mark: | N/A | | +| `additionalProperties` | Record\ | :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/models/outputcomputercallitem.mdx b/docs/models/outputcomputercallitem.mdx index 8b85ef07d..507d34ec3 100644 --- a/docs/models/outputcomputercallitem.mdx +++ b/docs/models/outputcomputercallitem.mdx @@ -8,7 +8,7 @@ title: "OutputComputerCallItem" import { OutputComputerCallItem } from "@openrouter/sdk/models"; let value: OutputComputerCallItem = { - callId: "call-abc123", + callId: "", pendingSafetyChecks: [], status: "completed", type: "computer_call", diff --git a/docs/models/outputdatetimeitem.mdx b/docs/models/outputdatetimeitem.mdx index 7d8c5bd4f..a77992945 100644 --- a/docs/models/outputdatetimeitem.mdx +++ b/docs/models/outputdatetimeitem.mdx @@ -10,9 +10,9 @@ An openrouter:datetime server tool output item import { OutputDatetimeItem } from "@openrouter/sdk/models"; let value: OutputDatetimeItem = { - datetime: "2026-03-12T14:30:00.000Z", + datetime: "2024-12-31T10:49:34.949Z", status: "completed", - timezone: "UTC", + timezone: "America/Danmarkshavn", type: "openrouter:datetime", }; ``` diff --git a/docs/models/outputfilesearchcallitem.mdx b/docs/models/outputfilesearchcallitem.mdx index 1bea84a57..a4b69149f 100644 --- a/docs/models/outputfilesearchcallitem.mdx +++ b/docs/models/outputfilesearchcallitem.mdx @@ -8,9 +8,11 @@ title: "OutputFileSearchCallItem" import { OutputFileSearchCallItem } from "@openrouter/sdk/models"; let value: OutputFileSearchCallItem = { - id: "fs-abc123", + id: "msg-abc123", queries: [ - "search term", + "", + "", + "", ], status: "completed", type: "file_search_call", diff --git a/docs/models/outputfusionservertoolitem.mdx b/docs/models/outputfusionservertoolitem.mdx index 27f18f901..8a70606ef 100644 --- a/docs/models/outputfusionservertoolitem.mdx +++ b/docs/models/outputfusionservertoolitem.mdx @@ -24,7 +24,7 @@ let value: OutputFusionServerToolItem = { | `failedModels` | [models.FailedModel](../models/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. | | | `failureReason` | *string* | :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` | *string* | :heavy_minus_sign: | N/A | | -| `responses` | [models.ResponseT](../models/responset.mdx)[] | :heavy_minus_sign: | Analysis models that produced a response in this fusion run, with each model's full panel content. | | +| `responses` | [models.OutputFusionServerToolItemResponse](../models/outputfusionservertoolitemresponse.mdx)[] | :heavy_minus_sign: | Analysis models that produced a response in this fusion run, with each model's full panel content. | | | `sources` | [models.FusionSource](../models/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` | [models.ToolCallStatus](../models/toolcallstatus.mdx) | :heavy_check_mark: | N/A | completed | | `type` | [models.OutputFusionServerToolItemType](../models/outputfusionservertoolitemtype.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/responset.mdx b/docs/models/outputfusionservertoolitemresponse.mdx similarity index 68% rename from docs/models/responset.mdx rename to docs/models/outputfusionservertoolitemresponse.mdx index e5f9caf13..ec84f788a 100644 --- a/docs/models/responset.mdx +++ b/docs/models/outputfusionservertoolitemresponse.mdx @@ -1,14 +1,14 @@ --- -title: "ResponseT" +title: "OutputFusionServerToolItemResponse" --- ## Example Usage ```typescript -import { ResponseT } from "@openrouter/sdk/models"; +import { OutputFusionServerToolItemResponse } from "@openrouter/sdk/models"; -let value: ResponseT = { - model: "El Camino", +let value: OutputFusionServerToolItemResponse = { + model: "Accord", }; ``` diff --git a/docs/models/outputimagegenerationcallitem.mdx b/docs/models/outputimagegenerationcallitem.mdx index fb6f5e8f3..cc220ac92 100644 --- a/docs/models/outputimagegenerationcallitem.mdx +++ b/docs/models/outputimagegenerationcallitem.mdx @@ -8,7 +8,7 @@ title: "OutputImageGenerationCallItem" import { OutputImageGenerationCallItem } from "@openrouter/sdk/models"; let value: OutputImageGenerationCallItem = { - id: "img-abc123", + id: "msg-abc123", status: "completed", type: "image_generation_call", }; diff --git a/docs/models/outputitems.mdx b/docs/models/outputitems.mdx index 819d41a41..c70d6f5ed 100644 --- a/docs/models/outputitems.mdx +++ b/docs/models/outputitems.mdx @@ -27,7 +27,7 @@ const value: models.OutputApplyPatchCallItem = { ```typescript const value: models.OutputCodeInterpreterCallItem = { - id: "ci-abc123", + id: "msg-abc123", status: "completed", type: "code_interpreter_call", }; @@ -37,7 +37,7 @@ const value: models.OutputCodeInterpreterCallItem = { ```typescript const value: models.OutputComputerCallItem = { - callId: "call-abc123", + callId: "", pendingSafetyChecks: [], status: "completed", type: "computer_call", @@ -59,9 +59,9 @@ const value: models.OutputCustomToolCallItem = { ```typescript const value: models.OutputFileSearchCallItem = { - id: "fs-abc123", + id: "msg-abc123", queries: [ - "search term", + "", ], status: "completed", type: "file_search_call", @@ -83,7 +83,7 @@ const value: models.OutputFunctionCallItem = { ```typescript const value: models.OutputImageGenerationCallItem = { - id: "img-abc123", + id: "msg-abc123", status: "completed", type: "image_generation_call", }; @@ -154,9 +154,9 @@ const value: models.OutputCodeInterpreterServerToolItem = { ```typescript const value: models.OutputDatetimeItem = { - datetime: "2026-03-12T14:30:00.000Z", + datetime: "2024-12-31T05:26:30.868Z", status: "completed", - timezone: "UTC", + timezone: "Europe/Vatican", type: "openrouter:datetime", }; ``` @@ -329,7 +329,7 @@ const value: models.OutputShellCallOutputItem = { ```typescript const value: models.OutputWebSearchCallItem = { - id: "ws-abc123", + id: "msg-abc123", status: "completed", type: "web_search_call", }; diff --git a/docs/models/outputwebsearchcallitem.mdx b/docs/models/outputwebsearchcallitem.mdx index 34e6702d6..7df5d46f2 100644 --- a/docs/models/outputwebsearchcallitem.mdx +++ b/docs/models/outputwebsearchcallitem.mdx @@ -8,7 +8,7 @@ title: "OutputWebSearchCallItem" import { OutputWebSearchCallItem } from "@openrouter/sdk/models"; let value: OutputWebSearchCallItem = { - id: "ws-abc123", + id: "msg-abc123", status: "completed", type: "web_search_call", }; @@ -16,10 +16,10 @@ let value: OutputWebSearchCallItem = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `action` | *models.Action* | :heavy_minus_sign: | N/A | | -| `id` | *string* | :heavy_check_mark: | N/A | | -| `status` | [models.WebSearchStatus](../models/websearchstatus.mdx) | :heavy_check_mark: | N/A | completed | -| `type` | [models.TypeWebSearchCall](../models/typewebsearchcall.mdx) | :heavy_check_mark: | N/A | | -| `additionalProperties` | Record\ | :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` | *models.Action* | :heavy_minus_sign: | N/A | | +| `id` | *string* | :heavy_check_mark: | N/A | | +| `status` | [models.WebSearchStatus](../models/websearchstatus.mdx) | :heavy_check_mark: | N/A | completed | +| `type` | [models.TypeWebSearchCall](../models/typewebsearchcall.mdx) | :heavy_check_mark: | N/A | | +| `additionalProperties` | Record\ | :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/models/reasoningdetail.mdx b/docs/models/reasoningdetail.mdx new file mode 100644 index 000000000..2c9b92446 --- /dev/null +++ b/docs/models/reasoningdetail.mdx @@ -0,0 +1,44 @@ +--- +title: "ReasoningDetail" +--- + +## Supported Types + +### `models.ReasoningDetailSummary` + +```typescript +const value: models.ReasoningDetailSummary = { + summary: + "The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...", + type: "reasoning.summary", +}; +``` + +### `models.ReasoningDetailEncrypted` + +```typescript +const value: models.ReasoningDetailEncrypted = { + data: "encrypted data", + type: "reasoning.encrypted", +}; +``` + +### `models.ReasoningDetailText` + +```typescript +const value: models.ReasoningDetailText = { + type: "reasoning.text", +}; +``` + +### `models.ReasoningDetailServerToolCall` + +```typescript +const value: models.ReasoningDetailServerToolCall = { + arguments: "{\"prompt\":\"Compare carbon tax proposals\"}", + result: "{\"status\":\"ok\",\"models\":[\"openai/gpt-4o\"]}", + toolName: "openrouter:fusion", + type: "reasoning.server_tool_call", +}; +``` + diff --git a/docs/models/reasoningdetailencrypted.mdx b/docs/models/reasoningdetailencrypted.mdx index 572ab1504..ddd3862da 100644 --- a/docs/models/reasoningdetailencrypted.mdx +++ b/docs/models/reasoningdetailencrypted.mdx @@ -10,7 +10,7 @@ Reasoning detail encrypted schema import { ReasoningDetailEncrypted } from "@openrouter/sdk/models"; let value: ReasoningDetailEncrypted = { - data: "", + data: "encrypted data", type: "reasoning.encrypted", }; ``` diff --git a/docs/models/reasoningdetailservertoolcall.mdx b/docs/models/reasoningdetailservertoolcall.mdx index 9760743b7..62f969f7a 100644 --- a/docs/models/reasoningdetailservertoolcall.mdx +++ b/docs/models/reasoningdetailservertoolcall.mdx @@ -10,9 +10,9 @@ Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried import { ReasoningDetailServerToolCall } from "@openrouter/sdk/models"; let value: ReasoningDetailServerToolCall = { - arguments: "", - result: "", - toolName: "", + arguments: "{\"prompt\":\"Compare carbon tax proposals\"}", + result: "{\"status\":\"ok\",\"models\":[\"openai/gpt-4o\"]}", + toolName: "openrouter:fusion", type: "reasoning.server_tool_call", }; ``` diff --git a/docs/models/reasoningdetailunion.mdx b/docs/models/reasoningdetailunion.mdx index 84d9c9fcb..f2293fcde 100644 --- a/docs/models/reasoningdetailunion.mdx +++ b/docs/models/reasoningdetailunion.mdx @@ -11,7 +11,7 @@ Reasoning detail union schema ```typescript const value: models.ReasoningDetailEncrypted = { - data: "", + data: "encrypted data", type: "reasoning.encrypted", }; ``` @@ -20,9 +20,9 @@ const value: models.ReasoningDetailEncrypted = { ```typescript const value: models.ReasoningDetailServerToolCall = { - arguments: "", - result: "", - toolName: "", + arguments: "{\"prompt\":\"Compare carbon tax proposals\"}", + result: "{\"status\":\"ok\",\"models\":[\"openai/gpt-4o\"]}", + toolName: "openrouter:fusion", type: "reasoning.server_tool_call", }; ``` diff --git a/docs/models/refusal.mdx b/docs/models/refusal.mdx new file mode 100644 index 000000000..78e6568f6 --- /dev/null +++ b/docs/models/refusal.mdx @@ -0,0 +1,35 @@ +--- +title: "Refusal" +--- + +## Example Usage + +```typescript +import { Refusal } from "@openrouter/sdk/models"; + +let value: Refusal = { + bytes: null, + logprob: 7310.99, + token: "", + topLogprobs: [ + { + bytes: [ + 56010, + 967373, + 9048, + ], + logprob: 4843.75, + token: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `bytes` | *number*[] | :heavy_check_mark: | N/A | +| `logprob` | *number* | :heavy_check_mark: | N/A | +| `token` | *string* | :heavy_check_mark: | N/A | +| `topLogprobs` | [models.RefusalTopLogprob](../models/refusaltoplogprob.mdx)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/refusaltoplogprob.mdx b/docs/models/refusaltoplogprob.mdx new file mode 100644 index 000000000..396776262 --- /dev/null +++ b/docs/models/refusaltoplogprob.mdx @@ -0,0 +1,26 @@ +--- +title: "RefusalTopLogprob" +--- + +## Example Usage + +```typescript +import { RefusalTopLogprob } from "@openrouter/sdk/models"; + +let value: RefusalTopLogprob = { + bytes: [ + 365203, + 300664, + ], + logprob: 1167.32, + token: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `bytes` | *number*[] | :heavy_check_mark: | N/A | +| `logprob` | *number* | :heavy_check_mark: | N/A | +| `token` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/requestt.mdx b/docs/models/requestt.mdx new file mode 100644 index 000000000..b449e05c2 --- /dev/null +++ b/docs/models/requestt.mdx @@ -0,0 +1,24 @@ +--- +title: "RequestT" +--- + +## Example Usage + +```typescript +import { RequestT } from "@openrouter/sdk/models"; + +let value: RequestT = { + body: { + "key": "", + "key1": "", + }, + customId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `body` | Record\ | :heavy_check_mark: | Request payload for the batch `endpoint`. | +| `customId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/result.mdx b/docs/models/result.mdx new file mode 100644 index 000000000..26640c925 --- /dev/null +++ b/docs/models/result.mdx @@ -0,0 +1,64 @@ +--- +title: "Result" +--- + +## Example Usage + +```typescript +import { Result } from "@openrouter/sdk/models"; + +let value: Result = { + customId: "", + error: { + message: "", + param: "", + type: "", + }, + id: "", + response: { + body: { + completedAt: 1704067210, + createdAt: 1704067200, + error: null, + frequencyPenalty: null, + id: "resp-abc123", + incompleteDetails: 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", + }, + ], + parallelToolCalls: true, + presencePenalty: null, + status: "completed", + temperature: null, + toolChoice: "auto", + tools: [], + topP: null, + }, + requestId: "", + statusCode: 170920, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `customId` | *string* | :heavy_check_mark: | N/A | +| `error` | [models.ResultError](../models/resulterror.mdx) | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `response` | [models.BatchObjectResponse](../models/batchobjectresponse.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/resulterror.mdx b/docs/models/resulterror.mdx new file mode 100644 index 000000000..46ae380dc --- /dev/null +++ b/docs/models/resulterror.mdx @@ -0,0 +1,24 @@ +--- +title: "ResultError" +--- + +## Example Usage + +```typescript +import { ResultError } from "@openrouter/sdk/models"; + +let value: ResultError = { + message: "", + param: "", + type: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `errorType` | [models.ApiErrorType](../models/apierrortype.mdx) | :heavy_minus_sign: | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded | +| `message` | *string* | :heavy_check_mark: | N/A | | +| `param` | *string* | :heavy_check_mark: | N/A | | +| `type` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/submitgenerationfeedbackrequest.mdx b/docs/models/submitgenerationfeedbackrequest.mdx index db7043f72..92aa35e53 100644 --- a/docs/models/submitgenerationfeedbackrequest.mdx +++ b/docs/models/submitgenerationfeedbackrequest.mdx @@ -17,8 +17,8 @@ let value: SubmitGenerationFeedbackRequest = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `category` | [models.Category](../models/category.mdx) | :heavy_check_mark: | The category of feedback being reported | incorrect_response | -| `comment` | *string* | :heavy_minus_sign: | An optional free-text comment describing the feedback | The model repeated the same paragraph three times. | -| `generationId` | *string* | :heavy_check_mark: | The generation to submit feedback on | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `category` | [models.SubmitGenerationFeedbackRequestCategory](../models/submitgenerationfeedbackrequestcategory.mdx) | :heavy_check_mark: | The category of feedback being reported | incorrect_response | +| `comment` | *string* | :heavy_minus_sign: | An optional free-text comment describing the feedback | The model repeated the same paragraph three times. | +| `generationId` | *string* | :heavy_check_mark: | The generation to submit feedback on | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG | \ No newline at end of file diff --git a/docs/models/category.mdx b/docs/models/submitgenerationfeedbackrequestcategory.mdx similarity index 60% rename from docs/models/category.mdx rename to docs/models/submitgenerationfeedbackrequestcategory.mdx index b5abb9ccc..dfe82bb81 100644 --- a/docs/models/category.mdx +++ b/docs/models/submitgenerationfeedbackrequestcategory.mdx @@ -1,5 +1,5 @@ --- -title: "Category" +title: "SubmitGenerationFeedbackRequestCategory" --- The category of feedback being reported @@ -7,9 +7,9 @@ The category of feedback being reported ## Example Usage ```typescript -import { Category } from "@openrouter/sdk/models"; +import { SubmitGenerationFeedbackRequestCategory } from "@openrouter/sdk/models"; -let value: Category = "incorrect_response"; +let value: SubmitGenerationFeedbackRequestCategory = "incorrect_response"; // Open enum: unrecognized values are captured as Unrecognized ``` diff --git a/docs/models/timings.mdx b/docs/models/timings.mdx deleted file mode 100644 index d4887bbdf..000000000 --- a/docs/models/timings.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "Timings" ---- - -## Example Usage - -```typescript -import { Timings } from "@openrouter/sdk/models"; - -let value: Timings = { - epochMs: 651094, - event: "first_token_received", - startMs: 652789, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `epochMs` | *number* | :heavy_check_mark: | N/A | -| `event` | [models.Event](../models/event.mdx) | :heavy_check_mark: | N/A | -| `startMs` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/toolcall.mdx b/docs/models/toolcall.mdx new file mode 100644 index 000000000..02b95fb1a --- /dev/null +++ b/docs/models/toolcall.mdx @@ -0,0 +1,28 @@ +--- +title: "ToolCall" +--- + +## Example Usage + +```typescript +import { ToolCall } from "@openrouter/sdk/models"; + +let value: ToolCall = { + function: { + arguments: "", + name: "", + }, + id: "", + index: 448237, + type: "function", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `function` | [models.BatchObjectFunction](../models/batchobjectfunction.mdx) | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `index` | *number* | :heavy_check_mark: | N/A | +| `type` | [models.ChoiceTypeFunction](../models/choicetypefunction.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/typewebsearchtoolresulterror.mdx b/docs/models/typewebsearchtoolresulterror.mdx deleted file mode 100644 index 9d4c672ed..000000000 --- a/docs/models/typewebsearchtoolresulterror.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "TypeWebSearchToolResultError" ---- - -## Example Usage - -```typescript -import { TypeWebSearchToolResultError } from "@openrouter/sdk/models"; - -let value: TypeWebSearchToolResultError = "web_search_tool_result_error"; -``` - -## Values - -```typescript -"web_search_tool_result_error" -``` \ No newline at end of file diff --git a/docs/models/upstream.mdx b/docs/models/upstream.mdx new file mode 100644 index 000000000..630daad07 --- /dev/null +++ b/docs/models/upstream.mdx @@ -0,0 +1,23 @@ +--- +title: "Upstream" +--- + +The upstream batch deletion outcome; omitted when no provider was assigned. + +## Example Usage + +```typescript +import { Upstream } from "@openrouter/sdk/models"; + +let value: Upstream = { + provider: "OpenAI", + status: "deleted", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `provider` | *string* | :heavy_check_mark: | The provider name stored on the batch. | OpenAI | +| `status` | [models.BatchDeletionOutcome](../models/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/models/websearchcitation.mdx b/docs/models/websearchcitation.mdx new file mode 100644 index 000000000..90a6c9d09 --- /dev/null +++ b/docs/models/websearchcitation.mdx @@ -0,0 +1,23 @@ +--- +title: "WebSearchCitation" +--- + +## Example Usage + +```typescript +import { WebSearchCitation } from "@openrouter/sdk/models"; + +let value: WebSearchCitation = { + title: "", + url: "https://feline-encouragement.com/", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `citedText` | *string* | :heavy_minus_sign: | N/A | +| `encryptedIndex` | *string* | :heavy_minus_sign: | N/A | +| `title` | *string* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | N/A | \ 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 000000000..5321bbffb --- /dev/null +++ b/docs/sdks/batch/README.mdx @@ -0,0 +1,646 @@ +--- +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 +* [createBatches](#createbatches) - Create a batch +* [delete](#delete) - Delete a batch +* [getBatches](#getbatches) - 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 + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.batch.list(); + + for await (const page of result) { + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { batchList } from "@openrouter/sdk/funcs/batchList.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchList(openRouter); + if (res.ok) { + const { value: result } = res; + for await (const page of result) { + console.log(page); + } + } else { + console.log("batchList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListBatchesRequest](../../models/operations/listbatchesrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListBatchesResponse](../../models/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 | \*/\* | + +## createBatches + +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 + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.batch.createBatches({ + batchSubmitBody: { + endpoint: "/v1/chat/completions", + model: "openai/gpt-4o", + requests: [ + { + body: { + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "openai/gpt-4o", + }, + customId: "req-0001", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { batchCreateBatches } from "@openrouter/sdk/funcs/batchCreateBatches.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchCreateBatches(openRouter, { + batchSubmitBody: { + endpoint: "/v1/chat/completions", + model: "openai/gpt-4o", + requests: [ + { + body: { + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "openai/gpt-4o", + }, + customId: "req-0001", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("batchCreateBatches failed:", res.error); + } +} + +run(); +``` +### Example Usage: messages + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.batch.createBatches({ + batchSubmitBody: { + endpoint: "/v1/messages", + model: "openai/gpt-5-nano", + requests: [ + { + body: { + "max_tokens": 1024, + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "openai/gpt-5-nano", + }, + customId: "req-0001", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { batchCreateBatches } from "@openrouter/sdk/funcs/batchCreateBatches.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchCreateBatches(openRouter, { + batchSubmitBody: { + endpoint: "/v1/messages", + model: "openai/gpt-5-nano", + requests: [ + { + body: { + "max_tokens": 1024, + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "openai/gpt-5-nano", + }, + customId: "req-0001", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("batchCreateBatches failed:", res.error); + } +} + +run(); +``` +### Example Usage: providerPinned + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.batch.createBatches({ + batchSubmitBody: { + endpoint: "/v1/chat/completions", + model: "google/gemini-3.6-flash", + requests: [ + { + body: { + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "google/gemini-3.6-flash", + }, + customId: "req-0001", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { batchCreateBatches } from "@openrouter/sdk/funcs/batchCreateBatches.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchCreateBatches(openRouter, { + batchSubmitBody: { + endpoint: "/v1/chat/completions", + model: "google/gemini-3.6-flash", + requests: [ + { + body: { + "messages": [ + { + "content": "Summarize ...", + "role": "user", + }, + ], + "model": "google/gemini-3.6-flash", + }, + customId: "req-0001", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("batchCreateBatches failed:", res.error); + } +} + +run(); +``` +### Example Usage: responses + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.batch.createBatches({ + batchSubmitBody: { + endpoint: "/v1/responses", + model: "openai/gpt-4o", + requests: [ + { + body: { + "input": [ + { + "content": [ + { + "text": "Summarize ...", + "type": "input_text", + }, + ], + "role": "user", + }, + ], + "model": "openai/gpt-4o", + }, + customId: "req-0001", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { batchCreateBatches } from "@openrouter/sdk/funcs/batchCreateBatches.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchCreateBatches(openRouter, { + batchSubmitBody: { + endpoint: "/v1/responses", + model: "openai/gpt-4o", + requests: [ + { + body: { + "input": [ + { + "content": [ + { + "text": "Summarize ...", + "type": "input_text", + }, + ], + "role": "user", + }, + ], + "model": "openai/gpt-4o", + }, + customId: "req-0001", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("batchCreateBatches failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBatchesRequest](../../models/operations/createbatchesrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.BatchObject](../../models/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 + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.batch.delete({ + id: "batch_abc123", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { batchDelete } from "@openrouter/sdk/funcs/batchDelete.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchDelete(openRouter, { + id: "batch_abc123", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("batchDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteBatchRequest](../../models/operations/deletebatchrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.BatchDeletedObject](../../models/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 | \*/\* | + +## getBatches + +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 + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.batch.getBatches({ + id: "batch_abc123", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { batchGetBatches } from "@openrouter/sdk/funcs/batchGetBatches.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchGetBatches(openRouter, { + id: "batch_abc123", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("batchGetBatches failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetBatchesRequest](../../models/operations/getbatchesrequest.mdx) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.BatchObject](../../models/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/jsr.json b/jsr.json index a3abc6d47..8ce62f33b 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.3.29", + "version": "1.3.30", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 565aa641c..bce51426b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.3.29", + "version": "1.3.30", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -73,15 +73,15 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", - "prepare": "npm run build", + "typecheck:transit": "exit 0", + "compile": "tsc && node scripts/unbarrel-imports.js", + "postinstall": "node scripts/check-types.js || true", "test:e2e": "vitest --run --project e2e", "test:transit": "exit 0", "test:watch": "vitest --watch --project unit", - "typecheck:transit": "exit 0", - "test": "vitest --run --project unit", "typecheck": "tsc --noEmit", - "compile": "tsc && node scripts/unbarrel-imports.js", - "postinstall": "node scripts/check-types.js || true" + "prepare": "npm run build", + "test": "vitest --run --project unit" }, "peerDependencies": { diff --git a/src/funcs/batchCreateBatches.ts b/src/funcs/batchCreateBatches.ts new file mode 100644 index 000000000..3c03a47c6 --- /dev/null +++ b/src/funcs/batchCreateBatches.ts @@ -0,0 +1,202 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8796df347125 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create a batch + * + * @remarks + * 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). + */ +export function batchCreateBatches( + client: OpenRouterCore, + request: operations.CreateBatchesRequest, + options?: RequestOptions, +): APIPromise< + Result< + models.BatchObject, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.CreateBatchesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + models.BatchObject, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.CreateBatchesRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.BatchSubmitBody, { explode: true }); + + const path = pathToFunc("/batches")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createBatches", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: false, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.BatchObject, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(202, models.BatchObject$inboundSchema), + M.jsonErr( + [400, 401, 402, 403, 404, 413, 422, 429], + errors.BatchErrorResponse$inboundSchema, + ), + M.jsonErr([500, 502], errors.BatchErrorResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/batchDelete.ts b/src/funcs/batchDelete.ts new file mode 100644 index 000000000..67513fd42 --- /dev/null +++ b/src/funcs/batchDelete.ts @@ -0,0 +1,204 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c86d26d514be + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete a batch + * + * @remarks + * 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). + */ +export function batchDelete( + client: OpenRouterCore, + request: operations.DeleteBatchRequest, + options?: RequestOptions, +): APIPromise< + Result< + models.BatchDeletedObject, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.DeleteBatchRequest, + options?: RequestOptions, +): Promise< + [ + Result< + models.BatchDeletedObject, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.DeleteBatchRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/batches/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteBatch", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.BatchDeletedObject, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, models.BatchDeletedObject$inboundSchema), + M.jsonErr([401, 404, 409, 429], errors.BatchErrorResponse$inboundSchema), + M.jsonErr([500, 502], errors.BatchErrorResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/batchGetBatches.ts b/src/funcs/batchGetBatches.ts new file mode 100644 index 000000000..c18c552d9 --- /dev/null +++ b/src/funcs/batchGetBatches.ts @@ -0,0 +1,208 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d4804b94cd90 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get a batch + * + * @remarks + * 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). + */ +export function batchGetBatches( + client: OpenRouterCore, + request: operations.GetBatchesRequest, + options?: RequestOptions, +): APIPromise< + Result< + models.BatchObject, + | errors.BatchPaymentRequiredResponseError + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.GetBatchesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + models.BatchObject, + | errors.BatchPaymentRequiredResponseError + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.GetBatchesRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/batches/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getBatches", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.BatchObject, + | errors.BatchPaymentRequiredResponseError + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, models.BatchObject$inboundSchema), + M.jsonErr(402, errors.BatchPaymentRequiredResponseError$inboundSchema), + M.jsonErr([401, 404, 429], errors.BatchErrorResponse$inboundSchema), + M.jsonErr([500, 502], errors.BatchErrorResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/batchList.ts b/src/funcs/batchList.ts new file mode 100644 index 000000000..62fca7b35 --- /dev/null +++ b/src/funcs/batchList.ts @@ -0,0 +1,274 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8709844813ac + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; +import { + createPageIterator, + haltIterator, + PageIterator, + Paginator, +} from "../types/operations.js"; + +/** + * List batches + * + * @remarks + * 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). + */ +export function batchList( + client: OpenRouterCore, + request?: operations.ListBatchesRequest | undefined, + options?: RequestOptions, +): APIPromise< + PageIterator< + Result< + operations.ListBatchesResponse, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { cursor: string } + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request?: operations.ListBatchesRequest | undefined, + options?: RequestOptions, +): Promise< + [ + PageIterator< + Result< + operations.ListBatchesResponse, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { cursor: string } + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListBatchesRequest$outboundSchema.optional().parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [haltIterator(parsed), { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/batches")(); + + const query = encodeFormQuery({ + "after": payload?.after, + "created_after": payload?.created_after, + "created_before": payload?.created_before, + "limit": payload?.limit, + "status": payload?.status, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "HTTP-Referer": encodeSimple( + "HTTP-Referer", + payload?.["HTTP-Referer"] ?? client._options.httpReferer, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Categories": encodeSimple( + "X-OpenRouter-Categories", + payload?.appCategories ?? client._options.appCategories, + { explode: false, charEncoding: "none" }, + ), + "X-OpenRouter-Title": encodeSimple( + "X-OpenRouter-Title", + payload?.appTitle ?? client._options.appTitle, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listBatches", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [haltIterator(requestRes), { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [haltIterator(doResult), { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result, raw] = await M.match< + operations.ListBatchesResponse, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ListBatchesResponse$inboundSchema, { + key: "Result", + }), + M.jsonErr([400, 401, 429], errors.BatchErrorResponse$inboundSchema), + M.jsonErr([500, 502], errors.BatchErrorResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [haltIterator(result), { + status: "complete", + request: req, + response, + }]; + } + + const nextFunc = ( + responseData: unknown, + ): { + next: Paginator< + Result< + operations.ListBatchesResponse, + | errors.BatchErrorResponse + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > + >; + "~next"?: { cursor: string }; + } => { + const nextCursor = (responseData as { last_id: unknown | null }).last_id; + if (typeof nextCursor !== "string") { + return { next: () => null }; + } + if (nextCursor.trim() === "") { + return { next: () => null }; + } + const results = (responseData as { data: unknown }).data; + if (!Array.isArray(results) || !results.length) { + return { next: () => null }; + } + + const nextVal = () => + batchList( + client, + { + ...request!, + after: nextCursor, + }, + options, + ); + + return { next: nextVal, "~next": { cursor: nextCursor } }; + }; + + const page = { ...result, ...nextFunc(raw) }; + return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, { + status: "complete", + request: req, + response, + }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index 0e3c82c7c..6cedac488 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.3.29", + sdkVersion: "1.3.30", genVersion: "2.914.0", - userAgent: "speakeasy-sdk/typescript 1.3.29 2.914.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.3.30 2.914.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/anthropicadvisortoolresult.ts b/src/models/anthropicadvisortoolresult.ts new file mode 100644 index 000000000..ea5b5c9cf --- /dev/null +++ b/src/models/anthropicadvisortoolresult.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e8832cf2f4c5 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicAdvisorToolResult = { + content: { [k: string]: any }; + toolUseId: string; + type: "advisor_tool_result"; +}; + +/** @internal */ +export const AnthropicAdvisorToolResult$inboundSchema: z.ZodType< + AnthropicAdvisorToolResult, + unknown +> = z.object({ + content: z.record(z.string(), z.any()), + tool_use_id: z.string(), + type: z.literal("advisor_tool_result"), +}).transform((v) => { + return remap$(v, { + "tool_use_id": "toolUseId", + }); +}); + +export function anthropicAdvisorToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicAdvisorToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicAdvisorToolResult' from JSON`, + ); +} diff --git a/src/models/anthropicbase64pdfsource.ts b/src/models/anthropicbase64pdfsource.ts index 4c010cca9..a26ac9732 100644 --- a/src/models/anthropicbase64pdfsource.ts +++ b/src/models/anthropicbase64pdfsource.ts @@ -5,7 +5,10 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export const AnthropicBase64PdfSourceMediaType = { ApplicationPdf: "application/pdf", @@ -14,22 +17,55 @@ export type AnthropicBase64PdfSourceMediaType = ClosedEnum< typeof AnthropicBase64PdfSourceMediaType >; +export const AnthropicBase64PdfSourceType = { + Base64: "base64", +} as const; +export type AnthropicBase64PdfSourceType = ClosedEnum< + typeof AnthropicBase64PdfSourceType +>; + export type AnthropicBase64PdfSource = { data: string; mediaType: AnthropicBase64PdfSourceMediaType; - type: "base64"; + type: AnthropicBase64PdfSourceType; }; /** @internal */ -export const AnthropicBase64PdfSourceMediaType$outboundSchema: z.ZodEnum< +export const AnthropicBase64PdfSourceMediaType$inboundSchema: z.ZodEnum< typeof AnthropicBase64PdfSourceMediaType > = z.enum(AnthropicBase64PdfSourceMediaType); +/** @internal */ +export const AnthropicBase64PdfSourceMediaType$outboundSchema: z.ZodEnum< + typeof AnthropicBase64PdfSourceMediaType +> = AnthropicBase64PdfSourceMediaType$inboundSchema; + +/** @internal */ +export const AnthropicBase64PdfSourceType$inboundSchema: z.ZodEnum< + typeof AnthropicBase64PdfSourceType +> = z.enum(AnthropicBase64PdfSourceType); +/** @internal */ +export const AnthropicBase64PdfSourceType$outboundSchema: z.ZodEnum< + typeof AnthropicBase64PdfSourceType +> = AnthropicBase64PdfSourceType$inboundSchema; +/** @internal */ +export const AnthropicBase64PdfSource$inboundSchema: z.ZodType< + AnthropicBase64PdfSource, + unknown +> = z.object({ + data: z.string(), + media_type: AnthropicBase64PdfSourceMediaType$inboundSchema, + type: AnthropicBase64PdfSourceType$inboundSchema, +}).transform((v) => { + return remap$(v, { + "media_type": "mediaType", + }); +}); /** @internal */ export type AnthropicBase64PdfSource$Outbound = { data: string; media_type: string; - type: "base64"; + type: string; }; /** @internal */ @@ -39,7 +75,7 @@ export const AnthropicBase64PdfSource$outboundSchema: z.ZodType< > = z.object({ data: z.string(), mediaType: AnthropicBase64PdfSourceMediaType$outboundSchema, - type: z.literal("base64"), + type: AnthropicBase64PdfSourceType$outboundSchema, }).transform((v) => { return remap$(v, { mediaType: "media_type", @@ -53,3 +89,12 @@ export function anthropicBase64PdfSourceToJSON( AnthropicBase64PdfSource$outboundSchema.parse(anthropicBase64PdfSource), ); } +export function anthropicBase64PdfSourceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicBase64PdfSource$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicBase64PdfSource' from JSON`, + ); +} diff --git a/src/models/anthropicbashcodeexecutioncontent.ts b/src/models/anthropicbashcodeexecutioncontent.ts new file mode 100644 index 000000000..9a6965e12 --- /dev/null +++ b/src/models/anthropicbashcodeexecutioncontent.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2cbd7b2f90c2 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicBashCodeExecutionResult, + AnthropicBashCodeExecutionResult$inboundSchema, +} from "./anthropicbashcodeexecutionresult.js"; +import { + AnthropicBashCodeExecutionToolResultError, + AnthropicBashCodeExecutionToolResultError$inboundSchema, +} from "./anthropicbashcodeexecutiontoolresulterror.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicBashCodeExecutionContent = + | AnthropicBashCodeExecutionResult + | AnthropicBashCodeExecutionToolResultError + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const AnthropicBashCodeExecutionContent$inboundSchema: z.ZodType< + AnthropicBashCodeExecutionContent, + unknown +> = discriminatedUnion("type", { + bash_code_execution_result: AnthropicBashCodeExecutionResult$inboundSchema, + bash_code_execution_tool_result_error: + AnthropicBashCodeExecutionToolResultError$inboundSchema, +}); + +export function anthropicBashCodeExecutionContentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicBashCodeExecutionContent$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicBashCodeExecutionContent' from JSON`, + ); +} diff --git a/src/models/anthropicbashcodeexecutionoutput.ts b/src/models/anthropicbashcodeexecutionoutput.ts new file mode 100644 index 000000000..da22ef330 --- /dev/null +++ b/src/models/anthropicbashcodeexecutionoutput.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 58a93663b57a + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicBashCodeExecutionOutputType = { + BashCodeExecutionOutput: "bash_code_execution_output", +} as const; +export type AnthropicBashCodeExecutionOutputType = ClosedEnum< + typeof AnthropicBashCodeExecutionOutputType +>; + +export type AnthropicBashCodeExecutionOutput = { + fileId: string; + type: AnthropicBashCodeExecutionOutputType; +}; + +/** @internal */ +export const AnthropicBashCodeExecutionOutputType$inboundSchema: z.ZodEnum< + typeof AnthropicBashCodeExecutionOutputType +> = z.enum(AnthropicBashCodeExecutionOutputType); + +/** @internal */ +export const AnthropicBashCodeExecutionOutput$inboundSchema: z.ZodType< + AnthropicBashCodeExecutionOutput, + unknown +> = z.object({ + file_id: z.string(), + type: AnthropicBashCodeExecutionOutputType$inboundSchema, +}).transform((v) => { + return remap$(v, { + "file_id": "fileId", + }); +}); + +export function anthropicBashCodeExecutionOutputFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicBashCodeExecutionOutput$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicBashCodeExecutionOutput' from JSON`, + ); +} diff --git a/src/models/anthropicbashcodeexecutionresult.ts b/src/models/anthropicbashcodeexecutionresult.ts new file mode 100644 index 000000000..5362483e2 --- /dev/null +++ b/src/models/anthropicbashcodeexecutionresult.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 556789aa061d + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicBashCodeExecutionOutput, + AnthropicBashCodeExecutionOutput$inboundSchema, +} from "./anthropicbashcodeexecutionoutput.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicBashCodeExecutionResult = { + content: Array; + returnCode: number; + stderr: string; + stdout: string; + type: "bash_code_execution_result"; +}; + +/** @internal */ +export const AnthropicBashCodeExecutionResult$inboundSchema: z.ZodType< + AnthropicBashCodeExecutionResult, + unknown +> = z.object({ + content: z.array(AnthropicBashCodeExecutionOutput$inboundSchema), + return_code: z.int(), + stderr: z.string(), + stdout: z.string(), + type: z.literal("bash_code_execution_result"), +}).transform((v) => { + return remap$(v, { + "return_code": "returnCode", + }); +}); + +export function anthropicBashCodeExecutionResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicBashCodeExecutionResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicBashCodeExecutionResult' from JSON`, + ); +} diff --git a/src/models/anthropicbashcodeexecutiontoolresult.ts b/src/models/anthropicbashcodeexecutiontoolresult.ts new file mode 100644 index 000000000..8b514dead --- /dev/null +++ b/src/models/anthropicbashcodeexecutiontoolresult.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5d55d5213281 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicBashCodeExecutionContent, + AnthropicBashCodeExecutionContent$inboundSchema, +} from "./anthropicbashcodeexecutioncontent.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicBashCodeExecutionToolResult = { + content: AnthropicBashCodeExecutionContent; + toolUseId: string; + type: "bash_code_execution_tool_result"; +}; + +/** @internal */ +export const AnthropicBashCodeExecutionToolResult$inboundSchema: z.ZodType< + AnthropicBashCodeExecutionToolResult, + unknown +> = z.object({ + content: AnthropicBashCodeExecutionContent$inboundSchema, + tool_use_id: z.string(), + type: z.literal("bash_code_execution_tool_result"), +}).transform((v) => { + return remap$(v, { + "tool_use_id": "toolUseId", + }); +}); + +export function anthropicBashCodeExecutionToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicBashCodeExecutionToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicBashCodeExecutionToolResult' from JSON`, + ); +} diff --git a/src/models/anthropicbashcodeexecutiontoolresulterror.ts b/src/models/anthropicbashcodeexecutiontoolresulterror.ts new file mode 100644 index 000000000..0d62afba5 --- /dev/null +++ b/src/models/anthropicbashcodeexecutiontoolresulterror.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8028d67ee728 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicBashCodeExecutionToolResultErrorErrorCode = { + InvalidToolInput: "invalid_tool_input", + Unavailable: "unavailable", + TooManyRequests: "too_many_requests", + ExecutionTimeExceeded: "execution_time_exceeded", + OutputFileTooLarge: "output_file_too_large", +} as const; +export type AnthropicBashCodeExecutionToolResultErrorErrorCode = OpenEnum< + typeof AnthropicBashCodeExecutionToolResultErrorErrorCode +>; + +export type AnthropicBashCodeExecutionToolResultError = { + errorCode: AnthropicBashCodeExecutionToolResultErrorErrorCode; + type: "bash_code_execution_tool_result_error"; +}; + +/** @internal */ +export const AnthropicBashCodeExecutionToolResultErrorErrorCode$inboundSchema: + z.ZodType = + openEnums.inboundSchema(AnthropicBashCodeExecutionToolResultErrorErrorCode); + +/** @internal */ +export const AnthropicBashCodeExecutionToolResultError$inboundSchema: z.ZodType< + AnthropicBashCodeExecutionToolResultError, + unknown +> = z.object({ + error_code: AnthropicBashCodeExecutionToolResultErrorErrorCode$inboundSchema, + type: z.literal("bash_code_execution_tool_result_error"), +}).transform((v) => { + return remap$(v, { + "error_code": "errorCode", + }); +}); + +export function anthropicBashCodeExecutionToolResultErrorFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicBashCodeExecutionToolResultError, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicBashCodeExecutionToolResultError$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicBashCodeExecutionToolResultError' from JSON`, + ); +} diff --git a/src/models/anthropiccaller.ts b/src/models/anthropiccaller.ts new file mode 100644 index 000000000..7e99e18d3 --- /dev/null +++ b/src/models/anthropiccaller.ts @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: bc8afb0ba329 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCodeExecution20250825Caller, + AnthropicCodeExecution20250825Caller$inboundSchema, +} from "./anthropiccodeexecution20250825caller.js"; +import { + AnthropicCodeExecution20260120Caller, + AnthropicCodeExecution20260120Caller$inboundSchema, +} from "./anthropiccodeexecution20260120caller.js"; +import { + AnthropicDirectCaller, + AnthropicDirectCaller$inboundSchema, +} from "./anthropicdirectcaller.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCaller = + | AnthropicCodeExecution20250825Caller + | AnthropicCodeExecution20260120Caller + | AnthropicDirectCaller + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const AnthropicCaller$inboundSchema: z.ZodType< + AnthropicCaller, + unknown +> = discriminatedUnion("type", { + code_execution_20250825: AnthropicCodeExecution20250825Caller$inboundSchema, + code_execution_20260120: AnthropicCodeExecution20260120Caller$inboundSchema, + direct: AnthropicDirectCaller$inboundSchema, +}); + +export function anthropicCallerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCaller$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCaller' from JSON`, + ); +} diff --git a/src/models/anthropiccitationcharlocation.ts b/src/models/anthropiccitationcharlocation.ts new file mode 100644 index 000000000..46c5e2c8b --- /dev/null +++ b/src/models/anthropiccitationcharlocation.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 49bb1c6c0a00 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCitationCharLocation = { + citedText: string; + documentIndex: number; + documentTitle: string | null; + endCharIndex: number; + fileId: string | null; + startCharIndex: number; + type: "char_location"; +}; + +/** @internal */ +export const AnthropicCitationCharLocation$inboundSchema: z.ZodType< + AnthropicCitationCharLocation, + unknown +> = z.object({ + cited_text: z.string(), + document_index: z.int(), + document_title: z.nullable(z.string()), + end_char_index: z.int(), + file_id: z.nullable(z.string()), + start_char_index: z.int(), + type: z.literal("char_location"), +}).transform((v) => { + return remap$(v, { + "cited_text": "citedText", + "document_index": "documentIndex", + "document_title": "documentTitle", + "end_char_index": "endCharIndex", + "file_id": "fileId", + "start_char_index": "startCharIndex", + }); +}); + +export function anthropicCitationCharLocationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCitationCharLocation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCitationCharLocation' from JSON`, + ); +} diff --git a/src/models/anthropiccitationcontentblocklocation.ts b/src/models/anthropiccitationcontentblocklocation.ts new file mode 100644 index 000000000..ebe3d4387 --- /dev/null +++ b/src/models/anthropiccitationcontentblocklocation.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2e23fb62209c + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCitationContentBlockLocation = { + citedText: string; + documentIndex: number; + documentTitle: string | null; + endBlockIndex: number; + fileId: string | null; + startBlockIndex: number; + type: "content_block_location"; +}; + +/** @internal */ +export const AnthropicCitationContentBlockLocation$inboundSchema: z.ZodType< + AnthropicCitationContentBlockLocation, + unknown +> = z.object({ + cited_text: z.string(), + document_index: z.int(), + document_title: z.nullable(z.string()), + end_block_index: z.int(), + file_id: z.nullable(z.string()), + start_block_index: z.int(), + type: z.literal("content_block_location"), +}).transform((v) => { + return remap$(v, { + "cited_text": "citedText", + "document_index": "documentIndex", + "document_title": "documentTitle", + "end_block_index": "endBlockIndex", + "file_id": "fileId", + "start_block_index": "startBlockIndex", + }); +}); + +export function anthropicCitationContentBlockLocationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicCitationContentBlockLocation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCitationContentBlockLocation' from JSON`, + ); +} diff --git a/src/models/anthropiccitationpagelocation.ts b/src/models/anthropiccitationpagelocation.ts new file mode 100644 index 000000000..ec77e8b87 --- /dev/null +++ b/src/models/anthropiccitationpagelocation.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e9776d496704 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCitationPageLocation = { + citedText: string; + documentIndex: number; + documentTitle: string | null; + endPageNumber: number; + fileId: string | null; + startPageNumber: number; + type: "page_location"; +}; + +/** @internal */ +export const AnthropicCitationPageLocation$inboundSchema: z.ZodType< + AnthropicCitationPageLocation, + unknown +> = z.object({ + cited_text: z.string(), + document_index: z.int(), + document_title: z.nullable(z.string()), + end_page_number: z.int(), + file_id: z.nullable(z.string()), + start_page_number: z.int(), + type: z.literal("page_location"), +}).transform((v) => { + return remap$(v, { + "cited_text": "citedText", + "document_index": "documentIndex", + "document_title": "documentTitle", + "end_page_number": "endPageNumber", + "file_id": "fileId", + "start_page_number": "startPageNumber", + }); +}); + +export function anthropicCitationPageLocationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCitationPageLocation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCitationPageLocation' from JSON`, + ); +} diff --git a/src/models/anthropiccitationsconfig.ts b/src/models/anthropiccitationsconfig.ts new file mode 100644 index 000000000..43e134155 --- /dev/null +++ b/src/models/anthropiccitationsconfig.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 980808a865ed + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCitationsConfig = { + enabled: boolean; +}; + +/** @internal */ +export const AnthropicCitationsConfig$inboundSchema: z.ZodType< + AnthropicCitationsConfig, + unknown +> = z.object({ + enabled: z.boolean(), +}); + +export function anthropicCitationsConfigFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCitationsConfig$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCitationsConfig' from JSON`, + ); +} diff --git a/src/models/anthropiccitationsearchresultlocation.ts b/src/models/anthropiccitationsearchresultlocation.ts new file mode 100644 index 000000000..40a77d94a --- /dev/null +++ b/src/models/anthropiccitationsearchresultlocation.ts @@ -0,0 +1,52 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3e456a65667d + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCitationSearchResultLocation = { + citedText: string; + endBlockIndex: number; + searchResultIndex: number; + source: string; + startBlockIndex: number; + title: string | null; + type: "search_result_location"; +}; + +/** @internal */ +export const AnthropicCitationSearchResultLocation$inboundSchema: z.ZodType< + AnthropicCitationSearchResultLocation, + unknown +> = z.object({ + cited_text: z.string(), + end_block_index: z.int(), + search_result_index: z.int(), + source: z.string(), + start_block_index: z.int(), + title: z.nullable(z.string()), + type: z.literal("search_result_location"), +}).transform((v) => { + return remap$(v, { + "cited_text": "citedText", + "end_block_index": "endBlockIndex", + "search_result_index": "searchResultIndex", + "start_block_index": "startBlockIndex", + }); +}); + +export function anthropicCitationSearchResultLocationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicCitationSearchResultLocation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCitationSearchResultLocation' from JSON`, + ); +} diff --git a/src/models/anthropiccitationwebsearchresultlocation.ts b/src/models/anthropiccitationwebsearchresultlocation.ts new file mode 100644 index 000000000..903239705 --- /dev/null +++ b/src/models/anthropiccitationwebsearchresultlocation.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5c08200bb3d1 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCitationWebSearchResultLocation = { + citedText: string; + encryptedIndex: string; + title: string | null; + type: "web_search_result_location"; + url: string; +}; + +/** @internal */ +export const AnthropicCitationWebSearchResultLocation$inboundSchema: z.ZodType< + AnthropicCitationWebSearchResultLocation, + unknown +> = z.object({ + cited_text: z.string(), + encrypted_index: z.string(), + title: z.nullable(z.string()), + type: z.literal("web_search_result_location"), + url: z.string(), +}).transform((v) => { + return remap$(v, { + "cited_text": "citedText", + "encrypted_index": "encryptedIndex", + }); +}); + +export function anthropicCitationWebSearchResultLocationFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicCitationWebSearchResultLocation, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicCitationWebSearchResultLocation$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicCitationWebSearchResultLocation' from JSON`, + ); +} diff --git a/src/models/anthropiccodeexecution20250825caller.ts b/src/models/anthropiccodeexecution20250825caller.ts new file mode 100644 index 000000000..70187ea1e --- /dev/null +++ b/src/models/anthropiccodeexecution20250825caller.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1fe1afcb6365 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCodeExecution20250825Caller = { + toolId: string; + type: "code_execution_20250825"; +}; + +/** @internal */ +export const AnthropicCodeExecution20250825Caller$inboundSchema: z.ZodType< + AnthropicCodeExecution20250825Caller, + unknown +> = z.object({ + tool_id: z.string(), + type: z.literal("code_execution_20250825"), +}).transform((v) => { + return remap$(v, { + "tool_id": "toolId", + }); +}); + +export function anthropicCodeExecution20250825CallerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicCodeExecution20250825Caller$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCodeExecution20250825Caller' from JSON`, + ); +} diff --git a/src/models/anthropiccodeexecution20260120caller.ts b/src/models/anthropiccodeexecution20260120caller.ts new file mode 100644 index 000000000..5bd53f2ad --- /dev/null +++ b/src/models/anthropiccodeexecution20260120caller.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3cf51aa80659 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCodeExecution20260120Caller = { + toolId: string; + type: "code_execution_20260120"; +}; + +/** @internal */ +export const AnthropicCodeExecution20260120Caller$inboundSchema: z.ZodType< + AnthropicCodeExecution20260120Caller, + unknown +> = z.object({ + tool_id: z.string(), + type: z.literal("code_execution_20260120"), +}).transform((v) => { + return remap$(v, { + "tool_id": "toolId", + }); +}); + +export function anthropicCodeExecution20260120CallerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicCodeExecution20260120Caller$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCodeExecution20260120Caller' from JSON`, + ); +} diff --git a/src/models/anthropiccodeexecutioncontent.ts b/src/models/anthropiccodeexecutioncontent.ts new file mode 100644 index 000000000..d75187199 --- /dev/null +++ b/src/models/anthropiccodeexecutioncontent.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f4f46d300ed2 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCodeExecutionResult, + AnthropicCodeExecutionResult$inboundSchema, +} from "./anthropiccodeexecutionresult.js"; +import { + AnthropicCodeExecutionToolResultError, + AnthropicCodeExecutionToolResultError$inboundSchema, +} from "./anthropiccodeexecutiontoolresulterror.js"; +import { + AnthropicEncryptedCodeExecutionResult, + AnthropicEncryptedCodeExecutionResult$inboundSchema, +} from "./anthropicencryptedcodeexecutionresult.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCodeExecutionContent = + | AnthropicCodeExecutionResult + | AnthropicCodeExecutionToolResultError + | AnthropicEncryptedCodeExecutionResult + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const AnthropicCodeExecutionContent$inboundSchema: z.ZodType< + AnthropicCodeExecutionContent, + unknown +> = discriminatedUnion("type", { + code_execution_result: AnthropicCodeExecutionResult$inboundSchema, + code_execution_tool_result_error: + AnthropicCodeExecutionToolResultError$inboundSchema, + encrypted_code_execution_result: + AnthropicEncryptedCodeExecutionResult$inboundSchema, +}); + +export function anthropicCodeExecutionContentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCodeExecutionContent$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCodeExecutionContent' from JSON`, + ); +} diff --git a/src/models/anthropiccodeexecutionoutput.ts b/src/models/anthropiccodeexecutionoutput.ts new file mode 100644 index 000000000..e0dcf8abf --- /dev/null +++ b/src/models/anthropiccodeexecutionoutput.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b7d015976558 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicCodeExecutionOutputType = { + CodeExecutionOutput: "code_execution_output", +} as const; +export type AnthropicCodeExecutionOutputType = ClosedEnum< + typeof AnthropicCodeExecutionOutputType +>; + +export type AnthropicCodeExecutionOutput = { + fileId: string; + type: AnthropicCodeExecutionOutputType; +}; + +/** @internal */ +export const AnthropicCodeExecutionOutputType$inboundSchema: z.ZodEnum< + typeof AnthropicCodeExecutionOutputType +> = z.enum(AnthropicCodeExecutionOutputType); + +/** @internal */ +export const AnthropicCodeExecutionOutput$inboundSchema: z.ZodType< + AnthropicCodeExecutionOutput, + unknown +> = z.object({ + file_id: z.string(), + type: AnthropicCodeExecutionOutputType$inboundSchema, +}).transform((v) => { + return remap$(v, { + "file_id": "fileId", + }); +}); + +export function anthropicCodeExecutionOutputFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCodeExecutionOutput$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCodeExecutionOutput' from JSON`, + ); +} diff --git a/src/models/anthropiccodeexecutionresult.ts b/src/models/anthropiccodeexecutionresult.ts new file mode 100644 index 000000000..eb1f20132 --- /dev/null +++ b/src/models/anthropiccodeexecutionresult.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a35c5b19103f + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCodeExecutionOutput, + AnthropicCodeExecutionOutput$inboundSchema, +} from "./anthropiccodeexecutionoutput.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCodeExecutionResult = { + content: Array; + returnCode: number; + stderr: string; + stdout: string; + type: "code_execution_result"; +}; + +/** @internal */ +export const AnthropicCodeExecutionResult$inboundSchema: z.ZodType< + AnthropicCodeExecutionResult, + unknown +> = z.object({ + content: z.array(AnthropicCodeExecutionOutput$inboundSchema), + return_code: z.int(), + stderr: z.string(), + stdout: z.string(), + type: z.literal("code_execution_result"), +}).transform((v) => { + return remap$(v, { + "return_code": "returnCode", + }); +}); + +export function anthropicCodeExecutionResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCodeExecutionResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCodeExecutionResult' from JSON`, + ); +} diff --git a/src/models/anthropiccodeexecutiontoolresult.ts b/src/models/anthropiccodeexecutiontoolresult.ts new file mode 100644 index 000000000..45445203c --- /dev/null +++ b/src/models/anthropiccodeexecutiontoolresult.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b65091190ef2 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCodeExecutionContent, + AnthropicCodeExecutionContent$inboundSchema, +} from "./anthropiccodeexecutioncontent.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCodeExecutionToolResult = { + content: AnthropicCodeExecutionContent; + toolUseId: string; + type: "code_execution_tool_result"; +}; + +/** @internal */ +export const AnthropicCodeExecutionToolResult$inboundSchema: z.ZodType< + AnthropicCodeExecutionToolResult, + unknown +> = z.object({ + content: AnthropicCodeExecutionContent$inboundSchema, + tool_use_id: z.string(), + type: z.literal("code_execution_tool_result"), +}).transform((v) => { + return remap$(v, { + "tool_use_id": "toolUseId", + }); +}); + +export function anthropicCodeExecutionToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCodeExecutionToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCodeExecutionToolResult' from JSON`, + ); +} diff --git a/src/models/anthropiccodeexecutiontoolresulterror.ts b/src/models/anthropiccodeexecutiontoolresulterror.ts new file mode 100644 index 000000000..d19409527 --- /dev/null +++ b/src/models/anthropiccodeexecutiontoolresulterror.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: bf9694582afc + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicServerToolErrorCode, + AnthropicServerToolErrorCode$inboundSchema, +} from "./anthropicservertoolerrorcode.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCodeExecutionToolResultError = { + errorCode: AnthropicServerToolErrorCode; + type: "code_execution_tool_result_error"; +}; + +/** @internal */ +export const AnthropicCodeExecutionToolResultError$inboundSchema: z.ZodType< + AnthropicCodeExecutionToolResultError, + unknown +> = z.object({ + error_code: AnthropicServerToolErrorCode$inboundSchema, + type: z.literal("code_execution_tool_result_error"), +}).transform((v) => { + return remap$(v, { + "error_code": "errorCode", + }); +}); + +export function anthropicCodeExecutionToolResultErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicCodeExecutionToolResultError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCodeExecutionToolResultError' from JSON`, + ); +} diff --git a/src/models/anthropiccompactionblock.ts b/src/models/anthropiccompactionblock.ts new file mode 100644 index 000000000..a35261695 --- /dev/null +++ b/src/models/anthropiccompactionblock.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2e8c7492d352 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicCompactionBlock = { + content: string | null; + encryptedContent?: string | null | undefined; + type: "compaction"; +}; + +/** @internal */ +export const AnthropicCompactionBlock$inboundSchema: z.ZodType< + AnthropicCompactionBlock, + unknown +> = z.object({ + content: z.nullable(z.string()), + encrypted_content: z.nullable(z.string()).optional(), + type: z.literal("compaction"), +}).transform((v) => { + return remap$(v, { + "encrypted_content": "encryptedContent", + }); +}); + +export function anthropicCompactionBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicCompactionBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicCompactionBlock' from JSON`, + ); +} diff --git a/src/models/anthropiccontainer.ts b/src/models/anthropiccontainer.ts new file mode 100644 index 000000000..4c946d2a6 --- /dev/null +++ b/src/models/anthropiccontainer.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e824c8443a90 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicContainerSkill, + AnthropicContainerSkill$inboundSchema, +} from "./anthropiccontainerskill.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicContainer = { + expiresAt: string; + id: string; + skills?: Array | null | undefined; +}; + +/** @internal */ +export const AnthropicContainer$inboundSchema: z.ZodType< + AnthropicContainer, + unknown +> = z.object({ + expires_at: z.string(), + id: z.string(), + skills: z.nullable(z.array(AnthropicContainerSkill$inboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + "expires_at": "expiresAt", + }); +}); + +export function anthropicContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicContainer' from JSON`, + ); +} diff --git a/src/models/anthropiccontainerskill.ts b/src/models/anthropiccontainerskill.ts new file mode 100644 index 000000000..e703b01dc --- /dev/null +++ b/src/models/anthropiccontainerskill.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5235f5b38850 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicContainerSkillType = { + Anthropic: "anthropic", + Custom: "custom", +} as const; +export type AnthropicContainerSkillType = OpenEnum< + typeof AnthropicContainerSkillType +>; + +export type AnthropicContainerSkill = { + skillId: string; + type: AnthropicContainerSkillType; + version: string; +}; + +/** @internal */ +export const AnthropicContainerSkillType$inboundSchema: z.ZodType< + AnthropicContainerSkillType, + unknown +> = openEnums.inboundSchema(AnthropicContainerSkillType); + +/** @internal */ +export const AnthropicContainerSkill$inboundSchema: z.ZodType< + AnthropicContainerSkill, + unknown +> = z.object({ + skill_id: z.string(), + type: AnthropicContainerSkillType$inboundSchema, + version: z.string(), +}).transform((v) => { + return remap$(v, { + "skill_id": "skillId", + }); +}); + +export function anthropicContainerSkillFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicContainerSkill$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicContainerSkill' from JSON`, + ); +} diff --git a/src/models/anthropiccontainerupload.ts b/src/models/anthropiccontainerupload.ts new file mode 100644 index 000000000..c191819a5 --- /dev/null +++ b/src/models/anthropiccontainerupload.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7c9967fcbcec + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicContainerUpload = { + fileId: string; + type: "container_upload"; +}; + +/** @internal */ +export const AnthropicContainerUpload$inboundSchema: z.ZodType< + AnthropicContainerUpload, + unknown +> = z.object({ + file_id: z.string(), + type: z.literal("container_upload"), +}).transform((v) => { + return remap$(v, { + "file_id": "fileId", + }); +}); + +export function anthropicContainerUploadFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicContainerUpload$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicContainerUpload' from JSON`, + ); +} diff --git a/src/models/anthropicdirectcaller.ts b/src/models/anthropicdirectcaller.ts new file mode 100644 index 000000000..749901bc0 --- /dev/null +++ b/src/models/anthropicdirectcaller.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c1dba2541585 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicDirectCaller = { + type: "direct"; +}; + +/** @internal */ +export const AnthropicDirectCaller$inboundSchema: z.ZodType< + AnthropicDirectCaller, + unknown +> = z.object({ + type: z.literal("direct"), +}); + +export function anthropicDirectCallerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicDirectCaller$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicDirectCaller' from JSON`, + ); +} diff --git a/src/models/anthropicdocumentblock.ts b/src/models/anthropicdocumentblock.ts new file mode 100644 index 000000000..8df8dcb53 --- /dev/null +++ b/src/models/anthropicdocumentblock.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6aec49691162 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicBase64PdfSource, + AnthropicBase64PdfSource$inboundSchema, +} from "./anthropicbase64pdfsource.js"; +import { + AnthropicCitationsConfig, + AnthropicCitationsConfig$inboundSchema, +} from "./anthropiccitationsconfig.js"; +import { + AnthropicPlainTextSource, + AnthropicPlainTextSource$inboundSchema, +} from "./anthropicplaintextsource.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicDocumentBlockSource = + | (AnthropicBase64PdfSource & { mediaType: "application/pdf" }) + | (AnthropicPlainTextSource & { mediaType: "text/plain" }) + | discriminatedUnionTypes.Unknown<"mediaType">; + +export const AnthropicDocumentBlockType = { + Document: "document", +} as const; +export type AnthropicDocumentBlockType = ClosedEnum< + typeof AnthropicDocumentBlockType +>; + +export type AnthropicDocumentBlock = { + citations?: AnthropicCitationsConfig | null | undefined; + source: + | (AnthropicBase64PdfSource & { mediaType: "application/pdf" }) + | (AnthropicPlainTextSource & { mediaType: "text/plain" }) + | discriminatedUnionTypes.Unknown<"mediaType">; + title: string | null; + type: AnthropicDocumentBlockType; +}; + +/** @internal */ +export const AnthropicDocumentBlockSource$inboundSchema: z.ZodType< + AnthropicDocumentBlockSource, + unknown +> = discriminatedUnion("media_type", { + ["application/pdf"]: AnthropicBase64PdfSource$inboundSchema.and( + z.object({ media_type: z.literal("application/pdf") }).transform((v) => ({ + mediaType: v.media_type, + })), + ), + ["text/plain"]: AnthropicPlainTextSource$inboundSchema.and( + z.object({ media_type: z.literal("text/plain") }).transform((v) => ({ + mediaType: v.media_type, + })), + ), +}, { outputPropertyName: "mediaType" }); + +export function anthropicDocumentBlockSourceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicDocumentBlockSource$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicDocumentBlockSource' from JSON`, + ); +} + +/** @internal */ +export const AnthropicDocumentBlockType$inboundSchema: z.ZodEnum< + typeof AnthropicDocumentBlockType +> = z.enum(AnthropicDocumentBlockType); + +/** @internal */ +export const AnthropicDocumentBlock$inboundSchema: z.ZodType< + AnthropicDocumentBlock, + unknown +> = z.object({ + citations: z.nullable(AnthropicCitationsConfig$inboundSchema).optional(), + source: discriminatedUnion("media_type", { + ["application/pdf"]: AnthropicBase64PdfSource$inboundSchema.and( + z.object({ media_type: z.literal("application/pdf") }).transform((v) => ({ + mediaType: v.media_type, + })), + ), + ["text/plain"]: AnthropicPlainTextSource$inboundSchema.and( + z.object({ media_type: z.literal("text/plain") }).transform((v) => ({ + mediaType: v.media_type, + })), + ), + }, { outputPropertyName: "mediaType" }), + title: z.nullable(z.string()), + type: AnthropicDocumentBlockType$inboundSchema, +}); + +export function anthropicDocumentBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicDocumentBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicDocumentBlock' from JSON`, + ); +} diff --git a/src/models/anthropicdocumentblockparam.ts b/src/models/anthropicdocumentblockparam.ts index e1b93a7cc..8297be79c 100644 --- a/src/models/anthropicdocumentblockparam.ts +++ b/src/models/anthropicdocumentblockparam.ts @@ -59,8 +59,8 @@ export type SourceContent = { }; export type AnthropicDocumentBlockParamSourceUnion = - | AnthropicBase64PdfSource - | AnthropicPlainTextSource + | (AnthropicBase64PdfSource & { type: "base64" }) + | (AnthropicPlainTextSource & { type: "text" }) | SourceContent | AnthropicUrlPdfSource | AnthropicFileDocumentSource; @@ -73,8 +73,8 @@ export type AnthropicDocumentBlockParam = { citations?: AnthropicDocumentBlockParamCitations | null | undefined; context?: string | null | undefined; source: - | AnthropicBase64PdfSource - | AnthropicPlainTextSource + | (AnthropicBase64PdfSource & { type: "base64" }) + | (AnthropicPlainTextSource & { type: "text" }) | SourceContent | AnthropicUrlPdfSource | AnthropicFileDocumentSource; @@ -191,8 +191,8 @@ export function sourceContentToJSON(sourceContent: SourceContent): string { /** @internal */ export type AnthropicDocumentBlockParamSourceUnion$Outbound = - | AnthropicBase64PdfSource$Outbound - | AnthropicPlainTextSource$Outbound + | (AnthropicBase64PdfSource$Outbound & { type: "base64" }) + | (AnthropicPlainTextSource$Outbound & { type: "text" }) | SourceContent$Outbound | AnthropicUrlPdfSource$Outbound | AnthropicFileDocumentSource$Outbound; @@ -202,8 +202,12 @@ export const AnthropicDocumentBlockParamSourceUnion$outboundSchema: z.ZodType< AnthropicDocumentBlockParamSourceUnion$Outbound, AnthropicDocumentBlockParamSourceUnion > = z.union([ - AnthropicBase64PdfSource$outboundSchema, - AnthropicPlainTextSource$outboundSchema, + AnthropicBase64PdfSource$outboundSchema.and( + z.object({ type: z.literal("base64") }), + ), + AnthropicPlainTextSource$outboundSchema.and( + z.object({ type: z.literal("text") }), + ), z.lazy(() => SourceContent$outboundSchema), AnthropicUrlPdfSource$outboundSchema, AnthropicFileDocumentSource$outboundSchema, @@ -226,8 +230,8 @@ export type AnthropicDocumentBlockParam$Outbound = { citations?: AnthropicDocumentBlockParamCitations$Outbound | null | undefined; context?: string | null | undefined; source: - | AnthropicBase64PdfSource$Outbound - | AnthropicPlainTextSource$Outbound + | (AnthropicBase64PdfSource$Outbound & { type: "base64" }) + | (AnthropicPlainTextSource$Outbound & { type: "text" }) | SourceContent$Outbound | AnthropicUrlPdfSource$Outbound | AnthropicFileDocumentSource$Outbound; @@ -246,8 +250,12 @@ export const AnthropicDocumentBlockParam$outboundSchema: z.ZodType< ).optional(), context: z.nullable(z.string()).optional(), source: z.union([ - AnthropicBase64PdfSource$outboundSchema, - AnthropicPlainTextSource$outboundSchema, + AnthropicBase64PdfSource$outboundSchema.and( + z.object({ type: z.literal("base64") }), + ), + AnthropicPlainTextSource$outboundSchema.and( + z.object({ type: z.literal("text") }), + ), z.lazy(() => SourceContent$outboundSchema), AnthropicUrlPdfSource$outboundSchema, AnthropicFileDocumentSource$outboundSchema, diff --git a/src/models/anthropicencryptedcodeexecutionresult.ts b/src/models/anthropicencryptedcodeexecutionresult.ts new file mode 100644 index 000000000..4c72a2ba6 --- /dev/null +++ b/src/models/anthropicencryptedcodeexecutionresult.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1e1762f68df1 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCodeExecutionOutput, + AnthropicCodeExecutionOutput$inboundSchema, +} from "./anthropiccodeexecutionoutput.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicEncryptedCodeExecutionResult = { + content: Array; + encryptedStdout: string; + returnCode: number; + stderr: string; + type: "encrypted_code_execution_result"; +}; + +/** @internal */ +export const AnthropicEncryptedCodeExecutionResult$inboundSchema: z.ZodType< + AnthropicEncryptedCodeExecutionResult, + unknown +> = z.object({ + content: z.array(AnthropicCodeExecutionOutput$inboundSchema), + encrypted_stdout: z.string(), + return_code: z.int(), + stderr: z.string(), + type: z.literal("encrypted_code_execution_result"), +}).transform((v) => { + return remap$(v, { + "encrypted_stdout": "encryptedStdout", + "return_code": "returnCode", + }); +}); + +export function anthropicEncryptedCodeExecutionResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicEncryptedCodeExecutionResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicEncryptedCodeExecutionResult' from JSON`, + ); +} diff --git a/src/models/anthropicinputtransformation.ts b/src/models/anthropicinputtransformation.ts new file mode 100644 index 000000000..a85d8d352 --- /dev/null +++ b/src/models/anthropicinputtransformation.ts @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 02d29ed9a0c4 + */ + +import * as z from "zod/v4"; +import { + collectExtraKeys as collectExtraKeys$, + safeParse, +} from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +/** + * A server-side transformation Anthropic applied to the request input + */ +export type AnthropicInputTransformation = { + path?: string | null | undefined; + reason?: string | null | undefined; + type: string; + additionalProperties?: { [k: string]: any } | undefined; +}; + +/** @internal */ +export const AnthropicInputTransformation$inboundSchema: z.ZodType< + AnthropicInputTransformation, + unknown +> = collectExtraKeys$( + z.object({ + path: z.nullable(z.string()).optional(), + reason: z.nullable(z.string()).optional(), + type: z.string(), + }).catchall(z.any()), + "additionalProperties", + true, +); + +export function anthropicInputTransformationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicInputTransformation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicInputTransformation' from JSON`, + ); +} diff --git a/src/models/anthropicoutputtokensdetails.ts b/src/models/anthropicoutputtokensdetails.ts new file mode 100644 index 000000000..9b34d2600 --- /dev/null +++ b/src/models/anthropicoutputtokensdetails.ts @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1c1cbd5cc017 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicOutputTokensDetails = { + thinkingTokens: number; +}; + +/** @internal */ +export const AnthropicOutputTokensDetails$inboundSchema: z.ZodType< + AnthropicOutputTokensDetails, + unknown +> = z.object({ + thinking_tokens: z.int(), +}).transform((v) => { + return remap$(v, { + "thinking_tokens": "thinkingTokens", + }); +}); + +export function anthropicOutputTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicOutputTokensDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicOutputTokensDetails' from JSON`, + ); +} diff --git a/src/models/anthropicplaintextsource.ts b/src/models/anthropicplaintextsource.ts index 2f7f00e0f..348bf2838 100644 --- a/src/models/anthropicplaintextsource.ts +++ b/src/models/anthropicplaintextsource.ts @@ -5,7 +5,10 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export const AnthropicPlainTextSourceMediaType = { TextPlain: "text/plain", @@ -14,22 +17,55 @@ export type AnthropicPlainTextSourceMediaType = ClosedEnum< typeof AnthropicPlainTextSourceMediaType >; +export const AnthropicPlainTextSourceType = { + Text: "text", +} as const; +export type AnthropicPlainTextSourceType = ClosedEnum< + typeof AnthropicPlainTextSourceType +>; + export type AnthropicPlainTextSource = { data: string; mediaType: AnthropicPlainTextSourceMediaType; - type: "text"; + type: AnthropicPlainTextSourceType; }; /** @internal */ -export const AnthropicPlainTextSourceMediaType$outboundSchema: z.ZodEnum< +export const AnthropicPlainTextSourceMediaType$inboundSchema: z.ZodEnum< typeof AnthropicPlainTextSourceMediaType > = z.enum(AnthropicPlainTextSourceMediaType); +/** @internal */ +export const AnthropicPlainTextSourceMediaType$outboundSchema: z.ZodEnum< + typeof AnthropicPlainTextSourceMediaType +> = AnthropicPlainTextSourceMediaType$inboundSchema; + +/** @internal */ +export const AnthropicPlainTextSourceType$inboundSchema: z.ZodEnum< + typeof AnthropicPlainTextSourceType +> = z.enum(AnthropicPlainTextSourceType); +/** @internal */ +export const AnthropicPlainTextSourceType$outboundSchema: z.ZodEnum< + typeof AnthropicPlainTextSourceType +> = AnthropicPlainTextSourceType$inboundSchema; +/** @internal */ +export const AnthropicPlainTextSource$inboundSchema: z.ZodType< + AnthropicPlainTextSource, + unknown +> = z.object({ + data: z.string(), + media_type: AnthropicPlainTextSourceMediaType$inboundSchema, + type: AnthropicPlainTextSourceType$inboundSchema, +}).transform((v) => { + return remap$(v, { + "media_type": "mediaType", + }); +}); /** @internal */ export type AnthropicPlainTextSource$Outbound = { data: string; media_type: string; - type: "text"; + type: string; }; /** @internal */ @@ -39,7 +75,7 @@ export const AnthropicPlainTextSource$outboundSchema: z.ZodType< > = z.object({ data: z.string(), mediaType: AnthropicPlainTextSourceMediaType$outboundSchema, - type: z.literal("text"), + type: AnthropicPlainTextSourceType$outboundSchema, }).transform((v) => { return remap$(v, { mediaType: "media_type", @@ -53,3 +89,12 @@ export function anthropicPlainTextSourceToJSON( AnthropicPlainTextSource$outboundSchema.parse(anthropicPlainTextSource), ); } +export function anthropicPlainTextSourceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicPlainTextSource$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicPlainTextSource' from JSON`, + ); +} diff --git a/src/models/anthropicredactedthinkingblock.ts b/src/models/anthropicredactedthinkingblock.ts new file mode 100644 index 000000000..5d2304a40 --- /dev/null +++ b/src/models/anthropicredactedthinkingblock.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9217d8bb8656 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicRedactedThinkingBlock = { + data: string; + type: "redacted_thinking"; +}; + +/** @internal */ +export const AnthropicRedactedThinkingBlock$inboundSchema: z.ZodType< + AnthropicRedactedThinkingBlock, + unknown +> = z.object({ + data: z.string(), + type: z.literal("redacted_thinking"), +}); + +export function anthropicRedactedThinkingBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicRedactedThinkingBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicRedactedThinkingBlock' from JSON`, + ); +} diff --git a/src/models/anthropicrefusalstopdetails.ts b/src/models/anthropicrefusalstopdetails.ts new file mode 100644 index 000000000..efe4175c3 --- /dev/null +++ b/src/models/anthropicrefusalstopdetails.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 62e4a3cb8de1 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicRefusalStopDetailsCategory = { + Cyber: "cyber", + Bio: "bio", + FrontierLlm: "frontier_llm", + ReasoningExtraction: "reasoning_extraction", + GeneralHarms: "general_harms", +} as const; +export type AnthropicRefusalStopDetailsCategory = OpenEnum< + typeof AnthropicRefusalStopDetailsCategory +>; + +export const AnthropicRefusalStopDetailsType = { + Refusal: "refusal", +} as const; +export type AnthropicRefusalStopDetailsType = ClosedEnum< + typeof AnthropicRefusalStopDetailsType +>; + +/** + * Structured information about a refusal + */ +export type AnthropicRefusalStopDetails = { + category: AnthropicRefusalStopDetailsCategory | null; + explanation: string | null; + type: AnthropicRefusalStopDetailsType; +}; + +/** @internal */ +export const AnthropicRefusalStopDetailsCategory$inboundSchema: z.ZodType< + AnthropicRefusalStopDetailsCategory, + unknown +> = openEnums.inboundSchema(AnthropicRefusalStopDetailsCategory); + +/** @internal */ +export const AnthropicRefusalStopDetailsType$inboundSchema: z.ZodEnum< + typeof AnthropicRefusalStopDetailsType +> = z.enum(AnthropicRefusalStopDetailsType); + +/** @internal */ +export const AnthropicRefusalStopDetails$inboundSchema: z.ZodType< + AnthropicRefusalStopDetails, + unknown +> = z.object({ + category: z.nullable(AnthropicRefusalStopDetailsCategory$inboundSchema), + explanation: z.nullable(z.string()), + type: AnthropicRefusalStopDetailsType$inboundSchema, +}); + +export function anthropicRefusalStopDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicRefusalStopDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicRefusalStopDetails' from JSON`, + ); +} diff --git a/src/models/anthropicservertoolerrorcode.ts b/src/models/anthropicservertoolerrorcode.ts new file mode 100644 index 000000000..d00ed9ffc --- /dev/null +++ b/src/models/anthropicservertoolerrorcode.ts @@ -0,0 +1,24 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 822c5d079562 + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +export const AnthropicServerToolErrorCode = { + InvalidToolInput: "invalid_tool_input", + Unavailable: "unavailable", + TooManyRequests: "too_many_requests", + ExecutionTimeExceeded: "execution_time_exceeded", +} as const; +export type AnthropicServerToolErrorCode = OpenEnum< + typeof AnthropicServerToolErrorCode +>; + +/** @internal */ +export const AnthropicServerToolErrorCode$inboundSchema: z.ZodType< + AnthropicServerToolErrorCode, + unknown +> = openEnums.inboundSchema(AnthropicServerToolErrorCode); diff --git a/src/models/anthropicservertoolusage.ts b/src/models/anthropicservertoolusage.ts new file mode 100644 index 000000000..a31b99473 --- /dev/null +++ b/src/models/anthropicservertoolusage.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 71a8b24aad61 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicServerToolUsage = { + webFetchRequests: number; + webSearchRequests: number; +}; + +/** @internal */ +export const AnthropicServerToolUsage$inboundSchema: z.ZodType< + AnthropicServerToolUsage, + unknown +> = z.object({ + web_fetch_requests: z.int(), + web_search_requests: z.int(), +}).transform((v) => { + return remap$(v, { + "web_fetch_requests": "webFetchRequests", + "web_search_requests": "webSearchRequests", + }); +}); + +export function anthropicServerToolUsageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicServerToolUsage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicServerToolUsage' from JSON`, + ); +} diff --git a/src/models/anthropicservicetier.ts b/src/models/anthropicservicetier.ts new file mode 100644 index 000000000..f3d2f0c4f --- /dev/null +++ b/src/models/anthropicservicetier.ts @@ -0,0 +1,21 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 414847377bd6 + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +export const AnthropicServiceTier = { + Standard: "standard", + Priority: "priority", + Batch: "batch", +} as const; +export type AnthropicServiceTier = OpenEnum; + +/** @internal */ +export const AnthropicServiceTier$inboundSchema: z.ZodType< + AnthropicServiceTier, + unknown +> = openEnums.inboundSchema(AnthropicServiceTier); diff --git a/src/models/anthropictextblock.ts b/src/models/anthropictextblock.ts new file mode 100644 index 000000000..80f275c9a --- /dev/null +++ b/src/models/anthropictextblock.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 92842709fc4d + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicTextCitation, + AnthropicTextCitation$inboundSchema, +} from "./anthropictextcitation.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicTextBlock = { + citations: Array | null; + text: string; + type: "text"; +}; + +/** @internal */ +export const AnthropicTextBlock$inboundSchema: z.ZodType< + AnthropicTextBlock, + unknown +> = z.object({ + citations: z.nullable(z.array(AnthropicTextCitation$inboundSchema)), + text: z.string(), + type: z.literal("text"), +}); + +export function anthropicTextBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicTextBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicTextBlock' from JSON`, + ); +} diff --git a/src/models/anthropictextcitation.ts b/src/models/anthropictextcitation.ts new file mode 100644 index 000000000..f2def0310 --- /dev/null +++ b/src/models/anthropictextcitation.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fe7e58a48729 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCitationCharLocation, + AnthropicCitationCharLocation$inboundSchema, +} from "./anthropiccitationcharlocation.js"; +import { + AnthropicCitationContentBlockLocation, + AnthropicCitationContentBlockLocation$inboundSchema, +} from "./anthropiccitationcontentblocklocation.js"; +import { + AnthropicCitationPageLocation, + AnthropicCitationPageLocation$inboundSchema, +} from "./anthropiccitationpagelocation.js"; +import { + AnthropicCitationSearchResultLocation, + AnthropicCitationSearchResultLocation$inboundSchema, +} from "./anthropiccitationsearchresultlocation.js"; +import { + AnthropicCitationWebSearchResultLocation, + AnthropicCitationWebSearchResultLocation$inboundSchema, +} from "./anthropiccitationwebsearchresultlocation.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicTextCitation = + | AnthropicCitationCharLocation + | AnthropicCitationContentBlockLocation + | AnthropicCitationPageLocation + | AnthropicCitationSearchResultLocation + | AnthropicCitationWebSearchResultLocation + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const AnthropicTextCitation$inboundSchema: z.ZodType< + AnthropicTextCitation, + unknown +> = discriminatedUnion("type", { + char_location: AnthropicCitationCharLocation$inboundSchema, + content_block_location: AnthropicCitationContentBlockLocation$inboundSchema, + page_location: AnthropicCitationPageLocation$inboundSchema, + search_result_location: AnthropicCitationSearchResultLocation$inboundSchema, + web_search_result_location: + AnthropicCitationWebSearchResultLocation$inboundSchema, +}); + +export function anthropicTextCitationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicTextCitation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicTextCitation' from JSON`, + ); +} diff --git a/src/models/anthropictexteditorcodeexecutioncontent.ts b/src/models/anthropictexteditorcodeexecutioncontent.ts new file mode 100644 index 000000000..e098c4ea8 --- /dev/null +++ b/src/models/anthropictexteditorcodeexecutioncontent.ts @@ -0,0 +1,65 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 832ee7a5e28a + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicTextEditorCodeExecutionCreateResult, + AnthropicTextEditorCodeExecutionCreateResult$inboundSchema, +} from "./anthropictexteditorcodeexecutioncreateresult.js"; +import { + AnthropicTextEditorCodeExecutionStrReplaceResult, + AnthropicTextEditorCodeExecutionStrReplaceResult$inboundSchema, +} from "./anthropictexteditorcodeexecutionstrreplaceresult.js"; +import { + AnthropicTextEditorCodeExecutionToolResultError, + AnthropicTextEditorCodeExecutionToolResultError$inboundSchema, +} from "./anthropictexteditorcodeexecutiontoolresulterror.js"; +import { + AnthropicTextEditorCodeExecutionViewResult, + AnthropicTextEditorCodeExecutionViewResult$inboundSchema, +} from "./anthropictexteditorcodeexecutionviewresult.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicTextEditorCodeExecutionContent = + | AnthropicTextEditorCodeExecutionCreateResult + | AnthropicTextEditorCodeExecutionStrReplaceResult + | AnthropicTextEditorCodeExecutionToolResultError + | AnthropicTextEditorCodeExecutionViewResult + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const AnthropicTextEditorCodeExecutionContent$inboundSchema: z.ZodType< + AnthropicTextEditorCodeExecutionContent, + unknown +> = discriminatedUnion("type", { + text_editor_code_execution_create_result: + AnthropicTextEditorCodeExecutionCreateResult$inboundSchema, + text_editor_code_execution_str_replace_result: + AnthropicTextEditorCodeExecutionStrReplaceResult$inboundSchema, + text_editor_code_execution_tool_result_error: + AnthropicTextEditorCodeExecutionToolResultError$inboundSchema, + text_editor_code_execution_view_result: + AnthropicTextEditorCodeExecutionViewResult$inboundSchema, +}); + +export function anthropicTextEditorCodeExecutionContentFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicTextEditorCodeExecutionContent, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicTextEditorCodeExecutionContent$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicTextEditorCodeExecutionContent' from JSON`, + ); +} diff --git a/src/models/anthropictexteditorcodeexecutioncreateresult.ts b/src/models/anthropictexteditorcodeexecutioncreateresult.ts new file mode 100644 index 000000000..e0296f69e --- /dev/null +++ b/src/models/anthropictexteditorcodeexecutioncreateresult.ts @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 86635cf190c0 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicTextEditorCodeExecutionCreateResult = { + isFileUpdate: boolean; + type: "text_editor_code_execution_create_result"; +}; + +/** @internal */ +export const AnthropicTextEditorCodeExecutionCreateResult$inboundSchema: + z.ZodType = z.object({ + is_file_update: z.boolean(), + type: z.literal("text_editor_code_execution_create_result"), + }).transform((v) => { + return remap$(v, { + "is_file_update": "isFileUpdate", + }); + }); + +export function anthropicTextEditorCodeExecutionCreateResultFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicTextEditorCodeExecutionCreateResult, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicTextEditorCodeExecutionCreateResult$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicTextEditorCodeExecutionCreateResult' from JSON`, + ); +} diff --git a/src/models/anthropictexteditorcodeexecutionstrreplaceresult.ts b/src/models/anthropictexteditorcodeexecutionstrreplaceresult.ts new file mode 100644 index 000000000..133371f45 --- /dev/null +++ b/src/models/anthropictexteditorcodeexecutionstrreplaceresult.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fed740239a98 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicTextEditorCodeExecutionStrReplaceResult = { + lines: Array | null; + newLines: number | null; + newStart: number | null; + oldLines: number | null; + oldStart: number | null; + type: "text_editor_code_execution_str_replace_result"; +}; + +/** @internal */ +export const AnthropicTextEditorCodeExecutionStrReplaceResult$inboundSchema: + z.ZodType = z + .object({ + lines: z.nullable(z.array(z.string())), + new_lines: z.nullable(z.int()), + new_start: z.nullable(z.int()), + old_lines: z.nullable(z.int()), + old_start: z.nullable(z.int()), + type: z.literal("text_editor_code_execution_str_replace_result"), + }).transform((v) => { + return remap$(v, { + "new_lines": "newLines", + "new_start": "newStart", + "old_lines": "oldLines", + "old_start": "oldStart", + }); + }); + +export function anthropicTextEditorCodeExecutionStrReplaceResultFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicTextEditorCodeExecutionStrReplaceResult, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicTextEditorCodeExecutionStrReplaceResult$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicTextEditorCodeExecutionStrReplaceResult' from JSON`, + ); +} diff --git a/src/models/anthropictexteditorcodeexecutiontoolresult.ts b/src/models/anthropictexteditorcodeexecutiontoolresult.ts new file mode 100644 index 000000000..e512e1e25 --- /dev/null +++ b/src/models/anthropictexteditorcodeexecutiontoolresult.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: aec07db74637 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicTextEditorCodeExecutionContent, + AnthropicTextEditorCodeExecutionContent$inboundSchema, +} from "./anthropictexteditorcodeexecutioncontent.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicTextEditorCodeExecutionToolResult = { + content: AnthropicTextEditorCodeExecutionContent; + toolUseId: string; + type: "text_editor_code_execution_tool_result"; +}; + +/** @internal */ +export const AnthropicTextEditorCodeExecutionToolResult$inboundSchema: + z.ZodType = z.object({ + content: AnthropicTextEditorCodeExecutionContent$inboundSchema, + tool_use_id: z.string(), + type: z.literal("text_editor_code_execution_tool_result"), + }).transform((v) => { + return remap$(v, { + "tool_use_id": "toolUseId", + }); + }); + +export function anthropicTextEditorCodeExecutionToolResultFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicTextEditorCodeExecutionToolResult, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicTextEditorCodeExecutionToolResult$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicTextEditorCodeExecutionToolResult' from JSON`, + ); +} diff --git a/src/models/anthropictexteditorcodeexecutiontoolresulterror.ts b/src/models/anthropictexteditorcodeexecutiontoolresulterror.ts new file mode 100644 index 000000000..68176537a --- /dev/null +++ b/src/models/anthropictexteditorcodeexecutiontoolresulterror.ts @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ccf083ba6bce + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicTextEditorCodeExecutionToolResultErrorErrorCode = { + InvalidToolInput: "invalid_tool_input", + Unavailable: "unavailable", + TooManyRequests: "too_many_requests", + ExecutionTimeExceeded: "execution_time_exceeded", + FileNotFound: "file_not_found", +} as const; +export type AnthropicTextEditorCodeExecutionToolResultErrorErrorCode = OpenEnum< + typeof AnthropicTextEditorCodeExecutionToolResultErrorErrorCode +>; + +export type AnthropicTextEditorCodeExecutionToolResultError = { + errorCode: AnthropicTextEditorCodeExecutionToolResultErrorErrorCode; + errorMessage: string | null; + type: "text_editor_code_execution_tool_result_error"; +}; + +/** @internal */ +export const AnthropicTextEditorCodeExecutionToolResultErrorErrorCode$inboundSchema: + z.ZodType = + openEnums.inboundSchema( + AnthropicTextEditorCodeExecutionToolResultErrorErrorCode, + ); + +/** @internal */ +export const AnthropicTextEditorCodeExecutionToolResultError$inboundSchema: + z.ZodType = z + .object({ + error_code: + AnthropicTextEditorCodeExecutionToolResultErrorErrorCode$inboundSchema, + error_message: z.nullable(z.string()), + type: z.literal("text_editor_code_execution_tool_result_error"), + }).transform((v) => { + return remap$(v, { + "error_code": "errorCode", + "error_message": "errorMessage", + }); + }); + +export function anthropicTextEditorCodeExecutionToolResultErrorFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicTextEditorCodeExecutionToolResultError, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicTextEditorCodeExecutionToolResultError$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicTextEditorCodeExecutionToolResultError' from JSON`, + ); +} diff --git a/src/models/anthropictexteditorcodeexecutionviewresult.ts b/src/models/anthropictexteditorcodeexecutionviewresult.ts new file mode 100644 index 000000000..de265b372 --- /dev/null +++ b/src/models/anthropictexteditorcodeexecutionviewresult.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d22abd4b2e55 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const FileType = { + Text: "text", + Image: "image", + Pdf: "pdf", +} as const; +export type FileType = OpenEnum; + +export type AnthropicTextEditorCodeExecutionViewResult = { + content: string; + fileType: FileType; + numLines: number | null; + startLine: number | null; + totalLines: number | null; + type: "text_editor_code_execution_view_result"; +}; + +/** @internal */ +export const FileType$inboundSchema: z.ZodType = openEnums + .inboundSchema(FileType); + +/** @internal */ +export const AnthropicTextEditorCodeExecutionViewResult$inboundSchema: + z.ZodType = z.object({ + content: z.string(), + file_type: FileType$inboundSchema, + num_lines: z.nullable(z.int()), + start_line: z.nullable(z.int()), + total_lines: z.nullable(z.int()), + type: z.literal("text_editor_code_execution_view_result"), + }).transform((v) => { + return remap$(v, { + "file_type": "fileType", + "num_lines": "numLines", + "start_line": "startLine", + "total_lines": "totalLines", + }); + }); + +export function anthropicTextEditorCodeExecutionViewResultFromJSON( + jsonString: string, +): SafeParseResult< + AnthropicTextEditorCodeExecutionViewResult, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + AnthropicTextEditorCodeExecutionViewResult$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'AnthropicTextEditorCodeExecutionViewResult' from JSON`, + ); +} diff --git a/src/models/anthropicthinkingblock.ts b/src/models/anthropicthinkingblock.ts new file mode 100644 index 000000000..2cb40f67a --- /dev/null +++ b/src/models/anthropicthinkingblock.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3d517d0c0ebc + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicThinkingBlock = { + signature: string; + thinking: string; + type: "thinking"; +}; + +/** @internal */ +export const AnthropicThinkingBlock$inboundSchema: z.ZodType< + AnthropicThinkingBlock, + unknown +> = z.object({ + signature: z.string(), + thinking: z.string(), + type: z.literal("thinking"), +}); + +export function anthropicThinkingBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicThinkingBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicThinkingBlock' from JSON`, + ); +} diff --git a/src/models/anthropictoolreference.ts b/src/models/anthropictoolreference.ts new file mode 100644 index 000000000..f4c72a0aa --- /dev/null +++ b/src/models/anthropictoolreference.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 106efa7085a7 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicToolReferenceType = { + ToolReference: "tool_reference", +} as const; +export type AnthropicToolReferenceType = ClosedEnum< + typeof AnthropicToolReferenceType +>; + +export type AnthropicToolReference = { + toolName: string; + type: AnthropicToolReferenceType; +}; + +/** @internal */ +export const AnthropicToolReferenceType$inboundSchema: z.ZodEnum< + typeof AnthropicToolReferenceType +> = z.enum(AnthropicToolReferenceType); + +/** @internal */ +export const AnthropicToolReference$inboundSchema: z.ZodType< + AnthropicToolReference, + unknown +> = z.object({ + tool_name: z.string(), + type: AnthropicToolReferenceType$inboundSchema, +}).transform((v) => { + return remap$(v, { + "tool_name": "toolName", + }); +}); + +export function anthropicToolReferenceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicToolReference$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicToolReference' from JSON`, + ); +} diff --git a/src/models/anthropictoolsearchcontent.ts b/src/models/anthropictoolsearchcontent.ts new file mode 100644 index 000000000..d3ad6d4b9 --- /dev/null +++ b/src/models/anthropictoolsearchcontent.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3a2d3e60694f + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicToolSearchResult, + AnthropicToolSearchResult$inboundSchema, +} from "./anthropictoolsearchresult.js"; +import { + AnthropicToolSearchResultError, + AnthropicToolSearchResultError$inboundSchema, +} from "./anthropictoolsearchresulterror.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicToolSearchContent = + | AnthropicToolSearchResultError + | AnthropicToolSearchResult + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const AnthropicToolSearchContent$inboundSchema: z.ZodType< + AnthropicToolSearchContent, + unknown +> = discriminatedUnion("type", { + tool_search_tool_result_error: AnthropicToolSearchResultError$inboundSchema, + tool_search_tool_search_result: AnthropicToolSearchResult$inboundSchema, +}); + +export function anthropicToolSearchContentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicToolSearchContent$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicToolSearchContent' from JSON`, + ); +} diff --git a/src/models/anthropictoolsearchresult.ts b/src/models/anthropictoolsearchresult.ts new file mode 100644 index 000000000..be2f37487 --- /dev/null +++ b/src/models/anthropictoolsearchresult.ts @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 465ebc45a91c + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicToolReference, + AnthropicToolReference$inboundSchema, +} from "./anthropictoolreference.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicToolSearchResult = { + toolReferences: Array; + type: "tool_search_tool_search_result"; +}; + +/** @internal */ +export const AnthropicToolSearchResult$inboundSchema: z.ZodType< + AnthropicToolSearchResult, + unknown +> = z.object({ + tool_references: z.array(AnthropicToolReference$inboundSchema), + type: z.literal("tool_search_tool_search_result"), +}).transform((v) => { + return remap$(v, { + "tool_references": "toolReferences", + }); +}); + +export function anthropicToolSearchResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicToolSearchResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicToolSearchResult' from JSON`, + ); +} diff --git a/src/models/anthropictoolsearchresulterror.ts b/src/models/anthropictoolsearchresulterror.ts new file mode 100644 index 000000000..5a0b3223c --- /dev/null +++ b/src/models/anthropictoolsearchresulterror.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fdf5a0f6072b + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicServerToolErrorCode, + AnthropicServerToolErrorCode$inboundSchema, +} from "./anthropicservertoolerrorcode.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicToolSearchResultError = { + errorCode: AnthropicServerToolErrorCode; + errorMessage: string | null; + type: "tool_search_tool_result_error"; +}; + +/** @internal */ +export const AnthropicToolSearchResultError$inboundSchema: z.ZodType< + AnthropicToolSearchResultError, + unknown +> = z.object({ + error_code: AnthropicServerToolErrorCode$inboundSchema, + error_message: z.nullable(z.string()), + type: z.literal("tool_search_tool_result_error"), +}).transform((v) => { + return remap$(v, { + "error_code": "errorCode", + "error_message": "errorMessage", + }); +}); + +export function anthropicToolSearchResultErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicToolSearchResultError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicToolSearchResultError' from JSON`, + ); +} diff --git a/src/models/anthropictoolsearchtoolresult.ts b/src/models/anthropictoolsearchtoolresult.ts new file mode 100644 index 000000000..5b0c5be27 --- /dev/null +++ b/src/models/anthropictoolsearchtoolresult.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0c393b072147 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicToolSearchContent, + AnthropicToolSearchContent$inboundSchema, +} from "./anthropictoolsearchcontent.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicToolSearchToolResult = { + content: AnthropicToolSearchContent; + toolUseId: string; + type: "tool_search_tool_result"; +}; + +/** @internal */ +export const AnthropicToolSearchToolResult$inboundSchema: z.ZodType< + AnthropicToolSearchToolResult, + unknown +> = z.object({ + content: AnthropicToolSearchContent$inboundSchema, + tool_use_id: z.string(), + type: z.literal("tool_search_tool_result"), +}).transform((v) => { + return remap$(v, { + "tool_use_id": "toolUseId", + }); +}); + +export function anthropicToolSearchToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicToolSearchToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicToolSearchToolResult' from JSON`, + ); +} diff --git a/src/models/anthropictooluseblock.ts b/src/models/anthropictooluseblock.ts new file mode 100644 index 000000000..df1ba5667 --- /dev/null +++ b/src/models/anthropictooluseblock.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6c9a5a6224a4 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCaller, + AnthropicCaller$inboundSchema, +} from "./anthropiccaller.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicToolUseBlock = { + caller: AnthropicCaller; + id: string; + input?: any | undefined; + name: string; + type: "tool_use"; +}; + +/** @internal */ +export const AnthropicToolUseBlock$inboundSchema: z.ZodType< + AnthropicToolUseBlock, + unknown +> = z.object({ + caller: AnthropicCaller$inboundSchema, + id: z.string(), + input: z.any().optional(), + name: z.string(), + type: z.literal("tool_use"), +}); + +export function anthropicToolUseBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicToolUseBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicToolUseBlock' from JSON`, + ); +} diff --git a/src/models/anthropicwebfetchblock.ts b/src/models/anthropicwebfetchblock.ts new file mode 100644 index 000000000..c6ad74300 --- /dev/null +++ b/src/models/anthropicwebfetchblock.ts @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0e3236a6988b + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicDocumentBlock, + AnthropicDocumentBlock$inboundSchema, +} from "./anthropicdocumentblock.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicWebFetchBlock = { + content: AnthropicDocumentBlock; + retrievedAt: string | null; + type: "web_fetch_result"; + url: string; +}; + +/** @internal */ +export const AnthropicWebFetchBlock$inboundSchema: z.ZodType< + AnthropicWebFetchBlock, + unknown +> = z.object({ + content: AnthropicDocumentBlock$inboundSchema, + retrieved_at: z.nullable(z.string()), + type: z.literal("web_fetch_result"), + url: z.string(), +}).transform((v) => { + return remap$(v, { + "retrieved_at": "retrievedAt", + }); +}); + +export function anthropicWebFetchBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicWebFetchBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebFetchBlock' from JSON`, + ); +} diff --git a/src/models/anthropicwebfetchcontent.ts b/src/models/anthropicwebfetchcontent.ts new file mode 100644 index 000000000..0a75a0e8c --- /dev/null +++ b/src/models/anthropicwebfetchcontent.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ef77960724b3 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicWebFetchBlock, + AnthropicWebFetchBlock$inboundSchema, +} from "./anthropicwebfetchblock.js"; +import { + AnthropicWebFetchToolResultError, + AnthropicWebFetchToolResultError$inboundSchema, +} from "./anthropicwebfetchtoolresulterror.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicWebFetchContent = + | AnthropicWebFetchBlock + | AnthropicWebFetchToolResultError + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const AnthropicWebFetchContent$inboundSchema: z.ZodType< + AnthropicWebFetchContent, + unknown +> = discriminatedUnion("type", { + web_fetch_result: AnthropicWebFetchBlock$inboundSchema, + web_fetch_tool_result_error: AnthropicWebFetchToolResultError$inboundSchema, +}); + +export function anthropicWebFetchContentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicWebFetchContent$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebFetchContent' from JSON`, + ); +} diff --git a/src/models/anthropicwebfetchtoolresult.ts b/src/models/anthropicwebfetchtoolresult.ts new file mode 100644 index 000000000..70f8c7e9e --- /dev/null +++ b/src/models/anthropicwebfetchtoolresult.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 12d2ff014a57 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCaller, + AnthropicCaller$inboundSchema, +} from "./anthropiccaller.js"; +import { + AnthropicWebFetchContent, + AnthropicWebFetchContent$inboundSchema, +} from "./anthropicwebfetchcontent.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicWebFetchToolResult = { + caller: AnthropicCaller; + content: AnthropicWebFetchContent; + toolUseId: string; + type: "web_fetch_tool_result"; +}; + +/** @internal */ +export const AnthropicWebFetchToolResult$inboundSchema: z.ZodType< + AnthropicWebFetchToolResult, + unknown +> = z.object({ + caller: AnthropicCaller$inboundSchema, + content: AnthropicWebFetchContent$inboundSchema, + tool_use_id: z.string(), + type: z.literal("web_fetch_tool_result"), +}).transform((v) => { + return remap$(v, { + "tool_use_id": "toolUseId", + }); +}); + +export function anthropicWebFetchToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicWebFetchToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebFetchToolResult' from JSON`, + ); +} diff --git a/src/models/anthropicwebfetchtoolresulterror.ts b/src/models/anthropicwebfetchtoolresulterror.ts new file mode 100644 index 000000000..92484f15f --- /dev/null +++ b/src/models/anthropicwebfetchtoolresulterror.ts @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 51ade5a2476e + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicWebFetchToolResultErrorErrorCode = { + InvalidToolInput: "invalid_tool_input", + UrlTooLong: "url_too_long", + UrlNotAllowed: "url_not_allowed", + UrlNotAccessible: "url_not_accessible", + UnsupportedContentType: "unsupported_content_type", + TooManyRequests: "too_many_requests", + MaxUsesExceeded: "max_uses_exceeded", + Unavailable: "unavailable", +} as const; +export type AnthropicWebFetchToolResultErrorErrorCode = OpenEnum< + typeof AnthropicWebFetchToolResultErrorErrorCode +>; + +export type AnthropicWebFetchToolResultError = { + errorCode: AnthropicWebFetchToolResultErrorErrorCode; + type: "web_fetch_tool_result_error"; +}; + +/** @internal */ +export const AnthropicWebFetchToolResultErrorErrorCode$inboundSchema: z.ZodType< + AnthropicWebFetchToolResultErrorErrorCode, + unknown +> = openEnums.inboundSchema(AnthropicWebFetchToolResultErrorErrorCode); + +/** @internal */ +export const AnthropicWebFetchToolResultError$inboundSchema: z.ZodType< + AnthropicWebFetchToolResultError, + unknown +> = z.object({ + error_code: AnthropicWebFetchToolResultErrorErrorCode$inboundSchema, + type: z.literal("web_fetch_tool_result_error"), +}).transform((v) => { + return remap$(v, { + "error_code": "errorCode", + }); +}); + +export function anthropicWebFetchToolResultErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicWebFetchToolResultError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebFetchToolResultError' from JSON`, + ); +} diff --git a/src/models/anthropicwebsearchresult.ts b/src/models/anthropicwebsearchresult.ts new file mode 100644 index 000000000..6c2280dd7 --- /dev/null +++ b/src/models/anthropicwebsearchresult.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8e1525a04bc3 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicWebSearchResultType = { + WebSearchResult: "web_search_result", +} as const; +export type AnthropicWebSearchResultType = ClosedEnum< + typeof AnthropicWebSearchResultType +>; + +export type AnthropicWebSearchResult = { + encryptedContent: string; + pageAge: string | null; + title: string; + type: AnthropicWebSearchResultType; + url: string; +}; + +/** @internal */ +export const AnthropicWebSearchResultType$inboundSchema: z.ZodEnum< + typeof AnthropicWebSearchResultType +> = z.enum(AnthropicWebSearchResultType); + +/** @internal */ +export const AnthropicWebSearchResult$inboundSchema: z.ZodType< + AnthropicWebSearchResult, + unknown +> = z.object({ + encrypted_content: z.string(), + page_age: z.nullable(z.string()), + title: z.string(), + type: AnthropicWebSearchResultType$inboundSchema, + url: z.string(), +}).transform((v) => { + return remap$(v, { + "encrypted_content": "encryptedContent", + "page_age": "pageAge", + }); +}); + +export function anthropicWebSearchResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicWebSearchResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebSearchResult' from JSON`, + ); +} diff --git a/src/models/anthropicwebsearchtoolresult.ts b/src/models/anthropicwebsearchtoolresult.ts new file mode 100644 index 000000000..5c3688cce --- /dev/null +++ b/src/models/anthropicwebsearchtoolresult.ts @@ -0,0 +1,81 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ba1707269043 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCaller, + AnthropicCaller$inboundSchema, +} from "./anthropiccaller.js"; +import { + AnthropicWebSearchResult, + AnthropicWebSearchResult$inboundSchema, +} from "./anthropicwebsearchresult.js"; +import { + AnthropicWebSearchToolResultError, + AnthropicWebSearchToolResultError$inboundSchema, +} from "./anthropicwebsearchtoolresulterror.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type AnthropicWebSearchToolResultContent = + | AnthropicWebSearchToolResultError + | Array; + +export type AnthropicWebSearchToolResult = { + caller: AnthropicCaller; + content: AnthropicWebSearchToolResultError | Array; + toolUseId: string; + type: "web_search_tool_result"; +}; + +/** @internal */ +export const AnthropicWebSearchToolResultContent$inboundSchema: z.ZodType< + AnthropicWebSearchToolResultContent, + unknown +> = z.union([ + AnthropicWebSearchToolResultError$inboundSchema, + z.array(AnthropicWebSearchResult$inboundSchema), +]); + +export function anthropicWebSearchToolResultContentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AnthropicWebSearchToolResultContent$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebSearchToolResultContent' from JSON`, + ); +} + +/** @internal */ +export const AnthropicWebSearchToolResult$inboundSchema: z.ZodType< + AnthropicWebSearchToolResult, + unknown +> = z.object({ + caller: AnthropicCaller$inboundSchema, + content: z.union([ + AnthropicWebSearchToolResultError$inboundSchema, + z.array(AnthropicWebSearchResult$inboundSchema), + ]), + tool_use_id: z.string(), + type: z.literal("web_search_tool_result"), +}).transform((v) => { + return remap$(v, { + "tool_use_id": "toolUseId", + }); +}); + +export function anthropicWebSearchToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicWebSearchToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebSearchToolResult' from JSON`, + ); +} diff --git a/src/models/anthropicwebsearchtoolresulterror.ts b/src/models/anthropicwebsearchtoolresulterror.ts new file mode 100644 index 000000000..5038420dc --- /dev/null +++ b/src/models/anthropicwebsearchtoolresulterror.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b1465ff3b43c + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const AnthropicWebSearchToolResultErrorErrorCode = { + InvalidToolInput: "invalid_tool_input", + Unavailable: "unavailable", + MaxUsesExceeded: "max_uses_exceeded", + TooManyRequests: "too_many_requests", + QueryTooLong: "query_too_long", + RequestTooLarge: "request_too_large", +} as const; +export type AnthropicWebSearchToolResultErrorErrorCode = OpenEnum< + typeof AnthropicWebSearchToolResultErrorErrorCode +>; + +export const AnthropicWebSearchToolResultErrorType = { + WebSearchToolResultError: "web_search_tool_result_error", +} as const; +export type AnthropicWebSearchToolResultErrorType = ClosedEnum< + typeof AnthropicWebSearchToolResultErrorType +>; + +export type AnthropicWebSearchToolResultError = { + errorCode: AnthropicWebSearchToolResultErrorErrorCode; + type: AnthropicWebSearchToolResultErrorType; +}; + +/** @internal */ +export const AnthropicWebSearchToolResultErrorErrorCode$inboundSchema: + z.ZodType = openEnums + .inboundSchema(AnthropicWebSearchToolResultErrorErrorCode); + +/** @internal */ +export const AnthropicWebSearchToolResultErrorType$inboundSchema: z.ZodEnum< + typeof AnthropicWebSearchToolResultErrorType +> = z.enum(AnthropicWebSearchToolResultErrorType); + +/** @internal */ +export const AnthropicWebSearchToolResultError$inboundSchema: z.ZodType< + AnthropicWebSearchToolResultError, + unknown +> = z.object({ + error_code: AnthropicWebSearchToolResultErrorErrorCode$inboundSchema, + type: AnthropicWebSearchToolResultErrorType$inboundSchema, +}).transform((v) => { + return remap$(v, { + "error_code": "errorCode", + }); +}); + +export function anthropicWebSearchToolResultErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnthropicWebSearchToolResultError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnthropicWebSearchToolResultError' from JSON`, + ); +} diff --git a/src/models/batchdeletedobject.ts b/src/models/batchdeletedobject.ts new file mode 100644 index 000000000..098a1d74f --- /dev/null +++ b/src/models/batchdeletedobject.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 142fca04702c + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + BatchDeletionTargets, + BatchDeletionTargets$inboundSchema, +} from "./batchdeletiontargets.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const BatchDeletedObjectObject = { + Batch: "batch", +} as const; +export type BatchDeletedObjectObject = ClosedEnum< + typeof BatchDeletedObjectObject +>; + +/** + * 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. + */ +export type BatchDeletedObject = { + /** + * OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome. + */ + deletion: BatchDeletionTargets; + id: string; + object: BatchDeletedObjectObject; +}; + +/** @internal */ +export const BatchDeletedObjectObject$inboundSchema: z.ZodEnum< + typeof BatchDeletedObjectObject +> = z.enum(BatchDeletedObjectObject); + +/** @internal */ +export const BatchDeletedObject$inboundSchema: z.ZodType< + BatchDeletedObject, + unknown +> = z.object({ + deletion: BatchDeletionTargets$inboundSchema, + id: z.string(), + object: BatchDeletedObjectObject$inboundSchema, +}); + +export function batchDeletedObjectFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchDeletedObject$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchDeletedObject' from JSON`, + ); +} diff --git a/src/models/batchdeletionoutcome.ts b/src/models/batchdeletionoutcome.ts new file mode 100644 index 000000000..fe41415c1 --- /dev/null +++ b/src/models/batchdeletionoutcome.ts @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d8b27b19149c + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +/** + * 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). + */ +export const BatchDeletionOutcome = { + Deleted: "deleted", + Unsupported: "unsupported", + NotApplicable: "not_applicable", +} as const; +/** + * 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). + */ +export type BatchDeletionOutcome = OpenEnum; + +/** @internal */ +export const BatchDeletionOutcome$inboundSchema: z.ZodType< + BatchDeletionOutcome, + unknown +> = openEnums.inboundSchema(BatchDeletionOutcome); diff --git a/src/models/batchdeletiontargets.ts b/src/models/batchdeletiontargets.ts new file mode 100644 index 000000000..afc19f67d --- /dev/null +++ b/src/models/batchdeletiontargets.ts @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 031cd7aaeaa3 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + BatchDeletionOutcome, + BatchDeletionOutcome$inboundSchema, +} from "./batchdeletionoutcome.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +/** + * OpenRouter-held request and result artifacts were purged. + */ +export const Openrouter = { + Deleted: "deleted", +} as const; +/** + * OpenRouter-held request and result artifacts were purged. + */ +export type Openrouter = ClosedEnum; + +/** + * The upstream batch deletion outcome; omitted when no provider was assigned. + */ +export type Upstream = { + /** + * The provider name stored on the batch. + */ + provider: string; + /** + * 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). + */ + status: BatchDeletionOutcome; +}; + +/** + * OpenRouter cleanup and, when a provider was assigned, the upstream batch deletion outcome. + */ +export type BatchDeletionTargets = { + /** + * OpenRouter-held request and result artifacts were purged. + */ + openrouter: Openrouter; + /** + * The upstream batch deletion outcome; omitted when no provider was assigned. + */ + upstream?: Upstream | undefined; +}; + +/** @internal */ +export const Openrouter$inboundSchema: z.ZodEnum = z.enum( + Openrouter, +); + +/** @internal */ +export const Upstream$inboundSchema: z.ZodType = z.object({ + provider: z.string(), + status: BatchDeletionOutcome$inboundSchema, +}); + +export function upstreamFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Upstream$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Upstream' from JSON`, + ); +} + +/** @internal */ +export const BatchDeletionTargets$inboundSchema: z.ZodType< + BatchDeletionTargets, + unknown +> = z.object({ + openrouter: Openrouter$inboundSchema, + upstream: z.lazy(() => Upstream$inboundSchema).optional(), +}); + +export function batchDeletionTargetsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchDeletionTargets$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchDeletionTargets' from JSON`, + ); +} diff --git a/src/models/batcherrorresponse.ts b/src/models/batcherrorresponse.ts new file mode 100644 index 000000000..1b8bf7795 --- /dev/null +++ b/src/models/batcherrorresponse.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 61c415402d74 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type BatchErrorResponseError = { + code: number; + message: string; +}; + +/** @internal */ +export const BatchErrorResponseError$inboundSchema: z.ZodType< + BatchErrorResponseError, + unknown +> = z.object({ + code: z.int(), + message: z.string(), +}); + +export function batchErrorResponseErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchErrorResponseError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchErrorResponseError' from JSON`, + ); +} diff --git a/src/models/batchlistitem.ts b/src/models/batchlistitem.ts new file mode 100644 index 000000000..eceedcc01 --- /dev/null +++ b/src/models/batchlistitem.ts @@ -0,0 +1,406 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7032c65d52eb + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCacheCreation, + AnthropicCacheCreation$inboundSchema, +} from "./anthropiccachecreation.js"; +import { + AnthropicSpeed, + AnthropicSpeed$inboundSchema, +} from "./anthropicspeed.js"; +import { + AnthropicUsageIteration, + AnthropicUsageIteration$inboundSchema, +} from "./anthropicusageiteration.js"; +import { CostDetails, CostDetails$inboundSchema } from "./costdetails.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const BatchListItemCompletionWindow = { + TwentyFourh: "24h", +} as const; +export type BatchListItemCompletionWindow = ClosedEnum< + typeof BatchListItemCompletionWindow +>; + +export type BatchListItemError = { + message: string; +}; + +export const BatchListItemObject = { + Batch: "batch", +} as const; +export type BatchListItemObject = ClosedEnum; + +export type BatchListItemRequestCounts = { + completed: number; + failed: number; + total: number; +}; + +export const BatchListItemStatus = { + Validating: "validating", + InProgress: "in_progress", + Finalizing: "finalizing", + Completed: "completed", + Failed: "failed", + Expired: "expired", + Cancelling: "cancelling", + Cancelled: "cancelled", +} as const; +export type BatchListItemStatus = OpenEnum; + +export type BatchListItemCompletionTokensDetails = { + /** + * Tokens generated by the model for audio output. + */ + audioTokens?: number | null | undefined; + /** + * Tokens generated by the model for image output. + */ + imageTokens?: number | null | undefined; + /** + * Tokens generated by the model for reasoning. + */ + reasoningTokens?: number | null | undefined; +}; + +/** + * Breakdown of tokens used in the prompt. + */ +export type BatchListItemPromptTokensDetails = { + /** + * Tokens used for input audio. + */ + audioTokens?: number | null | undefined; + /** + * Tokens written to cache. Only returned for models with explicit caching and cache write pricing. + */ + cacheWriteTokens?: number | null | undefined; + /** + * Tokens cached by the endpoint. + */ + cachedTokens?: number | null | undefined; + /** + * Tokens used for input files/documents. + */ + fileTokens?: number | null | undefined; + /** + * Tokens used for input video. + */ + videoTokens?: number | null | undefined; +}; + +/** + * Usage for server-side tool execution (e.g., web search) + */ +export type BatchListItemServerToolUse = { + /** + * Number of OpenRouter server tool calls that executed and produced a result. + */ + toolCallsExecuted?: number | null | undefined; + /** + * 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. + */ + toolCallsRequested?: number | null | undefined; + /** + * 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. + */ + webSearchRequests?: number | null | undefined; +}; + +export type BatchListItemUsage = { + cacheCreation?: AnthropicCacheCreation | null | undefined; + /** + * The tokens generated + */ + completionTokens: number; + completionTokensDetails?: + | BatchListItemCompletionTokensDetails + | null + | undefined; + /** + * Cost of the completion + */ + cost?: number | null | undefined; + /** + * Breakdown of upstream inference costs + */ + costDetails?: CostDetails | null | undefined; + /** + * Whether a request was made using a Bring Your Own Key configuration + */ + isByok?: boolean | undefined; + iterations?: Array | null | undefined; + /** + * Including images, input audio, and tools if any + */ + promptTokens: number; + /** + * Breakdown of tokens used in the prompt. + */ + promptTokensDetails?: BatchListItemPromptTokensDetails | null | undefined; + /** + * Usage for server-side tool execution (e.g., web search) + */ + serverToolUse?: BatchListItemServerToolUse | null | undefined; + /** + * The service tier used by the upstream provider for this request + */ + serviceTier?: string | null | undefined; + speed?: AnthropicSpeed | null | undefined; + /** + * Sum of the above two fields + */ + totalTokens: number; +}; + +/** + * Metadata-only batch object. `results` is always `null` in list responses. + */ +export type BatchListItem = { + completionWindow: BatchListItemCompletionWindow; + createdAt: number; + endpoint: string; + error: BatchListItemError | null; + finalizedAt: number | null; + id: string; + model: string; + object: BatchListItemObject; + requestCounts: BatchListItemRequestCounts; + /** + * Always null: retrieve the batch with `GET /batches/{id}` to access its results. + */ + results: any | null; + status: BatchListItemStatus; + usage: BatchListItemUsage | null; +}; + +/** @internal */ +export const BatchListItemCompletionWindow$inboundSchema: z.ZodEnum< + typeof BatchListItemCompletionWindow +> = z.enum(BatchListItemCompletionWindow); + +/** @internal */ +export const BatchListItemError$inboundSchema: z.ZodType< + BatchListItemError, + unknown +> = z.object({ + message: z.string(), +}); + +export function batchListItemErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchListItemError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListItemError' from JSON`, + ); +} + +/** @internal */ +export const BatchListItemObject$inboundSchema: z.ZodEnum< + typeof BatchListItemObject +> = z.enum(BatchListItemObject); + +/** @internal */ +export const BatchListItemRequestCounts$inboundSchema: z.ZodType< + BatchListItemRequestCounts, + unknown +> = z.object({ + completed: z.int(), + failed: z.int(), + total: z.int(), +}); + +export function batchListItemRequestCountsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchListItemRequestCounts$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListItemRequestCounts' from JSON`, + ); +} + +/** @internal */ +export const BatchListItemStatus$inboundSchema: z.ZodType< + BatchListItemStatus, + unknown +> = openEnums.inboundSchema(BatchListItemStatus); + +/** @internal */ +export const BatchListItemCompletionTokensDetails$inboundSchema: z.ZodType< + BatchListItemCompletionTokensDetails, + unknown +> = z.object({ + audio_tokens: z.nullable(z.int()).optional(), + image_tokens: z.nullable(z.int()).optional(), + reasoning_tokens: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "image_tokens": "imageTokens", + "reasoning_tokens": "reasoningTokens", + }); +}); + +export function batchListItemCompletionTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + BatchListItemCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListItemCompletionTokensDetails' from JSON`, + ); +} + +/** @internal */ +export const BatchListItemPromptTokensDetails$inboundSchema: z.ZodType< + BatchListItemPromptTokensDetails, + unknown +> = z.object({ + audio_tokens: z.nullable(z.int()).optional(), + cache_write_tokens: z.nullable(z.int()).optional(), + cached_tokens: z.nullable(z.int()).optional(), + file_tokens: z.nullable(z.int()).optional(), + video_tokens: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "cache_write_tokens": "cacheWriteTokens", + "cached_tokens": "cachedTokens", + "file_tokens": "fileTokens", + "video_tokens": "videoTokens", + }); +}); + +export function batchListItemPromptTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchListItemPromptTokensDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListItemPromptTokensDetails' from JSON`, + ); +} + +/** @internal */ +export const BatchListItemServerToolUse$inboundSchema: z.ZodType< + BatchListItemServerToolUse, + unknown +> = z.object({ + tool_calls_executed: z.nullable(z.int()).optional(), + tool_calls_requested: z.nullable(z.int()).optional(), + web_search_requests: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "tool_calls_executed": "toolCallsExecuted", + "tool_calls_requested": "toolCallsRequested", + "web_search_requests": "webSearchRequests", + }); +}); + +export function batchListItemServerToolUseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchListItemServerToolUse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListItemServerToolUse' from JSON`, + ); +} + +/** @internal */ +export const BatchListItemUsage$inboundSchema: z.ZodType< + BatchListItemUsage, + unknown +> = z.object({ + cache_creation: z.nullable(AnthropicCacheCreation$inboundSchema).optional(), + completion_tokens: z.int(), + completion_tokens_details: z.nullable( + z.lazy(() => BatchListItemCompletionTokensDetails$inboundSchema), + ).optional(), + cost: z.nullable(z.number()).optional(), + cost_details: z.nullable(CostDetails$inboundSchema).optional(), + is_byok: z.boolean().optional(), + iterations: z.nullable(z.array(AnthropicUsageIteration$inboundSchema)) + .optional(), + prompt_tokens: z.int(), + prompt_tokens_details: z.nullable( + z.lazy(() => BatchListItemPromptTokensDetails$inboundSchema), + ).optional(), + server_tool_use: z.nullable( + z.lazy(() => BatchListItemServerToolUse$inboundSchema), + ).optional(), + service_tier: z.nullable(z.string()).optional(), + speed: z.nullable(AnthropicSpeed$inboundSchema).optional(), + total_tokens: z.int(), +}).transform((v) => { + return remap$(v, { + "cache_creation": "cacheCreation", + "completion_tokens": "completionTokens", + "completion_tokens_details": "completionTokensDetails", + "cost_details": "costDetails", + "is_byok": "isByok", + "prompt_tokens": "promptTokens", + "prompt_tokens_details": "promptTokensDetails", + "server_tool_use": "serverToolUse", + "service_tier": "serviceTier", + "total_tokens": "totalTokens", + }); +}); + +export function batchListItemUsageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchListItemUsage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListItemUsage' from JSON`, + ); +} + +/** @internal */ +export const BatchListItem$inboundSchema: z.ZodType = z + .object({ + completion_window: BatchListItemCompletionWindow$inboundSchema, + created_at: z.int(), + endpoint: z.string(), + error: z.nullable(z.lazy(() => BatchListItemError$inboundSchema)), + finalized_at: z.nullable(z.int()), + id: z.string(), + model: z.string(), + object: BatchListItemObject$inboundSchema, + request_counts: z.lazy(() => BatchListItemRequestCounts$inboundSchema), + results: z.nullable(z.any()), + status: BatchListItemStatus$inboundSchema, + usage: z.nullable(z.lazy(() => BatchListItemUsage$inboundSchema)), + }).transform((v) => { + return remap$(v, { + "completion_window": "completionWindow", + "created_at": "createdAt", + "finalized_at": "finalizedAt", + "request_counts": "requestCounts", + }); + }); + +export function batchListItemFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchListItem$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListItem' from JSON`, + ); +} diff --git a/src/models/batchlistresponse.ts b/src/models/batchlistresponse.ts new file mode 100644 index 000000000..da2cb850c --- /dev/null +++ b/src/models/batchlistresponse.ts @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 951626e2dafe + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { BatchListItem, BatchListItem$inboundSchema } from "./batchlistitem.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const BatchListResponseObject = { + List: "list", +} as const; +export type BatchListResponseObject = ClosedEnum< + typeof BatchListResponseObject +>; + +/** + * A newest-first page of metadata-only batch objects. + */ +export type BatchListResponse = { + data: Array; + firstId: string | null; + hasMore: boolean; + lastId: string | null; + object: BatchListResponseObject; +}; + +/** @internal */ +export const BatchListResponseObject$inboundSchema: z.ZodEnum< + typeof BatchListResponseObject +> = z.enum(BatchListResponseObject); + +/** @internal */ +export const BatchListResponse$inboundSchema: z.ZodType< + BatchListResponse, + unknown +> = z.object({ + data: z.array(BatchListItem$inboundSchema), + first_id: z.nullable(z.string()), + has_more: z.boolean(), + last_id: z.nullable(z.string()), + object: BatchListResponseObject$inboundSchema, +}).transform((v) => { + return remap$(v, { + "first_id": "firstId", + "has_more": "hasMore", + "last_id": "lastId", + }); +}); + +export function batchListResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchListResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchListResponse' from JSON`, + ); +} diff --git a/src/models/batchliststatus.ts b/src/models/batchliststatus.ts new file mode 100644 index 000000000..4e0a13eca --- /dev/null +++ b/src/models/batchliststatus.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 153016536e91 + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +/** + * 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`. + */ +export const BatchListStatus = { + Validating: "validating", + InProgress: "in_progress", + Completed: "completed", + Failed: "failed", + Expired: "expired", + Cancelled: "cancelled", +} as const; +/** + * 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`. + */ +export type BatchListStatus = OpenEnum; + +/** @internal */ +export const BatchListStatus$outboundSchema: z.ZodType< + string, + BatchListStatus +> = openEnums.outboundSchema(BatchListStatus); diff --git a/src/models/batchlisttimestamp.ts b/src/models/batchlisttimestamp.ts new file mode 100644 index 000000000..e61bcceeb --- /dev/null +++ b/src/models/batchlisttimestamp.ts @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 55ff60a4c180 + */ + +import * as z from "zod/v4"; +import { RFCDate } from "../types/rfcdate.js"; + +/** + * Only include batches created strictly after this timestamp. + */ +export type BatchListTimestamp = string | RFCDate; + +/** @internal */ +export type BatchListTimestamp$Outbound = string | string; + +/** @internal */ +export const BatchListTimestamp$outboundSchema: z.ZodType< + BatchListTimestamp$Outbound, + BatchListTimestamp +> = z.union([ + z.string(), + z.custom(x => x instanceof RFCDate).transform(v => v.toString()), +]); + +export function batchListTimestampToJSON( + batchListTimestamp: BatchListTimestamp, +): string { + return JSON.stringify( + BatchListTimestamp$outboundSchema.parse(batchListTimestamp), + ); +} diff --git a/src/models/batchobject.ts b/src/models/batchobject.ts new file mode 100644 index 000000000..2408f4b72 --- /dev/null +++ b/src/models/batchobject.ts @@ -0,0 +1,2019 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8103bc5f4aeb + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { + collectExtraKeys as collectExtraKeys$, + safeParse, +} from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import * as openEnums from "../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCacheCreation, + AnthropicCacheCreation$inboundSchema, +} from "./anthropiccachecreation.js"; +import { + AnthropicContainer, + AnthropicContainer$inboundSchema, +} from "./anthropiccontainer.js"; +import { + AnthropicInputTransformation, + AnthropicInputTransformation$inboundSchema, +} from "./anthropicinputtransformation.js"; +import { + AnthropicOutputTokensDetails, + AnthropicOutputTokensDetails$inboundSchema, +} from "./anthropicoutputtokensdetails.js"; +import { + AnthropicRefusalStopDetails, + AnthropicRefusalStopDetails$inboundSchema, +} from "./anthropicrefusalstopdetails.js"; +import { + AnthropicServerToolUsage, + AnthropicServerToolUsage$inboundSchema, +} from "./anthropicservertoolusage.js"; +import { + AnthropicServiceTier, + AnthropicServiceTier$inboundSchema, +} from "./anthropicservicetier.js"; +import { + AnthropicSpeed, + AnthropicSpeed$inboundSchema, +} from "./anthropicspeed.js"; +import { + AnthropicUsageIteration, + AnthropicUsageIteration$inboundSchema, +} from "./anthropicusageiteration.js"; +import { ApiErrorType, ApiErrorType$inboundSchema } from "./apierrortype.js"; +import { CostDetails, CostDetails$inboundSchema } from "./costdetails.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { FinishReason, FinishReason$inboundSchema } from "./finishreason.js"; +import { + OpenResponsesResult, + OpenResponsesResult$inboundSchema, +} from "./openresponsesresult.js"; +import { + OpenRouterMetadata, + OpenRouterMetadata$inboundSchema, +} from "./openroutermetadata.js"; +import { + ORAnthropicContentBlock, + ORAnthropicContentBlock$inboundSchema, +} from "./oranthropiccontentblock.js"; +import { + ORAnthropicStopReason, + ORAnthropicStopReason$inboundSchema, +} from "./oranthropicstopreason.js"; +import { + ReasoningDetailEncrypted, + ReasoningDetailEncrypted$inboundSchema, +} from "./reasoningdetailencrypted.js"; +import { + ReasoningDetailServerToolCall, + ReasoningDetailServerToolCall$inboundSchema, +} from "./reasoningdetailservertoolcall.js"; +import { + ReasoningDetailSummary, + ReasoningDetailSummary$inboundSchema, +} from "./reasoningdetailsummary.js"; +import { + ReasoningDetailText, + ReasoningDetailText$inboundSchema, +} from "./reasoningdetailtext.js"; + +export const BatchObjectCompletionWindow = { + TwentyFourh: "24h", +} as const; +export type BatchObjectCompletionWindow = ClosedEnum< + typeof BatchObjectCompletionWindow +>; + +export type BatchObjectError = { + message: string; +}; + +export const BatchObjectObjectBatch = { + Batch: "batch", +} as const; +export type BatchObjectObjectBatch = ClosedEnum; + +export type BatchObjectRequestCounts = { + completed: number; + failed: number; + total: number; +}; + +export type ResultError = { + /** + * Canonical OpenRouter error type, stable across all API formats + */ + errorType?: ApiErrorType | undefined; + message: string; + param: string | null; + type: string; +}; + +/** + * Embedding vector as an array of floats or a base64 string + */ +export type Embedding = Array | string; + +export const ObjectEmbedding = { + Embedding: "embedding", +} as const; +export type ObjectEmbedding = ClosedEnum; + +/** + * A single embedding object + */ +export type BatchObjectData = { + /** + * Embedding vector as an array of floats or a base64 string + */ + embedding: Array | string; + /** + * Index of the embedding in the input list + */ + index?: number | undefined; + object: ObjectEmbedding; +}; + +export const BodyObjectList = { + List: "list", +} as const; +export type BodyObjectList = ClosedEnum; + +/** + * 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. + */ +export type BodyPromptTokensDetails2 = { + /** + * Number of audio tokens in the input + */ + audioTokens?: number | undefined; + /** + * Number of file/document tokens in the input + */ + fileTokens?: number | undefined; + /** + * Number of image tokens in the input + */ + imageTokens?: number | undefined; + /** + * Number of text tokens in the input + */ + textTokens?: number | undefined; + /** + * Number of video tokens in the input + */ + videoTokens?: number | undefined; +}; + +/** + * Token usage statistics + */ +export type BodyUsage3 = { + /** + * Cost of the request in credits + */ + cost?: number | undefined; + /** + * Breakdown of upstream inference costs + */ + costDetails?: CostDetails | null | undefined; + /** + * Whether a request was made using a Bring Your Own Key configuration + */ + isByok?: boolean | undefined; + /** + * Number of tokens in the input + */ + promptTokens: number; + /** + * 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. + */ + promptTokensDetails?: BodyPromptTokensDetails2 | undefined; + /** + * Total number of tokens used + */ + totalTokens: number; +}; + +/** + * Embeddings response containing embedding vectors + */ +export type BodyList = { + /** + * List of embedding objects + */ + data: Array; + /** + * Unique identifier for the embeddings response + */ + id?: string | undefined; + /** + * The model used for embeddings + */ + model: string; + object: BodyObjectList; + /** + * Token usage statistics + */ + usage?: BodyUsage3 | undefined; +}; + +export const BatchObjectRole = { + Assistant: "assistant", +} as const; +export type BatchObjectRole = ClosedEnum; + +export const BatchObjectTypeMessage = { + Message: "message", +} as const; +export type BatchObjectTypeMessage = ClosedEnum; + +export type BodyUsage2 = { + cacheCreation: AnthropicCacheCreation | null; + cacheCreationInputTokens: number | null; + cacheReadInputTokens: number | null; + inferenceGeo: string | null; + inputTokens: number; + outputTokens: number; + outputTokensDetails: AnthropicOutputTokensDetails | null; + serverToolUse: AnthropicServerToolUsage | null; + serviceTier: AnthropicServiceTier | null; + iterations?: Array | undefined; + speed?: AnthropicSpeed | null | undefined; +}; + +export type BodyMessage = { + container: AnthropicContainer | null; + content: Array; + id: string; + inputTransformations?: Array | null | undefined; + model: string; + role: BatchObjectRole; + /** + * Structured information about a refusal + */ + stopDetails: AnthropicRefusalStopDetails | null; + stopReason: ORAnthropicStopReason | null; + stopSequence: string | null; + type: BatchObjectTypeMessage; + usage: BodyUsage2; +}; + +export type ContentTopLogprob = { + bytes: Array | null; + logprob: number; + token: string; +}; + +export type LogprobsContent = { + bytes: Array | null; + logprob: number; + token: string; + topLogprobs: Array; +}; + +export type RefusalTopLogprob = { + bytes: Array | null; + logprob: number; + token: string; +}; + +export type Refusal = { + bytes: Array | null; + logprob: number; + token: string; + topLogprobs: Array; +}; + +export type Logprobs = { + content: Array | null; + refusal?: Array | null | undefined; +}; + +export type WebSearchCitation = { + citedText?: string | undefined; + encryptedIndex?: string | undefined; + title: string | null; + url: string; +}; + +export type AnnotationWebSearchCitation = { + type: "web_search_citation"; + webSearchCitation: WebSearchCitation; +}; + +export type BatchObjectUrlCitation = { + content?: string | undefined; + endIndex: number; + startIndex: number; + title: string; + url: string; +}; + +export type AnnotationURLCitation = { + type: "url_citation"; + urlCitation: BatchObjectUrlCitation; +}; + +export type ContentImageUrlImageUrl = { + url: string; +}; + +export type ContentImageURL = { + imageUrl: ContentImageUrlImageUrl; + type: "image_url"; +}; + +export type ContentText = { + text: string; + type: "text"; +}; + +export type AnnotationContentUnion = + | ContentText + | ContentImageURL + | discriminatedUnionTypes.Unknown<"type">; + +export type BatchObjectFile = { + content: Array< + ContentText | ContentImageURL | discriminatedUnionTypes.Unknown<"type"> + >; + hash: string; + name?: string | undefined; +}; + +export type AnnotationFile = { + file: BatchObjectFile; + type: "file"; +}; + +export type Annotation = + | AnnotationFile + | AnnotationURLCitation + | AnnotationWebSearchCitation + | discriminatedUnionTypes.Unknown<"type">; + +export type BatchObjectImageUrl = { + url: string; +}; + +export const ChoiceTypeImageURLEnum = { + ImageUrl: "image_url", +} as const; +export type ChoiceTypeImageURLEnum = ClosedEnum; + +export type Image = { + imageUrl: BatchObjectImageUrl; + type: ChoiceTypeImageURLEnum; +}; + +export type ReasoningDetail = + | ReasoningDetailSummary + | ReasoningDetailEncrypted + | ReasoningDetailText + | ReasoningDetailServerToolCall + | discriminatedUnionTypes.Unknown<"type">; + +export const ChoiceRole = { + Assistant: "assistant", +} as const; +export type ChoiceRole = ClosedEnum; + +export type BatchObjectFunction = { + arguments: string; + name: string; +}; + +export const ChoiceTypeFunction = { + Function: "function", +} as const; +export type ChoiceTypeFunction = ClosedEnum; + +export type ToolCall = { + function: BatchObjectFunction; + id: string; + index: number; + type: ChoiceTypeFunction; +}; + +export type Message = { + annotations?: + | Array< + | AnnotationFile + | AnnotationURLCitation + | AnnotationWebSearchCitation + | discriminatedUnionTypes.Unknown<"type"> + > + | undefined; + content: string | null; + images?: Array | null | undefined; + reasoning?: string | null | undefined; + reasoningDetails?: + | Array< + | ReasoningDetailSummary + | ReasoningDetailEncrypted + | ReasoningDetailText + | ReasoningDetailServerToolCall + | discriminatedUnionTypes.Unknown<"type"> + | null + > + | null + | undefined; + refusal: string | null; + role: ChoiceRole; + toolCalls?: Array | undefined; +}; + +export type Choice = { + finishReason: FinishReason; + index: number; + logprobs: Logprobs | null; + message: Message; + nativeFinishReason: string | null; +}; + +export const BatchObjectEvent = { + AdapterRequest: "adapter_request", + UpstreamHeadersReceived: "upstream_headers_received", + FirstTokenReceived: "first_token_received", + UpstreamBodyEnded: "upstream_body_ended", +} as const; +export type BatchObjectEvent = OpenEnum; + +export type BatchObjectTimings = { + epochMs: number; + event: BatchObjectEvent; + startMs: number; +}; + +export type BatchObjectDebug = { + echoUpstreamBody?: { [k: string]: any } | undefined; + timings?: BatchObjectTimings | undefined; + additionalProperties?: { [k: string]: any } | undefined; +}; + +export const BodyObjectChatCompletion = { + ChatCompletion: "chat.completion", +} as const; +export type BodyObjectChatCompletion = ClosedEnum< + typeof BodyObjectChatCompletion +>; + +export type BodyCompletionTokensDetails = { + /** + * Tokens generated by the model for audio output. + */ + audioTokens?: number | null | undefined; + /** + * Tokens generated by the model for image output. + */ + imageTokens?: number | null | undefined; + /** + * Tokens generated by the model for reasoning. + */ + reasoningTokens?: number | null | undefined; +}; + +/** + * Breakdown of tokens used in the prompt. + */ +export type BodyPromptTokensDetails1 = { + /** + * Tokens used for input audio. + */ + audioTokens?: number | null | undefined; + /** + * Tokens written to cache. Only returned for models with explicit caching and cache write pricing. + */ + cacheWriteTokens?: number | null | undefined; + /** + * Tokens cached by the endpoint. + */ + cachedTokens?: number | null | undefined; + /** + * Tokens used for input files/documents. + */ + fileTokens?: number | null | undefined; + /** + * Tokens used for input video. + */ + videoTokens?: number | null | undefined; +}; + +/** + * Usage for server-side tool execution (e.g., web search) + */ +export type BodyServerToolUse = { + /** + * Number of OpenRouter server tool calls that executed and produced a result. + */ + toolCallsExecuted?: number | null | undefined; + /** + * 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. + */ + toolCallsRequested?: number | null | undefined; + /** + * 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. + */ + webSearchRequests?: number | null | undefined; +}; + +/** + * Usage for server-side tool execution (e.g., web search) + */ +export type BatchObjectServerToolUseDetails = { + /** + * Number of OpenRouter server tool calls that executed and produced a result. + */ + toolCallsExecuted?: number | null | undefined; + /** + * 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. + */ + toolCallsRequested?: number | null | undefined; + /** + * 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. + */ + webSearchRequests?: number | null | undefined; +}; + +export type BodyUsage1 = { + /** + * The tokens generated + */ + completionTokens: number; + completionTokensDetails?: BodyCompletionTokensDetails | null | undefined; + /** + * Including images, input audio, and tools if any + */ + promptTokens: number; + /** + * Breakdown of tokens used in the prompt. + */ + promptTokensDetails?: BodyPromptTokensDetails1 | null | undefined; + /** + * Usage for server-side tool execution (e.g., web search) + */ + serverToolUse?: BodyServerToolUse | null | undefined; + /** + * Usage for server-side tool execution (e.g., web search) + */ + serverToolUseDetails?: BatchObjectServerToolUseDetails | null | undefined; + /** + * Sum of the above two fields + */ + totalTokens: number; +}; + +export type BodyChatCompletion = { + choices: Array; + created: number; + debug?: BatchObjectDebug | undefined; + id: string; + model: string; + object: BodyObjectChatCompletion; + openrouterMetadata?: OpenRouterMetadata | undefined; + provider?: string | null | undefined; + serviceTier?: string | null | undefined; + systemFingerprint?: string | null | undefined; + usage?: BodyUsage1 | undefined; +}; + +export type Body = + | OpenResponsesResult + | BodyMessage + | BodyChatCompletion + | BodyList; + +export type BatchObjectResponse = { + body: OpenResponsesResult | BodyMessage | BodyChatCompletion | BodyList; + requestId: string | null; + statusCode: number; +}; + +export type Result = { + customId: string; + error: ResultError | null; + id: string; + response: BatchObjectResponse | null; +}; + +export const BatchObjectStatus = { + Validating: "validating", + InProgress: "in_progress", + Finalizing: "finalizing", + Completed: "completed", + Failed: "failed", + Expired: "expired", + Cancelling: "cancelling", + Cancelled: "cancelled", +} as const; +export type BatchObjectStatus = OpenEnum; + +export type BatchObjectCompletionTokensDetails = { + /** + * Tokens generated by the model for audio output. + */ + audioTokens?: number | null | undefined; + /** + * Tokens generated by the model for image output. + */ + imageTokens?: number | null | undefined; + /** + * Tokens generated by the model for reasoning. + */ + reasoningTokens?: number | null | undefined; +}; + +/** + * Breakdown of tokens used in the prompt. + */ +export type BatchObjectPromptTokensDetails = { + /** + * Tokens used for input audio. + */ + audioTokens?: number | null | undefined; + /** + * Tokens written to cache. Only returned for models with explicit caching and cache write pricing. + */ + cacheWriteTokens?: number | null | undefined; + /** + * Tokens cached by the endpoint. + */ + cachedTokens?: number | null | undefined; + /** + * Tokens used for input files/documents. + */ + fileTokens?: number | null | undefined; + /** + * Tokens used for input video. + */ + videoTokens?: number | null | undefined; +}; + +/** + * Usage for server-side tool execution (e.g., web search) + */ +export type BatchObjectServerToolUse = { + /** + * Number of OpenRouter server tool calls that executed and produced a result. + */ + toolCallsExecuted?: number | null | undefined; + /** + * 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. + */ + toolCallsRequested?: number | null | undefined; + /** + * 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. + */ + webSearchRequests?: number | null | undefined; +}; + +export type BatchObjectUsage = { + cacheCreation?: AnthropicCacheCreation | null | undefined; + /** + * The tokens generated + */ + completionTokens: number; + completionTokensDetails?: + | BatchObjectCompletionTokensDetails + | null + | undefined; + /** + * Cost of the completion + */ + cost?: number | null | undefined; + /** + * Breakdown of upstream inference costs + */ + costDetails?: CostDetails | null | undefined; + /** + * Whether a request was made using a Bring Your Own Key configuration + */ + isByok?: boolean | undefined; + iterations?: Array | null | undefined; + /** + * Including images, input audio, and tools if any + */ + promptTokens: number; + /** + * Breakdown of tokens used in the prompt. + */ + promptTokensDetails?: BatchObjectPromptTokensDetails | null | undefined; + /** + * Usage for server-side tool execution (e.g., web search) + */ + serverToolUse?: BatchObjectServerToolUse | null | undefined; + /** + * The service tier used by the upstream provider for this request + */ + serviceTier?: string | null | undefined; + speed?: AnthropicSpeed | null | undefined; + /** + * Sum of the above two fields + */ + totalTokens: number; +}; + +export type BatchObject = { + completionWindow: BatchObjectCompletionWindow; + createdAt: number; + endpoint: string; + error: BatchObjectError | null; + finalizedAt: number | null; + id: string; + model: string; + object: BatchObjectObjectBatch; + requestCounts: BatchObjectRequestCounts; + results: Array | null; + status: BatchObjectStatus; + usage: BatchObjectUsage | null; +}; + +/** @internal */ +export const BatchObjectCompletionWindow$inboundSchema: z.ZodEnum< + typeof BatchObjectCompletionWindow +> = z.enum(BatchObjectCompletionWindow); + +/** @internal */ +export const BatchObjectError$inboundSchema: z.ZodType< + BatchObjectError, + unknown +> = z.object({ + message: z.string(), +}); + +export function batchObjectErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectError' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectObjectBatch$inboundSchema: z.ZodEnum< + typeof BatchObjectObjectBatch +> = z.enum(BatchObjectObjectBatch); + +/** @internal */ +export const BatchObjectRequestCounts$inboundSchema: z.ZodType< + BatchObjectRequestCounts, + unknown +> = z.object({ + completed: z.int(), + failed: z.int(), + total: z.int(), +}); + +export function batchObjectRequestCountsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectRequestCounts$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectRequestCounts' from JSON`, + ); +} + +/** @internal */ +export const ResultError$inboundSchema: z.ZodType = z + .object({ + error_type: ApiErrorType$inboundSchema.optional(), + message: z.string(), + param: z.nullable(z.string()), + type: z.string(), + }).transform((v) => { + return remap$(v, { + "error_type": "errorType", + }); + }); + +export function resultErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ResultError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ResultError' from JSON`, + ); +} + +/** @internal */ +export const Embedding$inboundSchema: z.ZodType = z.union([ + z.array(z.number()), + z.string(), +]); + +export function embeddingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Embedding$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Embedding' from JSON`, + ); +} + +/** @internal */ +export const ObjectEmbedding$inboundSchema: z.ZodEnum = + z.enum(ObjectEmbedding); + +/** @internal */ +export const BatchObjectData$inboundSchema: z.ZodType< + BatchObjectData, + unknown +> = z.object({ + embedding: z.union([z.array(z.number()), z.string()]), + index: z.int().optional(), + object: ObjectEmbedding$inboundSchema, +}); + +export function batchObjectDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectData' from JSON`, + ); +} + +/** @internal */ +export const BodyObjectList$inboundSchema: z.ZodEnum = z + .enum(BodyObjectList); + +/** @internal */ +export const BodyPromptTokensDetails2$inboundSchema: z.ZodType< + BodyPromptTokensDetails2, + unknown +> = z.object({ + audio_tokens: z.int().optional(), + file_tokens: z.int().optional(), + image_tokens: z.int().optional(), + text_tokens: z.int().optional(), + video_tokens: z.int().optional(), +}).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "file_tokens": "fileTokens", + "image_tokens": "imageTokens", + "text_tokens": "textTokens", + "video_tokens": "videoTokens", + }); +}); + +export function bodyPromptTokensDetails2FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyPromptTokensDetails2$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyPromptTokensDetails2' from JSON`, + ); +} + +/** @internal */ +export const BodyUsage3$inboundSchema: z.ZodType = z + .object({ + cost: z.number().optional(), + cost_details: z.nullable(CostDetails$inboundSchema).optional(), + is_byok: z.boolean().optional(), + prompt_tokens: z.int(), + prompt_tokens_details: z.lazy(() => BodyPromptTokensDetails2$inboundSchema) + .optional(), + total_tokens: z.int(), + }).transform((v) => { + return remap$(v, { + "cost_details": "costDetails", + "is_byok": "isByok", + "prompt_tokens": "promptTokens", + "prompt_tokens_details": "promptTokensDetails", + "total_tokens": "totalTokens", + }); + }); + +export function bodyUsage3FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyUsage3$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyUsage3' from JSON`, + ); +} + +/** @internal */ +export const BodyList$inboundSchema: z.ZodType = z.object({ + data: z.array(z.lazy(() => BatchObjectData$inboundSchema)), + id: z.string().optional(), + model: z.string(), + object: BodyObjectList$inboundSchema, + usage: z.lazy(() => BodyUsage3$inboundSchema).optional(), +}); + +export function bodyListFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyList$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyList' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectRole$inboundSchema: z.ZodEnum = + z.enum(BatchObjectRole); + +/** @internal */ +export const BatchObjectTypeMessage$inboundSchema: z.ZodEnum< + typeof BatchObjectTypeMessage +> = z.enum(BatchObjectTypeMessage); + +/** @internal */ +export const BodyUsage2$inboundSchema: z.ZodType = z + .object({ + cache_creation: z.nullable(AnthropicCacheCreation$inboundSchema), + cache_creation_input_tokens: z.nullable(z.int()), + cache_read_input_tokens: z.nullable(z.int()), + inference_geo: z.nullable(z.string()), + input_tokens: z.int(), + output_tokens: z.int(), + output_tokens_details: z.nullable( + AnthropicOutputTokensDetails$inboundSchema, + ), + server_tool_use: z.nullable(AnthropicServerToolUsage$inboundSchema), + service_tier: z.nullable(AnthropicServiceTier$inboundSchema), + iterations: z.array(AnthropicUsageIteration$inboundSchema).optional(), + speed: z.nullable(AnthropicSpeed$inboundSchema).optional(), + }).transform((v) => { + return remap$(v, { + "cache_creation": "cacheCreation", + "cache_creation_input_tokens": "cacheCreationInputTokens", + "cache_read_input_tokens": "cacheReadInputTokens", + "inference_geo": "inferenceGeo", + "input_tokens": "inputTokens", + "output_tokens": "outputTokens", + "output_tokens_details": "outputTokensDetails", + "server_tool_use": "serverToolUse", + "service_tier": "serviceTier", + }); + }); + +export function bodyUsage2FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyUsage2$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyUsage2' from JSON`, + ); +} + +/** @internal */ +export const BodyMessage$inboundSchema: z.ZodType = z + .object({ + container: z.nullable(AnthropicContainer$inboundSchema), + content: z.array(ORAnthropicContentBlock$inboundSchema), + id: z.string(), + input_transformations: z.nullable( + z.array(AnthropicInputTransformation$inboundSchema), + ).optional(), + model: z.string(), + role: BatchObjectRole$inboundSchema, + stop_details: z.nullable(AnthropicRefusalStopDetails$inboundSchema), + stop_reason: z.nullable(ORAnthropicStopReason$inboundSchema), + stop_sequence: z.nullable(z.string()), + type: BatchObjectTypeMessage$inboundSchema, + usage: z.lazy(() => BodyUsage2$inboundSchema), + }).transform((v) => { + return remap$(v, { + "input_transformations": "inputTransformations", + "stop_details": "stopDetails", + "stop_reason": "stopReason", + "stop_sequence": "stopSequence", + }); + }); + +export function bodyMessageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyMessage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyMessage' from JSON`, + ); +} + +/** @internal */ +export const ContentTopLogprob$inboundSchema: z.ZodType< + ContentTopLogprob, + unknown +> = z.object({ + bytes: z.nullable(z.array(z.int())), + logprob: z.number(), + token: z.string(), +}); + +export function contentTopLogprobFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ContentTopLogprob$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ContentTopLogprob' from JSON`, + ); +} + +/** @internal */ +export const LogprobsContent$inboundSchema: z.ZodType< + LogprobsContent, + unknown +> = z.object({ + bytes: z.nullable(z.array(z.int())), + logprob: z.number(), + token: z.string(), + top_logprobs: z.array(z.lazy(() => ContentTopLogprob$inboundSchema)), +}).transform((v) => { + return remap$(v, { + "top_logprobs": "topLogprobs", + }); +}); + +export function logprobsContentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogprobsContent$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogprobsContent' from JSON`, + ); +} + +/** @internal */ +export const RefusalTopLogprob$inboundSchema: z.ZodType< + RefusalTopLogprob, + unknown +> = z.object({ + bytes: z.nullable(z.array(z.int())), + logprob: z.number(), + token: z.string(), +}); + +export function refusalTopLogprobFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RefusalTopLogprob$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RefusalTopLogprob' from JSON`, + ); +} + +/** @internal */ +export const Refusal$inboundSchema: z.ZodType = z.object({ + bytes: z.nullable(z.array(z.int())), + logprob: z.number(), + token: z.string(), + top_logprobs: z.array(z.lazy(() => RefusalTopLogprob$inboundSchema)), +}).transform((v) => { + return remap$(v, { + "top_logprobs": "topLogprobs", + }); +}); + +export function refusalFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Refusal$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Refusal' from JSON`, + ); +} + +/** @internal */ +export const Logprobs$inboundSchema: z.ZodType = z.object({ + content: z.nullable(z.array(z.lazy(() => LogprobsContent$inboundSchema))), + refusal: z.nullable(z.array(z.lazy(() => Refusal$inboundSchema))).optional(), +}); + +export function logprobsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Logprobs$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Logprobs' from JSON`, + ); +} + +/** @internal */ +export const WebSearchCitation$inboundSchema: z.ZodType< + WebSearchCitation, + unknown +> = z.object({ + cited_text: z.string().optional(), + encrypted_index: z.string().optional(), + title: z.nullable(z.string()), + url: z.string(), +}).transform((v) => { + return remap$(v, { + "cited_text": "citedText", + "encrypted_index": "encryptedIndex", + }); +}); + +export function webSearchCitationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WebSearchCitation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WebSearchCitation' from JSON`, + ); +} + +/** @internal */ +export const AnnotationWebSearchCitation$inboundSchema: z.ZodType< + AnnotationWebSearchCitation, + unknown +> = z.object({ + type: z.literal("web_search_citation"), + web_search_citation: z.lazy(() => WebSearchCitation$inboundSchema), +}).transform((v) => { + return remap$(v, { + "web_search_citation": "webSearchCitation", + }); +}); + +export function annotationWebSearchCitationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnnotationWebSearchCitation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnnotationWebSearchCitation' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectUrlCitation$inboundSchema: z.ZodType< + BatchObjectUrlCitation, + unknown +> = z.object({ + content: z.string().optional(), + end_index: z.int(), + start_index: z.int(), + title: z.string(), + url: z.string(), +}).transform((v) => { + return remap$(v, { + "end_index": "endIndex", + "start_index": "startIndex", + }); +}); + +export function batchObjectUrlCitationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectUrlCitation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectUrlCitation' from JSON`, + ); +} + +/** @internal */ +export const AnnotationURLCitation$inboundSchema: z.ZodType< + AnnotationURLCitation, + unknown +> = z.object({ + type: z.literal("url_citation"), + url_citation: z.lazy(() => BatchObjectUrlCitation$inboundSchema), +}).transform((v) => { + return remap$(v, { + "url_citation": "urlCitation", + }); +}); + +export function annotationURLCitationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnnotationURLCitation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnnotationURLCitation' from JSON`, + ); +} + +/** @internal */ +export const ContentImageUrlImageUrl$inboundSchema: z.ZodType< + ContentImageUrlImageUrl, + unknown +> = z.object({ + url: z.string(), +}); + +export function contentImageUrlImageUrlFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ContentImageUrlImageUrl$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ContentImageUrlImageUrl' from JSON`, + ); +} + +/** @internal */ +export const ContentImageURL$inboundSchema: z.ZodType< + ContentImageURL, + unknown +> = z.object({ + image_url: z.lazy(() => ContentImageUrlImageUrl$inboundSchema), + type: z.literal("image_url"), +}).transform((v) => { + return remap$(v, { + "image_url": "imageUrl", + }); +}); + +export function contentImageURLFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ContentImageURL$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ContentImageURL' from JSON`, + ); +} + +/** @internal */ +export const ContentText$inboundSchema: z.ZodType = z + .object({ + text: z.string(), + type: z.literal("text"), + }); + +export function contentTextFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ContentText$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ContentText' from JSON`, + ); +} + +/** @internal */ +export const AnnotationContentUnion$inboundSchema: z.ZodType< + AnnotationContentUnion, + unknown +> = discriminatedUnion("type", { + text: z.lazy(() => ContentText$inboundSchema), + image_url: z.lazy(() => ContentImageURL$inboundSchema), +}); + +export function annotationContentUnionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnnotationContentUnion$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnnotationContentUnion' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectFile$inboundSchema: z.ZodType< + BatchObjectFile, + unknown +> = z.object({ + content: z.array( + discriminatedUnion("type", { + text: z.lazy(() => ContentText$inboundSchema), + image_url: z.lazy(() => ContentImageURL$inboundSchema), + }), + ), + hash: z.string(), + name: z.string().optional(), +}); + +export function batchObjectFileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectFile$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectFile' from JSON`, + ); +} + +/** @internal */ +export const AnnotationFile$inboundSchema: z.ZodType = + z.object({ + file: z.lazy(() => BatchObjectFile$inboundSchema), + type: z.literal("file"), + }); + +export function annotationFileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AnnotationFile$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AnnotationFile' from JSON`, + ); +} + +/** @internal */ +export const Annotation$inboundSchema: z.ZodType = + discriminatedUnion("type", { + file: z.lazy(() => AnnotationFile$inboundSchema), + url_citation: z.lazy(() => AnnotationURLCitation$inboundSchema), + web_search_citation: z.lazy(() => + AnnotationWebSearchCitation$inboundSchema + ), + }); + +export function annotationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Annotation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Annotation' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectImageUrl$inboundSchema: z.ZodType< + BatchObjectImageUrl, + unknown +> = z.object({ + url: z.string(), +}); + +export function batchObjectImageUrlFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectImageUrl$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectImageUrl' from JSON`, + ); +} + +/** @internal */ +export const ChoiceTypeImageURLEnum$inboundSchema: z.ZodEnum< + typeof ChoiceTypeImageURLEnum +> = z.enum(ChoiceTypeImageURLEnum); + +/** @internal */ +export const Image$inboundSchema: z.ZodType = z.object({ + image_url: z.lazy(() => BatchObjectImageUrl$inboundSchema), + type: ChoiceTypeImageURLEnum$inboundSchema, +}).transform((v) => { + return remap$(v, { + "image_url": "imageUrl", + }); +}); + +export function imageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Image$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Image' from JSON`, + ); +} + +/** @internal */ +export const ReasoningDetail$inboundSchema: z.ZodType< + ReasoningDetail, + unknown +> = discriminatedUnion("type", { + ["reasoning.summary"]: ReasoningDetailSummary$inboundSchema, + ["reasoning.encrypted"]: ReasoningDetailEncrypted$inboundSchema, + ["reasoning.text"]: ReasoningDetailText$inboundSchema, + ["reasoning.server_tool_call"]: ReasoningDetailServerToolCall$inboundSchema, +}); + +export function reasoningDetailFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ReasoningDetail$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ReasoningDetail' from JSON`, + ); +} + +/** @internal */ +export const ChoiceRole$inboundSchema: z.ZodEnum = z.enum( + ChoiceRole, +); + +/** @internal */ +export const BatchObjectFunction$inboundSchema: z.ZodType< + BatchObjectFunction, + unknown +> = z.object({ + arguments: z.string(), + name: z.string(), +}); + +export function batchObjectFunctionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectFunction$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectFunction' from JSON`, + ); +} + +/** @internal */ +export const ChoiceTypeFunction$inboundSchema: z.ZodEnum< + typeof ChoiceTypeFunction +> = z.enum(ChoiceTypeFunction); + +/** @internal */ +export const ToolCall$inboundSchema: z.ZodType = z.object({ + function: z.lazy(() => BatchObjectFunction$inboundSchema), + id: z.string(), + index: z.int(), + type: ChoiceTypeFunction$inboundSchema, +}); + +export function toolCallFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ToolCall$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ToolCall' from JSON`, + ); +} + +/** @internal */ +export const Message$inboundSchema: z.ZodType = z.object({ + annotations: z.array(discriminatedUnion("type", { + file: z.lazy(() => AnnotationFile$inboundSchema), + url_citation: z.lazy(() => AnnotationURLCitation$inboundSchema), + web_search_citation: z.lazy(() => + AnnotationWebSearchCitation$inboundSchema + ), + })).optional(), + content: z.nullable(z.string()), + images: z.nullable(z.array(z.lazy(() => Image$inboundSchema))).optional(), + reasoning: z.nullable(z.string()).optional(), + reasoning_details: z.nullable(z.array(z.nullable(discriminatedUnion("type", { + ["reasoning.summary"]: ReasoningDetailSummary$inboundSchema, + ["reasoning.encrypted"]: ReasoningDetailEncrypted$inboundSchema, + ["reasoning.text"]: ReasoningDetailText$inboundSchema, + ["reasoning.server_tool_call"]: ReasoningDetailServerToolCall$inboundSchema, + })))).optional(), + refusal: z.nullable(z.string()), + role: ChoiceRole$inboundSchema, + tool_calls: z.array(z.lazy(() => ToolCall$inboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + "reasoning_details": "reasoningDetails", + "tool_calls": "toolCalls", + }); +}); + +export function messageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Message$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Message' from JSON`, + ); +} + +/** @internal */ +export const Choice$inboundSchema: z.ZodType = z.object({ + finish_reason: FinishReason$inboundSchema, + index: z.int(), + logprobs: z.nullable(z.lazy(() => Logprobs$inboundSchema)), + message: z.lazy(() => Message$inboundSchema), + native_finish_reason: z.nullable(z.string()), +}).transform((v) => { + return remap$(v, { + "finish_reason": "finishReason", + "native_finish_reason": "nativeFinishReason", + }); +}); + +export function choiceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Choice$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Choice' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectEvent$inboundSchema: z.ZodType< + BatchObjectEvent, + unknown +> = openEnums.inboundSchema(BatchObjectEvent); + +/** @internal */ +export const BatchObjectTimings$inboundSchema: z.ZodType< + BatchObjectTimings, + unknown +> = z.object({ + epoch_ms: z.int(), + event: BatchObjectEvent$inboundSchema, + start_ms: z.int(), +}).transform((v) => { + return remap$(v, { + "epoch_ms": "epochMs", + "start_ms": "startMs", + }); +}); + +export function batchObjectTimingsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectTimings$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectTimings' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectDebug$inboundSchema: z.ZodType< + BatchObjectDebug, + unknown +> = collectExtraKeys$( + z.object({ + echo_upstream_body: z.record(z.string(), z.any()).optional(), + timings: z.lazy(() => BatchObjectTimings$inboundSchema).optional(), + }).catchall(z.any()), + "additionalProperties", + true, +).transform((v) => { + return remap$(v, { + "echo_upstream_body": "echoUpstreamBody", + }); +}); + +export function batchObjectDebugFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectDebug$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectDebug' from JSON`, + ); +} + +/** @internal */ +export const BodyObjectChatCompletion$inboundSchema: z.ZodEnum< + typeof BodyObjectChatCompletion +> = z.enum(BodyObjectChatCompletion); + +/** @internal */ +export const BodyCompletionTokensDetails$inboundSchema: z.ZodType< + BodyCompletionTokensDetails, + unknown +> = z.object({ + audio_tokens: z.nullable(z.int()).optional(), + image_tokens: z.nullable(z.int()).optional(), + reasoning_tokens: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "image_tokens": "imageTokens", + "reasoning_tokens": "reasoningTokens", + }); +}); + +export function bodyCompletionTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyCompletionTokensDetails' from JSON`, + ); +} + +/** @internal */ +export const BodyPromptTokensDetails1$inboundSchema: z.ZodType< + BodyPromptTokensDetails1, + unknown +> = z.object({ + audio_tokens: z.nullable(z.int()).optional(), + cache_write_tokens: z.nullable(z.int()).optional(), + cached_tokens: z.nullable(z.int()).optional(), + file_tokens: z.nullable(z.int()).optional(), + video_tokens: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "cache_write_tokens": "cacheWriteTokens", + "cached_tokens": "cachedTokens", + "file_tokens": "fileTokens", + "video_tokens": "videoTokens", + }); +}); + +export function bodyPromptTokensDetails1FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyPromptTokensDetails1$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyPromptTokensDetails1' from JSON`, + ); +} + +/** @internal */ +export const BodyServerToolUse$inboundSchema: z.ZodType< + BodyServerToolUse, + unknown +> = z.object({ + tool_calls_executed: z.nullable(z.int()).optional(), + tool_calls_requested: z.nullable(z.int()).optional(), + web_search_requests: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "tool_calls_executed": "toolCallsExecuted", + "tool_calls_requested": "toolCallsRequested", + "web_search_requests": "webSearchRequests", + }); +}); + +export function bodyServerToolUseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyServerToolUse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyServerToolUse' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectServerToolUseDetails$inboundSchema: z.ZodType< + BatchObjectServerToolUseDetails, + unknown +> = z.object({ + tool_calls_executed: z.nullable(z.int()).optional(), + tool_calls_requested: z.nullable(z.int()).optional(), + web_search_requests: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "tool_calls_executed": "toolCallsExecuted", + "tool_calls_requested": "toolCallsRequested", + "web_search_requests": "webSearchRequests", + }); +}); + +export function batchObjectServerToolUseDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectServerToolUseDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectServerToolUseDetails' from JSON`, + ); +} + +/** @internal */ +export const BodyUsage1$inboundSchema: z.ZodType = z + .object({ + completion_tokens: z.int(), + completion_tokens_details: z.nullable( + z.lazy(() => BodyCompletionTokensDetails$inboundSchema), + ).optional(), + prompt_tokens: z.int(), + prompt_tokens_details: z.nullable( + z.lazy(() => BodyPromptTokensDetails1$inboundSchema), + ).optional(), + server_tool_use: z.nullable(z.lazy(() => BodyServerToolUse$inboundSchema)) + .optional(), + server_tool_use_details: z.nullable( + z.lazy(() => BatchObjectServerToolUseDetails$inboundSchema), + ).optional(), + total_tokens: z.int(), + }).transform((v) => { + return remap$(v, { + "completion_tokens": "completionTokens", + "completion_tokens_details": "completionTokensDetails", + "prompt_tokens": "promptTokens", + "prompt_tokens_details": "promptTokensDetails", + "server_tool_use": "serverToolUse", + "server_tool_use_details": "serverToolUseDetails", + "total_tokens": "totalTokens", + }); + }); + +export function bodyUsage1FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyUsage1$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyUsage1' from JSON`, + ); +} + +/** @internal */ +export const BodyChatCompletion$inboundSchema: z.ZodType< + BodyChatCompletion, + unknown +> = z.object({ + choices: z.array(z.lazy(() => Choice$inboundSchema)), + created: z.int(), + debug: z.lazy(() => BatchObjectDebug$inboundSchema).optional(), + id: z.string(), + model: z.string(), + object: BodyObjectChatCompletion$inboundSchema, + openrouter_metadata: OpenRouterMetadata$inboundSchema.optional(), + provider: z.nullable(z.string()).optional(), + service_tier: z.nullable(z.string()).optional(), + system_fingerprint: z.nullable(z.string()).optional(), + usage: z.lazy(() => BodyUsage1$inboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + "openrouter_metadata": "openrouterMetadata", + "service_tier": "serviceTier", + "system_fingerprint": "systemFingerprint", + }); +}); + +export function bodyChatCompletionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BodyChatCompletion$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BodyChatCompletion' from JSON`, + ); +} + +/** @internal */ +export const Body$inboundSchema: z.ZodType = z.union([ + OpenResponsesResult$inboundSchema, + z.lazy(() => BodyMessage$inboundSchema), + z.lazy(() => BodyChatCompletion$inboundSchema), + z.lazy(() => BodyList$inboundSchema), +]); + +export function bodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Body$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Body' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectResponse$inboundSchema: z.ZodType< + BatchObjectResponse, + unknown +> = z.object({ + body: z.union([ + OpenResponsesResult$inboundSchema, + z.lazy(() => BodyMessage$inboundSchema), + z.lazy(() => BodyChatCompletion$inboundSchema), + z.lazy(() => BodyList$inboundSchema), + ]), + request_id: z.nullable(z.string()), + status_code: z.int(), +}).transform((v) => { + return remap$(v, { + "request_id": "requestId", + "status_code": "statusCode", + }); +}); + +export function batchObjectResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectResponse' from JSON`, + ); +} + +/** @internal */ +export const Result$inboundSchema: z.ZodType = z.object({ + custom_id: z.string(), + error: z.nullable(z.lazy(() => ResultError$inboundSchema)), + id: z.string(), + response: z.nullable(z.lazy(() => BatchObjectResponse$inboundSchema)), +}).transform((v) => { + return remap$(v, { + "custom_id": "customId", + }); +}); + +export function resultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Result$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Result' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectStatus$inboundSchema: z.ZodType< + BatchObjectStatus, + unknown +> = openEnums.inboundSchema(BatchObjectStatus); + +/** @internal */ +export const BatchObjectCompletionTokensDetails$inboundSchema: z.ZodType< + BatchObjectCompletionTokensDetails, + unknown +> = z.object({ + audio_tokens: z.nullable(z.int()).optional(), + image_tokens: z.nullable(z.int()).optional(), + reasoning_tokens: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "image_tokens": "imageTokens", + "reasoning_tokens": "reasoningTokens", + }); +}); + +export function batchObjectCompletionTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + BatchObjectCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectCompletionTokensDetails' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectPromptTokensDetails$inboundSchema: z.ZodType< + BatchObjectPromptTokensDetails, + unknown +> = z.object({ + audio_tokens: z.nullable(z.int()).optional(), + cache_write_tokens: z.nullable(z.int()).optional(), + cached_tokens: z.nullable(z.int()).optional(), + file_tokens: z.nullable(z.int()).optional(), + video_tokens: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "cache_write_tokens": "cacheWriteTokens", + "cached_tokens": "cachedTokens", + "file_tokens": "fileTokens", + "video_tokens": "videoTokens", + }); +}); + +export function batchObjectPromptTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectPromptTokensDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectPromptTokensDetails' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectServerToolUse$inboundSchema: z.ZodType< + BatchObjectServerToolUse, + unknown +> = z.object({ + tool_calls_executed: z.nullable(z.int()).optional(), + tool_calls_requested: z.nullable(z.int()).optional(), + web_search_requests: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "tool_calls_executed": "toolCallsExecuted", + "tool_calls_requested": "toolCallsRequested", + "web_search_requests": "webSearchRequests", + }); +}); + +export function batchObjectServerToolUseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectServerToolUse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectServerToolUse' from JSON`, + ); +} + +/** @internal */ +export const BatchObjectUsage$inboundSchema: z.ZodType< + BatchObjectUsage, + unknown +> = z.object({ + cache_creation: z.nullable(AnthropicCacheCreation$inboundSchema).optional(), + completion_tokens: z.int(), + completion_tokens_details: z.nullable( + z.lazy(() => BatchObjectCompletionTokensDetails$inboundSchema), + ).optional(), + cost: z.nullable(z.number()).optional(), + cost_details: z.nullable(CostDetails$inboundSchema).optional(), + is_byok: z.boolean().optional(), + iterations: z.nullable(z.array(AnthropicUsageIteration$inboundSchema)) + .optional(), + prompt_tokens: z.int(), + prompt_tokens_details: z.nullable( + z.lazy(() => BatchObjectPromptTokensDetails$inboundSchema), + ).optional(), + server_tool_use: z.nullable( + z.lazy(() => BatchObjectServerToolUse$inboundSchema), + ).optional(), + service_tier: z.nullable(z.string()).optional(), + speed: z.nullable(AnthropicSpeed$inboundSchema).optional(), + total_tokens: z.int(), +}).transform((v) => { + return remap$(v, { + "cache_creation": "cacheCreation", + "completion_tokens": "completionTokens", + "completion_tokens_details": "completionTokensDetails", + "cost_details": "costDetails", + "is_byok": "isByok", + "prompt_tokens": "promptTokens", + "prompt_tokens_details": "promptTokensDetails", + "server_tool_use": "serverToolUse", + "service_tier": "serviceTier", + "total_tokens": "totalTokens", + }); +}); + +export function batchObjectUsageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObjectUsage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObjectUsage' from JSON`, + ); +} + +/** @internal */ +export const BatchObject$inboundSchema: z.ZodType = z + .object({ + completion_window: BatchObjectCompletionWindow$inboundSchema, + created_at: z.int(), + endpoint: z.string(), + error: z.nullable(z.lazy(() => BatchObjectError$inboundSchema)), + finalized_at: z.nullable(z.int()), + id: z.string(), + model: z.string(), + object: BatchObjectObjectBatch$inboundSchema, + request_counts: z.lazy(() => BatchObjectRequestCounts$inboundSchema), + results: z.nullable(z.array(z.lazy(() => Result$inboundSchema))), + status: BatchObjectStatus$inboundSchema, + usage: z.nullable(z.lazy(() => BatchObjectUsage$inboundSchema)), + }).transform((v) => { + return remap$(v, { + "completion_window": "completionWindow", + "created_at": "createdAt", + "finalized_at": "finalizedAt", + "request_counts": "requestCounts", + }); + }); + +export function batchObjectFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchObject$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchObject' from JSON`, + ); +} diff --git a/src/models/batchpaymentrequiredresponseerror.ts b/src/models/batchpaymentrequiredresponseerror.ts new file mode 100644 index 000000000..d2118a94a --- /dev/null +++ b/src/models/batchpaymentrequiredresponseerror.ts @@ -0,0 +1,384 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9e233f8dd38a + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCacheCreation, + AnthropicCacheCreation$inboundSchema, +} from "./anthropiccachecreation.js"; +import { + AnthropicSpeed, + AnthropicSpeed$inboundSchema, +} from "./anthropicspeed.js"; +import { + AnthropicUsageIteration, + AnthropicUsageIteration$inboundSchema, +} from "./anthropicusageiteration.js"; +import { CostDetails, CostDetails$inboundSchema } from "./costdetails.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const BatchPaymentRequiredResponseCompletionWindow = { + TwentyFourh: "24h", +} as const; +export type BatchPaymentRequiredResponseCompletionWindow = ClosedEnum< + typeof BatchPaymentRequiredResponseCompletionWindow +>; + +export type BatchPaymentRequiredResponseError = { + code: number; + message: string; +}; + +export const BatchPaymentRequiredResponseObject = { + Batch: "batch", +} as const; +export type BatchPaymentRequiredResponseObject = ClosedEnum< + typeof BatchPaymentRequiredResponseObject +>; + +export type BatchPaymentRequiredResponseRequestCounts = { + completed: number; + failed: number; + total: number; +}; + +export const BatchPaymentRequiredResponseStatus = { + Validating: "validating", + InProgress: "in_progress", + Finalizing: "finalizing", + Completed: "completed", + Failed: "failed", + Expired: "expired", + Cancelling: "cancelling", + Cancelled: "cancelled", +} as const; +export type BatchPaymentRequiredResponseStatus = OpenEnum< + typeof BatchPaymentRequiredResponseStatus +>; + +export type BatchPaymentRequiredResponseCompletionTokensDetails = { + /** + * Tokens generated by the model for audio output. + */ + audioTokens?: number | null | undefined; + /** + * Tokens generated by the model for image output. + */ + imageTokens?: number | null | undefined; + /** + * Tokens generated by the model for reasoning. + */ + reasoningTokens?: number | null | undefined; +}; + +/** + * Breakdown of tokens used in the prompt. + */ +export type BatchPaymentRequiredResponsePromptTokensDetails = { + /** + * Tokens used for input audio. + */ + audioTokens?: number | null | undefined; + /** + * Tokens written to cache. Only returned for models with explicit caching and cache write pricing. + */ + cacheWriteTokens?: number | null | undefined; + /** + * Tokens cached by the endpoint. + */ + cachedTokens?: number | null | undefined; + /** + * Tokens used for input files/documents. + */ + fileTokens?: number | null | undefined; + /** + * Tokens used for input video. + */ + videoTokens?: number | null | undefined; +}; + +/** + * Usage for server-side tool execution (e.g., web search) + */ +export type BatchPaymentRequiredResponseServerToolUse = { + /** + * Number of OpenRouter server tool calls that executed and produced a result. + */ + toolCallsExecuted?: number | null | undefined; + /** + * 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. + */ + toolCallsRequested?: number | null | undefined; + /** + * 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. + */ + webSearchRequests?: number | null | undefined; +}; + +export type BatchPaymentRequiredResponseUsage = { + cacheCreation?: AnthropicCacheCreation | null | undefined; + /** + * The tokens generated + */ + completionTokens: number; + completionTokensDetails?: + | BatchPaymentRequiredResponseCompletionTokensDetails + | null + | undefined; + /** + * Cost of the completion + */ + cost?: number | null | undefined; + /** + * Breakdown of upstream inference costs + */ + costDetails?: CostDetails | null | undefined; + /** + * Whether a request was made using a Bring Your Own Key configuration + */ + isByok?: boolean | undefined; + iterations?: Array | null | undefined; + /** + * Including images, input audio, and tools if any + */ + promptTokens: number; + /** + * Breakdown of tokens used in the prompt. + */ + promptTokensDetails?: + | BatchPaymentRequiredResponsePromptTokensDetails + | null + | undefined; + /** + * Usage for server-side tool execution (e.g., web search) + */ + serverToolUse?: BatchPaymentRequiredResponseServerToolUse | null | undefined; + /** + * The service tier used by the upstream provider for this request + */ + serviceTier?: string | null | undefined; + speed?: AnthropicSpeed | null | undefined; + /** + * Sum of the above two fields + */ + totalTokens: number; +}; + +/** @internal */ +export const BatchPaymentRequiredResponseCompletionWindow$inboundSchema: + z.ZodEnum = z.enum( + BatchPaymentRequiredResponseCompletionWindow, + ); + +/** @internal */ +export const BatchPaymentRequiredResponseError$inboundSchema: z.ZodType< + BatchPaymentRequiredResponseError, + unknown +> = z.object({ + code: z.int(), + message: z.string(), +}); + +export function batchPaymentRequiredResponseErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchPaymentRequiredResponseError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchPaymentRequiredResponseError' from JSON`, + ); +} + +/** @internal */ +export const BatchPaymentRequiredResponseObject$inboundSchema: z.ZodEnum< + typeof BatchPaymentRequiredResponseObject +> = z.enum(BatchPaymentRequiredResponseObject); + +/** @internal */ +export const BatchPaymentRequiredResponseRequestCounts$inboundSchema: z.ZodType< + BatchPaymentRequiredResponseRequestCounts, + unknown +> = z.object({ + completed: z.int(), + failed: z.int(), + total: z.int(), +}); + +export function batchPaymentRequiredResponseRequestCountsFromJSON( + jsonString: string, +): SafeParseResult< + BatchPaymentRequiredResponseRequestCounts, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + BatchPaymentRequiredResponseRequestCounts$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'BatchPaymentRequiredResponseRequestCounts' from JSON`, + ); +} + +/** @internal */ +export const BatchPaymentRequiredResponseStatus$inboundSchema: z.ZodType< + BatchPaymentRequiredResponseStatus, + unknown +> = openEnums.inboundSchema(BatchPaymentRequiredResponseStatus); + +/** @internal */ +export const BatchPaymentRequiredResponseCompletionTokensDetails$inboundSchema: + z.ZodType = z + .object({ + audio_tokens: z.nullable(z.int()).optional(), + image_tokens: z.nullable(z.int()).optional(), + reasoning_tokens: z.nullable(z.int()).optional(), + }).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "image_tokens": "imageTokens", + "reasoning_tokens": "reasoningTokens", + }); + }); + +export function batchPaymentRequiredResponseCompletionTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult< + BatchPaymentRequiredResponseCompletionTokensDetails, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + BatchPaymentRequiredResponseCompletionTokensDetails$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'BatchPaymentRequiredResponseCompletionTokensDetails' from JSON`, + ); +} + +/** @internal */ +export const BatchPaymentRequiredResponsePromptTokensDetails$inboundSchema: + z.ZodType = z + .object({ + audio_tokens: z.nullable(z.int()).optional(), + cache_write_tokens: z.nullable(z.int()).optional(), + cached_tokens: z.nullable(z.int()).optional(), + file_tokens: z.nullable(z.int()).optional(), + video_tokens: z.nullable(z.int()).optional(), + }).transform((v) => { + return remap$(v, { + "audio_tokens": "audioTokens", + "cache_write_tokens": "cacheWriteTokens", + "cached_tokens": "cachedTokens", + "file_tokens": "fileTokens", + "video_tokens": "videoTokens", + }); + }); + +export function batchPaymentRequiredResponsePromptTokensDetailsFromJSON( + jsonString: string, +): SafeParseResult< + BatchPaymentRequiredResponsePromptTokensDetails, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + BatchPaymentRequiredResponsePromptTokensDetails$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'BatchPaymentRequiredResponsePromptTokensDetails' from JSON`, + ); +} + +/** @internal */ +export const BatchPaymentRequiredResponseServerToolUse$inboundSchema: z.ZodType< + BatchPaymentRequiredResponseServerToolUse, + unknown +> = z.object({ + tool_calls_executed: z.nullable(z.int()).optional(), + tool_calls_requested: z.nullable(z.int()).optional(), + web_search_requests: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "tool_calls_executed": "toolCallsExecuted", + "tool_calls_requested": "toolCallsRequested", + "web_search_requests": "webSearchRequests", + }); +}); + +export function batchPaymentRequiredResponseServerToolUseFromJSON( + jsonString: string, +): SafeParseResult< + BatchPaymentRequiredResponseServerToolUse, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + BatchPaymentRequiredResponseServerToolUse$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'BatchPaymentRequiredResponseServerToolUse' from JSON`, + ); +} + +/** @internal */ +export const BatchPaymentRequiredResponseUsage$inboundSchema: z.ZodType< + BatchPaymentRequiredResponseUsage, + unknown +> = z.object({ + cache_creation: z.nullable(AnthropicCacheCreation$inboundSchema).optional(), + completion_tokens: z.int(), + completion_tokens_details: z.nullable( + z.lazy(() => + BatchPaymentRequiredResponseCompletionTokensDetails$inboundSchema + ), + ).optional(), + cost: z.nullable(z.number()).optional(), + cost_details: z.nullable(CostDetails$inboundSchema).optional(), + is_byok: z.boolean().optional(), + iterations: z.nullable(z.array(AnthropicUsageIteration$inboundSchema)) + .optional(), + prompt_tokens: z.int(), + prompt_tokens_details: z.nullable( + z.lazy(() => BatchPaymentRequiredResponsePromptTokensDetails$inboundSchema), + ).optional(), + server_tool_use: z.nullable( + z.lazy(() => BatchPaymentRequiredResponseServerToolUse$inboundSchema), + ).optional(), + service_tier: z.nullable(z.string()).optional(), + speed: z.nullable(AnthropicSpeed$inboundSchema).optional(), + total_tokens: z.int(), +}).transform((v) => { + return remap$(v, { + "cache_creation": "cacheCreation", + "completion_tokens": "completionTokens", + "completion_tokens_details": "completionTokensDetails", + "cost_details": "costDetails", + "is_byok": "isByok", + "prompt_tokens": "promptTokens", + "prompt_tokens_details": "promptTokensDetails", + "server_tool_use": "serverToolUse", + "service_tier": "serviceTier", + "total_tokens": "totalTokens", + }); +}); + +export function batchPaymentRequiredResponseUsageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BatchPaymentRequiredResponseUsage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BatchPaymentRequiredResponseUsage' from JSON`, + ); +} diff --git a/src/models/batchproviderpreferences.ts b/src/models/batchproviderpreferences.ts new file mode 100644 index 000000000..789f4aa37 --- /dev/null +++ b/src/models/batchproviderpreferences.ts @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 250964898edb + */ + +import * as z from "zod/v4"; +import { ProviderName, ProviderName$outboundSchema } from "./providername.js"; + +export type BatchProviderPreferencesOnly = ProviderName | string; + +/** + * Batch provider routing preferences. Only `provider.only` is supported. + */ +export type BatchProviderPreferences = { + /** + * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + */ + only?: Array | null | undefined; +}; + +/** @internal */ +export type BatchProviderPreferencesOnly$Outbound = string | string; + +/** @internal */ +export const BatchProviderPreferencesOnly$outboundSchema: z.ZodType< + BatchProviderPreferencesOnly$Outbound, + BatchProviderPreferencesOnly +> = z.union([ProviderName$outboundSchema, z.string()]); + +export function batchProviderPreferencesOnlyToJSON( + batchProviderPreferencesOnly: BatchProviderPreferencesOnly, +): string { + return JSON.stringify( + BatchProviderPreferencesOnly$outboundSchema.parse( + batchProviderPreferencesOnly, + ), + ); +} + +/** @internal */ +export type BatchProviderPreferences$Outbound = { + only?: Array | null | undefined; +}; + +/** @internal */ +export const BatchProviderPreferences$outboundSchema: z.ZodType< + BatchProviderPreferences$Outbound, + BatchProviderPreferences +> = z.object({ + only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))) + .optional(), +}); + +export function batchProviderPreferencesToJSON( + batchProviderPreferences: BatchProviderPreferences, +): string { + return JSON.stringify( + BatchProviderPreferences$outboundSchema.parse(batchProviderPreferences), + ); +} diff --git a/src/models/batchsubmitbody.ts b/src/models/batchsubmitbody.ts new file mode 100644 index 000000000..89bd7bfc0 --- /dev/null +++ b/src/models/batchsubmitbody.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ae38a7f7eb9d + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import * as openEnums from "../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { + BatchProviderPreferences, + BatchProviderPreferences$Outbound, + BatchProviderPreferences$outboundSchema, +} from "./batchproviderpreferences.js"; + +export const BatchSubmitBodyCompletionWindow = { + TwentyFourh: "24h", +} as const; +export type BatchSubmitBodyCompletionWindow = ClosedEnum< + typeof BatchSubmitBodyCompletionWindow +>; + +export const Endpoint = { + RootV1ChatCompletions: "/v1/chat/completions", + RootV1Responses: "/v1/responses", + RootV1Messages: "/v1/messages", + RootV1Embeddings: "/v1/embeddings", +} as const; +export type Endpoint = OpenEnum; + +export type RequestT = { + /** + * Request payload for the batch `endpoint`. + */ + body: { [k: string]: any }; + customId: string; +}; + +/** + * Batch submit request body. + */ +export type BatchSubmitBody = { + completionWindow?: BatchSubmitBodyCompletionWindow | undefined; + endpoint: Endpoint; + model: string; + /** + * Batch provider routing preferences. Only `provider.only` is supported. + */ + provider?: BatchProviderPreferences | null | undefined; + requests: Array; +}; + +/** @internal */ +export const BatchSubmitBodyCompletionWindow$outboundSchema: z.ZodEnum< + typeof BatchSubmitBodyCompletionWindow +> = z.enum(BatchSubmitBodyCompletionWindow); + +/** @internal */ +export const Endpoint$outboundSchema: z.ZodType = openEnums + .outboundSchema(Endpoint); + +/** @internal */ +export type RequestT$Outbound = { + body: { [k: string]: any }; + custom_id: string; +}; + +/** @internal */ +export const RequestT$outboundSchema: z.ZodType = z + .object({ + body: z.record(z.string(), z.any()), + customId: z.string(), + }).transform((v) => { + return remap$(v, { + customId: "custom_id", + }); + }); + +export function requestToJSON(requestT: RequestT): string { + return JSON.stringify(RequestT$outboundSchema.parse(requestT)); +} + +/** @internal */ +export type BatchSubmitBody$Outbound = { + completion_window: string; + endpoint: string; + model: string; + provider?: BatchProviderPreferences$Outbound | null | undefined; + requests: Array; +}; + +/** @internal */ +export const BatchSubmitBody$outboundSchema: z.ZodType< + BatchSubmitBody$Outbound, + BatchSubmitBody +> = z.object({ + completionWindow: BatchSubmitBodyCompletionWindow$outboundSchema.default( + "24h", + ), + endpoint: Endpoint$outboundSchema, + model: z.string(), + provider: z.nullable(BatchProviderPreferences$outboundSchema).optional(), + requests: z.array(z.lazy(() => RequestT$outboundSchema)), +}).transform((v) => { + return remap$(v, { + completionWindow: "completion_window", + }); +}); + +export function batchSubmitBodyToJSON( + batchSubmitBody: BatchSubmitBody, +): string { + return JSON.stringify(BatchSubmitBody$outboundSchema.parse(batchSubmitBody)); +} diff --git a/src/models/debugevent.ts b/src/models/debugevent.ts index c67510d2d..ce8ac06d4 100644 --- a/src/models/debugevent.ts +++ b/src/models/debugevent.ts @@ -11,42 +11,47 @@ import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -export const Event = { +export const DebugEventEvent = { AdapterRequest: "adapter_request", UpstreamHeadersReceived: "upstream_headers_received", FirstTokenReceived: "first_token_received", UpstreamBodyEnded: "upstream_body_ended", } as const; -export type Event = OpenEnum; +export type DebugEventEvent = OpenEnum; -export type Timings = { +export type DebugEventTimings = { epochMs: number; - event: Event; + event: DebugEventEvent; startMs: number; }; -export type Debug = { +export type DebugEventDebug = { echoUpstreamBody?: { [k: string]: any } | undefined; - timings?: Timings | undefined; + timings?: DebugEventTimings | undefined; }; /** * Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones. */ export type DebugEvent = { - debug: Debug; + debug: DebugEventDebug; sequenceNumber: number; type: "response.debug"; }; /** @internal */ -export const Event$inboundSchema: z.ZodType = openEnums - .inboundSchema(Event); +export const DebugEventEvent$inboundSchema: z.ZodType< + DebugEventEvent, + unknown +> = openEnums.inboundSchema(DebugEventEvent); /** @internal */ -export const Timings$inboundSchema: z.ZodType = z.object({ +export const DebugEventTimings$inboundSchema: z.ZodType< + DebugEventTimings, + unknown +> = z.object({ epoch_ms: z.int(), - event: Event$inboundSchema, + event: DebugEventEvent$inboundSchema, start_ms: z.int(), }).transform((v) => { return remap$(v, { @@ -55,40 +60,43 @@ export const Timings$inboundSchema: z.ZodType = z.object({ }); }); -export function timingsFromJSON( +export function debugEventTimingsFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => Timings$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Timings' from JSON`, + (x) => DebugEventTimings$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DebugEventTimings' from JSON`, ); } /** @internal */ -export const Debug$inboundSchema: z.ZodType = z.object({ +export const DebugEventDebug$inboundSchema: z.ZodType< + DebugEventDebug, + unknown +> = z.object({ echo_upstream_body: z.record(z.string(), z.any()).optional(), - timings: z.lazy(() => Timings$inboundSchema).optional(), + timings: z.lazy(() => DebugEventTimings$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "echo_upstream_body": "echoUpstreamBody", }); }); -export function debugFromJSON( +export function debugEventDebugFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => Debug$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Debug' from JSON`, + (x) => DebugEventDebug$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DebugEventDebug' from JSON`, ); } /** @internal */ export const DebugEvent$inboundSchema: z.ZodType = z .object({ - debug: z.lazy(() => Debug$inboundSchema), + debug: z.lazy(() => DebugEventDebug$inboundSchema), sequence_number: z.int(), type: z.literal("response.debug"), }).transform((v) => { diff --git a/src/models/errors/batcherrorresponse.ts b/src/models/errors/batcherrorresponse.ts new file mode 100644 index 000000000..1e0c61169 --- /dev/null +++ b/src/models/errors/batcherrorresponse.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f2cce3eb05df + */ + +import * as z from "zod/v4"; +import * as models from "../index.js"; +import { OpenRouterError } from "./openroutererror.js"; + +export type BatchErrorResponseData = { + error: models.BatchErrorResponseError; +}; + +export class BatchErrorResponse extends OpenRouterError { + error: models.BatchErrorResponseError; + + /** The original data that was passed to this error instance. */ + data$: BatchErrorResponseData; + + constructor( + err: BatchErrorResponseData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const message = err.error?.message + || `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); + this.data$ = err; + this.error = err.error; + + this.name = "BatchErrorResponse"; + } +} + +/** @internal */ +export const BatchErrorResponse$inboundSchema: z.ZodType< + BatchErrorResponse, + unknown +> = z.object({ + error: z.lazy(() => models.BatchErrorResponseError$inboundSchema), + request$: z.custom(x => x instanceof Request), + response$: z.custom(x => x instanceof Response), + body$: z.string(), +}) + .transform((v) => { + return new BatchErrorResponse(v, { + request: v.request$, + response: v.response$, + body: v.body$, + }); + }); diff --git a/src/models/errors/batchpaymentrequiredresponseerror.ts b/src/models/errors/batchpaymentrequiredresponseerror.ts new file mode 100644 index 000000000..1b0fa0951 --- /dev/null +++ b/src/models/errors/batchpaymentrequiredresponseerror.ts @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2d141acc5a71 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as models from "../index.js"; +import { OpenRouterError } from "./openroutererror.js"; + +/** + * 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. + */ +export type BatchPaymentRequiredResponseErrorData = { + completionWindow: models.BatchPaymentRequiredResponseCompletionWindow; + createdAt: number; + endpoint: string; + error: models.BatchPaymentRequiredResponseError; + finalizedAt: number | null; + id: string; + model: string; + object: models.BatchPaymentRequiredResponseObject; + requestCounts: models.BatchPaymentRequiredResponseRequestCounts; + /** + * Always null: results are withheld until the batch charge is covered. + */ + results: any | null; + status: models.BatchPaymentRequiredResponseStatus; + usage: models.BatchPaymentRequiredResponseUsage | null; +}; + +/** + * 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. + */ +export class BatchPaymentRequiredResponseError extends OpenRouterError { + completionWindow: models.BatchPaymentRequiredResponseCompletionWindow; + createdAt: number; + endpoint: string; + error: models.BatchPaymentRequiredResponseError; + finalizedAt: number | null; + id: string; + model: string; + object: models.BatchPaymentRequiredResponseObject; + requestCounts: models.BatchPaymentRequiredResponseRequestCounts; + /** + * Always null: results are withheld until the batch charge is covered. + */ + results: any | null; + status: models.BatchPaymentRequiredResponseStatus; + usage: models.BatchPaymentRequiredResponseUsage | null; + + /** The original data that was passed to this error instance. */ + data$: BatchPaymentRequiredResponseErrorData; + + constructor( + err: BatchPaymentRequiredResponseErrorData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const message = err.error?.message + || `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); + this.data$ = err; + this.completionWindow = err.completionWindow; + this.createdAt = err.createdAt; + this.endpoint = err.endpoint; + this.error = err.error; + this.finalizedAt = err.finalizedAt; + this.id = err.id; + this.model = err.model; + this.object = err.object; + this.requestCounts = err.requestCounts; + this.results = err.results; + this.status = err.status; + this.usage = err.usage; + + this.name = "BatchPaymentRequiredResponseError"; + } +} + +/** @internal */ +export const BatchPaymentRequiredResponseError$inboundSchema: z.ZodType< + BatchPaymentRequiredResponseError, + unknown +> = z.object({ + completion_window: + models.BatchPaymentRequiredResponseCompletionWindow$inboundSchema, + created_at: z.int(), + endpoint: z.string(), + error: z.lazy(() => models.BatchPaymentRequiredResponseError$inboundSchema), + finalized_at: z.nullable(z.int()), + id: z.string(), + model: z.string(), + object: models.BatchPaymentRequiredResponseObject$inboundSchema, + request_counts: z.lazy(() => + models.BatchPaymentRequiredResponseRequestCounts$inboundSchema + ), + results: z.nullable(z.any()), + status: models.BatchPaymentRequiredResponseStatus$inboundSchema, + usage: z.nullable( + z.lazy(() => models.BatchPaymentRequiredResponseUsage$inboundSchema), + ), + request$: z.custom(x => x instanceof Request), + response$: z.custom(x => x instanceof Response), + body$: z.string(), +}) + .transform((v) => { + const remapped = remap$(v, { + "completion_window": "completionWindow", + "created_at": "createdAt", + "finalized_at": "finalizedAt", + "request_counts": "requestCounts", + }); + + return new BatchPaymentRequiredResponseError(remapped, { + request: v.request$, + response: v.response$, + body: v.body$, + }); + }); diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index c66b75f08..3afbbe438 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -5,6 +5,8 @@ export * from "./badgatewayresponseerror.js"; export * from "./badrequestresponseerror.js"; +export * from "./batcherrorresponse.js"; +export * from "./batchpaymentrequiredresponseerror.js"; export * from "./conflictresponseerror.js"; export * from "./edgenetworktimeoutresponseerror.js"; export * from "./forbiddenresponseerror.js"; diff --git a/src/models/finishreason.ts b/src/models/finishreason.ts new file mode 100644 index 000000000..ba8ef86ac --- /dev/null +++ b/src/models/finishreason.ts @@ -0,0 +1,21 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ceaee02b253a + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +export const FinishReason = { + Stop: "stop", + Length: "length", + ToolCalls: "tool_calls", + ContentFilter: "content_filter", + FunctionCall: "function_call", +} as const; +export type FinishReason = OpenEnum; + +/** @internal */ +export const FinishReason$inboundSchema: z.ZodType = + openEnums.inboundSchema(FinishReason); diff --git a/src/models/imagegenerationusage.ts b/src/models/imagegenerationusage.ts index 4f4e7dd2e..e5db32dcb 100644 --- a/src/models/imagegenerationusage.ts +++ b/src/models/imagegenerationusage.ts @@ -66,7 +66,7 @@ export type ImageGenerationUsagePromptTokensDetails = { /** * Usage for server-side tool execution (e.g., web search) */ -export type ServerToolUse = { +export type ImageGenerationUsageServerToolUse = { /** * Number of OpenRouter server tool calls that executed and produced a result. */ @@ -121,7 +121,7 @@ export type ImageGenerationUsage = { /** * Usage for server-side tool execution (e.g., web search) */ - serverToolUse?: ServerToolUse | null | undefined; + serverToolUse?: ImageGenerationUsageServerToolUse | null | undefined; /** * The service tier used by the upstream provider for this request */ @@ -200,26 +200,28 @@ export function imageGenerationUsagePromptTokensDetailsFromJSON( } /** @internal */ -export const ServerToolUse$inboundSchema: z.ZodType = z - .object({ - tool_calls_executed: z.nullable(z.int()).optional(), - tool_calls_requested: z.nullable(z.int()).optional(), - web_search_requests: z.nullable(z.int()).optional(), - }).transform((v) => { - return remap$(v, { - "tool_calls_executed": "toolCallsExecuted", - "tool_calls_requested": "toolCallsRequested", - "web_search_requests": "webSearchRequests", - }); +export const ImageGenerationUsageServerToolUse$inboundSchema: z.ZodType< + ImageGenerationUsageServerToolUse, + unknown +> = z.object({ + tool_calls_executed: z.nullable(z.int()).optional(), + tool_calls_requested: z.nullable(z.int()).optional(), + web_search_requests: z.nullable(z.int()).optional(), +}).transform((v) => { + return remap$(v, { + "tool_calls_executed": "toolCallsExecuted", + "tool_calls_requested": "toolCallsRequested", + "web_search_requests": "webSearchRequests", }); +}); -export function serverToolUseFromJSON( +export function imageGenerationUsageServerToolUseFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => ServerToolUse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ServerToolUse' from JSON`, + (x) => ImageGenerationUsageServerToolUse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ImageGenerationUsageServerToolUse' from JSON`, ); } @@ -242,8 +244,9 @@ export const ImageGenerationUsage$inboundSchema: z.ZodType< prompt_tokens_details: z.nullable( z.lazy(() => ImageGenerationUsagePromptTokensDetails$inboundSchema), ).optional(), - server_tool_use: z.nullable(z.lazy(() => ServerToolUse$inboundSchema)) - .optional(), + server_tool_use: z.nullable( + z.lazy(() => ImageGenerationUsageServerToolUse$inboundSchema), + ).optional(), service_tier: z.nullable(z.string()).optional(), speed: z.nullable(AnthropicSpeed$inboundSchema).optional(), total_tokens: z.int(), diff --git a/src/models/index.ts b/src/models/index.ts index 930bfcc83..a9452658a 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -13,19 +13,46 @@ export * from "./advisorservertoolopenrouter.js"; export * from "./agentmessageitem.js"; export * from "./annotationaddedevent.js"; export * from "./anthropicadvisormessageusageiteration.js"; +export * from "./anthropicadvisortoolresult.js"; export * from "./anthropicallowedcallers.js"; export * from "./anthropicbase64imagesource.js"; export * from "./anthropicbase64pdfsource.js"; +export * from "./anthropicbashcodeexecutioncontent.js"; +export * from "./anthropicbashcodeexecutionoutput.js"; +export * from "./anthropicbashcodeexecutionresult.js"; +export * from "./anthropicbashcodeexecutiontoolresult.js"; +export * from "./anthropicbashcodeexecutiontoolresulterror.js"; export * from "./anthropiccachecontroldirective.js"; export * from "./anthropiccachecontrolttl.js"; export * from "./anthropiccachecreation.js"; +export * from "./anthropiccaller.js"; +export * from "./anthropiccitationcharlocation.js"; export * from "./anthropiccitationcharlocationparam.js"; +export * from "./anthropiccitationcontentblocklocation.js"; export * from "./anthropiccitationcontentblocklocationparam.js"; +export * from "./anthropiccitationpagelocation.js"; export * from "./anthropiccitationpagelocationparam.js"; +export * from "./anthropiccitationsconfig.js"; +export * from "./anthropiccitationsearchresultlocation.js"; export * from "./anthropiccitationsearchresultlocationparam.js"; +export * from "./anthropiccitationwebsearchresultlocation.js"; export * from "./anthropiccitationwebsearchresultlocationparam.js"; +export * from "./anthropiccodeexecution20250825caller.js"; +export * from "./anthropiccodeexecution20260120caller.js"; +export * from "./anthropiccodeexecutioncontent.js"; +export * from "./anthropiccodeexecutionoutput.js"; +export * from "./anthropiccodeexecutionresult.js"; +export * from "./anthropiccodeexecutiontoolresult.js"; +export * from "./anthropiccodeexecutiontoolresulterror.js"; +export * from "./anthropiccompactionblock.js"; export * from "./anthropiccompactionusageiteration.js"; +export * from "./anthropiccontainer.js"; +export * from "./anthropiccontainerskill.js"; +export * from "./anthropiccontainerupload.js"; +export * from "./anthropicdirectcaller.js"; +export * from "./anthropicdocumentblock.js"; export * from "./anthropicdocumentblockparam.js"; +export * from "./anthropicencryptedcodeexecutionresult.js"; export * from "./anthropicfile.js"; export * from "./anthropicfiledeleted.js"; export * from "./anthropicfiledocumentsource.js"; @@ -34,28 +61,57 @@ export * from "./anthropicimageblockparam.js"; export * from "./anthropicimagemimetype.js"; export * from "./anthropicinputtokensclearatleast.js"; export * from "./anthropicinputtokenstrigger.js"; +export * from "./anthropicinputtransformation.js"; export * from "./anthropiciterationcachecreation.js"; export * from "./anthropicmessageoutputconfig.js"; export * from "./anthropicmessageusageiteration.js"; export * from "./anthropicoutputeffort.js"; +export * from "./anthropicoutputtokensdetails.js"; export * from "./anthropicplaintextsource.js"; +export * from "./anthropicredactedthinkingblock.js"; +export * from "./anthropicrefusalstopdetails.js"; export * from "./anthropicsafeguard.js"; export * from "./anthropicsearchresultblockparam.js"; +export * from "./anthropicservertoolerrorcode.js"; +export * from "./anthropicservertoolusage.js"; +export * from "./anthropicservicetier.js"; export * from "./anthropicspeed.js"; export * from "./anthropicsystemclearat.js"; +export * from "./anthropictextblock.js"; export * from "./anthropictextblockparam.js"; +export * from "./anthropictextcitation.js"; +export * from "./anthropictexteditorcodeexecutioncontent.js"; +export * from "./anthropictexteditorcodeexecutioncreateresult.js"; +export * from "./anthropictexteditorcodeexecutionstrreplaceresult.js"; +export * from "./anthropictexteditorcodeexecutiontoolresult.js"; +export * from "./anthropictexteditorcodeexecutiontoolresulterror.js"; +export * from "./anthropictexteditorcodeexecutionviewresult.js"; +export * from "./anthropicthinkingblock.js"; export * from "./anthropicthinkingblockbinding.js"; export * from "./anthropicthinkingdisplay.js"; export * from "./anthropicthinkingturns.js"; +export * from "./anthropictoolreference.js"; +export * from "./anthropictoolsearchcontent.js"; +export * from "./anthropictoolsearchresult.js"; +export * from "./anthropictoolsearchresulterror.js"; export * from "./anthropictoolsearchtoolbm25.js"; export * from "./anthropictoolsearchtoolregex.js"; +export * from "./anthropictoolsearchtoolresult.js"; +export * from "./anthropictooluseblock.js"; export * from "./anthropictooluseskeep.js"; export * from "./anthropictoolusestrigger.js"; export * from "./anthropicunknownusageiteration.js"; export * from "./anthropicurlimagesource.js"; export * from "./anthropicurlpdfsource.js"; export * from "./anthropicusageiteration.js"; +export * from "./anthropicwebfetchblock.js"; +export * from "./anthropicwebfetchcontent.js"; +export * from "./anthropicwebfetchtoolresult.js"; +export * from "./anthropicwebfetchtoolresulterror.js"; +export * from "./anthropicwebsearchresult.js"; export * from "./anthropicwebsearchresultblockparam.js"; +export * from "./anthropicwebsearchtoolresult.js"; +export * from "./anthropicwebsearchtoolresulterror.js"; export * from "./anthropicwebsearchtooluserlocation.js"; export * from "./apierrortype.js"; export * from "./applypatchcallitem.js"; @@ -83,6 +139,18 @@ export * from "./bashservertool.js"; export * from "./bashservertoolconfig.js"; export * from "./bashservertoolengine.js"; export * from "./bashservertoolenvironment.js"; +export * from "./batchdeletedobject.js"; +export * from "./batchdeletionoutcome.js"; +export * from "./batchdeletiontargets.js"; +export * from "./batcherrorresponse.js"; +export * from "./batchlistitem.js"; +export * from "./batchlistresponse.js"; +export * from "./batchliststatus.js"; +export * from "./batchlisttimestamp.js"; +export * from "./batchobject.js"; +export * from "./batchpaymentrequiredresponseerror.js"; +export * from "./batchproviderpreferences.js"; +export * from "./batchsubmitbody.js"; export * from "./booleancapability.js"; export * from "./bulkaddworkspacemembersrequest.js"; export * from "./bulkaddworkspacemembersresponse.js"; @@ -239,6 +307,7 @@ export * from "./fileresponse.js"; export * from "./filesearchservertool.js"; export * from "./filesservertool.js"; export * from "./filesservertoolconfig.js"; +export * from "./finishreason.js"; export * from "./forbiddenresponseerrordata.js"; export * from "./formatjsonobjectconfig.js"; export * from "./formatjsonschemaconfig.js"; @@ -454,6 +523,12 @@ export * from "./openrouterfiledeleted.js"; export * from "./openrouterfilelist.js"; export * from "./openroutermetadata.js"; export * from "./openrouterwebsearchservertool.js"; +export * from "./oranthropicbashtoolresult.js"; +export * from "./oranthropiccontentblock.js"; +export * from "./oranthropicnullablecaller.js"; +export * from "./oranthropicservertooluseblock.js"; +export * from "./oranthropicshelltoolresult.js"; +export * from "./oranthropicstopreason.js"; export * from "./outputadvisorservertoolitem.js"; export * from "./outputapplypatchcallitem.js"; export * from "./outputapplypatchservertoolitem.js"; diff --git a/src/models/internchatchoice.ts b/src/models/internchatchoice.ts index 4f49443ce..1bc35fdcd 100644 --- a/src/models/internchatchoice.ts +++ b/src/models/internchatchoice.ts @@ -18,7 +18,7 @@ import { /** * `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. */ -export const FinishReason = { +export const InternChatChoiceFinishReason = { Error: "error", Stop: "stop", ToolCalls: "tool_calls", @@ -26,7 +26,9 @@ export const 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. */ -export type FinishReason = OpenEnum; +export type InternChatChoiceFinishReason = OpenEnum< + typeof InternChatChoiceFinishReason +>; /** * The single choice this endpoint streams. @@ -39,13 +41,15 @@ export type InternChatChoice = { /** * `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. */ - finishReason: FinishReason | null; + finishReason: InternChatChoiceFinishReason | null; index: number; }; /** @internal */ -export const FinishReason$inboundSchema: z.ZodType = - openEnums.inboundSchema(FinishReason); +export const InternChatChoiceFinishReason$inboundSchema: z.ZodType< + InternChatChoiceFinishReason, + unknown +> = openEnums.inboundSchema(InternChatChoiceFinishReason); /** @internal */ export const InternChatChoice$inboundSchema: z.ZodType< @@ -53,7 +57,7 @@ export const InternChatChoice$inboundSchema: z.ZodType< unknown > = z.object({ delta: InternChatDelta$inboundSchema, - finish_reason: z.nullable(FinishReason$inboundSchema), + finish_reason: z.nullable(InternChatChoiceFinishReason$inboundSchema), index: z.int(), }).transform((v) => { return remap$(v, { diff --git a/src/models/messagesmessageparam.ts b/src/models/messagesmessageparam.ts index a165b1a4f..46bd5d8d1 100644 --- a/src/models/messagesmessageparam.ts +++ b/src/models/messagesmessageparam.ts @@ -82,25 +82,27 @@ export type ContentCompaction = { type: "compaction"; }; -export const ErrorCode = { +export const MessagesMessageParamErrorCode = { InvalidToolInput: "invalid_tool_input", Unavailable: "unavailable", MaxUsesExceeded: "max_uses_exceeded", TooManyRequests: "too_many_requests", QueryTooLong: "query_too_long", } as const; -export type ErrorCode = OpenEnum; +export type MessagesMessageParamErrorCode = OpenEnum< + typeof MessagesMessageParamErrorCode +>; -export const TypeWebSearchToolResultError = { +export const MessagesMessageParamTypeWebSearchToolResultError = { WebSearchToolResultError: "web_search_tool_result_error", } as const; -export type TypeWebSearchToolResultError = ClosedEnum< - typeof TypeWebSearchToolResultError +export type MessagesMessageParamTypeWebSearchToolResultError = ClosedEnum< + typeof MessagesMessageParamTypeWebSearchToolResultError >; export type ContentWebSearchToolResultError = { - errorCode: ErrorCode; - type: TypeWebSearchToolResultError; + errorCode: MessagesMessageParamErrorCode; + type: MessagesMessageParamTypeWebSearchToolResultError; }; export type MessagesMessageParamContentUnion3 = @@ -304,13 +306,16 @@ export function contentCompactionToJSON( } /** @internal */ -export const ErrorCode$outboundSchema: z.ZodType = openEnums - .outboundSchema(ErrorCode); +export const MessagesMessageParamErrorCode$outboundSchema: z.ZodType< + string, + MessagesMessageParamErrorCode +> = openEnums.outboundSchema(MessagesMessageParamErrorCode); /** @internal */ -export const TypeWebSearchToolResultError$outboundSchema: z.ZodEnum< - typeof TypeWebSearchToolResultError -> = z.enum(TypeWebSearchToolResultError); +export const MessagesMessageParamTypeWebSearchToolResultError$outboundSchema: + z.ZodEnum = z.enum( + MessagesMessageParamTypeWebSearchToolResultError, + ); /** @internal */ export type ContentWebSearchToolResultError$Outbound = { @@ -323,8 +328,8 @@ export const ContentWebSearchToolResultError$outboundSchema: z.ZodType< ContentWebSearchToolResultError$Outbound, ContentWebSearchToolResultError > = z.object({ - errorCode: ErrorCode$outboundSchema, - type: TypeWebSearchToolResultError$outboundSchema, + errorCode: MessagesMessageParamErrorCode$outboundSchema, + type: MessagesMessageParamTypeWebSearchToolResultError$outboundSchema, }).transform((v) => { return remap$(v, { errorCode: "error_code", diff --git a/src/models/operations/createbatches.ts b/src/models/operations/createbatches.ts new file mode 100644 index 000000000..e8e29a484 --- /dev/null +++ b/src/models/operations/createbatches.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ebc64cef17ca + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as models from "../index.js"; + +export type CreateBatchesGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type CreateBatchesRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + /** + * The batch to create. Each item in `requests` has a unique `custom_id` and a `body` in the request format of the chosen `endpoint`. + */ + batchSubmitBody: models.BatchSubmitBody; +}; + +/** @internal */ +export type CreateBatchesRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + BatchSubmitBody: models.BatchSubmitBody$Outbound; +}; + +/** @internal */ +export const CreateBatchesRequest$outboundSchema: z.ZodType< + CreateBatchesRequest$Outbound, + CreateBatchesRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + batchSubmitBody: models.BatchSubmitBody$outboundSchema, +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + batchSubmitBody: "BatchSubmitBody", + }); +}); + +export function createBatchesRequestToJSON( + createBatchesRequest: CreateBatchesRequest, +): string { + return JSON.stringify( + CreateBatchesRequest$outboundSchema.parse(createBatchesRequest), + ); +} diff --git a/src/models/operations/deletebatch.ts b/src/models/operations/deletebatch.ts new file mode 100644 index 000000000..96e3fabf0 --- /dev/null +++ b/src/models/operations/deletebatch.ts @@ -0,0 +1,86 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f2c0c45a0e0b + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; + +export type DeleteBatchGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type DeleteBatchRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + /** + * The batch job id returned from submit. + */ + id: string; +}; + +/** @internal */ +export type DeleteBatchRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + id: string; +}; + +/** @internal */ +export const DeleteBatchRequest$outboundSchema: z.ZodType< + DeleteBatchRequest$Outbound, + DeleteBatchRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + id: z.string(), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + }); +}); + +export function deleteBatchRequestToJSON( + deleteBatchRequest: DeleteBatchRequest, +): string { + return JSON.stringify( + DeleteBatchRequest$outboundSchema.parse(deleteBatchRequest), + ); +} diff --git a/src/models/operations/getbatches.ts b/src/models/operations/getbatches.ts new file mode 100644 index 000000000..2d75b6d2d --- /dev/null +++ b/src/models/operations/getbatches.ts @@ -0,0 +1,86 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 25fcdd59c2f1 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; + +export type GetBatchesGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type GetBatchesRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + /** + * The batch job id returned from submit. + */ + id: string; +}; + +/** @internal */ +export type GetBatchesRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + id: string; +}; + +/** @internal */ +export const GetBatchesRequest$outboundSchema: z.ZodType< + GetBatchesRequest$Outbound, + GetBatchesRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + id: z.string(), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + }); +}); + +export function getBatchesRequestToJSON( + getBatchesRequest: GetBatchesRequest, +): string { + return JSON.stringify( + GetBatchesRequest$outboundSchema.parse(getBatchesRequest), + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index dcf5f911b..19e2b028c 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -15,6 +15,7 @@ export * from "./createaudiospeech.js"; export * from "./createaudiotranscriptions.js"; export * from "./createaudiotranscriptionsmultipart.js"; export * from "./createauthkeyscode.js"; +export * from "./createbatches.js"; export * from "./createbyokkey.js"; export * from "./createembeddings.js"; export * from "./createguardrail.js"; @@ -34,6 +35,7 @@ export * from "./createscimsyncjob.js"; export * from "./createsystemone.js"; export * from "./createvideos.js"; export * from "./createworkspace.js"; +export * from "./deletebatch.js"; export * from "./deletebyokkey.js"; export * from "./deletefile.js"; export * from "./deleteguardrail.js"; @@ -50,6 +52,7 @@ export * from "./downloadfilecontent.js"; export * from "./exchangeauthcodeforapikey.js"; export * from "./getanalyticsmeta.js"; export * from "./getapprankings.js"; +export * from "./getbatches.js"; export * from "./getbenchmarks.js"; export * from "./getbyokkey.js"; export * from "./getcontainerfile.js"; @@ -77,6 +80,7 @@ export * from "./getworkspace.js"; export * from "./getworkspacebudget.js"; export * from "./invokeintern.js"; export * from "./list.js"; +export * from "./listbatches.js"; export * from "./listbyokkeys.js"; export * from "./listcontainerfiles.js"; export * from "./listembeddingsmodels.js"; diff --git a/src/models/operations/listbatches.ts b/src/models/operations/listbatches.ts new file mode 100644 index 000000000..78a909432 --- /dev/null +++ b/src/models/operations/listbatches.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ed6b34dc34af + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import * as models from "../index.js"; + +export type ListBatchesGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +export type ListBatchesRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + /** + * Maximum number of batches to return, from 1 through 100. + */ + limit?: number | undefined; + /** + * Batch id from the previous page's `last_id`. + */ + after?: string | undefined; + /** + * Repeat this parameter to include more than one status. + */ + status?: Array | undefined; + /** + * Only include batches created strictly after this timestamp. + */ + createdAfter?: models.BatchListTimestamp | undefined; + /** + * Only include batches created strictly before this timestamp. + */ + createdBefore?: models.BatchListTimestamp | undefined; +}; + +export type ListBatchesResponse = { + result: models.BatchListResponse; +}; + +/** @internal */ +export type ListBatchesRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + limit?: number | undefined; + after?: string | undefined; + status?: Array | undefined; + created_after?: models.BatchListTimestamp$Outbound | undefined; + created_before?: models.BatchListTimestamp$Outbound | undefined; +}; + +/** @internal */ +export const ListBatchesRequest$outboundSchema: z.ZodType< + ListBatchesRequest$Outbound, + ListBatchesRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + limit: z.int().optional(), + after: z.string().optional(), + status: z.array(models.BatchListStatus$outboundSchema).optional(), + createdAfter: models.BatchListTimestamp$outboundSchema.optional(), + createdBefore: models.BatchListTimestamp$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + createdAfter: "created_after", + createdBefore: "created_before", + }); +}); + +export function listBatchesRequestToJSON( + listBatchesRequest: ListBatchesRequest, +): string { + return JSON.stringify( + ListBatchesRequest$outboundSchema.parse(listBatchesRequest), + ); +} + +/** @internal */ +export const ListBatchesResponse$inboundSchema: z.ZodType< + ListBatchesResponse, + unknown +> = z.object({ + Result: models.BatchListResponse$inboundSchema, +}).transform((v) => { + return remap$(v, { + "Result": "result", + }); +}); + +export function listBatchesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListBatchesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListBatchesResponse' from JSON`, + ); +} diff --git a/src/models/oranthropicbashtoolresult.ts b/src/models/oranthropicbashtoolresult.ts new file mode 100644 index 000000000..418edd393 --- /dev/null +++ b/src/models/oranthropicbashtoolresult.ts @@ -0,0 +1,108 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 13070e32efe3 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const ORAnthropicBashToolResultTypeContainerFileCitation = { + ContainerFileCitation: "container_file_citation", +} as const; +export type ORAnthropicBashToolResultTypeContainerFileCitation = ClosedEnum< + typeof ORAnthropicBashToolResultTypeContainerFileCitation +>; + +export type ORAnthropicBashToolResultFile = { + containerId: string; + endIndex: number; + fileId: string; + filename: string; + startIndex: number; + type: ORAnthropicBashToolResultTypeContainerFileCitation; +}; + +/** + * Output of an `openrouter:bash` call executed in the OpenRouter sandbox (`engine: 'openrouter'`) + */ +export type ORAnthropicBashToolResult = { + /** + * 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. + */ + containerId?: string | undefined; + content: { [k: string]: any }; + /** + * Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. + */ + files?: Array | undefined; + toolUseId: string; + type: "openrouter_bash_tool_result"; +}; + +/** @internal */ +export const ORAnthropicBashToolResultTypeContainerFileCitation$inboundSchema: + z.ZodEnum = z.enum( + ORAnthropicBashToolResultTypeContainerFileCitation, + ); + +/** @internal */ +export const ORAnthropicBashToolResultFile$inboundSchema: z.ZodType< + ORAnthropicBashToolResultFile, + unknown +> = z.object({ + container_id: z.string(), + end_index: z.int(), + file_id: z.string(), + filename: z.string(), + start_index: z.int(), + type: ORAnthropicBashToolResultTypeContainerFileCitation$inboundSchema, +}).transform((v) => { + return remap$(v, { + "container_id": "containerId", + "end_index": "endIndex", + "file_id": "fileId", + "start_index": "startIndex", + }); +}); + +export function orAnthropicBashToolResultFileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ORAnthropicBashToolResultFile$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ORAnthropicBashToolResultFile' from JSON`, + ); +} + +/** @internal */ +export const ORAnthropicBashToolResult$inboundSchema: z.ZodType< + ORAnthropicBashToolResult, + unknown +> = z.object({ + container_id: z.string().optional(), + content: z.record(z.string(), z.any()), + files: z.array(z.lazy(() => ORAnthropicBashToolResultFile$inboundSchema)) + .optional(), + tool_use_id: z.string(), + type: z.literal("openrouter_bash_tool_result"), +}).transform((v) => { + return remap$(v, { + "container_id": "containerId", + "tool_use_id": "toolUseId", + }); +}); + +export function orAnthropicBashToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ORAnthropicBashToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ORAnthropicBashToolResult' from JSON`, + ); +} diff --git a/src/models/oranthropiccontentblock.ts b/src/models/oranthropiccontentblock.ts new file mode 100644 index 000000000..170f84445 --- /dev/null +++ b/src/models/oranthropiccontentblock.ts @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 29775b270fae + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicAdvisorToolResult, + AnthropicAdvisorToolResult$inboundSchema, +} from "./anthropicadvisortoolresult.js"; +import { + AnthropicBashCodeExecutionToolResult, + AnthropicBashCodeExecutionToolResult$inboundSchema, +} from "./anthropicbashcodeexecutiontoolresult.js"; +import { + AnthropicCodeExecutionToolResult, + AnthropicCodeExecutionToolResult$inboundSchema, +} from "./anthropiccodeexecutiontoolresult.js"; +import { + AnthropicCompactionBlock, + AnthropicCompactionBlock$inboundSchema, +} from "./anthropiccompactionblock.js"; +import { + AnthropicContainerUpload, + AnthropicContainerUpload$inboundSchema, +} from "./anthropiccontainerupload.js"; +import { + AnthropicRedactedThinkingBlock, + AnthropicRedactedThinkingBlock$inboundSchema, +} from "./anthropicredactedthinkingblock.js"; +import { + AnthropicTextBlock, + AnthropicTextBlock$inboundSchema, +} from "./anthropictextblock.js"; +import { + AnthropicTextEditorCodeExecutionToolResult, + AnthropicTextEditorCodeExecutionToolResult$inboundSchema, +} from "./anthropictexteditorcodeexecutiontoolresult.js"; +import { + AnthropicThinkingBlock, + AnthropicThinkingBlock$inboundSchema, +} from "./anthropicthinkingblock.js"; +import { + AnthropicToolSearchToolResult, + AnthropicToolSearchToolResult$inboundSchema, +} from "./anthropictoolsearchtoolresult.js"; +import { + AnthropicToolUseBlock, + AnthropicToolUseBlock$inboundSchema, +} from "./anthropictooluseblock.js"; +import { + AnthropicWebFetchToolResult, + AnthropicWebFetchToolResult$inboundSchema, +} from "./anthropicwebfetchtoolresult.js"; +import { + AnthropicWebSearchToolResult, + AnthropicWebSearchToolResult$inboundSchema, +} from "./anthropicwebsearchtoolresult.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ORAnthropicBashToolResult, + ORAnthropicBashToolResult$inboundSchema, +} from "./oranthropicbashtoolresult.js"; +import { + ORAnthropicServerToolUseBlock, + ORAnthropicServerToolUseBlock$inboundSchema, +} from "./oranthropicservertooluseblock.js"; +import { + ORAnthropicShellToolResult, + ORAnthropicShellToolResult$inboundSchema, +} from "./oranthropicshelltoolresult.js"; + +export type ORAnthropicContentBlock = + | AnthropicAdvisorToolResult + | AnthropicBashCodeExecutionToolResult + | AnthropicCodeExecutionToolResult + | AnthropicCompactionBlock + | AnthropicContainerUpload + | ORAnthropicBashToolResult + | ORAnthropicShellToolResult + | AnthropicRedactedThinkingBlock + | ORAnthropicServerToolUseBlock + | AnthropicTextBlock + | AnthropicTextEditorCodeExecutionToolResult + | AnthropicThinkingBlock + | AnthropicToolSearchToolResult + | AnthropicToolUseBlock + | AnthropicWebFetchToolResult + | AnthropicWebSearchToolResult + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const ORAnthropicContentBlock$inboundSchema: z.ZodType< + ORAnthropicContentBlock, + unknown +> = discriminatedUnion("type", { + advisor_tool_result: AnthropicAdvisorToolResult$inboundSchema, + bash_code_execution_tool_result: + AnthropicBashCodeExecutionToolResult$inboundSchema, + code_execution_tool_result: AnthropicCodeExecutionToolResult$inboundSchema, + compaction: AnthropicCompactionBlock$inboundSchema, + container_upload: AnthropicContainerUpload$inboundSchema, + openrouter_bash_tool_result: ORAnthropicBashToolResult$inboundSchema, + openrouter_shell_tool_result: ORAnthropicShellToolResult$inboundSchema, + redacted_thinking: AnthropicRedactedThinkingBlock$inboundSchema, + server_tool_use: ORAnthropicServerToolUseBlock$inboundSchema, + text: AnthropicTextBlock$inboundSchema, + text_editor_code_execution_tool_result: + AnthropicTextEditorCodeExecutionToolResult$inboundSchema, + thinking: AnthropicThinkingBlock$inboundSchema, + tool_search_tool_result: AnthropicToolSearchToolResult$inboundSchema, + tool_use: AnthropicToolUseBlock$inboundSchema, + web_fetch_tool_result: AnthropicWebFetchToolResult$inboundSchema, + web_search_tool_result: AnthropicWebSearchToolResult$inboundSchema, +}); + +export function orAnthropicContentBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ORAnthropicContentBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ORAnthropicContentBlock' from JSON`, + ); +} diff --git a/src/models/oranthropicnullablecaller.ts b/src/models/oranthropicnullablecaller.ts new file mode 100644 index 000000000..8a6fc4654 --- /dev/null +++ b/src/models/oranthropicnullablecaller.ts @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ecf0849a25c1 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { + AnthropicCodeExecution20250825Caller, + AnthropicCodeExecution20250825Caller$inboundSchema, +} from "./anthropiccodeexecution20250825caller.js"; +import { + AnthropicCodeExecution20260120Caller, + AnthropicCodeExecution20260120Caller$inboundSchema, +} from "./anthropiccodeexecution20260120caller.js"; +import { + AnthropicDirectCaller, + AnthropicDirectCaller$inboundSchema, +} from "./anthropicdirectcaller.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type ORAnthropicNullableCaller = + | AnthropicCodeExecution20250825Caller + | AnthropicCodeExecution20260120Caller + | AnthropicDirectCaller + | discriminatedUnionTypes.Unknown<"type">; + +/** @internal */ +export const ORAnthropicNullableCaller$inboundSchema: z.ZodType< + ORAnthropicNullableCaller, + unknown +> = discriminatedUnion("type", { + code_execution_20250825: AnthropicCodeExecution20250825Caller$inboundSchema, + code_execution_20260120: AnthropicCodeExecution20260120Caller$inboundSchema, + direct: AnthropicDirectCaller$inboundSchema, +}); + +export function orAnthropicNullableCallerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ORAnthropicNullableCaller$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ORAnthropicNullableCaller' from JSON`, + ); +} diff --git a/src/models/oranthropicservertooluseblock.ts b/src/models/oranthropicservertooluseblock.ts new file mode 100644 index 000000000..9234a171c --- /dev/null +++ b/src/models/oranthropicservertooluseblock.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6dab967e4db6 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ORAnthropicNullableCaller, + ORAnthropicNullableCaller$inboundSchema, +} from "./oranthropicnullablecaller.js"; + +export type ORAnthropicServerToolUseBlock = { + caller?: ORAnthropicNullableCaller | null | undefined; + id: string; + input?: any | undefined; + name: string; + type: "server_tool_use"; +}; + +/** @internal */ +export const ORAnthropicServerToolUseBlock$inboundSchema: z.ZodType< + ORAnthropicServerToolUseBlock, + unknown +> = z.object({ + caller: z.nullable(ORAnthropicNullableCaller$inboundSchema).optional(), + id: z.string(), + input: z.any().optional(), + name: z.string(), + type: z.literal("server_tool_use"), +}); + +export function orAnthropicServerToolUseBlockFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ORAnthropicServerToolUseBlock$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ORAnthropicServerToolUseBlock' from JSON`, + ); +} diff --git a/src/models/oranthropicshelltoolresult.ts b/src/models/oranthropicshelltoolresult.ts new file mode 100644 index 000000000..5370623c0 --- /dev/null +++ b/src/models/oranthropicshelltoolresult.ts @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6c0f19243a3e + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { ClosedEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const ORAnthropicShellToolResultTypeContainerFileCitation = { + ContainerFileCitation: "container_file_citation", +} as const; +export type ORAnthropicShellToolResultTypeContainerFileCitation = ClosedEnum< + typeof ORAnthropicShellToolResultTypeContainerFileCitation +>; + +export type ORAnthropicShellToolResultFile = { + containerId: string; + endIndex: number; + fileId: string; + filename: string; + startIndex: number; + type: ORAnthropicShellToolResultTypeContainerFileCitation; +}; + +/** + * Output of an `openrouter:shell` call executed in the OpenRouter sandbox + */ +export type ORAnthropicShellToolResult = { + /** + * 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. + */ + containerId?: string | undefined; + content: { [k: string]: any }; + /** + * Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. + */ + files?: Array | undefined; + toolUseId: string; + type: "openrouter_shell_tool_result"; +}; + +/** @internal */ +export const ORAnthropicShellToolResultTypeContainerFileCitation$inboundSchema: + z.ZodEnum = z + .enum(ORAnthropicShellToolResultTypeContainerFileCitation); + +/** @internal */ +export const ORAnthropicShellToolResultFile$inboundSchema: z.ZodType< + ORAnthropicShellToolResultFile, + unknown +> = z.object({ + container_id: z.string(), + end_index: z.int(), + file_id: z.string(), + filename: z.string(), + start_index: z.int(), + type: ORAnthropicShellToolResultTypeContainerFileCitation$inboundSchema, +}).transform((v) => { + return remap$(v, { + "container_id": "containerId", + "end_index": "endIndex", + "file_id": "fileId", + "start_index": "startIndex", + }); +}); + +export function orAnthropicShellToolResultFileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ORAnthropicShellToolResultFile$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ORAnthropicShellToolResultFile' from JSON`, + ); +} + +/** @internal */ +export const ORAnthropicShellToolResult$inboundSchema: z.ZodType< + ORAnthropicShellToolResult, + unknown +> = z.object({ + container_id: z.string().optional(), + content: z.record(z.string(), z.any()), + files: z.array(z.lazy(() => ORAnthropicShellToolResultFile$inboundSchema)) + .optional(), + tool_use_id: z.string(), + type: z.literal("openrouter_shell_tool_result"), +}).transform((v) => { + return remap$(v, { + "container_id": "containerId", + "tool_use_id": "toolUseId", + }); +}); + +export function orAnthropicShellToolResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ORAnthropicShellToolResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ORAnthropicShellToolResult' from JSON`, + ); +} diff --git a/src/models/oranthropicstopreason.ts b/src/models/oranthropicstopreason.ts new file mode 100644 index 000000000..4cec58cad --- /dev/null +++ b/src/models/oranthropicstopreason.ts @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2f8990149810 + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +export const ORAnthropicStopReason = { + EndTurn: "end_turn", + MaxTokens: "max_tokens", + ModelContextWindowExceeded: "model_context_window_exceeded", + StopSequence: "stop_sequence", + ToolUse: "tool_use", + PauseTurn: "pause_turn", + Refusal: "refusal", + Compaction: "compaction", +} as const; +export type ORAnthropicStopReason = OpenEnum; + +/** @internal */ +export const ORAnthropicStopReason$inboundSchema: z.ZodType< + ORAnthropicStopReason, + unknown +> = openEnums.inboundSchema(ORAnthropicStopReason); diff --git a/src/models/outputfusionservertoolitem.ts b/src/models/outputfusionservertoolitem.ts index e4613f4cd..7673b9524 100644 --- a/src/models/outputfusionservertoolitem.ts +++ b/src/models/outputfusionservertoolitem.ts @@ -42,7 +42,7 @@ export type FailedModel = { statusCode?: number | undefined; }; -export type ResponseT = { +export type OutputFusionServerToolItemResponse = { content?: string | undefined; model: string; }; @@ -78,7 +78,7 @@ export type OutputFusionServerToolItem = { /** * Analysis models that produced a response in this fusion run, with each model's full panel content. */ - responses?: Array | undefined; + responses?: Array | undefined; /** * 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. */ @@ -133,35 +133,45 @@ export function failedModelFromJSON( } /** @internal */ -export const ResponseT$inboundSchema: z.ZodType = z.object({ +export const OutputFusionServerToolItemResponse$inboundSchema: z.ZodType< + OutputFusionServerToolItemResponse, + unknown +> = z.object({ content: z.string().optional(), model: z.string(), }); /** @internal */ -export type ResponseT$Outbound = { +export type OutputFusionServerToolItemResponse$Outbound = { content?: string | undefined; model: string; }; /** @internal */ -export const ResponseT$outboundSchema: z.ZodType< - ResponseT$Outbound, - ResponseT +export const OutputFusionServerToolItemResponse$outboundSchema: z.ZodType< + OutputFusionServerToolItemResponse$Outbound, + OutputFusionServerToolItemResponse > = z.object({ content: z.string().optional(), model: z.string(), }); -export function responseToJSON(responseT: ResponseT): string { - return JSON.stringify(ResponseT$outboundSchema.parse(responseT)); +export function outputFusionServerToolItemResponseToJSON( + outputFusionServerToolItemResponse: OutputFusionServerToolItemResponse, +): string { + return JSON.stringify( + OutputFusionServerToolItemResponse$outboundSchema.parse( + outputFusionServerToolItemResponse, + ), + ); } -export function responseFromJSON( +export function outputFusionServerToolItemResponseFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => ResponseT$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ResponseT' from JSON`, + (x) => + OutputFusionServerToolItemResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OutputFusionServerToolItemResponse' from JSON`, ); } @@ -184,7 +194,9 @@ export const OutputFusionServerToolItem$inboundSchema: z.ZodType< failed_models: z.array(z.lazy(() => FailedModel$inboundSchema)).optional(), failure_reason: z.string().optional(), id: z.string().optional(), - responses: z.array(z.lazy(() => ResponseT$inboundSchema)).optional(), + responses: z.array( + z.lazy(() => OutputFusionServerToolItemResponse$inboundSchema), + ).optional(), sources: z.array(FusionSource$inboundSchema).optional(), status: ToolCallStatus$inboundSchema, type: OutputFusionServerToolItemType$inboundSchema, @@ -201,7 +213,7 @@ export type OutputFusionServerToolItem$Outbound = { failed_models?: Array | undefined; failure_reason?: string | undefined; id?: string | undefined; - responses?: Array | undefined; + responses?: Array | undefined; sources?: Array | undefined; status: string; type: string; @@ -217,7 +229,9 @@ export const OutputFusionServerToolItem$outboundSchema: z.ZodType< failedModels: z.array(z.lazy(() => FailedModel$outboundSchema)).optional(), failureReason: z.string().optional(), id: z.string().optional(), - responses: z.array(z.lazy(() => ResponseT$outboundSchema)).optional(), + responses: z.array( + z.lazy(() => OutputFusionServerToolItemResponse$outboundSchema), + ).optional(), sources: z.array(FusionSource$outboundSchema).optional(), status: ToolCallStatus$outboundSchema, type: OutputFusionServerToolItemType$outboundSchema, diff --git a/src/models/submitgenerationfeedbackrequest.ts b/src/models/submitgenerationfeedbackrequest.ts index b0896f9ca..8c12e4ae7 100644 --- a/src/models/submitgenerationfeedbackrequest.ts +++ b/src/models/submitgenerationfeedbackrequest.ts @@ -11,7 +11,7 @@ import { OpenEnum } from "../types/enums.js"; /** * The category of feedback being reported */ -export const Category = { +export const SubmitGenerationFeedbackRequestCategory = { Latency: "latency", Incoherence: "incoherence", IncorrectResponse: "incorrect_response", @@ -23,7 +23,9 @@ export const Category = { /** * The category of feedback being reported */ -export type Category = OpenEnum; +export type SubmitGenerationFeedbackRequestCategory = OpenEnum< + typeof SubmitGenerationFeedbackRequestCategory +>; /** * Structured feedback about a specific generation @@ -32,7 +34,7 @@ export type SubmitGenerationFeedbackRequest = { /** * The category of feedback being reported */ - category: Category; + category: SubmitGenerationFeedbackRequestCategory; /** * An optional free-text comment describing the feedback */ @@ -44,8 +46,10 @@ export type SubmitGenerationFeedbackRequest = { }; /** @internal */ -export const Category$outboundSchema: z.ZodType = openEnums - .outboundSchema(Category); +export const SubmitGenerationFeedbackRequestCategory$outboundSchema: z.ZodType< + string, + SubmitGenerationFeedbackRequestCategory +> = openEnums.outboundSchema(SubmitGenerationFeedbackRequestCategory); /** @internal */ export type SubmitGenerationFeedbackRequest$Outbound = { @@ -59,7 +63,7 @@ export const SubmitGenerationFeedbackRequest$outboundSchema: z.ZodType< SubmitGenerationFeedbackRequest$Outbound, SubmitGenerationFeedbackRequest > = z.object({ - category: Category$outboundSchema, + category: SubmitGenerationFeedbackRequestCategory$outboundSchema, comment: z.string().optional(), generationId: z.string(), }).transform((v) => { diff --git a/src/sdk/batch.ts b/src/sdk/batch.ts new file mode 100644 index 000000000..5d9705d9f --- /dev/null +++ b/src/sdk/batch.ts @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 254a218f7d6b + */ + +import { batchCreateBatches } from "../funcs/batchCreateBatches.js"; +import { batchDelete } from "../funcs/batchDelete.js"; +import { batchGetBatches } from "../funcs/batchGetBatches.js"; +import { batchList } from "../funcs/batchList.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Batch extends ClientSDK { + /** + * List batches + * + * @remarks + * 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). + */ + async list( + request?: operations.ListBatchesRequest | undefined, + options?: RequestOptions, + ): Promise> { + return unwrapResultIterator(batchList( + this, + request, + options, + )); + } + + /** + * Create a batch + * + * @remarks + * 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). + */ + async createBatches( + request: operations.CreateBatchesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(batchCreateBatches( + this, + request, + options, + )); + } + + /** + * Delete a batch + * + * @remarks + * 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). + */ + async delete( + request: operations.DeleteBatchRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(batchDelete( + this, + request, + options, + )); + } + + /** + * Get a batch + * + * @remarks + * 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). + */ + async getBatches( + request: operations.GetBatchesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(batchGetBatches( + this, + request, + options, + )); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index d15ef3c72..b83fbcaad 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -7,6 +7,7 @@ import { ClientSDK } from "../lib/sdks.js"; import { Alpha } from "./alpha.js"; import { Analytics } from "./analytics.js"; import { APIKeys } from "./apikeys.js"; +import { Batch } from "./batch.js"; import { Benchmarks } from "./benchmarks.js"; import { Beta } from "./beta.js"; import { BYOK } from "./byok.js"; @@ -76,6 +77,11 @@ export class OpenRouter extends ClientSDK { return (this._oAuth ??= new OAuth(this._options)); } + private _batch?: Batch; + get batch(): Batch { + return (this._batch ??= new Batch(this._options)); + } + private _benchmarks?: Benchmarks; get benchmarks(): Benchmarks { return (this._benchmarks ??= new Benchmarks(this._options));