diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index f5c47dfe..cdc01e0a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: a7cd3c07651de2ba68da18ed2e2839b5 + docChecksum: d112b45d4e2ab2d47caf5be7c653f0fb docVersion: 1.0.0 speakeasyVersion: 1.761.0 generationVersion: 2.879.1 - releaseVersion: 0.12.20 - configChecksum: a648338766eaf445221374d93286b713 + releaseVersion: 0.12.21 + configChecksum: ead6e6f6576969feb4ee0c0003182adb repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: 69cc04f8-f12a-4b99-b831-5798564e118e - pristine_commit_hash: ba5b5fd27b12df576ae189e8e902d16c5799a0a8 - pristine_tree_hash: 368ab012a3af1ec954516d5c1cb32826d946e17c + generation_id: 234c1d28-265a-40a0-9cf1-487ec0b694b9 + pristine_commit_hash: ea2a8546cf75ff8ba873cbad06442949b63e328e + pristine_tree_hash: ac4d5f48e7f31392169fc86b4391652332b7ccc5 features: typescript: acceptHeaders: 2.81.2 @@ -1139,13 +1139,13 @@ trackedFiles: deleted: true docs/models/createworkspacerequest.md: id: 8e9411a464de - last_write_checksum: sha1:e643de15844c7b630ae27b5f9476b4d771d21445 - pristine_git_object: 9e8cc8131edb55cda8bc90f979798505f3a101bb + last_write_checksum: sha1:f74b2c1fd5267d806136fc500e080ae690f83083 + pristine_git_object: fa85b8dccde71c75aa58ef7d540dcb4c9028283a deleted: true docs/models/createworkspaceresponse.md: id: 338a065bcee2 - last_write_checksum: sha1:1da3001d140d6e970e3047f4000e1e43598f739d - pristine_git_object: 57f1496ce1778cd0675786b8e2683a8748ed8f9d + last_write_checksum: sha1:0b8c44ed9ff39f92036acef55ff17e892069c496 + pristine_git_object: 0b59e302b7682efcfde5cd090218bbee5672ec40 deleted: true docs/models/customtool.md: id: f64ed08d154e @@ -1526,8 +1526,8 @@ trackedFiles: deleted: true docs/models/generationresponsedata.md: id: 6aa3e407630d - last_write_checksum: sha1:59d05332322a9649ae734509350b566350ea6bd6 - pristine_git_object: 84e5938ab2ecc20097d330681cf2f488cc55ffde + last_write_checksum: sha1:a18734de919fb19a50425da7454385ca7b02f583 + pristine_git_object: fba0a55b8561fd15f3e7adaa82ef38e6b79f39db deleted: true docs/models/getguardrailresponse.md: id: 3590ce9e2938 @@ -1536,8 +1536,8 @@ trackedFiles: deleted: true docs/models/getworkspaceresponse.md: id: 4aacc04e7be8 - last_write_checksum: sha1:d06949d6493183f1d54d8807d5ebd001b28643ac - pristine_git_object: 9fc6bb9c658b193d6f3951dbda686cb745ab7d28 + last_write_checksum: sha1:17d9e2f8125c16b21acd71619125e1b2d26b5e37 + pristine_git_object: 3546b33802adadbea42873952ebf6b9585fd0feb deleted: true docs/models/guardrail.md: id: 34d09568ab25 @@ -1819,8 +1819,8 @@ trackedFiles: deleted: true docs/models/inputsunion1.md: id: 1109bc1aa0ce - last_write_checksum: sha1:8729fe91ca60e4293c80bb7c09709299f223228e - pristine_git_object: a3599362492ac49e774f43ebeffebfee98f68fb0 + last_write_checksum: sha1:e179a03dba76f9d7f53218a3249003fe904f7b74 + pristine_git_object: 6f817c0a8136fd0f7d949d8a0783f68dd1d5740d deleted: true docs/models/inputtext.md: id: bc941fd800e1 @@ -1895,8 +1895,8 @@ trackedFiles: deleted: true docs/models/listworkspacesresponse.md: id: fd657130fbe9 - last_write_checksum: sha1:ce09597d38a2d6e2fb19b5779036943d28cd2552 - pristine_git_object: b9a6ab91c754a2801a8885eb5f270f8e5bd107d4 + last_write_checksum: sha1:8f58734dc57fc02f90f230437e8d4d221b646b55 + pristine_git_object: ac5a9376d5d46903afa4772763850c7e285342b3 deleted: true docs/models/logprob.md: id: 5a2841eb9a83 @@ -2807,8 +2807,8 @@ trackedFiles: deleted: true docs/models/operations/listworkspacesresponse.md: id: 056a8d647475 - last_write_checksum: sha1:dac580f0cffaf25ffa558a7551a7ebdb9a8e96d5 - pristine_git_object: b26309dc3695995f8b57fb5f95ce73f3dd7c225b + last_write_checksum: sha1:a64f80f86413f4ea3fa9ca890618053039170df7 + pristine_git_object: e0d40fb425cfe15322cb618349dd78a5cd8fa3a4 deleted: true docs/models/operations/objectembedding.md: id: a02a569169a0 @@ -2926,23 +2926,35 @@ trackedFiles: deleted: true docs/models/outputapplypatchservertoolitem.md: id: 19ad32aec353 - last_write_checksum: sha1:e8cec766eb007fddf7313324ceef9d2b947de77c - pristine_git_object: c83f61542428254a53e5f6ddfb4d10389c984579 + last_write_checksum: sha1:55bba94fc374580a1a1d80bf552bf0d6af8676ad + pristine_git_object: 975e450e586cacf6c2d3aa8e46c8fcb84c06a76d deleted: true + docs/models/outputapplypatchservertoolitemtype.md: + id: 704c9634cb2a + last_write_checksum: sha1:e3d5ded17ae6806185ecded5390205c1ffd02023 + pristine_git_object: ea9c9757c795cad71c53dd26be872881ecf92858 docs/models/outputbashservertoolitem.md: id: 182261db7417 - last_write_checksum: sha1:8ff5ac4bac8b7c1724a90c21f866df910cb91c9a - pristine_git_object: d06bb404e8523e0b35f25a6dfe500247e70e744a + last_write_checksum: sha1:74d28cfc924d92c2152713924289ce52b8f07653 + pristine_git_object: 30067c3504b59a19fbd4dde326b9a96ab5103800 deleted: true + docs/models/outputbashservertoolitemtype.md: + id: 6338aefcfd9f + last_write_checksum: sha1:40ac05e3ba6ff46c5b3dfb7fd3b50924218ea35e + pristine_git_object: f31550e240e6463ebb4d7caed7c18d03c5742572 docs/models/outputbrowseruseservertoolitem.md: id: 923fe281f913 - last_write_checksum: sha1:3d29ec182270378acabd5bda4134b628ab1efe3e - pristine_git_object: d103c236c8d5e4fa9dbbe8c774fd58750a609269 + last_write_checksum: sha1:37b11a0be19e6cd6adac649d21f9d4f3fc2ff153 + pristine_git_object: 87ed3932951d5cbb61a31ab31f2471c149f62207 deleted: true + docs/models/outputbrowseruseservertoolitemtype.md: + id: b4f35dc09673 + last_write_checksum: sha1:edc842a3c75ab4e90137687a41a20a1c7f23b946 + pristine_git_object: cf31e33e54891fb7eb3d40a5090da88bd594fb8e docs/models/outputcodeinterpretercallitem.md: id: 63f154a12737 - last_write_checksum: sha1:b3d28c4f63145d69af94ffbc13080d5becfb9a55 - pristine_git_object: 2e1f9327871df82f452278c259f6ab73df18725c + last_write_checksum: sha1:576694ce67d862244bc5bbaf40db5101b776ebb6 + pristine_git_object: 6d33e56a1cf9af60e36cd09e679b448b6bcb99a9 deleted: true docs/models/outputcodeinterpretercallitemoutputunion.md: id: 6c3c35f1a289 @@ -2951,19 +2963,27 @@ trackedFiles: deleted: true docs/models/outputcodeinterpreterservertoolitem.md: id: 6c502fbcda47 - last_write_checksum: sha1:d15c4a3f9236697e4ec40160d50e029d10dc0119 - pristine_git_object: 01860f5f58f9a5ec3b08df4edc76df5a609c2dc9 + last_write_checksum: sha1:7d5794506af7839a5914d3d3beee24dd31ef4c7d + pristine_git_object: 65a0fa24e131cf58a3477ec874aa7d62ef2d2758 deleted: true + docs/models/outputcodeinterpreterservertoolitemtype.md: + id: e2df50923fee + last_write_checksum: sha1:2d493960c2a43e1cb91f3096c4547b0a6d431aac + pristine_git_object: 291454eadc32441238165a07b6f3d0aac8dd4117 docs/models/outputcomputercallitem.md: id: df741eb146f4 - last_write_checksum: sha1:9475ed21af5c249108ecfe8ba23378b4d4a81832 - pristine_git_object: 5eff1434d07845ca878055a645659a2833f0af7a + last_write_checksum: sha1:82d5d5f18679ece4c25da87c5442159614574622 + pristine_git_object: ba7928d17320010abe8a6207785ff0717ea66028 deleted: true docs/models/outputcomputercallitemstatus.md: id: 54e141a5b0ce last_write_checksum: sha1:b12bb4eaaa3372bced5cb9e64473becb8bdd9eec pristine_git_object: a0f93be87b9c711762fbe845ea50c76f7a1ba04d deleted: true + docs/models/outputcomputercallitemtype.md: + id: c9de1f5a8463 + last_write_checksum: sha1:37221fda71bde8a477e7c96ae29473fe7420a08e + pristine_git_object: 50766d6a603ab44e9cfb53fab8f438169d878de3 docs/models/outputdatetimeitem.md: id: a4676f917431 last_write_checksum: sha1:de420e7bd8f01778b133753fafc2927dc525e900 @@ -2991,9 +3011,13 @@ trackedFiles: deleted: true docs/models/outputfilesearchservertoolitem.md: id: 08e51f97d609 - last_write_checksum: sha1:d4c7ae0bbe9b4d31074eb8e000ce0f62ff94216c - pristine_git_object: 8909957dbb1dc065f3bd0c97f7b6b1dc68e35182 + last_write_checksum: sha1:3aebf9711380ccfba44ad5d54e2ff4c8ec10e6a3 + pristine_git_object: 4c4716903ce69de1a3b5ff9491ee12164fa9d6c8 deleted: true + docs/models/outputfilesearchservertoolitemtype.md: + id: 9537253431fd + last_write_checksum: sha1:62c5ec23ecc86dec1a63bdfe9561eddeae07d86d + pristine_git_object: c2df51aaaa784066940745d02b12f1759c7c5b31 docs/models/outputformat.md: id: 80d5ef4c9cd5 last_write_checksum: sha1:bf3d1da7cec883391bbe86db7645d87c157e1fe5 @@ -3046,9 +3070,13 @@ trackedFiles: deleted: true docs/models/outputimagegenerationservertoolitem.md: id: 45ef89f9fb31 - last_write_checksum: sha1:1ffae52253e3660a6e7eb9f69b0d796a40560d8a - pristine_git_object: f68cedcfe3c14022cf039e224c1b8de8bb7f78a2 + last_write_checksum: sha1:7dbc04b5bc9308142e7f3392745b633a601a9d76 + pristine_git_object: 012bb77d3046bc02eb74d9a2a5bbf0a6fb79580d deleted: true + docs/models/outputimagegenerationservertoolitemtype.md: + id: 9ae5d60f0f1d + last_write_checksum: sha1:84fa9ddba0324cc5b87d6ce056a255a2ce70750d + pristine_git_object: 2940606dc1f1ad8d5f1eecd3bb84daf53198c16c docs/models/outputinputimage.md: id: cde5ba2f8cdb last_write_checksum: sha1:8a966e9832195d1add6b67ca4cbda9f22770c8a4 @@ -3064,8 +3092,8 @@ trackedFiles: pristine_git_object: 06c7d7bce3957e371abf88b72932c381684c553d docs/models/outputitems.md: id: 6942c0928d92 - last_write_checksum: sha1:5aed068c98554c822d72e414574b68ef6fd3a0c9 - pristine_git_object: 2099721fff5a55ffa7a8150c8c15506b581c3ac5 + last_write_checksum: sha1:93bd6b2547b2358f85f967348fa67bb014caf510 + pristine_git_object: 1366eafef0485e74f02a91da5fdd7dbf20882a4e deleted: true docs/models/outputlogs.md: id: ad270f2dd1a9 @@ -3074,14 +3102,22 @@ trackedFiles: deleted: true docs/models/outputmcpservertoolitem.md: id: cd168c16bdd1 - last_write_checksum: sha1:ed0ae5661b931c05c11c51d44dd591d3ae90ada8 - pristine_git_object: 182119acf506fa9d33431fff74e55b573758728c + last_write_checksum: sha1:e83b9d7cfe0dde881b9da09b28916ad9e2b0ecd2 + pristine_git_object: 2aa318685f76a6fdcd0a7d9e947e97270e082f48 deleted: true + docs/models/outputmcpservertoolitemtype.md: + id: a85112484a85 + last_write_checksum: sha1:4f50f93619d2da0b30e1eb8fdea874b442e29d51 + pristine_git_object: 282ab389cd08bfff9630f8be655736c1a7006596 docs/models/outputmemoryservertoolitem.md: id: 505fe948ff46 - last_write_checksum: sha1:fac2f7ed586c1fc290d0825a0be9876b139f4543 - pristine_git_object: c5261bbd8c9921f469465a568ee5affdfb05c355 + last_write_checksum: sha1:a9c4c29f5cf8ba21928052bcbf4abfc086b107b4 + pristine_git_object: e909bfd60b37699e29c6682f7ad93f1f15fbef4b deleted: true + docs/models/outputmemoryservertoolitemtype.md: + id: b2274e09b306 + last_write_checksum: sha1:38ab7686c44ef915e55a561df0911d4348bf320c + pristine_git_object: 64bfc139f11080eccdf0d1e6e7f0589994605268 docs/models/outputmessage.md: id: e52a5866db02 last_write_checksum: sha1:355c43bec9b422e5e2d30c1d1d48bb1a61be6b94 @@ -3230,9 +3266,13 @@ trackedFiles: deleted: true docs/models/outputsearchmodelsservertoolitem.md: id: ba182e2b6b60 - last_write_checksum: sha1:097b72051b173e1210cf499af4f854f5e95f2211 - pristine_git_object: e9af85f7e5b7b784de7cedaf0879c666cf171ef3 + last_write_checksum: sha1:0d8b4e38fd1088707c4397fd6a2c00e7ef025222 + pristine_git_object: 7967f3d8c4cfa82898cfb2bbe0972bf0327b9823 deleted: true + docs/models/outputsearchmodelsservertoolitemtype.md: + id: 70322ab7bfb1 + last_write_checksum: sha1:baa61c7a413a4d2fa4e52a73e42958ba5011a330 + pristine_git_object: 1c1da0b7a7b428b94df4b43fc30172a2630af5a4 docs/models/outputservertoolitem.md: id: bac48d21696f last_write_checksum: sha1:79b8d3c3387edb5ee597d24778df21e797c27aac @@ -3245,23 +3285,35 @@ trackedFiles: deleted: true docs/models/outputtexteditorservertoolitem.md: id: ec2973f798d5 - last_write_checksum: sha1:5d1c8becd8fbc8dd16ba35f74a37ab6a7a9dcf20 - pristine_git_object: d3b74ea772b350e9b4d029a30bec1299a55e08bc + last_write_checksum: sha1:a91c5d8039acaef99fb8275a6ea5843abbe63994 + pristine_git_object: 8daebb1d32aa112332ef8034c6bdd81fce196dec deleted: true + docs/models/outputtexteditorservertoolitemtype.md: + id: 5754046353ae + last_write_checksum: sha1:da4a57d11d0f73f317d7473d933f2969e79ed959 + pristine_git_object: 23c40b57a6369b7385c46b9f93012022898d2f88 docs/models/outputtokensdetails.md: id: 4ea91230cf2d last_write_checksum: sha1:e58beb39439aa240e55858909534036b23640af3 pristine_git_object: 7d5103ff709124192f32f744c74bb1a3ba5b2f7f docs/models/outputtoolsearchservertoolitem.md: id: e7d2599591c5 - last_write_checksum: sha1:d2072adce71a1f89aa41b464bb4f50d79d4aacb7 - pristine_git_object: 3ae5ac4c431597f386ec66c24ddda8dde920f5ef + last_write_checksum: sha1:110b2ff3bf5ae7e2f21454ac682268798c1edfe7 + pristine_git_object: a83a2bdd9b5cc910fd00154bfab30f1c7d833ba6 deleted: true + docs/models/outputtoolsearchservertoolitemtype.md: + id: 7c2467892d54 + last_write_checksum: sha1:3750e5955cd51da2168968c5828c3beeb2bd4c01 + pristine_git_object: 1eed9a9ee98da923d170ba779e011a66d6c5133d docs/models/outputwebfetchservertoolitem.md: id: 44c247302868 - last_write_checksum: sha1:6eeae930b71884576a80293a2e623aec3068050c - pristine_git_object: 77dba358e69efd7daa61e5e04429d76fd951ab7b + last_write_checksum: sha1:c6ad178e9611dca7c84b9815ea3b311ff02801c5 + pristine_git_object: ad859f28965f8310c9be76eebe4469805ae059c1 deleted: true + docs/models/outputwebfetchservertoolitemtype.md: + id: b43f7a22e846 + last_write_checksum: sha1:b3ea0da8243bfb053e9ef0a3f07458482d711a36 + pristine_git_object: 68a535e45976394f7803dcf9b07838bb7e0a36d8 docs/models/outputwebsearchcallitem.md: id: c714eb79154c last_write_checksum: sha1:f31a4c1a1b9e6d2b72f2152ccbd31893bdac19f4 @@ -4017,6 +4069,10 @@ trackedFiles: id: 98c32f09b2c8 last_write_checksum: sha1:0ab2246ff8dbb5a4b379ef7356b2b6d3fd5d8d6f pristine_git_object: 71afedd4f19f14664c959cd332da798d860e7fef + docs/models/typecodeinterpretercall.md: + id: 25ccfb4765bf + last_write_checksum: sha1:cebeb19253591b0a09e15ea165024a3c0efd2dcd + pristine_git_object: c507dc70366c9599c297085b6c0e2deb59bb6019 docs/models/typeurl.md: id: b2b253610bfa last_write_checksum: sha1:8a8edef8f989c578d2c1a6d60a3c2345723ef2d5 @@ -4047,13 +4103,13 @@ trackedFiles: deleted: true docs/models/updateworkspacerequest.md: id: 9e53386960ad - last_write_checksum: sha1:f41452079b4d1f64961c45895debf9591493a17a - pristine_git_object: 87569a5e2c157b668ce0add4d7e0c7c7c1991d3d + last_write_checksum: sha1:71dc4ebbc9542c906556f4f899f33a0a1e427fa8 + pristine_git_object: 016c61b124bbc15134ffcf9abbaf34590085bb91 deleted: true docs/models/updateworkspaceresponse.md: id: 67ed97f47308 - last_write_checksum: sha1:d073554d35fc756c7ae5795d77a013a63d015e95 - pristine_git_object: 8e80dc31d76645ebec8d86a7834fc99ca2278bac + last_write_checksum: sha1:2cd79f07889c4bee791d5c3b57eb4ec1f414f8b3 + pristine_git_object: 505c2d2dcaad4f58fc6ec3f21055481edc6d55a7 deleted: true docs/models/urlcitation.md: id: 6aea1a90dde8 @@ -4085,8 +4141,8 @@ trackedFiles: deleted: true docs/models/videogenerationrequest.md: id: 54058783eb0d - last_write_checksum: sha1:5cc4a01f6af5b578e814ace59f298bb5152161af - pristine_git_object: 124a8b643c10a7b326b58473dec512c10e96a3a7 + last_write_checksum: sha1:37eaad2faf5ed2ed62f8dabb38eea728b5e4dbc1 + pristine_git_object: c67a9d1253b58e6df8eb1f2853bfe4d24c3b8869 deleted: true docs/models/videogenerationrequestoptions.md: id: b8bc36028d6d @@ -4243,8 +4299,8 @@ trackedFiles: deleted: true docs/models/workspace.md: id: 157fdb55da03 - last_write_checksum: sha1:5f950a9b245795ff4aa094fdbedf024a48411208 - pristine_git_object: 1db3f741fbf000c6ac4776e653b578bdc527c64e + last_write_checksum: sha1:b8c80bc3e27d936be259a698d871f603e7595909 + pristine_git_object: fae0b1d55b37175cc58c65b7207fa3375b7798c9 deleted: true docs/models/workspacemember.md: id: 74015b802170 @@ -4351,12 +4407,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:9cf1b335c4fe27ca4ed5da9228446c092177aeb0 - pristine_git_object: fcef6efc5532abefada4d75ddbda45e6a6532ee3 + last_write_checksum: sha1:958ae2eaac02e5a3768677faf1c2e91b5c76e1a8 + pristine_git_object: 85c8dc76ed22ab4855dff0ef4f47742462cbdb34 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:07d757c451658202a63feba69a922fa25af878f2 - pristine_git_object: 0824c86da35416531e00ee7eae7c8c58d30e78ed + last_write_checksum: sha1:a1028f17d1b55a3bd7e83072978b5c4aa8b70811 + pristine_git_object: b4e769cc513fdfd6e754793b83cbb454d32079ea src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -4579,8 +4635,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:425f38743fb45a1fcb26d7c99250344dba898d7e - pristine_git_object: c33889d27811433524414c2a2ecd816d9e8d6dc5 + last_write_checksum: sha1:83db66e65330ea0025dd55ce1d4f280e02c125f0 + pristine_git_object: 337df45adf2920a545b838b8049e13c9ea41bac1 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -4947,8 +5003,8 @@ trackedFiles: pristine_git_object: 2329ce81235843e4ec07d364e5967c5d9ace6a37 src/models/createworkspacerequest.ts: id: 729716a42b74 - last_write_checksum: sha1:22dffd520ba8e36fc92e680a4cb70db2ea987199 - pristine_git_object: 51542076b5c66520cecf14d6563e944ecd96336e + last_write_checksum: sha1:23da0055088bd45040df6c5005d1f840ea44d4c7 + pristine_git_object: 587acc357f7e2882d771efa13ad637db7829063b src/models/createworkspaceresponse.ts: id: 8cdd42874330 last_write_checksum: sha1:c10631db57525e1b63530cefe2e73f450f6ea97d @@ -5143,8 +5199,8 @@ trackedFiles: pristine_git_object: fb1950525224243627836ce1a03eae69c4503027 src/models/generationresponse.ts: id: f9109ae06502 - last_write_checksum: sha1:4d54c6f9bde1940ad2b66108f929ac6d7d645540 - pristine_git_object: c2579644cf2f52697c92c18426c838225c07b99b + last_write_checksum: sha1:b004e9d6e4e5604c4dedd92a95e1be0fffb46a1f + pristine_git_object: b6f974dfa2e0b4d4ff425cc75cf416b96015879a src/models/getguardrailresponse.ts: id: 3103b978871a last_write_checksum: sha1:5ddb4118f2be61504caa75a7c83e3af7f0725b91 @@ -5231,8 +5287,8 @@ trackedFiles: pristine_git_object: a92bcc401c21e9213243e53629ccd4e673a94c12 src/models/inputsunion.ts: id: 3aff2165a17d - last_write_checksum: sha1:8d90aa5ea2241c462a27e6849c67a7a0c252130d - pristine_git_object: ebb73f69046918db39d6f479c3d8997de3b6d05b + last_write_checksum: sha1:47fef8641498366f19f7260cc0842023df7f84d6 + pristine_git_object: c9602cf4c967f3b3cd3c1467015fa7b6f3e90bb6 src/models/inputtext.ts: id: 8d6c10a240ae last_write_checksum: sha1:368790d7e5c0a376ec8d09c9a6fa8008e48228be @@ -5571,28 +5627,28 @@ trackedFiles: pristine_git_object: 83e9ddc2f1a627e2875fb531b43454d6275731fc src/models/outputapplypatchservertoolitem.ts: id: "761046712899" - last_write_checksum: sha1:cbfb5018f1efdd5ac95517a06dfddf7beee9ca09 - pristine_git_object: 78c82a6417dcd490599e8765ab8a74567ac4d4a9 + last_write_checksum: sha1:664c6a26d26dd742b80ad1ea1877cf2cf49b41f6 + pristine_git_object: ef9170246f8d63f7274eb2a877ada77010500474 src/models/outputbashservertoolitem.ts: id: 8eeee25f4818 - last_write_checksum: sha1:367d30dd01ff18673cbe5c4241fa788726cc2986 - pristine_git_object: 321efdaccdb0ac9ffad478860bc1241af07a4589 + last_write_checksum: sha1:b8a410a917678034b094fd82d3012d0250ad344f + pristine_git_object: 4697912ec6e4684cc74a9563bf995032b57d858c src/models/outputbrowseruseservertoolitem.ts: id: 5ad5586d0533 - last_write_checksum: sha1:851ffbdc43ce41328690038e9bf520ca288fa66f - pristine_git_object: 7528c6ac85c0b24e53e62f921f4d627aea9967d1 + last_write_checksum: sha1:44a6fd6d9a1a498889ae75a1b67330386bcaa636 + pristine_git_object: a7bdb03c8b4d6e8323d65a08655649f68ff48c52 src/models/outputcodeinterpretercallitem.ts: id: ee080e2eccae - last_write_checksum: sha1:d66da226998b9796842f677a7b0a0c2711b3078d - pristine_git_object: 0d62c987d574941ea5a25c8a7cb44c09ebefa1f8 + last_write_checksum: sha1:19627378a5026e0e899c4d183f1b2c6d2a136fc6 + pristine_git_object: 8273fa4c4abf289eb15afb2a5a7535c0bb5bb191 src/models/outputcodeinterpreterservertoolitem.ts: id: 16f87f6046c4 - last_write_checksum: sha1:eb5f79f2c1da140f96b1d740096c93ce681de3e9 - pristine_git_object: 26cce532250f523d5dd7d9538bf15382a671ba9d + last_write_checksum: sha1:9e962c22c0af585d75314aad0c1b62386389d434 + pristine_git_object: 07d2520d2f2a64c029084debe2c2a519dea6e5d3 src/models/outputcomputercallitem.ts: id: fd4439fdf358 - last_write_checksum: sha1:e3b6fd5e5e83b1cdf63b2b9636a5c4055ede8e57 - pristine_git_object: 7116d303e2221060f73b9a501d32230c062c29c0 + last_write_checksum: sha1:86ce4a08f670a94e51a321363a1479c43c076de1 + pristine_git_object: 7801e652c8fe5705ac5c6f78930ad044ebc24864 src/models/outputdatetimeitem.ts: id: 0c1828e72f98 last_write_checksum: sha1:86f98e5eb24990beb4283eba0d2ff0a12c7048b8 @@ -5603,8 +5659,8 @@ trackedFiles: pristine_git_object: 94f27e36c0566c6701724862bfe86003da60b5de src/models/outputfilesearchservertoolitem.ts: id: 3e5afbd64572 - last_write_checksum: sha1:93a957a8b709ef297507490c8f4b7f56c3452525 - pristine_git_object: 8c26b44e0a20c349681289d2ea7641f147527425 + last_write_checksum: sha1:506aadab979e68783da8a508bd9debb958854f26 + pristine_git_object: 52af35d5c4a5f110b7e29b4dc5980719c46eec8b src/models/outputfunctioncallitem.ts: id: 9c462e9ff54b last_write_checksum: sha1:6ad8504c7d7d5053e90a047c81965c1b5d8cbf25 @@ -5615,24 +5671,24 @@ trackedFiles: pristine_git_object: 2585593597d447cca0e080c517bc6808cc4dfb86 src/models/outputimagegenerationservertoolitem.ts: id: 1ea34f16eb56 - last_write_checksum: sha1:03fc11bea14d090617407403b8f55b3994867bba - pristine_git_object: 364a3df37055e512b89509c6af6c1fd689a72203 + last_write_checksum: sha1:fe1653f9c06a29063c43ec5b904991f7b144ff1c + pristine_git_object: 6538694bc179eadee53f054e76d1921b22a82b71 src/models/outputitemimagegenerationcall.ts: id: 9c3ac6a7a9ad last_write_checksum: sha1:a8471974e8e53999ae94955b7a3227423d637389 pristine_git_object: a13c08e43b6203a68e0a4678aa397ba2c2c7be6b src/models/outputitems.ts: id: 0d7161b3403e - last_write_checksum: sha1:95164317154a805d8469353e698a2d8942b8377f - pristine_git_object: 18f055598d9b036100b7f129ee7a149d7ffd404d + last_write_checksum: sha1:23abeb9589b22f5d9816335a5b6896a3b6c89a3f + pristine_git_object: 5f55406cae2640516b45e6cc5e2f7bd47f925238 src/models/outputmcpservertoolitem.ts: id: dd859086c9c7 - last_write_checksum: sha1:e7c601b7fb0ea41583e56fcb283c748021ca1e17 - pristine_git_object: 8d098a691f603a002b16177f6cf063a03f9d9b27 + last_write_checksum: sha1:9d24cb7ae62bb66e44869e2339f37444f34f12f0 + pristine_git_object: baeb25fc0174fe421b98da6ff0aae1a1279705db src/models/outputmemoryservertoolitem.ts: id: 2fb051c8b4e9 - last_write_checksum: sha1:8077a749646f1827e86f672ae3026a9a6f686fa6 - pristine_git_object: 84bed06d7ce673b00cf952d04c65d4c59acc324e + last_write_checksum: sha1:95d184f922c207779f65a79a02d995031a3f040a + pristine_git_object: 04abb2d33dbfe78dbb875b65953923102f141f18 src/models/outputmessage.ts: id: fa128cf87d51 last_write_checksum: sha1:9b1ef41364b1c06967c778d1e3dfb02c457aa849 @@ -5655,20 +5711,20 @@ trackedFiles: pristine_git_object: 17360bd197c4aa7e13c5c49f71b6de8d70bc12b2 src/models/outputsearchmodelsservertoolitem.ts: id: e7518c133cf6 - last_write_checksum: sha1:74682e114bb70c43eccf618c3fe551d73094bb36 - pristine_git_object: 30539e4c60490c5dedbd544480eb5ca9ca2bf1cd + last_write_checksum: sha1:5eb8f0a7e8a2feb1c715bec8f85b5135e63c915a + pristine_git_object: 1956550de211c54e5e6c1ab3fb19bc1bd99eb611 src/models/outputtexteditorservertoolitem.ts: id: 6c55837a703d - last_write_checksum: sha1:a3653ceec6678f92048e0e2aecba8a8e4c9d7339 - pristine_git_object: 76ea68e64985c5e8374d82fbe3b2b679180d0513 + last_write_checksum: sha1:cf4f1da9c088c8b67a5f873ea964867a2d00a35e + pristine_git_object: 269cd84f0c08cb2f4ab9858beb23715ac365d51b src/models/outputtoolsearchservertoolitem.ts: id: 54b4dacceeab - last_write_checksum: sha1:1d2e42e32e85fff8e8c15613c48de143763e7be3 - pristine_git_object: b4b97495d5c2634dcda5cd5cae863eacec8f75c3 + last_write_checksum: sha1:a1f35c1ddd3e5a2938952d458340facfbc36192b + pristine_git_object: 7cf68351e1081f61ca3553f73fa585b7c01f6aae src/models/outputwebfetchservertoolitem.ts: id: a28b106c9b49 - last_write_checksum: sha1:f8382ddf951ef5d1fe1856afbae31cec21c2775d - pristine_git_object: d93936e84d52921b3ad593318aab5bf8bd2fd9a5 + last_write_checksum: sha1:04c8235f19e232e87b1aaafbce0995322f7ee571 + pristine_git_object: bf11567d287b5de409b78e02266df793f9d80f23 src/models/outputwebsearchcallitem.ts: id: b4585d176186 last_write_checksum: sha1:5e08681051cbaf2ff67aa56926a2d848fddad8e8 @@ -5991,8 +6047,8 @@ trackedFiles: pristine_git_object: 62e472e9b880f14ff6a0433cd58068fead471355 src/models/updateworkspacerequest.ts: id: 84dd4f01b245 - last_write_checksum: sha1:ce1f27fd039ecb6275a5d73547432a718903ce48 - pristine_git_object: 013de86d89e04f1a8d612cd47b9b9d4d8a08f2a4 + last_write_checksum: sha1:3ef9799afb9ecd8a9834d1c2cda4b5c0accd406c + pristine_git_object: a5317e26e40861791a946e0c0973ca7adf196387 src/models/updateworkspaceresponse.ts: id: 5b6906dad2d6 last_write_checksum: sha1:d0e28032bcdb9b0bd4ceeeca4874b0a764561d6b @@ -6007,8 +6063,8 @@ trackedFiles: pristine_git_object: 246439b394b1b8415fb2c080d6a75b8b0c0e749d src/models/videogenerationrequest.ts: id: e72ea2e4c5b3 - last_write_checksum: sha1:429417b06115e7ed90864f98fc8d62c7d543541c - pristine_git_object: ad30399528b0d974aab08ca313c147cabef6f33f + last_write_checksum: sha1:19527ea792cd314289e8476565535e62c07d3d3b + pristine_git_object: be5b7dc1e5e87ae80f058a364ad76afec2a11d97 src/models/videogenerationresponse.ts: id: 0a96c6ee9eea last_write_checksum: sha1:73c631114adc4f4076585919439c06126aa6d55f @@ -6095,8 +6151,8 @@ trackedFiles: pristine_git_object: 083fd5620b151609ce5bc61705d8aa7456506981 src/models/workspace.ts: id: f3a6e662c47b - last_write_checksum: sha1:a66e89e9cfb2edebda48cbfc3684dd95fe3aac2f - pristine_git_object: 45c8a8b5ecdddff2d81b795b72559807dd98535a + last_write_checksum: sha1:ca8783eba8f2af4c546f2f2051d7507da8bc4c42 + pristine_git_object: 935c4c5abcab3973913fae7ba219e44cafe7a32b src/models/workspacemember.ts: id: 42cb4568aa7e last_write_checksum: sha1:5c1e899aafe361dc9b6c6fe23f3550c360f01be0 @@ -6915,7 +6971,7 @@ examples: speakeasy-default-list-workspaces: responses: "200": - application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}], "total_count": 1} + application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}], "total_count": 1} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": @@ -6926,7 +6982,7 @@ examples: application/json: {"name": "Production", "slug": "production"} responses: "201": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": null}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": null}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -6960,7 +7016,7 @@ examples: id: "production" responses: "200": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -6976,7 +7032,7 @@ examples: application/json: {} responses: "200": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Updated Workspace", "slug": "updated-workspace", "updated_at": "2025-08-25T10:00:00Z"}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Updated Workspace", "slug": "updated-workspace", "updated_at": "2025-08-25T10:00:00Z"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -7055,4 +7111,3 @@ examples: "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.embeddings.listModels()`: `response.data[].architecture.outputModalities[]` **Changed** (Breaking ⚠️)\n* `openrouter.endpoints.list()`: `response.data` **Changed** (Breaking ⚠️)\n* `openrouter.models.list()`: `response.data[].architecture.outputModalities[]` **Changed** (Breaking ⚠️)\n* `openrouter.models.listForUser()`: `response.data[].architecture.outputModalities[]` **Changed** (Breaking ⚠️)\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.provider.options.nexAgi` **Added**\n* `openrouter.chat.send()`: \n * `request.chatRequest.provider.ignore[].union(ProviderName).enum(nexAgi)` **Added**\n* `openrouter.embeddings.generate()`: \n * `request.requestBody.provider.ignore[].union(ProviderName).enum(nexAgi)` **Added**\n* `openrouter.endpoints.listZdrEndpoints()`: `response.data[].providerName.enum(nexAgi)` **Added**\n* `openrouter.generations.getGeneration()`: `response.data.providerResponses[].providerName.enum(nexAgi)` **Added**\n* `openrouter.rerank.rerank()`: \n * `request.requestBody.provider.ignore[].union(ProviderName).enum(nexAgi)` **Added**\n* `openrouter.beta.responses.send()`: \n * `request.responsesRequest.provider.ignore[].union(ProviderName).enum(nexAgi)` **Added**\n* `openrouter.videoGeneration.generate()`: \n * `request.videoGenerationRequest.provider.options.nexAgi` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 63e0162d..af832580 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true typescript: - version: 0.12.20 + version: 0.12.21 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index ae036d7c..64d237cf 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -5070,6 +5070,18 @@ components: maxLength: 500 nullable: true type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1) + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled example: true @@ -5109,6 +5121,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -6044,6 +6058,10 @@ components: example: req-1727282430-aBcDeFgHiJkLmNoPqRsT nullable: true type: string + response_cache_source_id: + description: If this generation was served from response cache, contains the original generation ID. Null otherwise. + nullable: true + type: string router: description: Router used for the request (e.g., openrouter/auto) example: openrouter/auto @@ -6178,6 +6196,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -6792,8 +6812,22 @@ components: - $ref: '#/components/schemas/OutputWebSearchCallItem' - $ref: '#/components/schemas/OutputFileSearchCallItem' - $ref: '#/components/schemas/OutputImageGenerationCallItem' + - $ref: '#/components/schemas/OutputCodeInterpreterCallItem' + - $ref: '#/components/schemas/OutputComputerCallItem' - $ref: '#/components/schemas/OutputDatetimeItem' - $ref: '#/components/schemas/OutputWebSearchServerToolItem' + - $ref: '#/components/schemas/OutputCodeInterpreterServerToolItem' + - $ref: '#/components/schemas/OutputFileSearchServerToolItem' + - $ref: '#/components/schemas/OutputImageGenerationServerToolItem' + - $ref: '#/components/schemas/OutputBrowserUseServerToolItem' + - $ref: '#/components/schemas/OutputBashServerToolItem' + - $ref: '#/components/schemas/OutputTextEditorServerToolItem' + - $ref: '#/components/schemas/OutputApplyPatchServerToolItem' + - $ref: '#/components/schemas/OutputWebFetchServerToolItem' + - $ref: '#/components/schemas/OutputToolSearchServerToolItem' + - $ref: '#/components/schemas/OutputMemoryServerToolItem' + - $ref: '#/components/schemas/OutputMcpServerToolItem' + - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' type: array description: Input for a response request - can be a string or array of items example: @@ -7201,6 +7235,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -13488,6 +13524,18 @@ components: maxLength: 500 nullable: true type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1) + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled example: true @@ -13524,6 +13572,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -13629,6 +13679,13 @@ components: - '9:21' example: '16:9' type: string + callback_url: + description: >- + URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level + default callback URL if set. Must be HTTPS. + example: https://example.com/webhook + format: uri + type: string duration: description: Duration of the generated video in seconds example: 8 @@ -14721,6 +14778,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -14762,6 +14821,18 @@ components: example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging. Null means all keys are logged. + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled for this workspace example: true @@ -14798,6 +14869,8 @@ components: - is_observability_io_logging_enabled - is_observability_broadcast_enabled - is_data_discount_logging_enabled + - io_logging_sampling_rate + - io_logging_api_key_ids - created_at - updated_at - created_by @@ -21077,6 +21150,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21153,6 +21228,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21311,6 +21388,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21391,6 +21470,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 8b70039b..0765b2cb 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -5113,6 +5113,18 @@ components: maxLength: 500 nullable: true type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1) + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled example: true @@ -5152,6 +5164,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -6092,6 +6106,10 @@ components: example: req-1727282430-aBcDeFgHiJkLmNoPqRsT nullable: true type: string + response_cache_source_id: + description: If this generation was served from response cache, contains the original generation ID. Null otherwise. + nullable: true + type: string router: description: Router used for the request (e.g., openrouter/auto) example: openrouter/auto @@ -6226,6 +6244,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -6849,8 +6869,22 @@ components: - $ref: '#/components/schemas/OutputWebSearchCallItem' - $ref: '#/components/schemas/OutputFileSearchCallItem' - $ref: '#/components/schemas/OutputImageGenerationCallItem' + - $ref: '#/components/schemas/OutputCodeInterpreterCallItem' + - $ref: '#/components/schemas/OutputComputerCallItem' - $ref: '#/components/schemas/OutputDatetimeItem' - $ref: '#/components/schemas/OutputWebSearchServerToolItem' + - $ref: '#/components/schemas/OutputCodeInterpreterServerToolItem' + - $ref: '#/components/schemas/OutputFileSearchServerToolItem' + - $ref: '#/components/schemas/OutputImageGenerationServerToolItem' + - $ref: '#/components/schemas/OutputBrowserUseServerToolItem' + - $ref: '#/components/schemas/OutputBashServerToolItem' + - $ref: '#/components/schemas/OutputTextEditorServerToolItem' + - $ref: '#/components/schemas/OutputApplyPatchServerToolItem' + - $ref: '#/components/schemas/OutputWebFetchServerToolItem' + - $ref: '#/components/schemas/OutputToolSearchServerToolItem' + - $ref: '#/components/schemas/OutputMemoryServerToolItem' + - $ref: '#/components/schemas/OutputMcpServerToolItem' + - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' type: array description: Input for a response request - can be a string or array of items example: @@ -7258,6 +7292,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -13539,6 +13575,18 @@ components: maxLength: 500 nullable: true type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1) + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled example: true @@ -13575,6 +13623,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -13681,6 +13731,12 @@ components: example: '16:9' type: string x-speakeasy-unknown-values: allow + callback_url: + description: >- + URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. + example: https://example.com/webhook + format: uri + type: string duration: description: Duration of the generated video in seconds example: 8 @@ -14765,6 +14821,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -14806,6 +14864,18 @@ components: example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging. Null means all keys are logged. + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled for this workspace example: true @@ -14842,6 +14912,8 @@ components: - is_observability_io_logging_enabled - is_observability_broadcast_enabled - is_data_discount_logging_enabled + - io_logging_sampling_rate + - io_logging_api_key_ids - created_at - updated_at - created_by @@ -21214,6 +21286,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21289,6 +21363,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21450,6 +21526,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21529,6 +21607,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index a93a3c96..9e4f33c5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,19 +2,20 @@ speakeasyVersion: 1.761.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:238a810a96f603a870271b245cefa92c86718ed238e6a421c0f3a9fb9b7f872e - sourceBlobDigest: sha256:bd8617356139aa1ff7859cc0fbb68213c0af6c3bc38e89d31d23ab994c74c199 + sourceRevisionDigest: sha256:734e478fb53850f730feb06ce894eadc42f2f1ca2e257459e3eec5c813bf1449 + sourceBlobDigest: sha256:1d44d1ea75985fd4f069fe3c5ef9c89edb88f7589e6a942f84f2f6d00ace55bb tags: - latest + - sdk-bot-openapi-update-20260423-162652 - 1.0.0 targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:238a810a96f603a870271b245cefa92c86718ed238e6a421c0f3a9fb9b7f872e - sourceBlobDigest: sha256:bd8617356139aa1ff7859cc0fbb68213c0af6c3bc38e89d31d23ab994c74c199 + sourceRevisionDigest: sha256:734e478fb53850f730feb06ce894eadc42f2f1ca2e257459e3eec5c813bf1449 + sourceBlobDigest: sha256:1d44d1ea75985fd4f069fe3c5ef9c89edb88f7589e6a942f84f2f6d00ace55bb codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:2b855deeaf408a7d4820e29f0511f4728120347ed0cfe531871d9a942bd06e80 + codeSamplesRevisionDigest: sha256:262f8ef990365f95690e9a013df7f78e866b07956dbff91aa8ac47c039ca0d48 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.761.0 diff --git a/jsr.json b/jsr.json index fcef6efc..85c8dc76 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.12.20", + "version": "0.12.21", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 04105939..52924e43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.12.20", + "version": "0.12.21", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.", "keywords": [ @@ -69,15 +69,15 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc", "prepublishOnly": "npm run build", - "test:transit": "exit 0", "compile": "tsc", "postinstall": "node scripts/check-types.js || true", - "prepare": "npm run build", "test": "vitest --run --project unit", + "prepare": "npm run build", + "test:e2e": "vitest --run --project e2e", + "test:transit": "exit 0", "test:watch": "vitest --watch --project unit", "typecheck": "tsc --noEmit", - "typecheck:transit": "exit 0", - "test:e2e": "vitest --run --project e2e" + "typecheck:transit": "exit 0" }, "peerDependencies": {}, "devDependencies": { diff --git a/src/lib/config.ts b/src/lib/config.ts index c33889d2..337df45a 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -75,7 +75,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.12.20", + sdkVersion: "0.12.21", genVersion: "2.879.1", - userAgent: "speakeasy-sdk/typescript 0.12.20 2.879.1 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.12.21 2.879.1 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/createworkspacerequest.ts b/src/models/createworkspacerequest.ts index 51542076..587acc35 100644 --- a/src/models/createworkspacerequest.ts +++ b/src/models/createworkspacerequest.ts @@ -23,6 +23,14 @@ export type CreateWorkspaceRequest = { * Description of the workspace */ description?: string | null | undefined; + /** + * Optional array of API key IDs to filter I/O logging + */ + ioLoggingApiKeyIds?: Array | null | undefined; + /** + * Sampling rate for I/O logging (0.0001-1) + */ + ioLoggingSamplingRate?: number | undefined; /** * Whether data discount logging is enabled */ @@ -51,6 +59,8 @@ export type CreateWorkspaceRequest$Outbound = { default_provider_sort?: string | null | undefined; default_text_model?: string | null | undefined; description?: string | null | undefined; + io_logging_api_key_ids?: Array | null | undefined; + io_logging_sampling_rate?: number | undefined; is_data_discount_logging_enabled?: boolean | undefined; is_observability_broadcast_enabled?: boolean | undefined; is_observability_io_logging_enabled?: boolean | undefined; @@ -67,6 +77,8 @@ export const CreateWorkspaceRequest$outboundSchema: z.ZodType< defaultProviderSort: z.nullable(z.string()).optional(), defaultTextModel: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), + ioLoggingApiKeyIds: z.nullable(z.array(z.int())).optional(), + ioLoggingSamplingRate: z.number().optional(), isDataDiscountLoggingEnabled: z.boolean().optional(), isObservabilityBroadcastEnabled: z.boolean().optional(), isObservabilityIoLoggingEnabled: z.boolean().optional(), @@ -77,6 +89,8 @@ export const CreateWorkspaceRequest$outboundSchema: z.ZodType< defaultImageModel: "default_image_model", defaultProviderSort: "default_provider_sort", defaultTextModel: "default_text_model", + ioLoggingApiKeyIds: "io_logging_api_key_ids", + ioLoggingSamplingRate: "io_logging_sampling_rate", isDataDiscountLoggingEnabled: "is_data_discount_logging_enabled", isObservabilityBroadcastEnabled: "is_observability_broadcast_enabled", isObservabilityIoLoggingEnabled: "is_observability_io_logging_enabled", diff --git a/src/models/generationresponse.ts b/src/models/generationresponse.ts index c2579644..b6f974df 100644 --- a/src/models/generationresponse.ts +++ b/src/models/generationresponse.ts @@ -150,6 +150,10 @@ export type GenerationResponseData = { * Unique identifier grouping all generations from a single API request */ requestId?: string | null | undefined; + /** + * If this generation was served from response cache, contains the original generation ID. Null otherwise. + */ + responseCacheSourceId?: string | null | undefined; /** * Router used for the request (e.g., openrouter/auto) */ @@ -244,6 +248,7 @@ export const GenerationResponseData$inboundSchema: z.ZodType< provider_name: z.nullable(z.string()), provider_responses: z.nullable(z.array(ProviderResponse$inboundSchema)), request_id: z.nullable(z.string()).optional(), + response_cache_source_id: z.nullable(z.string()).optional(), router: z.nullable(z.string()), session_id: z.nullable(z.string()).optional(), streamed: z.nullable(z.boolean()), @@ -281,6 +286,7 @@ export const GenerationResponseData$inboundSchema: z.ZodType< "provider_name": "providerName", "provider_responses": "providerResponses", "request_id": "requestId", + "response_cache_source_id": "responseCacheSourceId", "session_id": "sessionId", "tokens_completion": "tokensCompletion", "tokens_prompt": "tokensPrompt", diff --git a/src/models/inputsunion.ts b/src/models/inputsunion.ts index ebb73f69..c9602cf4 100644 --- a/src/models/inputsunion.ts +++ b/src/models/inputsunion.ts @@ -31,6 +31,36 @@ import { OpenAIResponsesRefusalContent$Outbound, OpenAIResponsesRefusalContent$outboundSchema, } from "./openairesponsesrefusalcontent.js"; +import { + OutputApplyPatchServerToolItem, + OutputApplyPatchServerToolItem$Outbound, + OutputApplyPatchServerToolItem$outboundSchema, +} from "./outputapplypatchservertoolitem.js"; +import { + OutputBashServerToolItem, + OutputBashServerToolItem$Outbound, + OutputBashServerToolItem$outboundSchema, +} from "./outputbashservertoolitem.js"; +import { + OutputBrowserUseServerToolItem, + OutputBrowserUseServerToolItem$Outbound, + OutputBrowserUseServerToolItem$outboundSchema, +} from "./outputbrowseruseservertoolitem.js"; +import { + OutputCodeInterpreterCallItem, + OutputCodeInterpreterCallItem$Outbound, + OutputCodeInterpreterCallItem$outboundSchema, +} from "./outputcodeinterpretercallitem.js"; +import { + OutputCodeInterpreterServerToolItem, + OutputCodeInterpreterServerToolItem$Outbound, + OutputCodeInterpreterServerToolItem$outboundSchema, +} from "./outputcodeinterpreterservertoolitem.js"; +import { + OutputComputerCallItem, + OutputComputerCallItem$Outbound, + OutputComputerCallItem$outboundSchema, +} from "./outputcomputercallitem.js"; import { OutputDatetimeItem, OutputDatetimeItem$Outbound, @@ -41,6 +71,11 @@ import { OutputFileSearchCallItem$Outbound, OutputFileSearchCallItem$outboundSchema, } from "./outputfilesearchcallitem.js"; +import { + OutputFileSearchServerToolItem, + OutputFileSearchServerToolItem$Outbound, + OutputFileSearchServerToolItem$outboundSchema, +} from "./outputfilesearchservertoolitem.js"; import { OutputFunctionCallItem, OutputFunctionCallItem$Outbound, @@ -51,6 +86,41 @@ import { OutputImageGenerationCallItem$Outbound, OutputImageGenerationCallItem$outboundSchema, } from "./outputimagegenerationcallitem.js"; +import { + OutputImageGenerationServerToolItem, + OutputImageGenerationServerToolItem$Outbound, + OutputImageGenerationServerToolItem$outboundSchema, +} from "./outputimagegenerationservertoolitem.js"; +import { + OutputMcpServerToolItem, + OutputMcpServerToolItem$Outbound, + OutputMcpServerToolItem$outboundSchema, +} from "./outputmcpservertoolitem.js"; +import { + OutputMemoryServerToolItem, + OutputMemoryServerToolItem$Outbound, + OutputMemoryServerToolItem$outboundSchema, +} from "./outputmemoryservertoolitem.js"; +import { + OutputSearchModelsServerToolItem, + OutputSearchModelsServerToolItem$Outbound, + OutputSearchModelsServerToolItem$outboundSchema, +} from "./outputsearchmodelsservertoolitem.js"; +import { + OutputTextEditorServerToolItem, + OutputTextEditorServerToolItem$Outbound, + OutputTextEditorServerToolItem$outboundSchema, +} from "./outputtexteditorservertoolitem.js"; +import { + OutputToolSearchServerToolItem, + OutputToolSearchServerToolItem$Outbound, + OutputToolSearchServerToolItem$outboundSchema, +} from "./outputtoolsearchservertoolitem.js"; +import { + OutputWebFetchServerToolItem, + OutputWebFetchServerToolItem$Outbound, + OutputWebFetchServerToolItem$outboundSchema, +} from "./outputwebfetchservertoolitem.js"; import { OutputWebSearchCallItem, OutputWebSearchCallItem$Outbound, @@ -224,17 +294,31 @@ export type InputsMessage = { }; export type InputsUnion1 = + | OutputCodeInterpreterCallItem | FunctionCallItem | InputsMessage | OutputFunctionCallItem | OutputWebSearchCallItem | OutputFileSearchCallItem + | OutputComputerCallItem | OutputDatetimeItem | ReasoningItem | FunctionCallOutputItem | InputsReasoning | OutputImageGenerationCallItem | OutputWebSearchServerToolItem + | OutputCodeInterpreterServerToolItem + | OutputFileSearchServerToolItem + | OutputImageGenerationServerToolItem + | OutputBrowserUseServerToolItem + | OutputBashServerToolItem + | OutputTextEditorServerToolItem + | OutputApplyPatchServerToolItem + | OutputWebFetchServerToolItem + | OutputToolSearchServerToolItem + | OutputMemoryServerToolItem + | OutputMcpServerToolItem + | OutputSearchModelsServerToolItem | EasyInputMessage | InputMessageItem; @@ -244,17 +328,31 @@ export type InputsUnion1 = export type InputsUnion = | string | Array< + | OutputCodeInterpreterCallItem | FunctionCallItem | InputsMessage | OutputFunctionCallItem | OutputWebSearchCallItem | OutputFileSearchCallItem + | OutputComputerCallItem | OutputDatetimeItem | ReasoningItem | FunctionCallOutputItem | InputsReasoning | OutputImageGenerationCallItem | OutputWebSearchServerToolItem + | OutputCodeInterpreterServerToolItem + | OutputFileSearchServerToolItem + | OutputImageGenerationServerToolItem + | OutputBrowserUseServerToolItem + | OutputBashServerToolItem + | OutputTextEditorServerToolItem + | OutputApplyPatchServerToolItem + | OutputWebFetchServerToolItem + | OutputToolSearchServerToolItem + | OutputMemoryServerToolItem + | OutputMcpServerToolItem + | OutputSearchModelsServerToolItem | EasyInputMessage | InputMessageItem >; @@ -517,17 +615,31 @@ export function inputsMessageToJSON(inputsMessage: InputsMessage): string { /** @internal */ export type InputsUnion1$Outbound = + | OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputWebSearchCallItem$Outbound | OutputFileSearchCallItem$Outbound + | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | InputsReasoning$Outbound | OutputImageGenerationCallItem$Outbound | OutputWebSearchServerToolItem$Outbound + | OutputCodeInterpreterServerToolItem$Outbound + | OutputFileSearchServerToolItem$Outbound + | OutputImageGenerationServerToolItem$Outbound + | OutputBrowserUseServerToolItem$Outbound + | OutputBashServerToolItem$Outbound + | OutputTextEditorServerToolItem$Outbound + | OutputApplyPatchServerToolItem$Outbound + | OutputWebFetchServerToolItem$Outbound + | OutputToolSearchServerToolItem$Outbound + | OutputMemoryServerToolItem$Outbound + | OutputMcpServerToolItem$Outbound + | OutputSearchModelsServerToolItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound; @@ -536,17 +648,31 @@ export const InputsUnion1$outboundSchema: z.ZodType< InputsUnion1$Outbound, InputsUnion1 > = z.union([ + OutputCodeInterpreterCallItem$outboundSchema, FunctionCallItem$outboundSchema, z.lazy(() => InputsMessage$outboundSchema), OutputFunctionCallItem$outboundSchema, OutputWebSearchCallItem$outboundSchema, OutputFileSearchCallItem$outboundSchema, + OutputComputerCallItem$outboundSchema, OutputDatetimeItem$outboundSchema, ReasoningItem$outboundSchema, FunctionCallOutputItem$outboundSchema, z.lazy(() => InputsReasoning$outboundSchema), OutputImageGenerationCallItem$outboundSchema, OutputWebSearchServerToolItem$outboundSchema, + OutputCodeInterpreterServerToolItem$outboundSchema, + OutputFileSearchServerToolItem$outboundSchema, + OutputImageGenerationServerToolItem$outboundSchema, + OutputBrowserUseServerToolItem$outboundSchema, + OutputBashServerToolItem$outboundSchema, + OutputTextEditorServerToolItem$outboundSchema, + OutputApplyPatchServerToolItem$outboundSchema, + OutputWebFetchServerToolItem$outboundSchema, + OutputToolSearchServerToolItem$outboundSchema, + OutputMemoryServerToolItem$outboundSchema, + OutputMcpServerToolItem$outboundSchema, + OutputSearchModelsServerToolItem$outboundSchema, EasyInputMessage$outboundSchema, InputMessageItem$outboundSchema, ]); @@ -559,17 +685,31 @@ export function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string { export type InputsUnion$Outbound = | string | Array< + | OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputWebSearchCallItem$Outbound | OutputFileSearchCallItem$Outbound + | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | InputsReasoning$Outbound | OutputImageGenerationCallItem$Outbound | OutputWebSearchServerToolItem$Outbound + | OutputCodeInterpreterServerToolItem$Outbound + | OutputFileSearchServerToolItem$Outbound + | OutputImageGenerationServerToolItem$Outbound + | OutputBrowserUseServerToolItem$Outbound + | OutputBashServerToolItem$Outbound + | OutputTextEditorServerToolItem$Outbound + | OutputApplyPatchServerToolItem$Outbound + | OutputWebFetchServerToolItem$Outbound + | OutputToolSearchServerToolItem$Outbound + | OutputMemoryServerToolItem$Outbound + | OutputMcpServerToolItem$Outbound + | OutputSearchModelsServerToolItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound >; @@ -580,21 +720,37 @@ export const InputsUnion$outboundSchema: z.ZodType< InputsUnion > = z.union([ z.string(), - z.array(z.union([ - FunctionCallItem$outboundSchema, - z.lazy(() => InputsMessage$outboundSchema), - OutputFunctionCallItem$outboundSchema, - OutputWebSearchCallItem$outboundSchema, - OutputFileSearchCallItem$outboundSchema, - OutputDatetimeItem$outboundSchema, - ReasoningItem$outboundSchema, - FunctionCallOutputItem$outboundSchema, - z.lazy(() => InputsReasoning$outboundSchema), - OutputImageGenerationCallItem$outboundSchema, - OutputWebSearchServerToolItem$outboundSchema, - EasyInputMessage$outboundSchema, - InputMessageItem$outboundSchema, - ])), + z.array( + z.union([ + OutputCodeInterpreterCallItem$outboundSchema, + FunctionCallItem$outboundSchema, + z.lazy(() => InputsMessage$outboundSchema), + OutputFunctionCallItem$outboundSchema, + OutputWebSearchCallItem$outboundSchema, + OutputFileSearchCallItem$outboundSchema, + OutputComputerCallItem$outboundSchema, + OutputDatetimeItem$outboundSchema, + ReasoningItem$outboundSchema, + FunctionCallOutputItem$outboundSchema, + z.lazy(() => InputsReasoning$outboundSchema), + OutputImageGenerationCallItem$outboundSchema, + OutputWebSearchServerToolItem$outboundSchema, + OutputCodeInterpreterServerToolItem$outboundSchema, + OutputFileSearchServerToolItem$outboundSchema, + OutputImageGenerationServerToolItem$outboundSchema, + OutputBrowserUseServerToolItem$outboundSchema, + OutputBashServerToolItem$outboundSchema, + OutputTextEditorServerToolItem$outboundSchema, + OutputApplyPatchServerToolItem$outboundSchema, + OutputWebFetchServerToolItem$outboundSchema, + OutputToolSearchServerToolItem$outboundSchema, + OutputMemoryServerToolItem$outboundSchema, + OutputMcpServerToolItem$outboundSchema, + OutputSearchModelsServerToolItem$outboundSchema, + EasyInputMessage$outboundSchema, + InputMessageItem$outboundSchema, + ]), + ), ]); export function inputsUnionToJSON(inputsUnion: InputsUnion): string { diff --git a/src/models/outputapplypatchservertoolitem.ts b/src/models/outputapplypatchservertoolitem.ts index 78c82a64..ef917024 100644 --- a/src/models/outputapplypatchservertoolitem.ts +++ b/src/models/outputapplypatchservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputApplyPatchServerToolItemType = { + OpenrouterApplyPatch: "openrouter:apply_patch", +} as const; +export type OutputApplyPatchServerToolItemType = ClosedEnum< + typeof OutputApplyPatchServerToolItemType +>; + /** * An openrouter:apply_patch server tool output item */ @@ -20,9 +29,18 @@ export type OutputApplyPatchServerToolItem = { id?: string | undefined; patch?: string | undefined; status: ToolCallStatus; - type: "openrouter:apply_patch"; + type: OutputApplyPatchServerToolItemType; }; +/** @internal */ +export const OutputApplyPatchServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputApplyPatchServerToolItemType +> = z.enum(OutputApplyPatchServerToolItemType); +/** @internal */ +export const OutputApplyPatchServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputApplyPatchServerToolItemType +> = OutputApplyPatchServerToolItemType$inboundSchema; + /** @internal */ export const OutputApplyPatchServerToolItem$inboundSchema: z.ZodType< OutputApplyPatchServerToolItem, @@ -32,9 +50,38 @@ export const OutputApplyPatchServerToolItem$inboundSchema: z.ZodType< id: z.string().optional(), patch: z.string().optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:apply_patch"), + type: OutputApplyPatchServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputApplyPatchServerToolItem$Outbound = { + filePath?: string | undefined; + id?: string | undefined; + patch?: string | undefined; + status: string; + type: string; +}; + +/** @internal */ +export const OutputApplyPatchServerToolItem$outboundSchema: z.ZodType< + OutputApplyPatchServerToolItem$Outbound, + OutputApplyPatchServerToolItem +> = z.object({ + filePath: z.string().optional(), + id: z.string().optional(), + patch: z.string().optional(), + status: ToolCallStatus$outboundSchema, + type: OutputApplyPatchServerToolItemType$outboundSchema, }); +export function outputApplyPatchServerToolItemToJSON( + outputApplyPatchServerToolItem: OutputApplyPatchServerToolItem, +): string { + return JSON.stringify( + OutputApplyPatchServerToolItem$outboundSchema.parse( + outputApplyPatchServerToolItem, + ), + ); +} export function outputApplyPatchServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputbashservertoolitem.ts b/src/models/outputbashservertoolitem.ts index 321efdac..4697912e 100644 --- a/src/models/outputbashservertoolitem.ts +++ b/src/models/outputbashservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputBashServerToolItemType = { + OpenrouterBash: "openrouter:bash", +} as const; +export type OutputBashServerToolItemType = ClosedEnum< + typeof OutputBashServerToolItemType +>; + /** * An openrouter:bash server tool output item */ @@ -22,9 +31,18 @@ export type OutputBashServerToolItem = { status: ToolCallStatus; stderr?: string | undefined; stdout?: string | undefined; - type: "openrouter:bash"; + type: OutputBashServerToolItemType; }; +/** @internal */ +export const OutputBashServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputBashServerToolItemType +> = z.enum(OutputBashServerToolItemType); +/** @internal */ +export const OutputBashServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputBashServerToolItemType +> = OutputBashServerToolItemType$inboundSchema; + /** @internal */ export const OutputBashServerToolItem$inboundSchema: z.ZodType< OutputBashServerToolItem, @@ -36,9 +54,40 @@ export const OutputBashServerToolItem$inboundSchema: z.ZodType< status: ToolCallStatus$inboundSchema, stderr: z.string().optional(), stdout: z.string().optional(), - type: z.literal("openrouter:bash"), + type: OutputBashServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputBashServerToolItem$Outbound = { + command?: string | undefined; + exitCode?: number | undefined; + id?: string | undefined; + status: string; + stderr?: string | undefined; + stdout?: string | undefined; + type: string; +}; + +/** @internal */ +export const OutputBashServerToolItem$outboundSchema: z.ZodType< + OutputBashServerToolItem$Outbound, + OutputBashServerToolItem +> = z.object({ + command: z.string().optional(), + exitCode: z.int().optional(), + id: z.string().optional(), + status: ToolCallStatus$outboundSchema, + stderr: z.string().optional(), + stdout: z.string().optional(), + type: OutputBashServerToolItemType$outboundSchema, }); +export function outputBashServerToolItemToJSON( + outputBashServerToolItem: OutputBashServerToolItem, +): string { + return JSON.stringify( + OutputBashServerToolItem$outboundSchema.parse(outputBashServerToolItem), + ); +} export function outputBashServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputbrowseruseservertoolitem.ts b/src/models/outputbrowseruseservertoolitem.ts index 7528c6ac..a7bdb03c 100644 --- a/src/models/outputbrowseruseservertoolitem.ts +++ b/src/models/outputbrowseruseservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputBrowserUseServerToolItemType = { + OpenrouterBrowserUse: "openrouter:browser_use", +} as const; +export type OutputBrowserUseServerToolItemType = ClosedEnum< + typeof OutputBrowserUseServerToolItemType +>; + /** * An openrouter:browser_use server tool output item */ @@ -20,9 +29,18 @@ export type OutputBrowserUseServerToolItem = { id?: string | undefined; screenshotB64?: string | undefined; status: ToolCallStatus; - type: "openrouter:browser_use"; + type: OutputBrowserUseServerToolItemType; }; +/** @internal */ +export const OutputBrowserUseServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputBrowserUseServerToolItemType +> = z.enum(OutputBrowserUseServerToolItemType); +/** @internal */ +export const OutputBrowserUseServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputBrowserUseServerToolItemType +> = OutputBrowserUseServerToolItemType$inboundSchema; + /** @internal */ export const OutputBrowserUseServerToolItem$inboundSchema: z.ZodType< OutputBrowserUseServerToolItem, @@ -32,9 +50,38 @@ export const OutputBrowserUseServerToolItem$inboundSchema: z.ZodType< id: z.string().optional(), screenshotB64: z.string().optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:browser_use"), + type: OutputBrowserUseServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputBrowserUseServerToolItem$Outbound = { + action?: string | undefined; + id?: string | undefined; + screenshotB64?: string | undefined; + status: string; + type: string; +}; + +/** @internal */ +export const OutputBrowserUseServerToolItem$outboundSchema: z.ZodType< + OutputBrowserUseServerToolItem$Outbound, + OutputBrowserUseServerToolItem +> = z.object({ + action: z.string().optional(), + id: z.string().optional(), + screenshotB64: z.string().optional(), + status: ToolCallStatus$outboundSchema, + type: OutputBrowserUseServerToolItemType$outboundSchema, }); +export function outputBrowserUseServerToolItemToJSON( + outputBrowserUseServerToolItem: OutputBrowserUseServerToolItem, +): string { + return JSON.stringify( + OutputBrowserUseServerToolItem$outboundSchema.parse( + outputBrowserUseServerToolItem, + ), + ); +} export function outputBrowserUseServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputcodeinterpretercallitem.ts b/src/models/outputcodeinterpretercallitem.ts index 0d62c987..8273fa4c 100644 --- a/src/models/outputcodeinterpretercallitem.ts +++ b/src/models/outputcodeinterpretercallitem.ts @@ -8,11 +8,13 @@ import { remap as remap$ } from "../lib/primitives.js"; 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; export type OutputLogs = { @@ -30,6 +32,13 @@ export type OutputCodeInterpreterCallItemOutputUnion = | OutputLogs | discriminatedUnionTypes.Unknown<"type">; +export const TypeCodeInterpreterCall = { + CodeInterpreterCall: "code_interpreter_call", +} as const; +export type TypeCodeInterpreterCall = ClosedEnum< + typeof TypeCodeInterpreterCall +>; + /** * A code interpreter execution call with outputs */ @@ -41,7 +50,7 @@ export type OutputCodeInterpreterCallItem = { | Array> | null; status: ToolCallStatus; - type: "code_interpreter_call"; + type: TypeCodeInterpreterCall; }; /** @internal */ @@ -50,7 +59,24 @@ export const OutputLogs$inboundSchema: z.ZodType = z logs: z.string(), type: z.literal("logs"), }); +/** @internal */ +export type OutputLogs$Outbound = { + logs: string; + type: "logs"; +}; + +/** @internal */ +export const OutputLogs$outboundSchema: z.ZodType< + OutputLogs$Outbound, + OutputLogs +> = z.object({ + logs: z.string(), + type: z.literal("logs"), +}); +export function outputLogsToJSON(outputLogs: OutputLogs): string { + return JSON.stringify(OutputLogs$outboundSchema.parse(outputLogs)); +} export function outputLogsFromJSON( jsonString: string, ): SafeParseResult { @@ -67,7 +93,24 @@ export const OutputImage$inboundSchema: z.ZodType = z type: z.literal("image"), url: z.string(), }); +/** @internal */ +export type OutputImage$Outbound = { + type: "image"; + url: string; +}; + +/** @internal */ +export const OutputImage$outboundSchema: z.ZodType< + OutputImage$Outbound, + OutputImage +> = z.object({ + type: z.literal("image"), + url: z.string(), +}); +export function outputImageToJSON(outputImage: OutputImage): string { + return JSON.stringify(OutputImage$outboundSchema.parse(outputImage)); +} export function outputImageFromJSON( jsonString: string, ): SafeParseResult { @@ -86,7 +129,30 @@ export const OutputCodeInterpreterCallItemOutputUnion$inboundSchema: z.ZodType< image: z.lazy(() => OutputImage$inboundSchema), logs: z.lazy(() => OutputLogs$inboundSchema), }); +/** @internal */ +export type OutputCodeInterpreterCallItemOutputUnion$Outbound = + | OutputImage$Outbound + | OutputLogs$Outbound; +/** @internal */ +export const OutputCodeInterpreterCallItemOutputUnion$outboundSchema: z.ZodType< + OutputCodeInterpreterCallItemOutputUnion$Outbound, + OutputCodeInterpreterCallItemOutputUnion +> = z.union([ + z.lazy(() => OutputImage$outboundSchema), + z.lazy(() => OutputLogs$outboundSchema), +]); + +export function outputCodeInterpreterCallItemOutputUnionToJSON( + outputCodeInterpreterCallItemOutputUnion: + OutputCodeInterpreterCallItemOutputUnion, +): string { + return JSON.stringify( + OutputCodeInterpreterCallItemOutputUnion$outboundSchema.parse( + outputCodeInterpreterCallItemOutputUnion, + ), + ); +} export function outputCodeInterpreterCallItemOutputUnionFromJSON( jsonString: string, ): SafeParseResult< @@ -103,6 +169,15 @@ export function outputCodeInterpreterCallItemOutputUnionFromJSON( ); } +/** @internal */ +export const TypeCodeInterpreterCall$inboundSchema: z.ZodEnum< + typeof TypeCodeInterpreterCall +> = z.enum(TypeCodeInterpreterCall); +/** @internal */ +export const TypeCodeInterpreterCall$outboundSchema: z.ZodEnum< + typeof TypeCodeInterpreterCall +> = TypeCodeInterpreterCall$inboundSchema; + /** @internal */ export const OutputCodeInterpreterCallItem$inboundSchema: z.ZodType< OutputCodeInterpreterCallItem, @@ -120,13 +195,55 @@ export const OutputCodeInterpreterCallItem$inboundSchema: z.ZodType< })), ), status: ToolCallStatus$inboundSchema, - type: z.literal("code_interpreter_call"), + type: TypeCodeInterpreterCall$inboundSchema, }).transform((v) => { return remap$(v, { "container_id": "containerId", }); }); +/** @internal */ +export type OutputCodeInterpreterCallItem$Outbound = { + code: string | null; + container_id: string; + id: string; + outputs: Array | null; + status: string; + type: string; +}; + +/** @internal */ +export const OutputCodeInterpreterCallItem$outboundSchema: z.ZodType< + OutputCodeInterpreterCallItem$Outbound, + OutputCodeInterpreterCallItem +> = z.object({ + code: z.nullable(z.string()), + containerId: z.string(), + id: z.string(), + outputs: z.nullable( + z.array(z.union([ + z.lazy(() => OutputImage$outboundSchema), + z.lazy(() => + OutputLogs$outboundSchema + ), + ])), + ), + status: ToolCallStatus$outboundSchema, + type: TypeCodeInterpreterCall$outboundSchema, +}).transform((v) => { + return remap$(v, { + containerId: "container_id", + }); +}); +export function outputCodeInterpreterCallItemToJSON( + outputCodeInterpreterCallItem: OutputCodeInterpreterCallItem, +): string { + return JSON.stringify( + OutputCodeInterpreterCallItem$outboundSchema.parse( + outputCodeInterpreterCallItem, + ), + ); +} export function outputCodeInterpreterCallItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputcodeinterpreterservertoolitem.ts b/src/models/outputcodeinterpreterservertoolitem.ts index 26cce532..07d2520d 100644 --- a/src/models/outputcodeinterpreterservertoolitem.ts +++ b/src/models/outputcodeinterpreterservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputCodeInterpreterServerToolItemType = { + OpenrouterCodeInterpreter: "openrouter:code_interpreter", +} as const; +export type OutputCodeInterpreterServerToolItemType = ClosedEnum< + typeof OutputCodeInterpreterServerToolItemType +>; + /** * An openrouter:code_interpreter server tool output item */ @@ -23,9 +32,18 @@ export type OutputCodeInterpreterServerToolItem = { status: ToolCallStatus; stderr?: string | undefined; stdout?: string | undefined; - type: "openrouter:code_interpreter"; + type: OutputCodeInterpreterServerToolItemType; }; +/** @internal */ +export const OutputCodeInterpreterServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputCodeInterpreterServerToolItemType +> = z.enum(OutputCodeInterpreterServerToolItemType); +/** @internal */ +export const OutputCodeInterpreterServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputCodeInterpreterServerToolItemType +> = OutputCodeInterpreterServerToolItemType$inboundSchema; + /** @internal */ export const OutputCodeInterpreterServerToolItem$inboundSchema: z.ZodType< OutputCodeInterpreterServerToolItem, @@ -38,9 +56,44 @@ export const OutputCodeInterpreterServerToolItem$inboundSchema: z.ZodType< status: ToolCallStatus$inboundSchema, stderr: z.string().optional(), stdout: z.string().optional(), - type: z.literal("openrouter:code_interpreter"), + type: OutputCodeInterpreterServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputCodeInterpreterServerToolItem$Outbound = { + code?: string | undefined; + exitCode?: number | undefined; + id?: string | undefined; + language?: string | undefined; + status: string; + stderr?: string | undefined; + stdout?: string | undefined; + type: string; +}; + +/** @internal */ +export const OutputCodeInterpreterServerToolItem$outboundSchema: z.ZodType< + OutputCodeInterpreterServerToolItem$Outbound, + OutputCodeInterpreterServerToolItem +> = z.object({ + code: z.string().optional(), + exitCode: z.int().optional(), + id: z.string().optional(), + language: z.string().optional(), + status: ToolCallStatus$outboundSchema, + stderr: z.string().optional(), + stdout: z.string().optional(), + type: OutputCodeInterpreterServerToolItemType$outboundSchema, }); +export function outputCodeInterpreterServerToolItemToJSON( + outputCodeInterpreterServerToolItem: OutputCodeInterpreterServerToolItem, +): string { + return JSON.stringify( + OutputCodeInterpreterServerToolItem$outboundSchema.parse( + outputCodeInterpreterServerToolItem, + ), + ); +} export function outputCodeInterpreterServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputcomputercallitem.ts b/src/models/outputcomputercallitem.ts index 7116d303..7801e652 100644 --- a/src/models/outputcomputercallitem.ts +++ b/src/models/outputcomputercallitem.ts @@ -7,7 +7,7 @@ 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 { ClosedEnum, OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; @@ -26,13 +26,20 @@ export type OutputComputerCallItemStatus = OpenEnum< typeof OutputComputerCallItemStatus >; +export const OutputComputerCallItemType = { + ComputerCall: "computer_call", +} as const; +export type OutputComputerCallItemType = ClosedEnum< + typeof OutputComputerCallItemType +>; + export type OutputComputerCallItem = { action?: any | null | undefined; callId: string; id?: string | undefined; pendingSafetyChecks: Array; status: OutputComputerCallItemStatus; - type: "computer_call"; + type: OutputComputerCallItemType; }; /** @internal */ @@ -44,7 +51,30 @@ export const PendingSafetyCheck$inboundSchema: z.ZodType< id: z.string(), message: z.string(), }); +/** @internal */ +export type PendingSafetyCheck$Outbound = { + code: string; + id: string; + message: string; +}; + +/** @internal */ +export const PendingSafetyCheck$outboundSchema: z.ZodType< + PendingSafetyCheck$Outbound, + PendingSafetyCheck +> = z.object({ + code: z.string(), + id: z.string(), + message: z.string(), +}); +export function pendingSafetyCheckToJSON( + pendingSafetyCheck: PendingSafetyCheck, +): string { + return JSON.stringify( + PendingSafetyCheck$outboundSchema.parse(pendingSafetyCheck), + ); +} export function pendingSafetyCheckFromJSON( jsonString: string, ): SafeParseResult { @@ -60,6 +90,20 @@ export const OutputComputerCallItemStatus$inboundSchema: z.ZodType< OutputComputerCallItemStatus, unknown > = openEnums.inboundSchema(OutputComputerCallItemStatus); +/** @internal */ +export const OutputComputerCallItemStatus$outboundSchema: z.ZodType< + string, + OutputComputerCallItemStatus +> = openEnums.outboundSchema(OutputComputerCallItemStatus); + +/** @internal */ +export const OutputComputerCallItemType$inboundSchema: z.ZodEnum< + typeof OutputComputerCallItemType +> = z.enum(OutputComputerCallItemType); +/** @internal */ +export const OutputComputerCallItemType$outboundSchema: z.ZodEnum< + typeof OutputComputerCallItemType +> = OutputComputerCallItemType$inboundSchema; /** @internal */ export const OutputComputerCallItem$inboundSchema: z.ZodType< @@ -73,14 +117,48 @@ export const OutputComputerCallItem$inboundSchema: z.ZodType< z.lazy(() => PendingSafetyCheck$inboundSchema), ), status: OutputComputerCallItemStatus$inboundSchema, - type: z.literal("computer_call"), + type: OutputComputerCallItemType$inboundSchema, }).transform((v) => { return remap$(v, { "call_id": "callId", "pending_safety_checks": "pendingSafetyChecks", }); }); +/** @internal */ +export type OutputComputerCallItem$Outbound = { + action?: any | null | undefined; + call_id: string; + id?: string | undefined; + pending_safety_checks: Array; + status: string; + type: string; +}; + +/** @internal */ +export const OutputComputerCallItem$outboundSchema: z.ZodType< + OutputComputerCallItem$Outbound, + OutputComputerCallItem +> = z.object({ + action: z.nullable(z.any()).optional(), + callId: z.string(), + id: z.string().optional(), + pendingSafetyChecks: z.array(z.lazy(() => PendingSafetyCheck$outboundSchema)), + status: OutputComputerCallItemStatus$outboundSchema, + type: OutputComputerCallItemType$outboundSchema, +}).transform((v) => { + return remap$(v, { + callId: "call_id", + pendingSafetyChecks: "pending_safety_checks", + }); +}); +export function outputComputerCallItemToJSON( + outputComputerCallItem: OutputComputerCallItem, +): string { + return JSON.stringify( + OutputComputerCallItem$outboundSchema.parse(outputComputerCallItem), + ); +} export function outputComputerCallItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputfilesearchservertoolitem.ts b/src/models/outputfilesearchservertoolitem.ts index 8c26b44e..52af35d5 100644 --- a/src/models/outputfilesearchservertoolitem.ts +++ b/src/models/outputfilesearchservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputFileSearchServerToolItemType = { + OpenrouterFileSearch: "openrouter:file_search", +} as const; +export type OutputFileSearchServerToolItemType = ClosedEnum< + typeof OutputFileSearchServerToolItemType +>; + /** * An openrouter:file_search server tool output item */ @@ -19,9 +28,18 @@ export type OutputFileSearchServerToolItem = { id?: string | undefined; queries?: Array | undefined; status: ToolCallStatus; - type: "openrouter:file_search"; + type: OutputFileSearchServerToolItemType; }; +/** @internal */ +export const OutputFileSearchServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputFileSearchServerToolItemType +> = z.enum(OutputFileSearchServerToolItemType); +/** @internal */ +export const OutputFileSearchServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputFileSearchServerToolItemType +> = OutputFileSearchServerToolItemType$inboundSchema; + /** @internal */ export const OutputFileSearchServerToolItem$inboundSchema: z.ZodType< OutputFileSearchServerToolItem, @@ -30,9 +48,36 @@ export const OutputFileSearchServerToolItem$inboundSchema: z.ZodType< id: z.string().optional(), queries: z.array(z.string()).optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:file_search"), + type: OutputFileSearchServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputFileSearchServerToolItem$Outbound = { + id?: string | undefined; + queries?: Array | undefined; + status: string; + type: string; +}; + +/** @internal */ +export const OutputFileSearchServerToolItem$outboundSchema: z.ZodType< + OutputFileSearchServerToolItem$Outbound, + OutputFileSearchServerToolItem +> = z.object({ + id: z.string().optional(), + queries: z.array(z.string()).optional(), + status: ToolCallStatus$outboundSchema, + type: OutputFileSearchServerToolItemType$outboundSchema, }); +export function outputFileSearchServerToolItemToJSON( + outputFileSearchServerToolItem: OutputFileSearchServerToolItem, +): string { + return JSON.stringify( + OutputFileSearchServerToolItem$outboundSchema.parse( + outputFileSearchServerToolItem, + ), + ); +} export function outputFileSearchServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputimagegenerationservertoolitem.ts b/src/models/outputimagegenerationservertoolitem.ts index 364a3df3..6538694b 100644 --- a/src/models/outputimagegenerationservertoolitem.ts +++ b/src/models/outputimagegenerationservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputImageGenerationServerToolItemType = { + OpenrouterImageGeneration: "openrouter:image_generation", +} as const; +export type OutputImageGenerationServerToolItemType = ClosedEnum< + typeof OutputImageGenerationServerToolItemType +>; + /** * An openrouter:image_generation server tool output item */ @@ -25,9 +34,18 @@ export type OutputImageGenerationServerToolItem = { result?: string | null | undefined; revisedPrompt?: string | undefined; status: ToolCallStatus; - type: "openrouter:image_generation"; + type: OutputImageGenerationServerToolItemType; }; +/** @internal */ +export const OutputImageGenerationServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputImageGenerationServerToolItemType +> = z.enum(OutputImageGenerationServerToolItemType); +/** @internal */ +export const OutputImageGenerationServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputImageGenerationServerToolItemType +> = OutputImageGenerationServerToolItemType$inboundSchema; + /** @internal */ export const OutputImageGenerationServerToolItem$inboundSchema: z.ZodType< OutputImageGenerationServerToolItem, @@ -39,9 +57,42 @@ export const OutputImageGenerationServerToolItem$inboundSchema: z.ZodType< result: z.nullable(z.string()).optional(), revisedPrompt: z.string().optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:image_generation"), + type: OutputImageGenerationServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputImageGenerationServerToolItem$Outbound = { + id?: string | undefined; + imageB64?: string | undefined; + imageUrl?: string | undefined; + result?: string | null | undefined; + revisedPrompt?: string | undefined; + status: string; + type: string; +}; + +/** @internal */ +export const OutputImageGenerationServerToolItem$outboundSchema: z.ZodType< + OutputImageGenerationServerToolItem$Outbound, + OutputImageGenerationServerToolItem +> = z.object({ + id: z.string().optional(), + imageB64: z.string().optional(), + imageUrl: z.string().optional(), + result: z.nullable(z.string()).optional(), + revisedPrompt: z.string().optional(), + status: ToolCallStatus$outboundSchema, + type: OutputImageGenerationServerToolItemType$outboundSchema, }); +export function outputImageGenerationServerToolItemToJSON( + outputImageGenerationServerToolItem: OutputImageGenerationServerToolItem, +): string { + return JSON.stringify( + OutputImageGenerationServerToolItem$outboundSchema.parse( + outputImageGenerationServerToolItem, + ), + ); +} export function outputImageGenerationServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputitems.ts b/src/models/outputitems.ts index 18f05559..5f55406c 100644 --- a/src/models/outputitems.ts +++ b/src/models/outputitems.ts @@ -102,25 +102,31 @@ import { * An output item from the response */ export type OutputItems = - | OutputCodeInterpreterCallItem - | OutputComputerCallItem + | (OutputCodeInterpreterCallItem & { type: "code_interpreter_call" }) + | (OutputComputerCallItem & { type: "computer_call" }) | (OutputFileSearchCallItem & { type: "file_search_call" }) | (OutputFunctionCallItem & { type: "function_call" }) | (OutputImageGenerationCallItem & { type: "image_generation_call" }) | OutputMessageItem - | OutputApplyPatchServerToolItem - | OutputBashServerToolItem - | OutputBrowserUseServerToolItem - | OutputCodeInterpreterServerToolItem + | (OutputApplyPatchServerToolItem & { type: "openrouter:apply_patch" }) + | (OutputBashServerToolItem & { type: "openrouter:bash" }) + | (OutputBrowserUseServerToolItem & { type: "openrouter:browser_use" }) + | (OutputCodeInterpreterServerToolItem & { + type: "openrouter:code_interpreter"; + }) | (OutputDatetimeItem & { type: "openrouter:datetime" }) - | OutputSearchModelsServerToolItem - | OutputFileSearchServerToolItem - | OutputImageGenerationServerToolItem - | OutputMcpServerToolItem - | OutputMemoryServerToolItem - | OutputTextEditorServerToolItem - | OutputToolSearchServerToolItem - | OutputWebFetchServerToolItem + | (OutputSearchModelsServerToolItem & { + type: "openrouter:experimental__search_models"; + }) + | (OutputFileSearchServerToolItem & { type: "openrouter:file_search" }) + | (OutputImageGenerationServerToolItem & { + type: "openrouter:image_generation"; + }) + | (OutputMcpServerToolItem & { type: "openrouter:mcp" }) + | (OutputMemoryServerToolItem & { type: "openrouter:memory" }) + | (OutputTextEditorServerToolItem & { type: "openrouter:text_editor" }) + | (OutputToolSearchServerToolItem & { type: "openrouter:tool_search" }) + | (OutputWebFetchServerToolItem & { type: "openrouter:web_fetch" }) | (OutputWebSearchServerToolItem & { type: "openrouter:web_search" }) | OutputReasoningItem | (OutputWebSearchCallItem & { type: "web_search_call" }) @@ -129,8 +135,12 @@ export type OutputItems = /** @internal */ export const OutputItems$inboundSchema: z.ZodType = discriminatedUnion("type", { - code_interpreter_call: OutputCodeInterpreterCallItem$inboundSchema, - computer_call: OutputComputerCallItem$inboundSchema, + code_interpreter_call: OutputCodeInterpreterCallItem$inboundSchema.and( + z.object({ type: z.literal("code_interpreter_call") }), + ), + computer_call: OutputComputerCallItem$inboundSchema.and( + z.object({ type: z.literal("computer_call") }), + ), file_search_call: OutputFileSearchCallItem$inboundSchema.and( z.object({ type: z.literal("file_search_call") }), ), @@ -141,24 +151,43 @@ export const OutputItems$inboundSchema: z.ZodType = z.object({ type: z.literal("image_generation_call") }), ), message: OutputMessageItem$inboundSchema, - ["openrouter:apply_patch"]: OutputApplyPatchServerToolItem$inboundSchema, - ["openrouter:bash"]: OutputBashServerToolItem$inboundSchema, - ["openrouter:browser_use"]: OutputBrowserUseServerToolItem$inboundSchema, + ["openrouter:apply_patch"]: OutputApplyPatchServerToolItem$inboundSchema + .and(z.object({ type: z.literal("openrouter:apply_patch") })), + ["openrouter:bash"]: OutputBashServerToolItem$inboundSchema.and( + z.object({ type: z.literal("openrouter:bash") }), + ), + ["openrouter:browser_use"]: OutputBrowserUseServerToolItem$inboundSchema + .and(z.object({ type: z.literal("openrouter:browser_use") })), ["openrouter:code_interpreter"]: - OutputCodeInterpreterServerToolItem$inboundSchema, + OutputCodeInterpreterServerToolItem$inboundSchema.and( + z.object({ type: z.literal("openrouter:code_interpreter") }), + ), ["openrouter:datetime"]: OutputDatetimeItem$inboundSchema.and( z.object({ type: z.literal("openrouter:datetime") }), ), ["openrouter:experimental__search_models"]: - OutputSearchModelsServerToolItem$inboundSchema, - ["openrouter:file_search"]: OutputFileSearchServerToolItem$inboundSchema, + OutputSearchModelsServerToolItem$inboundSchema.and( + z.object({ type: z.literal("openrouter:experimental__search_models") }), + ), + ["openrouter:file_search"]: OutputFileSearchServerToolItem$inboundSchema + .and(z.object({ type: z.literal("openrouter:file_search") })), ["openrouter:image_generation"]: - OutputImageGenerationServerToolItem$inboundSchema, - ["openrouter:mcp"]: OutputMcpServerToolItem$inboundSchema, - ["openrouter:memory"]: OutputMemoryServerToolItem$inboundSchema, - ["openrouter:text_editor"]: OutputTextEditorServerToolItem$inboundSchema, - ["openrouter:tool_search"]: OutputToolSearchServerToolItem$inboundSchema, - ["openrouter:web_fetch"]: OutputWebFetchServerToolItem$inboundSchema, + OutputImageGenerationServerToolItem$inboundSchema.and( + z.object({ type: z.literal("openrouter:image_generation") }), + ), + ["openrouter:mcp"]: OutputMcpServerToolItem$inboundSchema.and( + z.object({ type: z.literal("openrouter:mcp") }), + ), + ["openrouter:memory"]: OutputMemoryServerToolItem$inboundSchema.and( + z.object({ type: z.literal("openrouter:memory") }), + ), + ["openrouter:text_editor"]: OutputTextEditorServerToolItem$inboundSchema + .and(z.object({ type: z.literal("openrouter:text_editor") })), + ["openrouter:tool_search"]: OutputToolSearchServerToolItem$inboundSchema + .and(z.object({ type: z.literal("openrouter:tool_search") })), + ["openrouter:web_fetch"]: OutputWebFetchServerToolItem$inboundSchema.and( + z.object({ type: z.literal("openrouter:web_fetch") }), + ), ["openrouter:web_search"]: OutputWebSearchServerToolItem$inboundSchema.and( z.object({ type: z.literal("openrouter:web_search") }), ), diff --git a/src/models/outputmcpservertoolitem.ts b/src/models/outputmcpservertoolitem.ts index 8d098a69..baeb25fc 100644 --- a/src/models/outputmcpservertoolitem.ts +++ b/src/models/outputmcpservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputMcpServerToolItemType = { + OpenrouterMcp: "openrouter:mcp", +} as const; +export type OutputMcpServerToolItemType = ClosedEnum< + typeof OutputMcpServerToolItemType +>; + /** * An openrouter:mcp server tool output item */ @@ -20,9 +29,18 @@ export type OutputMcpServerToolItem = { serverLabel?: string | undefined; status: ToolCallStatus; toolName?: string | undefined; - type: "openrouter:mcp"; + type: OutputMcpServerToolItemType; }; +/** @internal */ +export const OutputMcpServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputMcpServerToolItemType +> = z.enum(OutputMcpServerToolItemType); +/** @internal */ +export const OutputMcpServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputMcpServerToolItemType +> = OutputMcpServerToolItemType$inboundSchema; + /** @internal */ export const OutputMcpServerToolItem$inboundSchema: z.ZodType< OutputMcpServerToolItem, @@ -32,9 +50,36 @@ export const OutputMcpServerToolItem$inboundSchema: z.ZodType< serverLabel: z.string().optional(), status: ToolCallStatus$inboundSchema, toolName: z.string().optional(), - type: z.literal("openrouter:mcp"), + type: OutputMcpServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputMcpServerToolItem$Outbound = { + id?: string | undefined; + serverLabel?: string | undefined; + status: string; + toolName?: string | undefined; + type: string; +}; + +/** @internal */ +export const OutputMcpServerToolItem$outboundSchema: z.ZodType< + OutputMcpServerToolItem$Outbound, + OutputMcpServerToolItem +> = z.object({ + id: z.string().optional(), + serverLabel: z.string().optional(), + status: ToolCallStatus$outboundSchema, + toolName: z.string().optional(), + type: OutputMcpServerToolItemType$outboundSchema, }); +export function outputMcpServerToolItemToJSON( + outputMcpServerToolItem: OutputMcpServerToolItem, +): string { + return JSON.stringify( + OutputMcpServerToolItem$outboundSchema.parse(outputMcpServerToolItem), + ); +} export function outputMcpServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputmemoryservertoolitem.ts b/src/models/outputmemoryservertoolitem.ts index 84bed06d..04abb2d3 100644 --- a/src/models/outputmemoryservertoolitem.ts +++ b/src/models/outputmemoryservertoolitem.ts @@ -6,12 +6,13 @@ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import * as openEnums from "../types/enums.js"; -import { OpenEnum } 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"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; export const ActionEnum = { @@ -21,6 +22,13 @@ export const ActionEnum = { } as const; export type ActionEnum = OpenEnum; +export const OutputMemoryServerToolItemType = { + OpenrouterMemory: "openrouter:memory", +} as const; +export type OutputMemoryServerToolItemType = ClosedEnum< + typeof OutputMemoryServerToolItemType +>; + /** * An openrouter:memory server tool output item */ @@ -29,13 +37,25 @@ export type OutputMemoryServerToolItem = { id?: string | undefined; key?: string | undefined; status: ToolCallStatus; - type: "openrouter:memory"; + type: OutputMemoryServerToolItemType; value?: any | null | undefined; }; /** @internal */ export const ActionEnum$inboundSchema: z.ZodType = openEnums.inboundSchema(ActionEnum); +/** @internal */ +export const ActionEnum$outboundSchema: z.ZodType = + openEnums.outboundSchema(ActionEnum); + +/** @internal */ +export const OutputMemoryServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputMemoryServerToolItemType +> = z.enum(OutputMemoryServerToolItemType); +/** @internal */ +export const OutputMemoryServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputMemoryServerToolItemType +> = OutputMemoryServerToolItemType$inboundSchema; /** @internal */ export const OutputMemoryServerToolItem$inboundSchema: z.ZodType< @@ -46,10 +66,39 @@ export const OutputMemoryServerToolItem$inboundSchema: z.ZodType< id: z.string().optional(), key: z.string().optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:memory"), + type: OutputMemoryServerToolItemType$inboundSchema, + value: z.nullable(z.any()).optional(), +}); +/** @internal */ +export type OutputMemoryServerToolItem$Outbound = { + action?: string | undefined; + id?: string | undefined; + key?: string | undefined; + status: string; + type: string; + value?: any | null | undefined; +}; + +/** @internal */ +export const OutputMemoryServerToolItem$outboundSchema: z.ZodType< + OutputMemoryServerToolItem$Outbound, + OutputMemoryServerToolItem +> = z.object({ + action: ActionEnum$outboundSchema.optional(), + id: z.string().optional(), + key: z.string().optional(), + status: ToolCallStatus$outboundSchema, + type: OutputMemoryServerToolItemType$outboundSchema, value: z.nullable(z.any()).optional(), }); +export function outputMemoryServerToolItemToJSON( + outputMemoryServerToolItem: OutputMemoryServerToolItem, +): string { + return JSON.stringify( + OutputMemoryServerToolItem$outboundSchema.parse(outputMemoryServerToolItem), + ); +} export function outputMemoryServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputsearchmodelsservertoolitem.ts b/src/models/outputsearchmodelsservertoolitem.ts index 30539e4c..1956550d 100644 --- a/src/models/outputsearchmodelsservertoolitem.ts +++ b/src/models/outputsearchmodelsservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputSearchModelsServerToolItemType = { + OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models", +} as const; +export type OutputSearchModelsServerToolItemType = ClosedEnum< + typeof OutputSearchModelsServerToolItemType +>; + /** * An openrouter:experimental__search_models server tool output item */ @@ -23,9 +32,18 @@ export type OutputSearchModelsServerToolItem = { id?: string | undefined; query?: string | undefined; status: ToolCallStatus; - type: "openrouter:experimental__search_models"; + type: OutputSearchModelsServerToolItemType; }; +/** @internal */ +export const OutputSearchModelsServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputSearchModelsServerToolItemType +> = z.enum(OutputSearchModelsServerToolItemType); +/** @internal */ +export const OutputSearchModelsServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputSearchModelsServerToolItemType +> = OutputSearchModelsServerToolItemType$inboundSchema; + /** @internal */ export const OutputSearchModelsServerToolItem$inboundSchema: z.ZodType< OutputSearchModelsServerToolItem, @@ -35,9 +53,38 @@ export const OutputSearchModelsServerToolItem$inboundSchema: z.ZodType< id: z.string().optional(), query: z.string().optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:experimental__search_models"), + type: OutputSearchModelsServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputSearchModelsServerToolItem$Outbound = { + arguments?: string | undefined; + id?: string | undefined; + query?: string | undefined; + status: string; + type: string; +}; + +/** @internal */ +export const OutputSearchModelsServerToolItem$outboundSchema: z.ZodType< + OutputSearchModelsServerToolItem$Outbound, + OutputSearchModelsServerToolItem +> = z.object({ + arguments: z.string().optional(), + id: z.string().optional(), + query: z.string().optional(), + status: ToolCallStatus$outboundSchema, + type: OutputSearchModelsServerToolItemType$outboundSchema, }); +export function outputSearchModelsServerToolItemToJSON( + outputSearchModelsServerToolItem: OutputSearchModelsServerToolItem, +): string { + return JSON.stringify( + OutputSearchModelsServerToolItem$outboundSchema.parse( + outputSearchModelsServerToolItem, + ), + ); +} export function outputSearchModelsServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputtexteditorservertoolitem.ts b/src/models/outputtexteditorservertoolitem.ts index 76ea68e6..269cd84f 100644 --- a/src/models/outputtexteditorservertoolitem.ts +++ b/src/models/outputtexteditorservertoolitem.ts @@ -6,12 +6,13 @@ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import * as openEnums from "../types/enums.js"; -import { OpenEnum } 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"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; export const Command = { @@ -22,6 +23,13 @@ export const Command = { } as const; export type Command = OpenEnum; +export const OutputTextEditorServerToolItemType = { + OpenrouterTextEditor: "openrouter:text_editor", +} as const; +export type OutputTextEditorServerToolItemType = ClosedEnum< + typeof OutputTextEditorServerToolItemType +>; + /** * An openrouter:text_editor server tool output item */ @@ -30,12 +38,24 @@ export type OutputTextEditorServerToolItem = { filePath?: string | undefined; id?: string | undefined; status: ToolCallStatus; - type: "openrouter:text_editor"; + type: OutputTextEditorServerToolItemType; }; /** @internal */ export const Command$inboundSchema: z.ZodType = openEnums .inboundSchema(Command); +/** @internal */ +export const Command$outboundSchema: z.ZodType = openEnums + .outboundSchema(Command); + +/** @internal */ +export const OutputTextEditorServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputTextEditorServerToolItemType +> = z.enum(OutputTextEditorServerToolItemType); +/** @internal */ +export const OutputTextEditorServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputTextEditorServerToolItemType +> = OutputTextEditorServerToolItemType$inboundSchema; /** @internal */ export const OutputTextEditorServerToolItem$inboundSchema: z.ZodType< @@ -46,9 +66,38 @@ export const OutputTextEditorServerToolItem$inboundSchema: z.ZodType< filePath: z.string().optional(), id: z.string().optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:text_editor"), + type: OutputTextEditorServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputTextEditorServerToolItem$Outbound = { + command?: string | undefined; + filePath?: string | undefined; + id?: string | undefined; + status: string; + type: string; +}; + +/** @internal */ +export const OutputTextEditorServerToolItem$outboundSchema: z.ZodType< + OutputTextEditorServerToolItem$Outbound, + OutputTextEditorServerToolItem +> = z.object({ + command: Command$outboundSchema.optional(), + filePath: z.string().optional(), + id: z.string().optional(), + status: ToolCallStatus$outboundSchema, + type: OutputTextEditorServerToolItemType$outboundSchema, }); +export function outputTextEditorServerToolItemToJSON( + outputTextEditorServerToolItem: OutputTextEditorServerToolItem, +): string { + return JSON.stringify( + OutputTextEditorServerToolItem$outboundSchema.parse( + outputTextEditorServerToolItem, + ), + ); +} export function outputTextEditorServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputtoolsearchservertoolitem.ts b/src/models/outputtoolsearchservertoolitem.ts index b4b97495..7cf68351 100644 --- a/src/models/outputtoolsearchservertoolitem.ts +++ b/src/models/outputtoolsearchservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputToolSearchServerToolItemType = { + OpenrouterToolSearch: "openrouter:tool_search", +} as const; +export type OutputToolSearchServerToolItemType = ClosedEnum< + typeof OutputToolSearchServerToolItemType +>; + /** * An openrouter:tool_search server tool output item */ @@ -19,9 +28,18 @@ export type OutputToolSearchServerToolItem = { id?: string | undefined; query?: string | undefined; status: ToolCallStatus; - type: "openrouter:tool_search"; + type: OutputToolSearchServerToolItemType; }; +/** @internal */ +export const OutputToolSearchServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputToolSearchServerToolItemType +> = z.enum(OutputToolSearchServerToolItemType); +/** @internal */ +export const OutputToolSearchServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputToolSearchServerToolItemType +> = OutputToolSearchServerToolItemType$inboundSchema; + /** @internal */ export const OutputToolSearchServerToolItem$inboundSchema: z.ZodType< OutputToolSearchServerToolItem, @@ -30,9 +48,36 @@ export const OutputToolSearchServerToolItem$inboundSchema: z.ZodType< id: z.string().optional(), query: z.string().optional(), status: ToolCallStatus$inboundSchema, - type: z.literal("openrouter:tool_search"), + type: OutputToolSearchServerToolItemType$inboundSchema, +}); +/** @internal */ +export type OutputToolSearchServerToolItem$Outbound = { + id?: string | undefined; + query?: string | undefined; + status: string; + type: string; +}; + +/** @internal */ +export const OutputToolSearchServerToolItem$outboundSchema: z.ZodType< + OutputToolSearchServerToolItem$Outbound, + OutputToolSearchServerToolItem +> = z.object({ + id: z.string().optional(), + query: z.string().optional(), + status: ToolCallStatus$outboundSchema, + type: OutputToolSearchServerToolItemType$outboundSchema, }); +export function outputToolSearchServerToolItemToJSON( + outputToolSearchServerToolItem: OutputToolSearchServerToolItem, +): string { + return JSON.stringify( + OutputToolSearchServerToolItem$outboundSchema.parse( + outputToolSearchServerToolItem, + ), + ); +} export function outputToolSearchServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/outputwebfetchservertoolitem.ts b/src/models/outputwebfetchservertoolitem.ts index d93936e8..bf11567d 100644 --- a/src/models/outputwebfetchservertoolitem.ts +++ b/src/models/outputwebfetchservertoolitem.ts @@ -5,13 +5,22 @@ 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { ToolCallStatus, ToolCallStatus$inboundSchema, + ToolCallStatus$outboundSchema, } from "./toolcallstatus.js"; +export const OutputWebFetchServerToolItemType = { + OpenrouterWebFetch: "openrouter:web_fetch", +} as const; +export type OutputWebFetchServerToolItemType = ClosedEnum< + typeof OutputWebFetchServerToolItemType +>; + /** * An openrouter:web_fetch server tool output item */ @@ -20,10 +29,19 @@ export type OutputWebFetchServerToolItem = { id?: string | undefined; status: ToolCallStatus; title?: string | undefined; - type: "openrouter:web_fetch"; + type: OutputWebFetchServerToolItemType; url?: string | undefined; }; +/** @internal */ +export const OutputWebFetchServerToolItemType$inboundSchema: z.ZodEnum< + typeof OutputWebFetchServerToolItemType +> = z.enum(OutputWebFetchServerToolItemType); +/** @internal */ +export const OutputWebFetchServerToolItemType$outboundSchema: z.ZodEnum< + typeof OutputWebFetchServerToolItemType +> = OutputWebFetchServerToolItemType$inboundSchema; + /** @internal */ export const OutputWebFetchServerToolItem$inboundSchema: z.ZodType< OutputWebFetchServerToolItem, @@ -33,10 +51,41 @@ export const OutputWebFetchServerToolItem$inboundSchema: z.ZodType< id: z.string().optional(), status: ToolCallStatus$inboundSchema, title: z.string().optional(), - type: z.literal("openrouter:web_fetch"), + type: OutputWebFetchServerToolItemType$inboundSchema, + url: z.string().optional(), +}); +/** @internal */ +export type OutputWebFetchServerToolItem$Outbound = { + content?: string | undefined; + id?: string | undefined; + status: string; + title?: string | undefined; + type: string; + url?: string | undefined; +}; + +/** @internal */ +export const OutputWebFetchServerToolItem$outboundSchema: z.ZodType< + OutputWebFetchServerToolItem$Outbound, + OutputWebFetchServerToolItem +> = z.object({ + content: z.string().optional(), + id: z.string().optional(), + status: ToolCallStatus$outboundSchema, + title: z.string().optional(), + type: OutputWebFetchServerToolItemType$outboundSchema, url: z.string().optional(), }); +export function outputWebFetchServerToolItemToJSON( + outputWebFetchServerToolItem: OutputWebFetchServerToolItem, +): string { + return JSON.stringify( + OutputWebFetchServerToolItem$outboundSchema.parse( + outputWebFetchServerToolItem, + ), + ); +} export function outputWebFetchServerToolItemFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/updateworkspacerequest.ts b/src/models/updateworkspacerequest.ts index 013de86d..a5317e26 100644 --- a/src/models/updateworkspacerequest.ts +++ b/src/models/updateworkspacerequest.ts @@ -23,6 +23,14 @@ export type UpdateWorkspaceRequest = { * New description for the workspace */ description?: string | null | undefined; + /** + * Optional array of API key IDs to filter I/O logging + */ + ioLoggingApiKeyIds?: Array | null | undefined; + /** + * Sampling rate for I/O logging (0.0001-1) + */ + ioLoggingSamplingRate?: number | undefined; /** * Whether data discount logging is enabled */ @@ -51,6 +59,8 @@ export type UpdateWorkspaceRequest$Outbound = { default_provider_sort?: string | null | undefined; default_text_model?: string | null | undefined; description?: string | null | undefined; + io_logging_api_key_ids?: Array | null | undefined; + io_logging_sampling_rate?: number | undefined; is_data_discount_logging_enabled?: boolean | undefined; is_observability_broadcast_enabled?: boolean | undefined; is_observability_io_logging_enabled?: boolean | undefined; @@ -67,6 +77,8 @@ export const UpdateWorkspaceRequest$outboundSchema: z.ZodType< defaultProviderSort: z.nullable(z.string()).optional(), defaultTextModel: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), + ioLoggingApiKeyIds: z.nullable(z.array(z.int())).optional(), + ioLoggingSamplingRate: z.number().optional(), isDataDiscountLoggingEnabled: z.boolean().optional(), isObservabilityBroadcastEnabled: z.boolean().optional(), isObservabilityIoLoggingEnabled: z.boolean().optional(), @@ -77,6 +89,8 @@ export const UpdateWorkspaceRequest$outboundSchema: z.ZodType< defaultImageModel: "default_image_model", defaultProviderSort: "default_provider_sort", defaultTextModel: "default_text_model", + ioLoggingApiKeyIds: "io_logging_api_key_ids", + ioLoggingSamplingRate: "io_logging_sampling_rate", isDataDiscountLoggingEnabled: "is_data_discount_logging_enabled", isObservabilityBroadcastEnabled: "is_observability_broadcast_enabled", isObservabilityIoLoggingEnabled: "is_observability_io_logging_enabled", diff --git a/src/models/videogenerationrequest.ts b/src/models/videogenerationrequest.ts index ad303995..be5b7dc1 100644 --- a/src/models/videogenerationrequest.ts +++ b/src/models/videogenerationrequest.ts @@ -180,6 +180,10 @@ export type VideoGenerationRequest = { * Aspect ratio of the generated video */ aspectRatio?: AspectRatio | undefined; + /** + * URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. + */ + callbackUrl?: string | undefined; /** * Duration of the generated video in seconds */ @@ -512,6 +516,7 @@ export const Resolution$outboundSchema: z.ZodType = /** @internal */ export type VideoGenerationRequest$Outbound = { aspect_ratio?: string | undefined; + callback_url?: string | undefined; duration?: number | undefined; frame_images?: Array | undefined; generate_audio?: boolean | undefined; @@ -530,6 +535,7 @@ export const VideoGenerationRequest$outboundSchema: z.ZodType< VideoGenerationRequest > = z.object({ aspectRatio: AspectRatio$outboundSchema.optional(), + callbackUrl: z.string().optional(), duration: z.int().optional(), frameImages: z.array(FrameImage$outboundSchema).optional(), generateAudio: z.boolean().optional(), @@ -544,6 +550,7 @@ export const VideoGenerationRequest$outboundSchema: z.ZodType< }).transform((v) => { return remap$(v, { aspectRatio: "aspect_ratio", + callbackUrl: "callback_url", frameImages: "frame_images", generateAudio: "generate_audio", inputReferences: "input_references", diff --git a/src/models/workspace.ts b/src/models/workspace.ts index 45c8a8b5..935c4c5a 100644 --- a/src/models/workspace.ts +++ b/src/models/workspace.ts @@ -38,6 +38,14 @@ export type Workspace = { * Unique identifier for the workspace */ id: string; + /** + * Optional array of API key IDs to filter I/O logging. Null means all keys are logged. + */ + ioLoggingApiKeyIds: Array | null; + /** + * Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. + */ + ioLoggingSamplingRate: number; /** * Whether data discount logging is enabled for this workspace */ @@ -73,6 +81,8 @@ export const Workspace$inboundSchema: z.ZodType = z.object({ default_text_model: z.nullable(z.string()), description: z.nullable(z.string()), id: z.string(), + io_logging_api_key_ids: z.nullable(z.array(z.int())), + io_logging_sampling_rate: z.number(), is_data_discount_logging_enabled: z.boolean(), is_observability_broadcast_enabled: z.boolean(), is_observability_io_logging_enabled: z.boolean(), @@ -86,6 +96,8 @@ export const Workspace$inboundSchema: z.ZodType = z.object({ "default_image_model": "defaultImageModel", "default_provider_sort": "defaultProviderSort", "default_text_model": "defaultTextModel", + "io_logging_api_key_ids": "ioLoggingApiKeyIds", + "io_logging_sampling_rate": "ioLoggingSamplingRate", "is_data_discount_logging_enabled": "isDataDiscountLoggingEnabled", "is_observability_broadcast_enabled": "isObservabilityBroadcastEnabled", "is_observability_io_logging_enabled": "isObservabilityIoLoggingEnabled",