From a0824563ae679199f56e4cf876e63c3014ca90b0 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 7 Jul 2026 21:48:27 +0000 Subject: [PATCH 1/2] ## Typescript SDK Changes: * `openrouter.stt.createTranscription()`: * `request.sttRequest` **Changed** * `response` **Changed** * `openrouter.stt.createTranscriptionMultipart()`: * `request.requestBody` **Changed** * `response` **Changed** * `openrouter.datasets.getRankingsDaily()`: `request` **Changed** --- .speakeasy/gen.lock | 149 +++++++---- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 249 +++++++++++++++++- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- docs/models/operations/contextbucket.mdx | 21 ++ ...udiotranscriptionsmultipartrequestbody.mdx | 5 +- .../operations/getrankingsdailycategory.mdx | 21 ++ .../operations/getrankingsdailyrequest.mdx | 19 +- docs/models/operations/languagetype.mdx | 21 ++ docs/models/operations/modality.mdx | 21 ++ docs/models/operations/period.mdx | 21 ++ docs/models/operations/responseformat.mdx | 8 +- .../operations/timestampgranularities.mdx | 19 ++ docs/models/speechrequest.mdx | 2 +- ...um.mdx => speechrequestresponseformat.mdx} | 6 +- docs/models/sttrequest.mdx | 16 +- docs/models/sttrequestresponseformat.mdx | 21 ++ docs/models/sttresponse.mdx | 7 +- docs/models/sttsegment.mdx | 33 +++ docs/models/stttimestampgranularity.mdx | 21 ++ docs/models/sttword.mdx | 25 ++ docs/sdks/datasets/README.mdx | 7 + jsr.json | 2 +- package.json | 14 +- src/funcs/datasetsGetRankingsDaily.ts | 12 + src/funcs/sttCreateTranscriptionMultipart.ts | 7 + src/lib/config.ts | 4 +- src/models/index.ts | 3 + .../createaudiotranscriptionsmultipart.ts | 36 ++- src/models/operations/getrankingsdaily.ts | 135 ++++++++++ src/models/speechrequest.ts | 16 +- src/models/sttrequest.ts | 41 +++ src/models/sttresponse.ts | 27 ++ src/models/sttsegment.ts | 87 ++++++ src/models/stttimestampgranularity.ts | 26 ++ src/models/sttword.ts | 44 ++++ src/sdk/datasets.ts | 7 + 38 files changed, 1073 insertions(+), 104 deletions(-) create mode 100644 docs/models/operations/contextbucket.mdx create mode 100644 docs/models/operations/getrankingsdailycategory.mdx create mode 100644 docs/models/operations/languagetype.mdx create mode 100644 docs/models/operations/modality.mdx create mode 100644 docs/models/operations/period.mdx create mode 100644 docs/models/operations/timestampgranularities.mdx rename docs/models/{responseformatenum.mdx => speechrequestresponseformat.mdx} (56%) create mode 100644 docs/models/sttrequestresponseformat.mdx create mode 100644 docs/models/sttsegment.mdx create mode 100644 docs/models/stttimestampgranularity.mdx create mode 100644 docs/models/sttword.mdx create mode 100644 src/models/sttsegment.ts create mode 100644 src/models/stttimestampgranularity.ts create mode 100644 src/models/sttword.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5e13c710d..0e064af6d 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 8f5f7de14ca3d171835598c14e73ad97 + docChecksum: 1a57ba8663bff56b84e58cd70c6afd7c docVersion: 1.0.0 speakeasyVersion: 1.763.2 generationVersion: 2.884.4 - releaseVersion: 0.13.27 - configChecksum: 96f2117240a58e33dcdc8158d6eb3ef6 + releaseVersion: 0.13.28 + configChecksum: d7b58d2e40c5b5709162e6cf6e5dd65e repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: f16146f0-a144-43ac-98e3-c5419f730bab - pristine_commit_hash: eacf13ad9da490a9ce61f5ddbaa8bf698b37f93b - pristine_tree_hash: 89d85d368f1c10ac569c9350b9d3b5a9378e45c3 + generation_id: 65f6ab08-cc04-4c8e-9092-2b1c060f99c1 + pristine_commit_hash: 565f74d31f4b796d1d13973952ccadd9aa156f8e + pristine_tree_hash: 95dc95a551697c2a0d583e2734010a48650d7e5d features: typescript: acceptHeaders: 2.81.2 @@ -6492,6 +6492,10 @@ trackedFiles: id: f285c3c8700e last_write_checksum: sha1:2c46b75396c1bcb630c7798e3eefc641f9dcc555 pristine_git_object: 3aad999fb062be2877b6bb7f05ba8619f146d8c8 + docs/models/operations/contextbucket.mdx: + id: a60f1f5ea284 + last_write_checksum: sha1:09ddb20c0b4ae19faf2a0d6981dbc7f881ab38e6 + pristine_git_object: ecb3018d661ab70c0f3df141a30fdf36a2e54e43 docs/models/operations/costdetails.md: id: 2244d5f1d81e last_write_checksum: sha1:63aa69f94709909458489c896490b7957696f9c3 @@ -6542,8 +6546,8 @@ trackedFiles: pristine_git_object: e08cabe8838f39f909b860ebc6d5870e25674b5f docs/models/operations/createaudiotranscriptionsmultipartrequestbody.mdx: id: fc22099a3f6b - last_write_checksum: sha1:da61e8b767c8718c938b6a907718369f820c0f0a - pristine_git_object: f3c521e225a093ad98788c52b53df80bc292065b + last_write_checksum: sha1:b4c6635571d38d6a05b94279d9cf7124ef9c4ea2 + pristine_git_object: bfcbac846ddc9b6509e631b90f93d10f88ac9b80 docs/models/operations/createaudiotranscriptionsrequest.md: id: 31a341d016bb last_write_checksum: sha1:d5048af13afe597d60f3731c62cc347041551ed9 @@ -7435,6 +7439,10 @@ trackedFiles: id: 41262a2f0b75 last_write_checksum: sha1:e9fb19ccdd6d045e10b52a461043d11cdc11ee72 pristine_git_object: 4b0ffbd7bc7bfcc06a75cf0611b9e62245e1123c + docs/models/operations/getrankingsdailycategory.mdx: + id: 9307256562a8 + last_write_checksum: sha1:b3c8e6bde94778a0a92f60587c369a476fa21feb + pristine_git_object: 88afdc7242b36493796ccc3f715c50a32d2aa079 docs/models/operations/getrankingsdailyglobals.md: id: dd96d9c22697 last_write_checksum: sha1:f0338eba8d0a81ddb09a293b4a9aa723266cf9bd @@ -7451,8 +7459,8 @@ trackedFiles: deleted: true docs/models/operations/getrankingsdailyrequest.mdx: id: 6dfdb3504444 - last_write_checksum: sha1:5f946b338db63c3c7ce7cb382b08c0bc5bad5b7f - pristine_git_object: b5d72d0079c9a8b5e0f9b122eb187a3d5c947b9c + last_write_checksum: sha1:b0c37c97d2e9e9e55233fa026f4ffe3031816518 + pristine_git_object: a8d815b3da3d87b5c263febb15aa82218acc7c77 docs/models/operations/gettaskclassificationsglobals.md: id: 39c95297a6c7 last_write_checksum: sha1:d3cdded90a20312c4cce31776ed51a44115868e5 @@ -7554,6 +7562,10 @@ trackedFiles: id: e1966b690efd last_write_checksum: sha1:75b21f671e2bdeb55b6badd248f27a3d9a3431d6 pristine_git_object: e7222d1f3e732241030df7ab5612b086ab2bda9a + docs/models/operations/languagetype.mdx: + id: 086bdbefa10c + last_write_checksum: sha1:66c73ffc67d8de172550360167f4aae12bf86bc1 + pristine_git_object: cd6ab5f62f5aa6bacc0f3251b2cd48c359a29c04 docs/models/operations/listbyokkeysglobals.md: id: 2ec47afa72f6 last_write_checksum: sha1:e21b7823b008931df19053631eec0af403c92d66 @@ -8043,6 +8055,10 @@ trackedFiles: id: 200e854b5b6b last_write_checksum: sha1:ba913bb9141224d082fa4e0bb3e6634e0b067486 pristine_git_object: baf32b1b82dad22a865a491e1f3342389a3d60a3 + docs/models/operations/modality.mdx: + id: 379dc3070d2a + last_write_checksum: sha1:e47631d04866f7ec83737e934f14391e037c3175 + pristine_git_object: 8f8eda2492414470708913261e9001072c96a24d docs/models/operations/objectembedding.mdx: id: 13e39ce5a598 last_write_checksum: sha1:31812369e37f0b89e45d2b28acaa802189a9fcd3 @@ -8083,6 +8099,10 @@ trackedFiles: id: dbfeee94a561 last_write_checksum: sha1:d8eeabccfd30353e2dba7f5fb7d18b6027ef0076 pristine_git_object: 7e0164874ae8c4f20accc56854ac27f20a4f2b22 + docs/models/operations/period.mdx: + id: 1fe51817870a + last_write_checksum: sha1:4970aa01ca6fb6eb15f0250c3c47b71cd2a81e15 + pristine_git_object: d6ec95a19b2928502c92f8beee8cd97e8f5c9cd1 docs/models/operations/prompttokensdetails.md: id: ed0db1d0b1b5 last_write_checksum: sha1:e83927d9f7d56e96acaabc5b355252be3e78f07d @@ -8175,8 +8195,8 @@ trackedFiles: deleted: true docs/models/operations/responseformat.mdx: id: afbebcea034b - last_write_checksum: sha1:b5318b96124ae8b72add8556d96296b740506d4a - pristine_git_object: dfc18dc5fc67f42ac1cc684ce9eba4b5cf569529 + last_write_checksum: sha1:3fae3af54e36a362da0fbd9ed50b819c987bfc24 + pristine_git_object: 37540faa291e56d2d182fc3e136a61c6e907d190 docs/models/operations/result.md: id: 6953cabb9266 last_write_checksum: sha1:169e606b02c5bf9775b900a153b5ba98cc77dd9d @@ -8248,6 +8268,10 @@ trackedFiles: id: 291e7bd950ea last_write_checksum: sha1:cd95731a1a04d2b01c0b2332d9b3f5c26123e23c pristine_git_object: 838df8340cf186499d1450460478c1795baa0cc2 + docs/models/operations/timestampgranularities.mdx: + id: fbda673978d2 + last_write_checksum: sha1:8672fb673d3543985c76ede8798f9f19c197e6ff + pristine_git_object: 7caa44f0098c775c3fbd2b3bab79f333f80b252d docs/models/operations/updatebyokkeyglobals.md: id: 2414875fe0e2 last_write_checksum: sha1:35bb40fed4968387e68de252f6502617657c1e3f @@ -10009,10 +10033,6 @@ trackedFiles: last_write_checksum: sha1:42b38026cf98dc551e87445a5b5868c181e24037 pristine_git_object: 07f2f66424055d7e0efcc8da9f21091800413c13 deleted: true - docs/models/responseformatenum.mdx: - id: 23b674b0461b - last_write_checksum: sha1:ee041886b8c89fcc565f2d9beb8592d994d01f98 - pristine_git_object: 473f544835b48e452ee7b3667a3f21d3f545e4d0 docs/models/responsehealingplugin.md: id: bac517f9331b last_write_checksum: sha1:d648c8cf3df4c59aac454314552a7864745f7ff4 @@ -10454,8 +10474,8 @@ trackedFiles: deleted: true docs/models/speechrequest.mdx: id: c9e3c03ff84e - last_write_checksum: sha1:789bb0e44254e8d45d6e9d71fcc48f45b7c4cb2f - pristine_git_object: b8a0db1dc337f7ca7c6203b6dfb043b17e199d6a + last_write_checksum: sha1:5ac5106618d40464284599b39ae14237404f313c + pristine_git_object: a6a20f9adb1f144f7eb5a9d949c6ccdfe07fd13b docs/models/speechrequestoptions.md: id: 2d3d36e99ad0 last_write_checksum: sha1:a5810a37b774c3e34bb1d943b64620bc31de2278 @@ -10470,6 +10490,10 @@ trackedFiles: id: 5cc34a7a437c last_write_checksum: sha1:8365a336c495f109137517423133e373fbf055f2 pristine_git_object: 7df1d6454b3345f86653ee653d3e72bfe5b61792 + docs/models/speechrequestresponseformat.mdx: + id: 7200d4067ed4 + last_write_checksum: sha1:6408066269a07cc06a330c6c4b26543a96ecd8e8 + pristine_git_object: a1aca57e1da6af144b0eefa4bd9da2cabf1ae7aa docs/models/speed.md: id: bb9f84c89a03 last_write_checksum: sha1:5552d8f62c081d98de3274fc62419aac109d7027 @@ -10658,8 +10682,8 @@ trackedFiles: deleted: true docs/models/sttrequest.mdx: id: 3db98eb65064 - last_write_checksum: sha1:f2ec9f643cd6fb11dfa18ce10bca40f752484b82 - pristine_git_object: f7eb611f4e1f9edf6dd5a3ef2412ebcd060f43f5 + last_write_checksum: sha1:22c2254693e99adce612bd299d9d7d1e57299717 + pristine_git_object: a73202bfd583b6a408e4404d0c9aaae2cd621ed9 docs/models/sttrequestprovider.md: id: 6c1330c9d45f last_write_checksum: sha1:6f6b7c1c0fb5efbb016f5e6a4bc34b4086e4a903 @@ -10669,6 +10693,10 @@ trackedFiles: id: 6129e97c62b2 last_write_checksum: sha1:9bb74e341bd6c82dbe0e0f2efb55d7517b4be2df pristine_git_object: 0c02e68fb6aeeab5b882e739471a46414d2d528f + docs/models/sttrequestresponseformat.mdx: + id: 4b6efef684b4 + last_write_checksum: sha1:ca1dc01fc9aa726718308b73f7bb0c778ecc56e9 + pristine_git_object: 80ebbbaeb78e52749a96fc31bf13114657b0bd6d docs/models/sttresponse.md: id: e93076045504 last_write_checksum: sha1:b113380bd7e9de0ec5eb11ec42117fae7227a825 @@ -10676,8 +10704,16 @@ trackedFiles: deleted: true docs/models/sttresponse.mdx: id: b32fefefc5a1 - last_write_checksum: sha1:e2192ea24630069962ca21124866ae467134b2cf - pristine_git_object: a167932610a950870800af5b1fa41267ffc73328 + last_write_checksum: sha1:a4bc858708760917d53cb7e7563fd12a14458ebf + pristine_git_object: 2669680d76daafa6f2610066ec642bc3352f236c + docs/models/sttsegment.mdx: + id: dafc141a887e + last_write_checksum: sha1:c9cce798594594f258b01cdcd018ccef6c61283e + pristine_git_object: 20193a812aa3594833becbd8c097481238e36a51 + docs/models/stttimestampgranularity.mdx: + id: 07ff4ca92af0 + last_write_checksum: sha1:d33580c40ef765a902ff68a8daeb852dfc037cab + pristine_git_object: e21f981f5c9947cb65b6f06c185901448f6c0355 docs/models/sttusage.md: id: fb5b46b82d83 last_write_checksum: sha1:54d203a4687ff52092d3b1997d1e4adad6977966 @@ -10687,6 +10723,10 @@ trackedFiles: id: 999635872b99 last_write_checksum: sha1:f87189f6ebd0bd888170001b15d160582b545624 pristine_git_object: 99ed839ab9ce881a087a70ea93436e3af3471738 + docs/models/sttword.mdx: + id: f08736cccd98 + last_write_checksum: sha1:73cea0506546a3b8015603a6f720afe1bf5ab7e3 + pristine_git_object: a4306639c1aeb1672d5ebf5cf37cb47a37427762 docs/models/subagentnestedtool.md: id: 64f36dbb6ae1 last_write_checksum: sha1:a0115ffc5e144eabe874bee90968a8856e9b28b5 @@ -11942,8 +11982,8 @@ trackedFiles: deleted: true docs/sdks/datasets/README.mdx: id: 15e5ab0183de - last_write_checksum: sha1:125c9da6cf18a0d623948b3a5223376211175cbb - pristine_git_object: 1e23b04cae7738a6741fbabd19d7d10e34d1461a + last_write_checksum: sha1:fcc637e5ed5e2ddfa56c3eea84a41ed7f0bf1448 + pristine_git_object: 7601498429445c6d877096d06f4a72ee46403748 docs/sdks/embeddings/README.mdx: id: cd71581df291 last_write_checksum: sha1:b2fe683118139b4e1ea49c5ae049a2bccdff6c04 @@ -12088,12 +12128,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:46ff8ea7453cbb9e67914c9a2f4609de2574f2ec - pristine_git_object: f776154cb0197d44879c0b1e19457f0f10bad891 + last_write_checksum: sha1:097d6ae93ed4a6195ff5133f160e0be922af99fe + pristine_git_object: 8f7254e1fd295e730e9dc654e64d1bd739c36668 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:2de97c23a918f09c122e2659d31a1dfd30501bb9 - pristine_git_object: d98d27e095d10b2dce0ce6766a7ce37590d3ec4a + last_write_checksum: sha1:89c242673393c12fe7eaccd2228d21ffc3e577c9 + pristine_git_object: c7058b79798893f7e856038c6c814d6cae243496 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -12180,8 +12220,8 @@ trackedFiles: pristine_git_object: d5cedc6219034e33b9a17b67e43b9fcb7b0b033c src/funcs/datasetsGetRankingsDaily.ts: id: f0177699bfaf - last_write_checksum: sha1:1249e6d078bcb317f5086a7719057b6176935b08 - pristine_git_object: 9a09eb2872375b1d550d09ca515f3b792637190b + last_write_checksum: sha1:cf25ca1a1c141c0ba5f1efbf18cead0d4e9e357d + pristine_git_object: 283c4fb40018046b20aba0f0cd07dc07d300ef05 src/funcs/embeddingsGenerate.ts: id: f6455fcfe2c8 last_write_checksum: sha1:689ffe08961ffe06d9c515eccf6b71142da52051 @@ -12380,8 +12420,8 @@ trackedFiles: pristine_git_object: 17376cac83c1540a625b51a55356700fdccff754 src/funcs/sttCreateTranscriptionMultipart.ts: id: ec09b43036c3 - last_write_checksum: sha1:4d26646888dcf54f6eec40dffa7c327338583ee0 - pristine_git_object: 839d5b8a8067a0b1469278d7ed364093cb583921 + last_write_checksum: sha1:adcbc7e31ac589ccc8d77b0a492251f6376ae4eb + pristine_git_object: 99e46fefcbf2a7d7476c10f18d500c781046ba44 src/funcs/ttsCreateSpeech.ts: id: ed304f5d6ad8 last_write_checksum: sha1:c10aaf95268325ae6691c0d13c7a55c61d68646d @@ -12468,8 +12508,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:eb9ca94bcf7660f2ed737ba84a5191402384dd3d - pristine_git_object: 7e9565e8d898757a7d6811a36cdb5082bd5257f5 + last_write_checksum: sha1:3b6a61c4011ea5dfe871e7d5ccb745a18471f3ce + pristine_git_object: c550996e218ff881e9fef33367ae17815283b46b src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -13620,8 +13660,8 @@ trackedFiles: pristine_git_object: 8e109bedfdcf2c4808e49323dda861e3c6069d51 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:f61801e044abad412cbd763cca7831e03a477220 - pristine_git_object: 3016f8ee880e4c4d4d765e318fc9dee0595a39be + last_write_checksum: sha1:8e01211aa6b649d6161a54824e6a946614db39dc + pristine_git_object: e274ebce5985aa21e76eb930f3721a7fc80af894 src/models/inputaudio.ts: id: 9bdc14c7565f last_write_checksum: sha1:2f8dc4c1d6a9c2927d9eb186e0ecedf7b81838e6 @@ -14000,8 +14040,8 @@ trackedFiles: pristine_git_object: 680fccc1542fed95993d96651f175c345bb4c687 src/models/operations/createaudiotranscriptionsmultipart.ts: id: 29a4e7468387 - last_write_checksum: sha1:1dfdd5c887560bbaaa154dbc91e8d8802a9a4f87 - pristine_git_object: 1a41300bfc724640dbfee22a972855fb36fb8620 + last_write_checksum: sha1:b2e483531f8ffbb3df7dff19a4500c967933685b + pristine_git_object: 1cbb0a53b1fdd9e0117ddefa79bb0473abe4f447 src/models/operations/createauthkeyscode.ts: id: 1443f6afbf40 last_write_checksum: sha1:752516c2ce734a4a22ec17355adb8c1607859959 @@ -14156,8 +14196,8 @@ trackedFiles: pristine_git_object: 6720ddf5594b84e705b19f0d494809a9ed17c537 src/models/operations/getrankingsdaily.ts: id: b165b39aba3b - last_write_checksum: sha1:f3f6720e5806c995b1b8d1ff50c78695fdf4e5dc - pristine_git_object: 9f6dbba7b0fbef8ca4ef105ff07a17622c041cf3 + last_write_checksum: sha1:32bf3b847bf3c69eda9be0575af092236369d58f + pristine_git_object: ddec4fc4a47b70dd7c8b3741232ffe93014bc97c src/models/operations/gettaskclassifications.ts: id: 8482753ddd33 last_write_checksum: sha1:eabf9f38dead635af268288733e71d20af1df218 @@ -14772,8 +14812,8 @@ trackedFiles: pristine_git_object: a9942b00e73f643b04914833159b39b28001fb66 src/models/speechrequest.ts: id: 96d573d68420 - last_write_checksum: sha1:045c49c40eed5b7f932352d3562a59e2b482438d - pristine_git_object: 251fab2b7ba3a9843221a9ea9a5f7f54dd3f67c5 + last_write_checksum: sha1:263a2b6351d0fdb6ac4d756d862ffcd2358ef81a + pristine_git_object: 4d1ed973065fa1854c0446f5dfb138f92d26f287 src/models/stopservertoolswhencondition.ts: id: 3c90e3993bad last_write_checksum: sha1:b95847e6581593c6f1106971d0508acb2cce1106 @@ -14840,16 +14880,28 @@ trackedFiles: pristine_git_object: 48c884de16729adba8d45fb09a6e3fd292925570 src/models/sttrequest.ts: id: 3be8453c0517 - last_write_checksum: sha1:afe21589b9426c17b20c4ee76a92d81a88d9e939 - pristine_git_object: ae4c8f749a78648a808311dc0492b39d1d44573c + last_write_checksum: sha1:6c1655746cbfc4a4de0fcf9ae2f667d0470c35e3 + pristine_git_object: a5a34acaba5770d798829482948b0c3ee24069a7 src/models/sttresponse.ts: id: 383a6e21047b - last_write_checksum: sha1:9c01392c6013a053174a511ec0a013002be54697 - pristine_git_object: bd24a57f88a46201ccfea0a2ae8a5f2dfb20448c + last_write_checksum: sha1:caf1496912c71478147c631a755b6c01c94ff434 + pristine_git_object: 0ea35bd4b4c0f45530da2baaf7dd8cc092990e3c + src/models/sttsegment.ts: + id: 610157864a1c + last_write_checksum: sha1:3c19b7646ee140288a61ddaede68fc56c398ad53 + pristine_git_object: 81e4bd10dff6da90b91909aab40c67e179d9b9db + src/models/stttimestampgranularity.ts: + id: 506bf5060d97 + last_write_checksum: sha1:d7f575d280d0b3bc8e35ed5f2a55a4c38212ab24 + pristine_git_object: b08b05137cfba7c7b9a0830bd72a6632b194ab14 src/models/sttusage.ts: id: 6d43566c0d40 last_write_checksum: sha1:8754d3492cdde94b8fc2babd96d083eee39d4a6b pristine_git_object: 2b8edcdd24e9b9f75bf1ac78f79c387794ac839b + src/models/sttword.ts: + id: 748744003b2c + last_write_checksum: sha1:27c1fa0fe81276b1dae800d3ccdb5e9f6532222c + pristine_git_object: ab8c14d037914d0f42619840500d6450c1cdd82e src/models/subagentnestedtool.ts: id: 9d5ec7df4bc2 last_write_checksum: sha1:3003fc14a329a54d5683d4253bf40648c0d0fd78 @@ -15144,8 +15196,8 @@ trackedFiles: pristine_git_object: 02d1a2d408eca05a63439bdb65dfda8821f141fd src/sdk/datasets.ts: id: 2f1e89a21914 - last_write_checksum: sha1:7e47655fbd6ffb4173dc60d6c78a1882a650be3e - pristine_git_object: 487dc147768e5637f03ab62fbb2b43b471613bab + last_write_checksum: sha1:44ec9146b34a81c806a25d80294f96dfe78d12f4 + pristine_git_object: 04e4443073875177cd2e4d723a8b8035728563ec src/sdk/embeddings.ts: id: 70cbb18bedaf last_write_checksum: sha1:e62ce45c27f12941ae5ec7e458b87952db3cedba @@ -16781,3 +16833,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 +releaseNotes: "## Typescript SDK Changes:\n* `openrouter.stt.createTranscription()`: \n * `request.sttRequest` **Changed**\n * `response` **Changed**\n* `openrouter.stt.createTranscriptionMultipart()`: \n * `request.requestBody` **Changed**\n * `response` **Changed**\n* `openrouter.datasets.getRankingsDaily()`: `request` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1b5389aa5..747052521 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 0.13.27 + version: 0.13.28 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c523eb822..dd4c5854b 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -20696,11 +20696,28 @@ components: options: $ref: '#/components/schemas/ProviderOptions' type: object + response_format: + description: >- + Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + enum: + - json + - verbose_json + example: json + type: string + x-speakeasy-unknown-values: allow temperature: description: Sampling temperature for transcription example: 0 format: double type: number + timestamp_granularities: + description: >- + Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". + example: + - segment + items: + $ref: '#/components/schemas/STTTimestampGranularity' + type: array required: - model - input_audio @@ -20716,6 +20733,24 @@ components: seconds: 9.2 total_tokens: 113 properties: + duration: + description: Duration of the input audio in seconds, present when response_format is verbose_json + example: 9.2 + format: double + type: number + language: + description: Detected or forced language, present when response_format is verbose_json + example: english + type: string + segments: + description: Timestamped transcript segments, present when response_format is verbose_json + items: + $ref: '#/components/schemas/STTSegment' + type: array + task: + description: The task performed, present when response_format is verbose_json + example: transcribe + type: string text: description: The transcribed text example: >- @@ -20723,9 +20758,88 @@ components: type: string usage: $ref: '#/components/schemas/STTUsage' + words: + description: Timestamped words, present when the provider returns word-level timestamps + items: + $ref: '#/components/schemas/STTWord' + type: array required: - text type: object + STTSegment: + description: A timestamped transcript segment, returned when response_format is verbose_json + example: + avg_logprob: -0.28 + compression_ratio: 1.13 + end: 3.2 + id: 0 + no_speech_prob: 0.01 + seek: 0 + start: 0 + temperature: 0 + text: Hello there. + tokens: + - 50364 + - 2425 + - 456 + properties: + avg_logprob: + description: Average log probability of the segment + format: double + type: number + compression_ratio: + description: Compression ratio of the segment + format: double + type: number + end: + description: Segment end time in seconds + example: 3.2 + format: double + type: number + id: + description: Segment index within the transcript + example: 0 + type: integer + no_speech_prob: + description: Probability the segment contains no speech + format: double + type: number + seek: + description: Seek offset of the segment + example: 0 + type: integer + start: + description: Segment start time in seconds + example: 0 + format: double + type: number + temperature: + description: Temperature used for the segment + format: double + type: number + text: + description: Transcribed text of the segment + example: Hello there. + type: string + tokens: + description: Token IDs of the segment + items: + type: integer + type: array + required: + - id + - start + - end + - text + type: object + STTTimestampGranularity: + description: A timestamp detail level for verbose_json transcription responses. + enum: + - word + - segment + example: word + type: string + x-speakeasy-unknown-values: allow STTUsage: description: Aggregated usage statistics for the request example: @@ -20758,6 +20872,32 @@ components: example: 113 type: integer type: object + STTWord: + description: A timestamped word, returned when the provider includes word-level timestamps + example: + end: 0.4 + start: 0 + word: Hello + properties: + end: + description: Word end time in seconds + example: 0.4 + format: double + type: number + start: + description: Word start time in seconds + example: 0 + format: double + type: number + word: + description: The transcribed word + example: Hello + type: string + required: + - word + - start + - end + type: object SubagentNestedTool: additionalProperties: nullable: true @@ -23756,13 +23896,26 @@ paths: description: The model to use for transcription. type: string response_format: - description: The response format. Only "json" is supported. + description: >- + The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). enum: - json + - verbose_json type: string + x-speakeasy-unknown-values: allow temperature: description: The sampling temperature. type: number + timestamp_granularities[]: + description: >- + Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. + items: + enum: + - word + - segment + type: string + x-speakeasy-unknown-values: allow + type: array required: - file - model @@ -25516,6 +25669,13 @@ paths: reserved permaslug `other` and is always returned last within its date, so callers can compute `top-50 traffic / total daily traffic` without a second request. + Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time + grain. `modality` and `context_bucket` narrow the exact dataset by output/input + modality (or tool-calling activity) and request context length. `category` and + `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are + weekly-grain estimates — they cannot be combined with each other or with the exact + filters, and reject `period=day` with a 400. + Authenticate with any valid OpenRouter API key (same key used for inference). Rate-limited to 30 requests/minute per key and 500 requests/day per account. @@ -25550,6 +25710,93 @@ paths: example: '2026-05-11' pattern: ^\d{4}-\d{2}-\d{2}$ type: string + - description: >- + Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + in: query + name: period + required: false + schema: + description: >- + Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + enum: + - day + - week + - month + example: day + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + in: query + name: modality + required: false + schema: + description: >- + Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + enum: + - text + - image + - image_output + - audio + - tool_calling + example: text + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + in: query + name: context_bucket + required: false + schema: + description: >- + Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + enum: + - 1K + - 10K + - 100K + - 1M + - 10M + example: 100K + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + in: query + name: category + required: false + schema: + description: >- + Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + example: programming + type: string + x-speakeasy-unknown-values: allow + - description: >- + Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + in: query + name: language_type + required: false + schema: + description: >- + Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + enum: + - natural + - programming + example: natural + type: string + x-speakeasy-unknown-values: allow responses: '200': content: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 18613d78d..c1211b72b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.763.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:8fa6fcbf5e63ee5f39c79269965678734263cd9a852faf0e010ef50bc6ac0f4e - sourceBlobDigest: sha256:95e0cddee7109d51fb81fb6cd47ba258a1a9e94c8c42819470b052097f482503 + sourceRevisionDigest: sha256:4ffc9fdd0407af4d86e8e3a5bbbc96102772248af9f12b6fe6ac66c4455b46f3 + sourceBlobDigest: sha256:052977af275318cfdcbbc6cb8c36cef93812c28d93ada67f06074ea8c54dd1b9 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:8fa6fcbf5e63ee5f39c79269965678734263cd9a852faf0e010ef50bc6ac0f4e - sourceBlobDigest: sha256:95e0cddee7109d51fb81fb6cd47ba258a1a9e94c8c42819470b052097f482503 + sourceRevisionDigest: sha256:4ffc9fdd0407af4d86e8e3a5bbbc96102772248af9f12b6fe6ac66c4455b46f3 + sourceBlobDigest: sha256:052977af275318cfdcbbc6cb8c36cef93812c28d93ada67f06074ea8c54dd1b9 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:f702621147305f76823110efddda25da5e8f858abaa114a565b6d9c7d29c5fd6 + codeSamplesRevisionDigest: sha256:f1d13a7ce3aaac022623ed8e85172e23c394a581805aec99e7dffd0211f59145 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.763.2 diff --git a/RELEASES.md b/RELEASES.md index 4bcb9dff3..7d1c80375 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1506,4 +1506,14 @@ Based on: ### Generated - [typescript v0.13.27] . ### Releases -- [NPM v0.13.27] https://www.npmjs.com/package/@openrouter/sdk/v/0.13.27 - . \ No newline at end of file +- [NPM v0.13.27] https://www.npmjs.com/package/@openrouter/sdk/v/0.13.27 - . + +## 2026-07-07 21:46:25 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.763.2 (2.884.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.13.28] . +### Releases +- [NPM v0.13.28] https://www.npmjs.com/package/@openrouter/sdk/v/0.13.28 - . \ No newline at end of file diff --git a/docs/models/operations/contextbucket.mdx b/docs/models/operations/contextbucket.mdx new file mode 100644 index 000000000..ecb3018d6 --- /dev/null +++ b/docs/models/operations/contextbucket.mdx @@ -0,0 +1,21 @@ +--- +title: "ContextBucket" +--- + +Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + +## Example Usage + +```typescript +import { ContextBucket } from "@openrouter/sdk/models/operations"; + +let value: ContextBucket = "100K"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"1K" | "10K" | "100K" | "1M" | "10M" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/createaudiotranscriptionsmultipartrequestbody.mdx b/docs/models/operations/createaudiotranscriptionsmultipartrequestbody.mdx index f3c521e22..bfcbac846 100644 --- a/docs/models/operations/createaudiotranscriptionsmultipartrequestbody.mdx +++ b/docs/models/operations/createaudiotranscriptionsmultipartrequestbody.mdx @@ -17,5 +17,6 @@ import { CreateAudioTranscriptionsMultipartRequestBody } from "@openrouter/sdk/m | `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.CreateAudioTranscriptionsMultipartFile](../../models/operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. | | `language` | *string* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). | | `model` | *string* | :heavy_check_mark: | The model to use for transcription. | -| `responseFormat` | [operations.ResponseFormat](../../models/operations/responseformat.mdx) | :heavy_minus_sign: | The response format. Only "json" is supported. | -| `temperature` | *number* | :heavy_minus_sign: | The sampling temperature. | \ No newline at end of file +| `responseFormat` | [operations.ResponseFormat](../../models/operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). | +| `temperature` | *number* | :heavy_minus_sign: | The sampling temperature. | +| `timestampGranularities` | [operations.TimestampGranularities](../../models/operations/timestampgranularities.mdx)[] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. | \ No newline at end of file diff --git a/docs/models/operations/getrankingsdailycategory.mdx b/docs/models/operations/getrankingsdailycategory.mdx new file mode 100644 index 000000000..88afdc724 --- /dev/null +++ b/docs/models/operations/getrankingsdailycategory.mdx @@ -0,0 +1,21 @@ +--- +title: "GetRankingsDailyCategory" +--- + +Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + +## Example Usage + +```typescript +import { GetRankingsDailyCategory } from "@openrouter/sdk/models/operations"; + +let value: GetRankingsDailyCategory = "programming"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"programming" | "roleplay" | "marketing" | "marketing/seo" | "technology" | "science" | "translation" | "legal" | "finance" | "health" | "trivia" | "academia" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/getrankingsdailyrequest.mdx b/docs/models/operations/getrankingsdailyrequest.mdx index b5d72d007..a8d815b3d 100644 --- a/docs/models/operations/getrankingsdailyrequest.mdx +++ b/docs/models/operations/getrankingsdailyrequest.mdx @@ -12,10 +12,15 @@ let value: GetRankingsDailyRequest = {}; ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `startDate` | *string* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | -| `endDate` | *string* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `httpReferer` | *string* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `startDate` | *string* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | +| `endDate` | *string* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | +| `period` | [operations.Period](../../models/operations/period.mdx) | :heavy_minus_sign: | Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. | day | +| `modality` | [operations.Modality](../../models/operations/modality.mdx) | :heavy_minus_sign: | Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. | text | +| `contextBucket` | [operations.ContextBucket](../../models/operations/contextbucket.mdx) | :heavy_minus_sign: | Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. | 100K | +| `category` | [operations.GetRankingsDailyCategory](../../models/operations/getrankingsdailycategory.mdx) | :heavy_minus_sign: | Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. | programming | +| `languageType` | [operations.LanguageType](../../models/operations/languagetype.mdx) | :heavy_minus_sign: | Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. | natural | \ No newline at end of file diff --git a/docs/models/operations/languagetype.mdx b/docs/models/operations/languagetype.mdx new file mode 100644 index 000000000..cd6ab5f62 --- /dev/null +++ b/docs/models/operations/languagetype.mdx @@ -0,0 +1,21 @@ +--- +title: "LanguageType" +--- + +Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + +## Example Usage + +```typescript +import { LanguageType } from "@openrouter/sdk/models/operations"; + +let value: LanguageType = "natural"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"natural" | "programming" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/modality.mdx b/docs/models/operations/modality.mdx new file mode 100644 index 000000000..8f8eda249 --- /dev/null +++ b/docs/models/operations/modality.mdx @@ -0,0 +1,21 @@ +--- +title: "Modality" +--- + +Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + +## Example Usage + +```typescript +import { Modality } from "@openrouter/sdk/models/operations"; + +let value: Modality = "text"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"text" | "image" | "image_output" | "audio" | "tool_calling" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/period.mdx b/docs/models/operations/period.mdx new file mode 100644 index 000000000..d6ec95a19 --- /dev/null +++ b/docs/models/operations/period.mdx @@ -0,0 +1,21 @@ +--- +title: "Period" +--- + +Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + +## Example Usage + +```typescript +import { Period } from "@openrouter/sdk/models/operations"; + +let value: Period = "day"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"day" | "week" | "month" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/responseformat.mdx b/docs/models/operations/responseformat.mdx index dfc18dc5f..37540faa2 100644 --- a/docs/models/operations/responseformat.mdx +++ b/docs/models/operations/responseformat.mdx @@ -2,18 +2,20 @@ title: "ResponseFormat" --- -The response format. Only "json" is supported. +The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). ## Example Usage ```typescript import { ResponseFormat } from "@openrouter/sdk/models/operations"; -let value: ResponseFormat = "json"; +let value: ResponseFormat = "verbose_json"; + +// Open enum: unrecognized values are captured as Unrecognized ``` ## Values ```typescript -"json" +"json" | "verbose_json" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/operations/timestampgranularities.mdx b/docs/models/operations/timestampgranularities.mdx new file mode 100644 index 000000000..7caa44f00 --- /dev/null +++ b/docs/models/operations/timestampgranularities.mdx @@ -0,0 +1,19 @@ +--- +title: "TimestampGranularities" +--- + +## Example Usage + +```typescript +import { TimestampGranularities } from "@openrouter/sdk/models/operations"; + +let value: TimestampGranularities = "word"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"word" | "segment" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/speechrequest.mdx b/docs/models/speechrequest.mdx index b8a0db1dc..a6a20f9ad 100644 --- a/docs/models/speechrequest.mdx +++ b/docs/models/speechrequest.mdx @@ -23,6 +23,6 @@ let value: SpeechRequest = { | `input` | *string* | :heavy_check_mark: | Text to synthesize | Hello world | | `model` | *string* | :heavy_check_mark: | TTS model identifier | elevenlabs/eleven-turbo-v2 | | `provider` | [models.SpeechRequestProvider](../models/speechrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `responseFormat` | [models.ResponseFormatEnum](../models/responseformatenum.mdx) | :heavy_minus_sign: | Audio output format | pcm | +| `responseFormat` | [models.SpeechRequestResponseFormat](../models/speechrequestresponseformat.mdx) | :heavy_minus_sign: | Audio output format | pcm | | `speed` | *number* | :heavy_minus_sign: | Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. | 1 | | `voice` | *string* | :heavy_check_mark: | Voice identifier (provider-specific). | alloy | \ No newline at end of file diff --git a/docs/models/responseformatenum.mdx b/docs/models/speechrequestresponseformat.mdx similarity index 56% rename from docs/models/responseformatenum.mdx rename to docs/models/speechrequestresponseformat.mdx index 473f54483..a1aca57e1 100644 --- a/docs/models/responseformatenum.mdx +++ b/docs/models/speechrequestresponseformat.mdx @@ -1,5 +1,5 @@ --- -title: "ResponseFormatEnum" +title: "SpeechRequestResponseFormat" --- Audio output format @@ -7,9 +7,9 @@ Audio output format ## Example Usage ```typescript -import { ResponseFormatEnum } from "@openrouter/sdk/models"; +import { SpeechRequestResponseFormat } from "@openrouter/sdk/models"; -let value: ResponseFormatEnum = "pcm"; +let value: SpeechRequestResponseFormat = "pcm"; // Open enum: unrecognized values are captured as Unrecognized ``` diff --git a/docs/models/sttrequest.mdx b/docs/models/sttrequest.mdx index f7eb611f4..a73202bfd 100644 --- a/docs/models/sttrequest.mdx +++ b/docs/models/sttrequest.mdx @@ -20,10 +20,12 @@ let value: STTRequest = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `inputAudio` | [models.STTInputAudio](../models/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{
"data": "UklGRiQA...",
"format": "wav"
} | -| `language` | *string* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en | -| `model` | *string* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 | -| `provider` | [models.STTRequestProvider](../models/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `temperature` | *number* | :heavy_minus_sign: | Sampling temperature for transcription | 0 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `inputAudio` | [models.STTInputAudio](../models/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{
"data": "UklGRiQA...",
"format": "wav"
} | +| `language` | *string* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en | +| `model` | *string* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 | +| `provider` | [models.STTRequestProvider](../models/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | +| `responseFormat` | [models.STTRequestResponseFormat](../models/sttrequestresponseformat.mdx) | :heavy_minus_sign: | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json | +| `temperature` | *number* | :heavy_minus_sign: | Sampling temperature for transcription | 0 | +| `timestampGranularities` | [models.STTTimestampGranularity](../models/stttimestampgranularity.mdx)[] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". | [
"segment"
] | \ No newline at end of file diff --git a/docs/models/sttrequestresponseformat.mdx b/docs/models/sttrequestresponseformat.mdx new file mode 100644 index 000000000..80ebbbaeb --- /dev/null +++ b/docs/models/sttrequestresponseformat.mdx @@ -0,0 +1,21 @@ +--- +title: "STTRequestResponseFormat" +--- + +Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + +## Example Usage + +```typescript +import { STTRequestResponseFormat } from "@openrouter/sdk/models"; + +let value: STTRequestResponseFormat = "json"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"json" | "verbose_json" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/sttresponse.mdx b/docs/models/sttresponse.mdx index a16793261..2669680d7 100644 --- a/docs/models/sttresponse.mdx +++ b/docs/models/sttresponse.mdx @@ -18,5 +18,10 @@ let value: STTResponse = { | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `duration` | *number* | :heavy_minus_sign: | Duration of the input audio in seconds, present when response_format is verbose_json | 9.2 | +| `language` | *string* | :heavy_minus_sign: | Detected or forced language, present when response_format is verbose_json | english | +| `segments` | [models.STTSegment](../models/sttsegment.mdx)[] | :heavy_minus_sign: | Timestamped transcript segments, present when response_format is verbose_json | | +| `task` | *string* | :heavy_minus_sign: | The task performed, present when response_format is verbose_json | transcribe | | `text` | *string* | :heavy_check_mark: | The transcribed text | Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees. | -| `usage` | [models.STTUsage](../models/sttusage.mdx) | :heavy_minus_sign: | Aggregated usage statistics for the request | \{
"cost": 0.000508,
"input_tokens": 83,
"output_tokens": 30,
"seconds": 9.2,
"total_tokens": 113
} | \ No newline at end of file +| `usage` | [models.STTUsage](../models/sttusage.mdx) | :heavy_minus_sign: | Aggregated usage statistics for the request | \{
"cost": 0.000508,
"input_tokens": 83,
"output_tokens": 30,
"seconds": 9.2,
"total_tokens": 113
} | +| `words` | [models.STTWord](../models/sttword.mdx)[] | :heavy_minus_sign: | Timestamped words, present when the provider returns word-level timestamps | | \ No newline at end of file diff --git a/docs/models/sttsegment.mdx b/docs/models/sttsegment.mdx new file mode 100644 index 000000000..20193a812 --- /dev/null +++ b/docs/models/sttsegment.mdx @@ -0,0 +1,33 @@ +--- +title: "STTSegment" +--- + +A timestamped transcript segment, returned when response_format is verbose_json + +## Example Usage + +```typescript +import { STTSegment } from "@openrouter/sdk/models"; + +let value: STTSegment = { + end: 3.2, + id: 0, + start: 0, + text: "Hello there.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `avgLogprob` | *number* | :heavy_minus_sign: | Average log probability of the segment | | +| `compressionRatio` | *number* | :heavy_minus_sign: | Compression ratio of the segment | | +| `end` | *number* | :heavy_check_mark: | Segment end time in seconds | 3.2 | +| `id` | *number* | :heavy_check_mark: | Segment index within the transcript | 0 | +| `noSpeechProb` | *number* | :heavy_minus_sign: | Probability the segment contains no speech | | +| `seek` | *number* | :heavy_minus_sign: | Seek offset of the segment | 0 | +| `start` | *number* | :heavy_check_mark: | Segment start time in seconds | 0 | +| `temperature` | *number* | :heavy_minus_sign: | Temperature used for the segment | | +| `text` | *string* | :heavy_check_mark: | Transcribed text of the segment | Hello there. | +| `tokens` | *number*[] | :heavy_minus_sign: | Token IDs of the segment | | \ No newline at end of file diff --git a/docs/models/stttimestampgranularity.mdx b/docs/models/stttimestampgranularity.mdx new file mode 100644 index 000000000..e21f981f5 --- /dev/null +++ b/docs/models/stttimestampgranularity.mdx @@ -0,0 +1,21 @@ +--- +title: "STTTimestampGranularity" +--- + +A timestamp detail level for verbose_json transcription responses. + +## Example Usage + +```typescript +import { STTTimestampGranularity } from "@openrouter/sdk/models"; + +let value: STTTimestampGranularity = "word"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"word" | "segment" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/sttword.mdx b/docs/models/sttword.mdx new file mode 100644 index 000000000..a4306639c --- /dev/null +++ b/docs/models/sttword.mdx @@ -0,0 +1,25 @@ +--- +title: "STTWord" +--- + +A timestamped word, returned when the provider includes word-level timestamps + +## Example Usage + +```typescript +import { STTWord } from "@openrouter/sdk/models"; + +let value: STTWord = { + end: 0.4, + start: 0, + word: "Hello", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `end` | *number* | :heavy_check_mark: | Word end time in seconds | 0.4 | +| `start` | *number* | :heavy_check_mark: | Word start time in seconds | 0 | +| `word` | *string* | :heavy_check_mark: | The transcribed word | Hello | \ No newline at end of file diff --git a/docs/sdks/datasets/README.mdx b/docs/sdks/datasets/README.mdx index 1e23b04ca..760149842 100644 --- a/docs/sdks/datasets/README.mdx +++ b/docs/sdks/datasets/README.mdx @@ -127,6 +127,13 @@ Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the reserved permaslug `other` and is always returned last within its date, so callers can compute `top-50 traffic / total daily traffic` without a second request. +Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time +grain. `modality` and `context_bucket` narrow the exact dataset by output/input +modality (or tool-calling activity) and request context length. `category` and +`language_type` instead read a sampled, upsampled dataset whose `total_tokens` are +weekly-grain estimates — they cannot be combined with each other or with the exact +filters, and reject `period=day` with a 400. + Authenticate with any valid OpenRouter API key (same key used for inference). Rate-limited to 30 requests/minute per key and 500 requests/day per account. diff --git a/jsr.json b/jsr.json index f776154cb..8f7254e1f 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.13.27", + "version": "0.13.28", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 4e47978a2..7a8cb17ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.13.27", + "version": "0.13.28", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -73,15 +73,15 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc", "prepublishOnly": "npm run build", - "test": "vitest --run --project unit", - "test:e2e": "vitest --run --project e2e", + "prepare": "npm run build", "test:transit": "exit 0", - "test:watch": "vitest --watch --project unit", + "typecheck": "tsc --noEmit", "compile": "tsc", "postinstall": "node scripts/check-types.js || true", - "typecheck": "tsc --noEmit", - "typecheck:transit": "exit 0", - "prepare": "npm run build" + "test": "vitest --run --project unit", + "test:e2e": "vitest --run --project e2e", + "test:watch": "vitest --watch --project unit", + "typecheck:transit": "exit 0" }, "peerDependencies": {}, "devDependencies": { diff --git a/src/funcs/datasetsGetRankingsDaily.ts b/src/funcs/datasetsGetRankingsDaily.ts index 9a09eb287..283c4fb40 100644 --- a/src/funcs/datasetsGetRankingsDaily.ts +++ b/src/funcs/datasetsGetRankingsDaily.ts @@ -41,6 +41,13 @@ import { Result } from "../types/fp.js"; * reserved permaslug `other` and is always returned last within its date, so callers * can compute `top-50 traffic / total daily traffic` without a second request. * + * Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time + * grain. `modality` and `context_bucket` narrow the exact dataset by output/input + * modality (or tool-calling activity) and request context length. `category` and + * `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are + * weekly-grain estimates — they cannot be combined with each other or with the exact + * filters, and reject `period=day` with a 400. + * * Authenticate with any valid OpenRouter API key (same key used for inference). * Rate-limited to 30 requests/minute per key and 500 requests/day per account. * @@ -119,7 +126,12 @@ async function $do( const path = pathToFunc("/datasets/rankings-daily")(); const query = encodeFormQuery({ + "category": payload?.category, + "context_bucket": payload?.context_bucket, "end_date": payload?.end_date, + "language_type": payload?.language_type, + "modality": payload?.modality, + "period": payload?.period, "start_date": payload?.start_date, }); diff --git a/src/funcs/sttCreateTranscriptionMultipart.ts b/src/funcs/sttCreateTranscriptionMultipart.ts index 839d5b8a8..99e46fefc 100644 --- a/src/funcs/sttCreateTranscriptionMultipart.ts +++ b/src/funcs/sttCreateTranscriptionMultipart.ts @@ -158,6 +158,13 @@ async function $do( if (payload.RequestBody.temperature !== undefined) { appendForm(body, "temperature", payload.RequestBody.temperature); } + if (payload.RequestBody["timestamp_granularities[]"] !== undefined) { + appendForm( + body, + "timestamp_granularities[]", + payload.RequestBody["timestamp_granularities[]"], + ); + } const path = pathToFunc("/audio/transcriptions")(); diff --git a/src/lib/config.ts b/src/lib/config.ts index 7e9565e8d..c550996e2 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.13.27", + sdkVersion: "0.13.28", genVersion: "2.884.4", - userAgent: "speakeasy-sdk/typescript 0.13.27 2.884.4 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.13.28 2.884.4 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/index.ts b/src/models/index.ts index 3016f8ee8..e274ebce5 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -472,7 +472,10 @@ export * from "./streamlogprobtoplogprob.js"; export * from "./sttinputaudio.js"; export * from "./sttrequest.js"; export * from "./sttresponse.js"; +export * from "./sttsegment.js"; +export * from "./stttimestampgranularity.js"; export * from "./sttusage.js"; +export * from "./sttword.js"; export * from "./subagentnestedtool.js"; export * from "./subagentreasoning.js"; export * from "./subagentservertoolconfig.js"; diff --git a/src/models/operations/createaudiotranscriptionsmultipart.ts b/src/models/operations/createaudiotranscriptionsmultipart.ts index 1a41300bf..1cbb0a53b 100644 --- a/src/models/operations/createaudiotranscriptionsmultipart.ts +++ b/src/models/operations/createaudiotranscriptionsmultipart.ts @@ -6,7 +6,8 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { blobLikeSchema } from "../../types/blobs.js"; -import { ClosedEnum } from "../../types/enums.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; export type CreateAudioTranscriptionsMultipartGlobals = { /** @@ -36,15 +37,22 @@ export type CreateAudioTranscriptionsMultipartFile = { }; /** - * The response format. Only "json" is supported. + * The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). */ export const ResponseFormat = { Json: "json", + VerboseJson: "verbose_json", } as const; /** - * The response format. Only "json" is supported. + * The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). */ -export type ResponseFormat = ClosedEnum; +export type ResponseFormat = OpenEnum; + +export const TimestampGranularities = { + Word: "word", + Segment: "segment", +} as const; +export type TimestampGranularities = OpenEnum; export type CreateAudioTranscriptionsMultipartRequestBody = { /** @@ -60,13 +68,17 @@ export type CreateAudioTranscriptionsMultipartRequestBody = { */ model: string; /** - * The response format. Only "json" is supported. + * The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). */ responseFormat?: ResponseFormat | undefined; /** * The sampling temperature. */ temperature?: number | undefined; + /** + * Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. + */ + timestampGranularities?: Array | undefined; }; export type CreateAudioTranscriptionsMultipartRequest = { @@ -124,8 +136,14 @@ export function createAudioTranscriptionsMultipartFileToJSON( } /** @internal */ -export const ResponseFormat$outboundSchema: z.ZodEnum = z - .enum(ResponseFormat); +export const ResponseFormat$outboundSchema: z.ZodType = + openEnums.outboundSchema(ResponseFormat); + +/** @internal */ +export const TimestampGranularities$outboundSchema: z.ZodType< + string, + TimestampGranularities +> = openEnums.outboundSchema(TimestampGranularities); /** @internal */ export type CreateAudioTranscriptionsMultipartRequestBody$Outbound = { @@ -134,6 +152,7 @@ export type CreateAudioTranscriptionsMultipartRequestBody$Outbound = { model: string; response_format?: string | undefined; temperature?: number | undefined; + "timestamp_granularities[]"?: Array | undefined; }; /** @internal */ @@ -148,9 +167,12 @@ export const CreateAudioTranscriptionsMultipartRequestBody$outboundSchema: model: z.string(), responseFormat: ResponseFormat$outboundSchema.optional(), temperature: z.number().optional(), + timestampGranularities: z.array(TimestampGranularities$outboundSchema) + .optional(), }).transform((v) => { return remap$(v, { responseFormat: "response_format", + timestampGranularities: "timestamp_granularities[]", }); }); diff --git a/src/models/operations/getrankingsdaily.ts b/src/models/operations/getrankingsdaily.ts index 9f6dbba7b..ddec4fc4a 100644 --- a/src/models/operations/getrankingsdaily.ts +++ b/src/models/operations/getrankingsdaily.ts @@ -5,6 +5,8 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; export type GetRankingsDailyGlobals = { /** @@ -28,6 +30,85 @@ export type GetRankingsDailyGlobals = { appCategories?: string | undefined; }; +/** + * Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + */ +export const Period = { + Day: "day", + Week: "week", + Month: "month", +} as const; +/** + * Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + */ +export type Period = OpenEnum; + +/** + * Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + */ +export const Modality = { + Text: "text", + Image: "image", + ImageOutput: "image_output", + Audio: "audio", + ToolCalling: "tool_calling", +} as const; +/** + * Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + */ +export type Modality = OpenEnum; + +/** + * Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + */ +export const ContextBucket = { + OneK: "1K", + TenK: "10K", + OneHundredK: "100K", + OneM: "1M", + TenM: "10M", +} as const; +/** + * Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + */ +export type ContextBucket = OpenEnum; + +/** + * Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + */ +export const GetRankingsDailyCategory = { + Programming: "programming", + Roleplay: "roleplay", + Marketing: "marketing", + MarketingSeo: "marketing/seo", + Technology: "technology", + Science: "science", + Translation: "translation", + Legal: "legal", + Finance: "finance", + Health: "health", + Trivia: "trivia", + Academia: "academia", +} as const; +/** + * Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + */ +export type GetRankingsDailyCategory = OpenEnum< + typeof GetRankingsDailyCategory +>; + +/** + * Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + */ +export const LanguageType = { + Natural: "natural", + Programming: "programming", +} as const; +/** + * Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + */ +export type LanguageType = OpenEnum; + export type GetRankingsDailyRequest = { /** * The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -56,8 +137,50 @@ export type GetRankingsDailyRequest = { * End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. */ endDate?: string | undefined; + /** + * Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. + */ + period?: Period | undefined; + /** + * Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. + */ + modality?: Modality | undefined; + /** + * Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. + */ + contextBucket?: ContextBucket | undefined; + /** + * Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. + */ + category?: GetRankingsDailyCategory | undefined; + /** + * Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. + */ + languageType?: LanguageType | undefined; }; +/** @internal */ +export const Period$outboundSchema: z.ZodType = openEnums + .outboundSchema(Period); + +/** @internal */ +export const Modality$outboundSchema: z.ZodType = openEnums + .outboundSchema(Modality); + +/** @internal */ +export const ContextBucket$outboundSchema: z.ZodType = + openEnums.outboundSchema(ContextBucket); + +/** @internal */ +export const GetRankingsDailyCategory$outboundSchema: z.ZodType< + string, + GetRankingsDailyCategory +> = openEnums.outboundSchema(GetRankingsDailyCategory); + +/** @internal */ +export const LanguageType$outboundSchema: z.ZodType = + openEnums.outboundSchema(LanguageType); + /** @internal */ export type GetRankingsDailyRequest$Outbound = { "HTTP-Referer"?: string | undefined; @@ -65,6 +188,11 @@ export type GetRankingsDailyRequest$Outbound = { appCategories?: string | undefined; start_date?: string | undefined; end_date?: string | undefined; + period?: string | undefined; + modality?: string | undefined; + context_bucket?: string | undefined; + category?: string | undefined; + language_type?: string | undefined; }; /** @internal */ @@ -77,11 +205,18 @@ export const GetRankingsDailyRequest$outboundSchema: z.ZodType< appCategories: z.string().optional(), startDate: z.string().optional(), endDate: z.string().optional(), + period: Period$outboundSchema.optional(), + modality: Modality$outboundSchema.optional(), + contextBucket: ContextBucket$outboundSchema.optional(), + category: GetRankingsDailyCategory$outboundSchema.optional(), + languageType: LanguageType$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpReferer: "HTTP-Referer", startDate: "start_date", endDate: "end_date", + contextBucket: "context_bucket", + languageType: "language_type", }); }); diff --git a/src/models/speechrequest.ts b/src/models/speechrequest.ts index 251fab2b7..4d1ed9730 100644 --- a/src/models/speechrequest.ts +++ b/src/models/speechrequest.ts @@ -26,14 +26,16 @@ export type SpeechRequestProvider = { /** * Audio output format */ -export const ResponseFormatEnum = { +export const SpeechRequestResponseFormat = { Mp3: "mp3", Pcm: "pcm", } as const; /** * Audio output format */ -export type ResponseFormatEnum = OpenEnum; +export type SpeechRequestResponseFormat = OpenEnum< + typeof SpeechRequestResponseFormat +>; /** * Text-to-speech request input @@ -54,7 +56,7 @@ export type SpeechRequest = { /** * Audio output format */ - responseFormat?: ResponseFormatEnum | undefined; + responseFormat?: SpeechRequestResponseFormat | undefined; /** * Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. */ @@ -87,10 +89,10 @@ export function speechRequestProviderToJSON( } /** @internal */ -export const ResponseFormatEnum$outboundSchema: z.ZodType< +export const SpeechRequestResponseFormat$outboundSchema: z.ZodType< string, - ResponseFormatEnum -> = openEnums.outboundSchema(ResponseFormatEnum); + SpeechRequestResponseFormat +> = openEnums.outboundSchema(SpeechRequestResponseFormat); /** @internal */ export type SpeechRequest$Outbound = { @@ -110,7 +112,7 @@ export const SpeechRequest$outboundSchema: z.ZodType< input: z.string(), model: z.string(), provider: z.lazy(() => SpeechRequestProvider$outboundSchema).optional(), - responseFormat: ResponseFormatEnum$outboundSchema.default("pcm"), + responseFormat: SpeechRequestResponseFormat$outboundSchema.default("pcm"), speed: z.number().optional(), voice: z.string(), }).transform((v) => { diff --git a/src/models/sttrequest.ts b/src/models/sttrequest.ts index ae4c8f749..a5a34acab 100644 --- a/src/models/sttrequest.ts +++ b/src/models/sttrequest.ts @@ -5,6 +5,8 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; import { ProviderOptions, ProviderOptions$Outbound, @@ -15,6 +17,10 @@ import { STTInputAudio$Outbound, STTInputAudio$outboundSchema, } from "./sttinputaudio.js"; +import { + STTTimestampGranularity, + STTTimestampGranularity$outboundSchema, +} from "./stttimestampgranularity.js"; /** * Provider-specific passthrough configuration @@ -26,6 +32,20 @@ export type STTRequestProvider = { options?: ProviderOptions | undefined; }; +/** + * Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + */ +export const STTRequestResponseFormat = { + Json: "json", + VerboseJson: "verbose_json", +} as const; +/** + * Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + */ +export type STTRequestResponseFormat = OpenEnum< + typeof STTRequestResponseFormat +>; + /** * Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio. */ @@ -46,10 +66,18 @@ export type STTRequest = { * Provider-specific passthrough configuration */ provider?: STTRequestProvider | undefined; + /** + * Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. + */ + responseFormat?: STTRequestResponseFormat | undefined; /** * Sampling temperature for transcription */ temperature?: number | undefined; + /** + * Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". + */ + timestampGranularities?: Array | undefined; }; /** @internal */ @@ -73,13 +101,21 @@ export function sttRequestProviderToJSON( ); } +/** @internal */ +export const STTRequestResponseFormat$outboundSchema: z.ZodType< + string, + STTRequestResponseFormat +> = openEnums.outboundSchema(STTRequestResponseFormat); + /** @internal */ export type STTRequest$Outbound = { input_audio: STTInputAudio$Outbound; language?: string | undefined; model: string; provider?: STTRequestProvider$Outbound | undefined; + response_format?: string | undefined; temperature?: number | undefined; + timestamp_granularities?: Array | undefined; }; /** @internal */ @@ -91,10 +127,15 @@ export const STTRequest$outboundSchema: z.ZodType< language: z.string().optional(), model: z.string(), provider: z.lazy(() => STTRequestProvider$outboundSchema).optional(), + responseFormat: STTRequestResponseFormat$outboundSchema.optional(), temperature: z.number().optional(), + timestampGranularities: z.array(STTTimestampGranularity$outboundSchema) + .optional(), }).transform((v) => { return remap$(v, { inputAudio: "input_audio", + responseFormat: "response_format", + timestampGranularities: "timestamp_granularities", }); }); diff --git a/src/models/sttresponse.ts b/src/models/sttresponse.ts index bd24a57f8..0ea35bd4b 100644 --- a/src/models/sttresponse.ts +++ b/src/models/sttresponse.ts @@ -7,12 +7,30 @@ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { STTSegment, STTSegment$inboundSchema } from "./sttsegment.js"; import { STTUsage, STTUsage$inboundSchema } from "./sttusage.js"; +import { STTWord, STTWord$inboundSchema } from "./sttword.js"; /** * STT response containing transcribed text and optional usage statistics */ export type STTResponse = { + /** + * Duration of the input audio in seconds, present when response_format is verbose_json + */ + duration?: number | undefined; + /** + * Detected or forced language, present when response_format is verbose_json + */ + language?: string | undefined; + /** + * Timestamped transcript segments, present when response_format is verbose_json + */ + segments?: Array | undefined; + /** + * The task performed, present when response_format is verbose_json + */ + task?: string | undefined; /** * The transcribed text */ @@ -21,13 +39,22 @@ export type STTResponse = { * Aggregated usage statistics for the request */ usage?: STTUsage | undefined; + /** + * Timestamped words, present when the provider returns word-level timestamps + */ + words?: Array | undefined; }; /** @internal */ export const STTResponse$inboundSchema: z.ZodType = z .object({ + duration: z.number().optional(), + language: z.string().optional(), + segments: z.array(STTSegment$inboundSchema).optional(), + task: z.string().optional(), text: z.string(), usage: STTUsage$inboundSchema.optional(), + words: z.array(STTWord$inboundSchema).optional(), }); export function sttResponseFromJSON( diff --git a/src/models/sttsegment.ts b/src/models/sttsegment.ts new file mode 100644 index 000000000..81e4bd10d --- /dev/null +++ b/src/models/sttsegment.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 610157864a1c + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +/** + * A timestamped transcript segment, returned when response_format is verbose_json + */ +export type STTSegment = { + /** + * Average log probability of the segment + */ + avgLogprob?: number | undefined; + /** + * Compression ratio of the segment + */ + compressionRatio?: number | undefined; + /** + * Segment end time in seconds + */ + end: number; + /** + * Segment index within the transcript + */ + id: number; + /** + * Probability the segment contains no speech + */ + noSpeechProb?: number | undefined; + /** + * Seek offset of the segment + */ + seek?: number | undefined; + /** + * Segment start time in seconds + */ + start: number; + /** + * Temperature used for the segment + */ + temperature?: number | undefined; + /** + * Transcribed text of the segment + */ + text: string; + /** + * Token IDs of the segment + */ + tokens?: Array | undefined; +}; + +/** @internal */ +export const STTSegment$inboundSchema: z.ZodType = z + .object({ + avg_logprob: z.number().optional(), + compression_ratio: z.number().optional(), + end: z.number(), + id: z.int(), + no_speech_prob: z.number().optional(), + seek: z.int().optional(), + start: z.number(), + temperature: z.number().optional(), + text: z.string(), + tokens: z.array(z.int()).optional(), + }).transform((v) => { + return remap$(v, { + "avg_logprob": "avgLogprob", + "compression_ratio": "compressionRatio", + "no_speech_prob": "noSpeechProb", + }); + }); + +export function sttSegmentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => STTSegment$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'STTSegment' from JSON`, + ); +} diff --git a/src/models/stttimestampgranularity.ts b/src/models/stttimestampgranularity.ts new file mode 100644 index 000000000..b08b05137 --- /dev/null +++ b/src/models/stttimestampgranularity.ts @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 506bf5060d97 + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +/** + * A timestamp detail level for verbose_json transcription responses. + */ +export const STTTimestampGranularity = { + Word: "word", + Segment: "segment", +} as const; +/** + * A timestamp detail level for verbose_json transcription responses. + */ +export type STTTimestampGranularity = OpenEnum; + +/** @internal */ +export const STTTimestampGranularity$outboundSchema: z.ZodType< + string, + STTTimestampGranularity +> = openEnums.outboundSchema(STTTimestampGranularity); diff --git a/src/models/sttword.ts b/src/models/sttword.ts new file mode 100644 index 000000000..ab8c14d03 --- /dev/null +++ b/src/models/sttword.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 748744003b2c + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +/** + * A timestamped word, returned when the provider includes word-level timestamps + */ +export type STTWord = { + /** + * Word end time in seconds + */ + end: number; + /** + * Word start time in seconds + */ + start: number; + /** + * The transcribed word + */ + word: string; +}; + +/** @internal */ +export const STTWord$inboundSchema: z.ZodType = z.object({ + end: z.number(), + start: z.number(), + word: z.string(), +}); + +export function sttWordFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => STTWord$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'STTWord' from JSON`, + ); +} diff --git a/src/sdk/datasets.ts b/src/sdk/datasets.ts index 487dc1477..04e444307 100644 --- a/src/sdk/datasets.ts +++ b/src/sdk/datasets.ts @@ -66,6 +66,13 @@ export class Datasets extends ClientSDK { * reserved permaslug `other` and is always returned last within its date, so callers * can compute `top-50 traffic / total daily traffic` without a second request. * + * Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time + * grain. `modality` and `context_bucket` narrow the exact dataset by output/input + * modality (or tool-calling activity) and request context length. `category` and + * `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are + * weekly-grain estimates — they cannot be combined with each other or with the exact + * filters, and reject `period=day` with a 400. + * * Authenticate with any valid OpenRouter API key (same key used for inference). * Rate-limited to 30 requests/minute per key and 500 requests/day per account. * From ae8e2760bdba3a2349ea7565219a8d630e0ff75f Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:48:33 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow