diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ba703761e..5bb651755 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 2ef06fd2320bafc1b28e6e4d52616e29 + docChecksum: b65fe4a635018eed611e25f9407c7600 docVersion: 1.0.0 speakeasyVersion: 1.763.2 generationVersion: 2.884.4 - releaseVersion: 0.13.12 - configChecksum: df40f2fa0fbe104751d246b5a8f79c3c + releaseVersion: 0.13.13 + configChecksum: 86085347fb631155905bfa7ed4c877b0 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: 165c7888-5c5f-43bd-b1fc-eacce9e561d8 - pristine_commit_hash: 31af541d591883c304f6090b47def0549b166824 - pristine_tree_hash: 8b2a5a161fb7bd8ecd2758fbc26e26090f22faa1 + generation_id: 260f7c2e-8965-44a8-bfdc-d185a33fd3db + pristine_commit_hash: 0700ee230cab280dfe612d608d731e454c14c443 + pristine_tree_hash: 61a8c96f81a7df1010139057f06d990a2f1978d9 features: typescript: acceptHeaders: 2.81.2 @@ -1873,6 +1873,10 @@ trackedFiles: last_write_checksum: sha1:28e0ed6258a9a3dc145020ca4abe933ff8ed8278 pristine_git_object: 317f8962ca2d526e8442eb6881c06c1521e13540 deleted: true + docs/models/data.md: + id: 9a31987caf78 + last_write_checksum: sha1:07bc3a7f5aa18aaa7b440e8f0a2d2c097ffb4d58 + pristine_git_object: 9ac8b87e7e0e13bd412790462d6891af27dafa10 docs/models/datacollection.md: id: e9b57ccc9d48 last_write_checksum: sha1:1023a06bafd4dc8b3dedcf9a0298c86f1e3c4829 @@ -1902,6 +1906,10 @@ trackedFiles: last_write_checksum: sha1:908ab0823a1c81787514ba73887b0378af00dc4f pristine_git_object: b24b71a719e9df16551212634b2de564cbbed6f6 deleted: true + docs/models/defaulteffort.md: + id: 1b40c6f49171 + last_write_checksum: sha1:6353466366caec9afb2211bb279d8fadf91c52e3 + pristine_git_object: fb5f483279289069eadf3fbf7a6ae108eaa345f6 docs/models/defaultparameters.md: id: 91207995478e last_write_checksum: sha1:87e375bdebf31d05199b15468a852b798d22a324 @@ -1925,6 +1933,7 @@ trackedFiles: id: 3f9e0c7bda7e last_write_checksum: sha1:4e5e504602df23c0d6321efc19451fdcaa9fb8a7 pristine_git_object: 38d32d7641b94e26a9db9a13fac9a6733fd75525 + deleted: true docs/models/deleteworkspaceresponse.md: id: 88b47c2028f9 last_write_checksum: sha1:dd0916e2fddb7bef9a6c39433753258be9597f6e @@ -2898,6 +2907,7 @@ trackedFiles: id: 7b25fbff0283 last_write_checksum: sha1:ade25543d5e312c7160573411bbea9f06931fae3 pristine_git_object: 222cf928ec9e403d648bbb8ee2d65cd041ea1dc5 + deleted: true docs/models/listworkspacesresponse.md: id: fd657130fbe9 last_write_checksum: sha1:8f58734dc57fc02f90f230437e8d4d221b646b55 @@ -3119,8 +3129,8 @@ trackedFiles: deleted: true docs/models/model.md: id: 66e0236ac289 - last_write_checksum: sha1:b9bc1c6639a2059db0fa551154c436ba3213d351 - pristine_git_object: 1b38986df12f36f02aa1bb37678b08939ef9434e + last_write_checksum: sha1:7956b2f50e7d8d9cad21f90fda6f966c673de228 + pristine_git_object: 13d36933c3443703a2ac1693a3d37957a2672b43 docs/models/modelarchitecture.md: id: 7eab960e8441 last_write_checksum: sha1:722c920e474bc5ce757280c8a80406dfd484eee1 @@ -3148,10 +3158,14 @@ trackedFiles: last_write_checksum: sha1:8e3c5086cc05069ab69d345756c9252083d8df94 pristine_git_object: 32656664b666779e69bda03853e9c0b75271db6e deleted: true + docs/models/modelreasoning.md: + id: "832494311749" + last_write_checksum: sha1:c5baf538f79a73b4b428283e6bab20c998411241 + pristine_git_object: 3ec5854ca541acebdbcd9508ac713b263596e908 docs/models/modelresponse.md: id: 0796a34df81d - last_write_checksum: sha1:f1862998d4f517e6e9d799d685a506023956bb43 - pristine_git_object: 946e1c363a9353254f635e46615c1b93eed99e72 + last_write_checksum: sha1:b36e61c2f129928ba7efea9145471e5447903f74 + pristine_git_object: fef0a736782262d7731748066b2a5fa9204601ab deleted: true docs/models/modelscountresponse.md: id: 1b997e3738fa @@ -3644,8 +3658,8 @@ trackedFiles: deleted: true docs/models/operations/arena.md: id: 18236c4c4904 - last_write_checksum: sha1:81f0ba16674f0ea52178b4b85693ccf45cccc0ba - pristine_git_object: c5a0cf7724fc76a7e346d21726dd35f390c280b6 + last_write_checksum: sha1:5dcbf7f15f7ae622c831ac0c0b6865ec1bdf0266 + pristine_git_object: ebe1c56b8db7c7afe16bef166ec62cebbb2b8a98 deleted: true docs/models/operations/bulkaddworkspacemembersglobals.md: id: f67e8819f471 @@ -4002,10 +4016,12 @@ trackedFiles: id: 7e9a1f4cb03d last_write_checksum: sha1:eba7bc81e36395f0353c074480ac92045dc08ef8 pristine_git_object: 9e6e8ee12921b7ac48a881dc4a427c4484b2e104 + deleted: true docs/models/operations/deleteworkspacebudgetrequest.md: id: fa6bd9e45adb last_write_checksum: sha1:876d008227a20349388c19e9650434b3a4c0549d pristine_git_object: 279bfc891e377acae9f2da80e0c3d8d208966ed0 + deleted: true docs/models/operations/deleteworkspaceglobals.md: id: 43fe94eda9d4 last_write_checksum: sha1:258f7d4f27d2fb9d9a77304b3eab908ae8fbc0ab @@ -4164,6 +4180,14 @@ trackedFiles: last_write_checksum: sha1:72a42d64f1ddb3ae47010bb65aa25cb03cb804c4 pristine_git_object: 3ecdb020e4ce5c2e28abe6127f4d1754c3a32a08 deleted: true + docs/models/operations/getbenchmarksglobals.md: + id: 19d271519ab5 + last_write_checksum: sha1:e18aa493b5f352b820a6cc846ecb3bcc3a48f938 + pristine_git_object: 8b0df019d0e2da52461282ffab6127ede746457a + docs/models/operations/getbenchmarksrequest.md: + id: 6f639b6d7f9c + last_write_checksum: sha1:7cdf09b287cfe6c6e46b1ac37cff639f8e6db68e + pristine_git_object: b8fb86020b53392f07243fef4669b700cb26db4a docs/models/operations/getbyokkeyglobals.md: id: b561ccf55c78 last_write_checksum: sha1:61eaba657fceee808718be5ba50ac5809478c2f0 @@ -4649,10 +4673,12 @@ trackedFiles: id: a8ed73899220 last_write_checksum: sha1:62ec4f85db2f67947a6bf00d77e2536ad0c3b8d8 pristine_git_object: a2316831e40e4b6a63d97f9a9f622c0926c6874d + deleted: true docs/models/operations/listworkspacebudgetsrequest.md: id: 3c4af10b0d1b last_write_checksum: sha1:fa75809d21a36b9970db72cc72877ffff1ec5b92 pristine_git_object: 977d149aea250e8465fdf0286204f02f487fb25b + deleted: true docs/models/operations/listworkspacesglobals.md: id: 838d0615597b last_write_checksum: sha1:d7b46bb37d03a5e66791e5f850ab40f57de10fc2 @@ -4787,11 +4813,19 @@ trackedFiles: last_write_checksum: sha1:543fe646dc04ed9e97b16b74d80426636b49e57a pristine_git_object: 19ef27f26aee908e4a3ab113384e9065b1495f51 deleted: true + docs/models/operations/source.md: + id: 31a3e4b3b2e6 + last_write_checksum: sha1:d13f05bb263a1cd7365b0f1ef4ae2d94d9460071 + pristine_git_object: 686e71ddc167a69a80cab0ff1dd2d0642cb0bd6f docs/models/operations/subcategory.md: id: 8bb0b30b82e2 last_write_checksum: sha1:c122a4cdea2dcfec2333bca847be8fdaf810cb4a pristine_git_object: 5e861778b47568b23dfe659471b8aa36d203ab7c deleted: true + docs/models/operations/tasktype.md: + id: 8c10844969fe + last_write_checksum: sha1:5df90e1a08131b66a04f04d1ab325767dea670a9 + pristine_git_object: a5d22ff52558a8f6a90151b78f29cb9f01daa25c docs/models/operations/timerange.md: id: 1f5778dd63dd last_write_checksum: sha1:a0bc1b6009eed06bd9947c778dc2405c816edc7a @@ -4878,10 +4912,12 @@ trackedFiles: id: 1ed24dfd705d last_write_checksum: sha1:3a42d6d277bf6aca7bce2c0553f5afa046c767de pristine_git_object: d4473f37d96cad55c0ea59586ea0fdc10e7df590 + deleted: true docs/models/operations/upsertworkspacebudgetrequest.md: id: 9c4b77df56d7 last_write_checksum: sha1:fc87def3111be0ae9eecd855900d504213a5f8d0 pristine_git_object: 110c64aa2d7b57935f52b02d4272adc2b4c61fb5 + deleted: true docs/models/operations/usagelimittype.md: id: 22ad2742a599 last_write_checksum: sha1:7a6bf686440f92d48981d49715bcff65bb122e2f @@ -5895,6 +5931,7 @@ trackedFiles: id: f9bdd1bc3c89 last_write_checksum: sha1:236a00ce12bf0deafcd7d7c65771b262e9b13263 pristine_git_object: 19e0a3b06b330e3df1fda3fcf6437c7e0958a136 + deleted: true docs/models/resolution.md: id: 7d1066bfde17 last_write_checksum: sha1:0319d080679b03d75765d5f87a5615833db105d3 @@ -6181,8 +6218,8 @@ trackedFiles: deleted: true docs/models/sourceenum.md: id: 27e3ed293e57 - last_write_checksum: sha1:e6b431fd8e643ed9afa072abb00c192f30c5212b - pristine_git_object: 49da095792643e1cd28dea674f444a0dd47b855e + last_write_checksum: sha1:c2255b7ac492205a940c1ea17a9745c4d165847e + pristine_git_object: 25bb464a7d3d97b4fc739863f52e08edee82f250 deleted: true docs/models/sourceurl.md: id: d1991075045c @@ -6668,6 +6705,30 @@ trackedFiles: id: 769991618d26 last_write_checksum: sha1:073e42ea882cc210725f64898e33a58687444bdf pristine_git_object: 12ff8937ee3d8246b20bf835bfaac766cdec65a3 + docs/models/unifiedbenchmarkpricing.md: + id: 98bf9d88d551 + last_write_checksum: sha1:4d9fd4478e1ae02ceee2a8ecd8da5b3bac894802 + pristine_git_object: 2d66c1599852915afb864291bf7f2a4bce96331d + docs/models/unifiedbenchmarksaaitem.md: + id: 5a16272abc20 + last_write_checksum: sha1:b4b23e8b3bd334ad439c3fdfbd4032b01ecc3da2 + pristine_git_object: 38ef1810f222602f733af75e473d2a693805b2ab + docs/models/unifiedbenchmarksdaitem.md: + id: 4ef3c9b25a4f + last_write_checksum: sha1:cbbe649ddac47cdb13a64965fca751988fb46f80 + pristine_git_object: 19a81a07127f5a1e929dea41dbc77e760189f0c8 + docs/models/unifiedbenchmarksmeta.md: + id: 9ca84a93fcdd + last_write_checksum: sha1:07c3fbae9bb6a1784ae6119cb5cabebec9c44f98 + pristine_git_object: a6542e9b9607cb69d2913a692b2e87e307cc28f3 + docs/models/unifiedbenchmarksmetaversion.md: + id: 1e84a34547c8 + last_write_checksum: sha1:3086270a0efffc88d8a9bd5f32c5cedfd9819178 + pristine_git_object: 5dbacf03f24ed26bc1724e2d493cf1d0546c2c57 + docs/models/unifiedbenchmarksresponse.md: + id: bd3775eed576 + last_write_checksum: sha1:6ba45f13cfd8c31944f83eac53f86afaeef73da9 + pristine_git_object: ec9eec469e5394062e0444bd30ae6eb1d150ac67 docs/models/uniqueinsight.md: id: 9536f878930d last_write_checksum: sha1:0ce0cd9ccfe0e92ebb6c0c96d2a3a136165665de @@ -6721,10 +6782,12 @@ trackedFiles: id: 62ee02cdd938 last_write_checksum: sha1:81557306485380cc13970d9775d05a2497a243ec pristine_git_object: a42e5951b0545a15fc43e646ae9e1eed1c769600 + deleted: true docs/models/upsertworkspacebudgetresponse.md: id: 0c591e2948b7 last_write_checksum: sha1:acfe317cf75678391860a4d5c573d3c4860fa251 pristine_git_object: 1ec53e116474ab906ba0a4738bdf0a1243176a41 + deleted: true docs/models/urlcitation.md: id: 6aea1a90dde8 last_write_checksum: sha1:e5df19403ffa88cf3428f15ed4563c9f10447a12 @@ -6955,10 +7018,12 @@ trackedFiles: id: c678dc2b99c5 last_write_checksum: sha1:41a7076e626f37245109117de75302fed706700b pristine_git_object: 9acac00214f2fe92257e588da35796c6d40e3f53 + deleted: true docs/models/workspacebudgetinterval.md: id: c508bc91013e last_write_checksum: sha1:95e1219e91bd3a0c5717b8ad0ac1237710acb37f pristine_git_object: 45631df7fe5271927ba959e5363f18df90b8dd2e + deleted: true docs/models/workspacemember.md: id: 74015b802170 last_write_checksum: sha1:93ba22a4fe479c4ab77db026481e3fd47e14f70e @@ -6977,6 +7042,10 @@ trackedFiles: id: e2bd25998427 last_write_checksum: sha1:101f1e799a897e49663ed287cbaab2121f07c82d pristine_git_object: a2f9bf1e079e16406d4274d2260e792b7e0d4426 + docs/sdks/benchmarks/README.md: + id: 61c16262af9b + last_write_checksum: sha1:830d366c35edcf1ebdaec6c3537dd1cdde764ba4 + pristine_git_object: b9cdbb0a46da993d77b57fe2d6c4ca5409a04fad docs/sdks/betaanalytics/README.md: id: e037af84b386 last_write_checksum: sha1:c76adb9f7c43f5a243eb7969aeade241f4d992e2 @@ -6997,8 +7066,8 @@ trackedFiles: pristine_git_object: a902be6fa740c256c7a78fc05b891ed610710feb docs/sdks/datasets/README.md: id: deb5d90f4faf - last_write_checksum: sha1:bed3bc40b4fb5f86c8940d8d5b489e6b8780121d - pristine_git_object: 85359f31b77102cc86390cd80b3c6a85a321b35d + last_write_checksum: sha1:5816470b019dd193623af3b0cbf8a795d834250b + pristine_git_object: e56eda099b10a6bc6128a4122a45521a07ab743a deleted: true docs/sdks/embeddings/README.md: id: 15b5b04486c1 @@ -7099,12 +7168,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:b9bb27ad91f2f5db898a0fa04f5a8918b6ffc3f3 - pristine_git_object: 4da4364d1fea0c03b42152ce675569232241e080 + last_write_checksum: sha1:49e647d541960f416708592ff90dd91ba327a082 + pristine_git_object: 5582223ca37557214ef59e925a0fb12e0feac43a package.json: id: 7030d0b2f71b - last_write_checksum: sha1:31c0cbe5a20d7796e12161b52b25693180d640e8 - pristine_git_object: cb3f2902557b864afceb86913334706c1e91457e + last_write_checksum: sha1:7928c20fd6c4c3f4a88d5055f2a4ffc58a9bdc2b + pristine_git_object: b1a804c50d24d5ae1987cca9c78fe83438bc5bea src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -7137,6 +7206,10 @@ trackedFiles: id: 05700884934b last_write_checksum: sha1:1601df51682834e672fa4778f7faa6549ec7ab48 pristine_git_object: 8ba5a8539ecb868231e65516aefc024d60ee994c + src/funcs/benchmarksGetBenchmarks.ts: + id: 1b5fbe93cea7 + last_write_checksum: sha1:c2f2a57f510b8f661f8b2fd7150433de6fd03abf + pristine_git_object: 4e9870ca83e15a33e55e86396ab1eb5feba50e23 src/funcs/betaAnalyticsGetAnalyticsMeta.ts: id: fd48bb0a54a8 last_write_checksum: sha1:74fe8e626ccc50fc79049b94d97b157a90d1474a @@ -7181,14 +7254,6 @@ trackedFiles: id: 2ae09697d446 last_write_checksum: sha1:2e66aac41ab399a7005a1462361247229526b10c pristine_git_object: d5cedc6219034e33b9a17b67e43b9fcb7b0b033c - src/funcs/datasetsGetBenchmarksArtificialAnalysis.ts: - id: 8997506a6260 - last_write_checksum: sha1:7f5474ba4240a25843d6b9a908f5b6f86653bef2 - pristine_git_object: 317d232fa02ecd495e56ff9d5b4783640ec7ebbd - src/funcs/datasetsGetBenchmarksDesignArena.ts: - id: 1e5ef73682ba - last_write_checksum: sha1:cb144aeb0e495fb7209e080cd19424945833f4f6 - pristine_git_object: db10a9f95a48c3f184104c81fedf34e7e329ef7a src/funcs/datasetsGetRankingsDaily.ts: id: f0177699bfaf last_write_checksum: sha1:1249e6d078bcb317f5086a7719057b6176935b08 @@ -7459,8 +7524,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:8230365dbcdee12d1368a606259e7d7f53aba0ca - pristine_git_object: f9bb538d6de8df9fc2546b64d2459823a01bff86 + last_write_checksum: sha1:972ada09f00d5f8e641a4064475bbdce848b165a + pristine_git_object: b932decc07728b578a7ab8a9a56fcb3a58f840e4 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -7757,34 +7822,6 @@ trackedFiles: id: 61289ac69d53 last_write_checksum: sha1:72c2589843687ac2d3f38e6796d333ed1ccfc4db pristine_git_object: 04093e855ff637f0f53758e7eb842c5a8bda4a21 - src/models/benchmarkpricing.ts: - id: 74aab084b178 - last_write_checksum: sha1:f767529db933eec850e70c1a6efcc3e41447e36c - pristine_git_object: 274450e53b905ef0a5daa4b74e9db52d523c60a2 - src/models/benchmarksaaitem.ts: - id: 82b5c9f01e00 - last_write_checksum: sha1:5895ceb46fc3f0f7148a4e2a3dff3cfd1e6246a7 - pristine_git_object: 54fbada85e21e548d78712863a83cce94eb1bb99 - src/models/benchmarksaameta.ts: - id: ea7ac20c3f7c - last_write_checksum: sha1:468aefb21a577e5274c153a40a686ffa9aa530e0 - pristine_git_object: c64ee9ca0f28f05cbfa97e272fed084127b5cd1b - src/models/benchmarksaaresponse.ts: - id: 57a074171835 - last_write_checksum: sha1:413b40b3e3c0571e8c544ad652cd29b8b3f2674f - pristine_git_object: 39ae16b8eb695be512781947f258851e378c469d - src/models/benchmarksdaitem.ts: - id: a8a7a42ac948 - last_write_checksum: sha1:009ee8dd42435a322d95f2cf571680e7d5f0efff - pristine_git_object: 60e0bed98f8e363c572dcaadd60b674f8ecc8a21 - src/models/benchmarksdameta.ts: - id: caee78d8918e - last_write_checksum: sha1:e13b15ab0bceaa82a1f02c3fd853265a99ffa4ba - pristine_git_object: 3ae479d96bf0ec466cfa8b1f32cb93d18a7754a7 - src/models/benchmarksdaresponse.ts: - id: ea90fb0e8882 - last_write_checksum: sha1:c7495300898b4e3de0ca223f62815a5b558dd1e9 - pristine_git_object: 7477dd4474c6b9b72b1443a38b38ba831515b1da src/models/bulkaddworkspacemembersrequest.ts: id: dc2d569c8386 last_write_checksum: sha1:97635406307dcdb64f23774918ba27340a239060 @@ -8523,8 +8560,8 @@ trackedFiles: pristine_git_object: 8e109bedfdcf2c4808e49323dda861e3c6069d51 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:5ff8c942a7d39487e134bb47034b8b790a49ff4a - pristine_git_object: b6af20234aa25d0050e16c4f2e622fe6b9341fe7 + last_write_checksum: sha1:d26d23cbffe02665d92e70a8a289b2cab05e9954 + pristine_git_object: abd3def3e89bd8c378786aefc0776b6b5ddb3f3e src/models/inputaudio.ts: id: 9bdc14c7565f last_write_checksum: sha1:2f8dc4c1d6a9c2927d9eb186e0ecedf7b81838e6 @@ -8683,8 +8720,8 @@ trackedFiles: pristine_git_object: fe01365b2f672e05779601a08c80f7e8eee154e7 src/models/model.ts: id: b99d4c14e794 - last_write_checksum: sha1:21fabc3dd4cf160d6d928b5baae7df50d27c1fb5 - pristine_git_object: 414b0872a5ea68967913de8b84eff7f6c80ac2e4 + last_write_checksum: sha1:6ce7782310911b2ed66114edae3280e742547d5f + pristine_git_object: 36fc524556c5a7e74eb21656a07a09e78485f87e src/models/modelarchitecture.ts: id: 57607576095f last_write_checksum: sha1:4c15d83f2f3c4f3af7c14185d039d1fec8cf9b06 @@ -8701,6 +8738,10 @@ trackedFiles: id: 965b10bc40c4 last_write_checksum: sha1:0dced5177ae5c305c73e3a1d35294698ea634cc9 pristine_git_object: dd5fb55709969dd04f6f1f562bf3057b680c95fd + src/models/modelreasoning.ts: + id: c7312e55417d + last_write_checksum: sha1:eb1e541023cfba6f84fc7fe8734c59a5b218fbdb + pristine_git_object: 427b17cfbf92832ceb44ebb885bfe9d115f73903 src/models/modelresponse.ts: id: fcc2bf8be188 last_write_checksum: sha1:991fae410d1711b9ba3775c96bc38bc9554e2b86 @@ -8989,14 +9030,10 @@ trackedFiles: id: edd3364e84c1 last_write_checksum: sha1:3368aad033c01d34f611ba291e8cd555a107310a pristine_git_object: 18f090439648b6fbd98936558a3669df06d9bbc1 - src/models/operations/getbenchmarksartificialanalysis.ts: - id: 1b7863e0088a - last_write_checksum: sha1:8e40e014506cf3e6597793efb34de7f88feda60a - pristine_git_object: a510b93023a863b52cca9806ff6555b0cf7b9e36 - src/models/operations/getbenchmarksdesignarena.ts: - id: 86e27de57b33 - last_write_checksum: sha1:1a8971a84794d3c0c51542bf7411ab6c7512fcd2 - pristine_git_object: 09db903b1ff19d80bde4c4dc71237e9440f6a960 + src/models/operations/getbenchmarks.ts: + id: 52eb1eb063ae + last_write_checksum: sha1:4c87a3f3599da1f71d98bde5a6ce95a9a874feef + pristine_git_object: f8ad3f92cbb2423a36e4bf734a992d37c94d4bfa src/models/operations/getbyokkey.ts: id: 883c19bd90fb last_write_checksum: sha1:4a878f1b92430b6ea7254edac7e5ded6447592f4 @@ -9063,8 +9100,8 @@ trackedFiles: pristine_git_object: 6b14994d428c8fb6d58adc4f880ab796d6a2a2e5 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:48059c889096b7d5a9274124772912fdcc9c3533 - pristine_git_object: 54f61e82e897fd78c4e27a52fa866d732abfd7b4 + last_write_checksum: sha1:eea251d3023fd2c96a5a51d34efa5964be4093e3 + pristine_git_object: 3ac772bf86b9d43ef65295d025f88e4a1b6f9628 src/models/operations/list.ts: id: ce11386ad30f last_write_checksum: sha1:c6f6be4f00954f38c1c900beff6956be260873e0 @@ -9773,6 +9810,26 @@ trackedFiles: id: d335c48e0c3e last_write_checksum: sha1:0aeb2103469f3dad0c04196c8470d851d7e09142 pristine_git_object: 3b24025f18893e96d15b6ae2f71de60a4ad721ee + src/models/unifiedbenchmarkpricing.ts: + id: c6862b5223a1 + last_write_checksum: sha1:497eb9d4343dd4ebb69a877a3f9564fb55c2cbe0 + pristine_git_object: 0a39dad2499f18e1e8ec597219ba8722af83fccc + src/models/unifiedbenchmarksaaitem.ts: + id: "436660899947" + last_write_checksum: sha1:af8cbe65cb56aca1faee5a75f5bf4034b01d0bf0 + pristine_git_object: b81f764c6053128a66ccbf1ede1284205e2d66c5 + src/models/unifiedbenchmarksdaitem.ts: + id: f911314affb3 + last_write_checksum: sha1:6002965f28bd01089c774dcc9a6351fefe0850f0 + pristine_git_object: caebfff514df1e0860f2b10b8bb2bab60dc5a58d + src/models/unifiedbenchmarksmeta.ts: + id: d146ee8b8956 + last_write_checksum: sha1:5bc5677ec06ecb965225be379479a24fc9c5b5cb + pristine_git_object: 75831c38081637389b36e5c1cb53d0b569d57780 + src/models/unifiedbenchmarksresponse.ts: + id: b3f08556727b + last_write_checksum: sha1:1e1ef4602946f3282c900afa2a0b0bc38f63f1df + pristine_git_object: 3b2c430dfc2efeb05cbce02c80e7b72e4f131343 src/models/unprocessableentityresponseerrordata.ts: id: "557063315301" last_write_checksum: sha1:77a2c2515bda14c3d700340277b8762cb0067688 @@ -9945,6 +10002,10 @@ trackedFiles: id: 5dda931501e1 last_write_checksum: sha1:5487c45ff4293655f4bbbd4b23042acd1c23c96b pristine_git_object: 19b6c7c2a7f2a35969d68472c70ea83e31959fcf + src/sdk/benchmarks.ts: + id: 72ce7b70fba8 + last_write_checksum: sha1:c1a152949961a188b9235507b872e912e184c797 + pristine_git_object: 91a1625ea8ea68f11d5c6acf1a71dad3f2edf7ed src/sdk/beta.ts: id: afeac65e28f8 last_write_checksum: sha1:56537204e5d03cbc46fbdea1d187d3d88592b886 @@ -9967,8 +10028,8 @@ trackedFiles: pristine_git_object: 02d1a2d408eca05a63439bdb65dfda8821f141fd src/sdk/datasets.ts: id: 2f1e89a21914 - last_write_checksum: sha1:1c647b6c450adc5a3cfcbc88a7e3945067b2924e - pristine_git_object: a3f51a67e18aa307957d5c8bb7367b67cd3d3723 + last_write_checksum: sha1:7e47655fbd6ffb4173dc60d6c78a1882a650be3e + pristine_git_object: 487dc147768e5637f03ab62fbb2b43b471613bab src/sdk/embeddings.ts: id: 70cbb18bedaf last_write_checksum: sha1:e62ce45c27f12941ae5ec7e458b87952db3cedba @@ -10027,8 +10088,8 @@ trackedFiles: pristine_git_object: 143b7b9e6a282d3c16648723c59648b335491972 src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:3a4454f47422804bd4cbdcd30a92dd205b364e4c - pristine_git_object: 9bbf1d64dab3fce3a462c5d70c1332299ed80082 + last_write_checksum: sha1:9604af0a8fb89d5058ad4cbd3930c2aa31b671f9 + pristine_git_object: d6773282394379073da68e989f77f818cb3b05d5 src/sdk/stt.ts: id: fd9e88c22d1f last_write_checksum: sha1:81843dfe6675e4edca828465e7934f6505a69154 @@ -11480,9 +11541,30 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getBenchmarks: + speakeasy-default-get-benchmarks: + parameters: + query: + source: "artificial-analysis" + max_results: 20 + responses: + "200": + application/json: {"data": [{"agentic_index": 58.3, "coding_index": 65.8, "display_name": "GPT-4o", "intelligence_index": 71.2, "model_permaslug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "source": "artificial-analysis"}], "meta": {"as_of": "2026-06-03T12:00:00Z", "citation": "Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).", "model_count": 1, "source": "artificial-analysis", "source_url": "https://artificialanalysis.ai", "task_type": null, "version": "v1"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 releaseNotes: | ## Typescript SDK Changes: - * `openrouter.workspaces.listBudgets()`: **Added** - * `openrouter.workspaces.deleteBudget()`: **Added** - * `openrouter.workspaces.setBudget()`: **Added** + * `openrouter.benchmarks.getBenchmarks()`: **Added** + * `openrouter.datasets.getBenchmarksArtificialAnalysis()`: **Removed** (Breaking ⚠️) + * `openrouter.datasets.getBenchmarksDesignArena()`: **Removed** (Breaking ⚠️) + * `openrouter.embeddings.listModels()`: `response.data[].reasoning` **Added** + * `openrouter.models.get()`: `response.data.reasoning` **Added** + * `openrouter.models.list()`: `response.data[].reasoning` **Added** + * `openrouter.models.listForUser()`: `response.data[].reasoning` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ebb40c73a..cc5ad2c3e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true typescript: - version: 0.13.12 + version: 0.13.13 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 3de5dd963..720bd49f3 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -3651,349 +3651,6 @@ components: oneOf: - $ref: '#/components/schemas/ContainerAutoEnvironment' - $ref: '#/components/schemas/ContainerReferenceEnvironment' - BenchmarkPricing: - description: OpenRouter pricing per token for this model. Null if pricing is unavailable. - example: - completion: '0.000015' - prompt: '0.000003' - nullable: true - properties: - completion: - description: Cost per output token (USD, decimal string). - example: '0.000015' - type: string - prompt: - description: Cost per input token (USD, decimal string). - example: '0.000003' - type: string - required: - - prompt - - completion - type: object - BenchmarksAAItem: - example: - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - properties: - aa_name: - description: Model name as listed on Artificial Analysis. - example: GPT-4o - type: string - agentic_index: - description: Artificial Analysis Agentic Index composite score. Higher is better. - example: 58.3 - format: double - nullable: true - type: number - coding_index: - description: Artificial Analysis Coding Index composite score. Higher is better. - example: 65.8 - format: double - nullable: true - type: number - intelligence_index: - description: Artificial Analysis Intelligence Index composite score. Higher is better. - example: 71.2 - format: double - nullable: true - type: number - model_permaslug: - description: Stable OpenRouter model identifier. - example: openai/gpt-4o - type: string - pricing: - $ref: '#/components/schemas/BenchmarkPricing' - required: - - model_permaslug - - aa_name - - intelligence_index - - coding_index - - agentic_index - - pricing - type: object - BenchmarksAAMeta: - example: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 50 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 - properties: - as_of: - description: ISO-8601 timestamp of when this data was last updated. - example: '2026-06-03T12:00:00Z' - type: string - citation: - description: Required attribution when republishing this data. - example: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - type: string - model_count: - description: Number of unique models in the response. - type: integer - source: - description: Data source identifier. - enum: - - artificial-analysis - type: string - source_url: - description: URL of the upstream data source. - enum: - - https://artificialanalysis.ai - type: string - version: - description: Dataset version. - enum: - - v1 - type: string - required: - - as_of - - version - - source - - source_url - - citation - - model_count - type: object - BenchmarksAAResponse: - example: - data: - - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - meta: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 1 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 - properties: - data: - items: - $ref: '#/components/schemas/BenchmarksAAItem' - type: array - meta: - $ref: '#/components/schemas/BenchmarksAAMeta' - required: - - data - - meta - type: object - BenchmarksDAItem: - example: - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 - properties: - arena: - description: Arena this ranking belongs to. - example: models - type: string - avg_generation_time_ms: - description: Average generation time in milliseconds. - example: 3200 - format: double - nullable: true - type: number - category: - description: Category within the arena. - example: codecategories - type: string - display_name: - description: Human-readable model name from Design Arena. - example: Claude Sonnet 4 - type: string - elo: - description: ELO rating from head-to-head arena battles. - example: 1423 - format: double - type: number - model_permaslug: - description: >- - Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. - example: anthropic/claude-sonnet-4 - type: string - pricing: - $ref: '#/components/schemas/BenchmarkPricing' - tournament_stats: - description: Placement distribution from tournament matches. - properties: - first_place: - nullable: true - type: integer - fourth_place: - nullable: true - type: integer - second_place: - nullable: true - type: integer - third_place: - nullable: true - type: integer - total: - nullable: true - type: integer - required: - - first_place - - second_place - - third_place - - fourth_place - - total - type: object - win_rate: - description: Win rate as a percentage (0–100). - example: 72 - format: double - type: number - required: - - model_permaslug - - display_name - - arena - - category - - elo - - win_rate - - avg_generation_time_ms - - tournament_stats - - pricing - type: object - BenchmarksDAMeta: - example: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 50 - source: design-arena - source_url: https://www.designarena.ai - version: v1 - properties: - arena: - description: The arena filter applied. - type: string - as_of: - description: ISO-8601 timestamp of when this data was generated. - example: '2026-06-03T12:00:00Z' - type: string - category: - description: The category filter applied, or null if showing all. - nullable: true - type: string - citation: - description: Required attribution when republishing this data. - example: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - type: string - elo_bounds: - description: ELO range across all returned models for normalization. - properties: - max: - description: Maximum ELO in the result set. - format: double - type: number - min: - description: Minimum ELO in the result set. - format: double - type: number - required: - - min - - max - type: object - model_count: - description: Number of unique models in the response. - type: integer - source: - description: Data source identifier. - enum: - - design-arena - type: string - source_url: - description: URL of the upstream data source. - enum: - - https://www.designarena.ai - type: string - version: - description: Dataset version. - enum: - - v1 - type: string - required: - - as_of - - version - - source - - source_url - - citation - - model_count - - arena - - category - - elo_bounds - type: object - BenchmarksDAResponse: - example: - data: - - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 - meta: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 1 - source: design-arena - source_url: https://www.designarena.ai - version: v1 - properties: - data: - items: - $ref: '#/components/schemas/BenchmarksDAItem' - type: array - meta: - $ref: '#/components/schemas/BenchmarksDAMeta' - required: - - data - - meta - type: object BigNumberUnion: description: Price per million prompt tokens example: 1000 @@ -12160,6 +11817,15 @@ components: image: '0' prompt: '0.00003' request: '0' + reasoning: + default_effort: medium + default_enabled: true + mandatory: false + supported_efforts: + - high + - medium + - low + - minimal supported_parameters: - temperature - top_p @@ -12222,6 +11888,8 @@ components: $ref: '#/components/schemas/PerRequestLimits' pricing: $ref: '#/components/schemas/PublicPricing' + reasoning: + $ref: '#/components/schemas/ModelReasoning' supported_parameters: description: List of supported parameters for this model items: @@ -12386,6 +12054,43 @@ components: description: Model to use for completion example: openai/gpt-4 type: string + ModelReasoning: + description: Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. + example: + default_effort: medium + default_enabled: true + mandatory: false + supported_efforts: + - high + - medium + - low + - minimal + properties: + default_effort: + allOf: + - $ref: '#/components/schemas/ReasoningEffort' + - description: >- + Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning. + default_enabled: + description: Default reasoning enabled state when the client does not set `reasoning.enabled`. + type: boolean + mandatory: + description: When true, reasoning cannot be disabled and effort "none" is rejected. + type: boolean + supported_efforts: + description: >- + Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted. + items: + $ref: '#/components/schemas/ReasoningEffort' + nullable: true + type: array + supports_max_tokens: + description: >- + Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise. + type: boolean + required: + - mandatory + type: object ModelResponse: description: Single model response example: @@ -20335,73 +20040,331 @@ components: required: - is_moderated type: object - TraceConfig: - additionalProperties: - nullable: true - description: >- - Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + TraceConfig: + additionalProperties: + nullable: true + description: >- + Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + example: + trace_id: trace-abc123 + trace_name: my-app-trace + properties: + generation_name: + type: string + parent_span_id: + type: string + span_name: + type: string + trace_id: + type: string + trace_name: + type: string + type: object + Truncation: + enum: + - auto + - disabled + - null + example: auto + nullable: true + type: string + x-speakeasy-unknown-values: allow + UnauthorizedResponse: + description: Unauthorized - Authentication required or invalid credentials + example: + error: + code: 401 + message: Missing Authentication header + properties: + error: + $ref: '#/components/schemas/UnauthorizedResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + UnauthorizedResponseErrorData: + description: Error data for UnauthorizedResponse + example: + code: 401 + message: Missing Authentication header + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + UnifiedBenchmarkPricing: + description: OpenRouter pricing per token for this model. Null if pricing is unavailable. + example: + completion: '0.000015' + prompt: '0.000003' + nullable: true + properties: + completion: + description: Cost per output token (USD, decimal string). + example: '0.000015' + type: string + prompt: + description: Cost per input token (USD, decimal string). + example: '0.000003' + type: string + required: + - prompt + - completion + type: object + UnifiedBenchmarksAAItem: + example: + agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + properties: + agentic_index: + description: Artificial Analysis Agentic Index composite score. Higher is better. + example: 58.3 + format: double + nullable: true + type: number + coding_index: + description: Artificial Analysis Coding Index composite score. Higher is better. + example: 65.8 + format: double + nullable: true + type: number + display_name: + description: Model name as listed on Artificial Analysis. + example: GPT-4o + type: string + intelligence_index: + description: Artificial Analysis Intelligence Index composite score. Higher is better. + example: 71.2 + format: double + nullable: true + type: number + model_permaslug: + description: Stable OpenRouter model identifier. + example: openai/gpt-4o + type: string + pricing: + $ref: '#/components/schemas/UnifiedBenchmarkPricing' + source: + description: Benchmark source discriminator. + enum: + - artificial-analysis + type: string + required: + - source + - model_permaslug + - display_name + - intelligence_index + - coding_index + - agentic_index + - pricing + type: object + UnifiedBenchmarksDAItem: + example: + arena: models + avg_generation_time_ms: 3200 + category: codecategories + display_name: Claude Sonnet 4 + elo: 1423 + model_permaslug: anthropic/claude-sonnet-4 + pricing: + completion: '0.000015' + prompt: '0.000003' + source: design-arena + tournament_stats: + first_place: 12 + fourth_place: 2 + second_place: 8 + third_place: 5 + total: 27 + win_rate: 72 + properties: + arena: + description: Arena this ranking belongs to. + example: models + type: string + avg_generation_time_ms: + description: Average generation time in milliseconds. + example: 3200 + format: double + nullable: true + type: number + category: + description: Category within the arena. + example: codecategories + type: string + display_name: + description: Human-readable model name from Design Arena. + example: Claude Sonnet 4 + type: string + elo: + description: ELO rating from head-to-head arena battles. + example: 1423 + format: double + type: number + model_permaslug: + description: Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id. + example: anthropic/claude-sonnet-4 + type: string + pricing: + $ref: '#/components/schemas/UnifiedBenchmarkPricing' + source: + description: Benchmark source discriminator. + enum: + - design-arena + type: string + tournament_stats: + description: Placement distribution from tournament matches. + properties: + first_place: + nullable: true + type: integer + fourth_place: + nullable: true + type: integer + second_place: + nullable: true + type: integer + third_place: + nullable: true + type: integer + total: + nullable: true + type: integer + required: + - first_place + - second_place + - third_place + - fourth_place + - total + type: object + win_rate: + description: Win rate as a percentage (0–100). + example: 72 + format: double + type: number + required: + - source + - model_permaslug + - display_name + - arena + - category + - elo + - win_rate + - avg_generation_time_ms + - tournament_stats + - pricing + type: object + UnifiedBenchmarksMeta: example: - trace_id: trace-abc123 - trace_name: my-app-trace + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 50 + source: artificial-analysis + source_url: https://artificialanalysis.ai + task_type: null + version: v1 properties: - generation_name: - type: string - parent_span_id: + as_of: + description: ISO-8601 timestamp of when this data was last updated. + example: '2026-06-03T12:00:00Z' type: string - span_name: + citation: + description: Required attribution when republishing this data. + example: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' type: string - trace_id: + model_count: + description: Number of unique models in the response. + type: integer + source: + description: The source filter applied. + enum: + - artificial-analysis + - design-arena + example: artificial-analysis type: string - trace_name: + x-speakeasy-unknown-values: allow + source_url: + description: URL of the upstream data source. + example: https://artificialanalysis.ai type: string - type: object - Truncation: - enum: - - auto - - disabled - - null - example: auto - nullable: true - type: string - x-speakeasy-unknown-values: allow - UnauthorizedResponse: - description: Unauthorized - Authentication required or invalid credentials - example: - error: - code: 401 - message: Missing Authentication header - properties: - error: - $ref: '#/components/schemas/UnauthorizedResponseErrorData' - openrouter_metadata: - additionalProperties: - nullable: true - nullable: true - type: object - user_id: + task_type: + description: The task_type filter applied, or null if showing all. nullable: true type: string + version: + description: Dataset version. + enum: + - v1 + type: string required: - - error + - as_of + - version + - source + - source_url + - citation + - model_count + - task_type type: object - UnauthorizedResponseErrorData: - description: Error data for UnauthorizedResponse + UnifiedBenchmarksResponse: example: - code: 401 - message: Missing Authentication header + data: + - agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + meta: + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 1 + source: artificial-analysis + source_url: https://artificialanalysis.ai + task_type: null + version: v1 properties: - code: - type: integer - message: - type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object + data: + items: + discriminator: + mapping: + artificial-analysis: '#/components/schemas/UnifiedBenchmarksAAItem' + design-arena: '#/components/schemas/UnifiedBenchmarksDAItem' + propertyName: source + oneOf: + - $ref: '#/components/schemas/UnifiedBenchmarksAAItem' + - $ref: '#/components/schemas/UnifiedBenchmarksDAItem' + type: array + meta: + $ref: '#/components/schemas/UnifiedBenchmarksMeta' required: - - code - - message + - data + - meta type: object UnprocessableEntityResponse: description: Unprocessable Entity - Semantic validation failure @@ -22891,44 +22854,195 @@ paths: application/json: example: data: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: auth_code_xyz789 + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: auth_code_xyz789 + schema: + example: + data: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: auth_code_xyz789 + properties: + data: + description: Auth code data + example: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: auth_code_xyz789 + properties: + app_id: + description: The application ID associated with this auth code + example: 12345 + type: integer + created_at: + description: ISO 8601 timestamp of when the auth code was created + example: '2025-08-24T10:30:00Z' + type: string + id: + description: The authorization code ID to use in the exchange request + example: auth_code_xyz789 + type: string + required: + - id + - app_id + - created_at + type: object + required: + - data + type: object + description: Successfully created authorization code + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '409': + content: + application/json: + example: + error: + code: 409 + message: Resource conflict. Please try again later. + schema: + $ref: '#/components/schemas/ConflictResponse' + description: Conflict - Resource conflict or concurrent modification + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Create authorization code + tags: + - OAuth + x-speakeasy-name-override: createAuthCode + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /benchmarks: + get: + description: >- + Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + operationId: getBenchmarks + parameters: + - description: Benchmark source to query. Determines the shape of the returned items. + in: query + name: source + required: true + schema: + description: Benchmark source to query. Determines the shape of the returned items. + enum: + - artificial-analysis + - design-arena + example: artificial-analysis + type: string + x-speakeasy-unknown-values: allow + - description: >- + Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + in: query + name: task_type + required: false + schema: + description: >- + Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + enum: + - coding + - intelligence + - agentic + example: coding + type: string + x-speakeasy-unknown-values: allow + - description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + in: query + name: arena + required: false + schema: + description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + enum: + - models + - builders + - agents + example: models + type: string + x-speakeasy-unknown-values: allow + - description: >- + Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + in: query + name: category + required: false + schema: + description: >- + Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + example: codecategories + type: string + - description: Max results to return (1–100, default 50). + in: query + name: max_results + required: false + schema: + default: 50 + description: Max results to return (1–100, default 50). + example: 20 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + meta: + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 1 + source: artificial-analysis + source_url: https://artificialanalysis.ai + task_type: null + version: v1 schema: - example: - data: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: auth_code_xyz789 - properties: - data: - description: Auth code data - example: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: auth_code_xyz789 - properties: - app_id: - description: The application ID associated with this auth code - example: 12345 - type: integer - created_at: - description: ISO 8601 timestamp of when the auth code was created - example: '2025-08-24T10:30:00Z' - type: string - id: - description: The authorization code ID to use in the exchange request - example: auth_code_xyz789 - type: string - required: - - id - - app_id - - created_at - type: object - required: - - data - type: object - description: Successfully created authorization code + $ref: '#/components/schemas/UnifiedBenchmarksResponse' + description: Benchmark results filtered by the specified source and optional task type. '400': content: application/json: @@ -22949,26 +23063,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '403': - content: - application/json: - example: - error: - code: 403 - message: Only management keys can perform this operation - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions - '409': + '429': content: application/json: example: error: - code: 409 - message: Resource conflict. Please try again later. + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/ConflictResponse' - description: Conflict - Resource conflict or concurrent modification + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -22979,10 +23083,9 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Create authorization code + summary: List Benchmarks tags: - - OAuth - x-speakeasy-name-override: createAuthCode + - Benchmarks parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" @@ -24058,219 +24161,6 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /datasets/benchmarks/artificial-analysis: - get: - description: >- - Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - operationId: getBenchmarksArtificialAnalysis - parameters: - - description: Max results to return (1–100, default 50). - in: query - name: max_results - required: false - schema: - default: 50 - description: Max results to return (1–100, default 50). - example: 20 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - meta: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 1 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 - schema: - $ref: '#/components/schemas/BenchmarksAAResponse' - description: Artificial Analysis composite index scores with pricing and attribution metadata. - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input - '401': - content: - application/json: - example: - error: - code: 401 - message: Missing Authentication header - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Artificial Analysis Benchmark Indices - tags: - - Datasets - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /datasets/benchmarks/design-arena: - get: - description: >- - Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - operationId: getBenchmarksDesignArena - parameters: - - description: Arena to query. Defaults to `models`. - in: query - name: arena - required: false - schema: - default: models - description: Arena to query. Defaults to `models`. - enum: - - models - - builders - - agents - example: models - type: string - x-speakeasy-unknown-values: allow - - description: >- - Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - in: query - name: category - required: false - schema: - description: >- - Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - example: codecategories - type: string - - description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' - in: query - name: max_results - required: false - schema: - default: 50 - description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' - example: 20 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 - meta: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 1 - source: design-arena - source_url: https://www.designarena.ai - version: v1 - schema: - $ref: '#/components/schemas/BenchmarksDAResponse' - description: Design Arena ELO rankings with pricing and attribution metadata. - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input - '401': - content: - application/json: - example: - error: - code: 401 - message: Missing Authentication header - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Design Arena Benchmark Rankings - tags: - - Datasets - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" /datasets/rankings-daily: get: description: |- @@ -28734,7 +28624,7 @@ paths: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -32690,6 +32580,8 @@ tags: name: Anthropic Messages - description: BYOK endpoints name: BYOK + - description: Benchmarks endpoints + name: Benchmarks - description: Chat completion endpoints name: Chat - description: Credit management endpoints diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0cc33bd09..29913e985 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:40af9b9fd342d9b1902866ba1aae1c6708d028b0ad58cf338830011c27a5f2fe - sourceBlobDigest: sha256:bde7a0c1490354f5b9fc7ecf1a6722947087f769c521b2179199d3cd690c7c0e + sourceRevisionDigest: sha256:b0051fbe961017aad4c94adc04def55aa2205ea13644710a75f7e0c0c5382ead + sourceBlobDigest: sha256:64469f5055452af54cb59ff9b73d2ff13bf81731e6cfaa3bac5b3fda270b4291 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:40af9b9fd342d9b1902866ba1aae1c6708d028b0ad58cf338830011c27a5f2fe - sourceBlobDigest: sha256:bde7a0c1490354f5b9fc7ecf1a6722947087f769c521b2179199d3cd690c7c0e + sourceRevisionDigest: sha256:b0051fbe961017aad4c94adc04def55aa2205ea13644710a75f7e0c0c5382ead + sourceBlobDigest: sha256:64469f5055452af54cb59ff9b73d2ff13bf81731e6cfaa3bac5b3fda270b4291 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:96d0af75c0818bc7a7ef8b366a29274a9c180ad80c5831faeba65a70f60c2131 + codeSamplesRevisionDigest: sha256:3cbf31a7cb4579d9923ab5245b1e289e849dea426762db611f46eec827a985bc workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.763.2 diff --git a/RELEASES.md b/RELEASES.md index 6a72aadea..2df540407 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1356,4 +1356,14 @@ Based on: ### Generated - [typescript v0.13.12] . ### Releases -- [NPM v0.13.12] https://www.npmjs.com/package/@openrouter/sdk/v/0.13.12 - . \ No newline at end of file +- [NPM v0.13.12] https://www.npmjs.com/package/@openrouter/sdk/v/0.13.12 - . + +## 2026-06-18 20:08:11 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.763.2 (2.884.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.13.13] . +### Releases +- [NPM v0.13.13] https://www.npmjs.com/package/@openrouter/sdk/v/0.13.13 - . \ No newline at end of file diff --git a/docs/models/model.md b/docs/models/model.md index 1b38986df..13d36933c 100644 --- a/docs/models/model.md +++ b/docs/models/model.md @@ -62,6 +62,7 @@ let value: Model = { | `name` | *string* | :heavy_check_mark: | Display name of the model | GPT-4 | | `perRequestLimits` | [models.PerRequestLimits](../models/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"completion_tokens": 1000,
"prompt_tokens": 1000
} | | `pricing` | [models.PublicPricing](../models/publicpricing.md) | :heavy_check_mark: | Pricing information for the model | {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
} | +| `reasoning` | [models.ModelReasoning](../models/modelreasoning.md) | :heavy_minus_sign: | Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. | {
"default_effort": "medium",
"default_enabled": true,
"mandatory": false,
"supported_efforts": [
"high",
"medium",
"low",
"minimal"
]
} | | `supportedParameters` | [models.Parameter](../models/parameter.md)[] | :heavy_check_mark: | List of supported parameters for this model | | | `supportedVoices` | *string*[] | :heavy_check_mark: | List of supported voice identifiers for TTS models. Null for non-TTS models. | | | `topProvider` | [models.TopProviderInfo](../models/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
} | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 4da4364d1..5582223ca 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.13.12", + "version": "0.13.13", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 86784c8be..336679769 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.13.12", + "version": "0.13.13", "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": [ @@ -21,8 +21,8 @@ "license": "Apache-2.0", "packageManager": "pnpm@10.22.0", "publishConfig": { - "access": "public", - "provenance": true + "provenance": true, + "access": "public" }, "type": "module", "main": "./esm/index.js", @@ -74,14 +74,14 @@ "build": "tsc", "prepublishOnly": "npm run build", "test:transit": "exit 0", + "postinstall": "node scripts/check-types.js || true", "test:watch": "vitest --watch --project unit", "typecheck": "tsc --noEmit", "typecheck:transit": "exit 0", "compile": "tsc", - "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build", - "test:e2e": "vitest --run --project e2e", - "test": "vitest --run --project unit" + "test": "vitest --run --project unit", + "test:e2e": "vitest --run --project e2e" }, "peerDependencies": {}, "devDependencies": { diff --git a/src/funcs/datasetsGetBenchmarksArtificialAnalysis.ts b/src/funcs/benchmarksGetBenchmarks.ts similarity index 81% rename from src/funcs/datasetsGetBenchmarksArtificialAnalysis.ts rename to src/funcs/benchmarksGetBenchmarks.ts index 317d232fa..4e9870ca8 100644 --- a/src/funcs/datasetsGetBenchmarksArtificialAnalysis.ts +++ b/src/funcs/benchmarksGetBenchmarks.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 8997506a6260 + * @generated-id: 1b5fbe93cea7 */ import { OpenRouterCore } from "../core.js"; @@ -29,18 +29,18 @@ import { APICall, APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; /** - * Artificial Analysis Benchmark Indices + * List Benchmarks * * @remarks - * Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. */ -export function datasetsGetBenchmarksArtificialAnalysis( +export function benchmarksGetBenchmarks( client: OpenRouterCore, - request?: operations.GetBenchmarksArtificialAnalysisRequest | undefined, + request: operations.GetBenchmarksRequest, options?: RequestOptions, ): APIPromise< Result< - models.BenchmarksAAResponse, + models.UnifiedBenchmarksResponse, | errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.TooManyRequestsResponseError @@ -64,12 +64,12 @@ export function datasetsGetBenchmarksArtificialAnalysis( async function $do( client: OpenRouterCore, - request?: operations.GetBenchmarksArtificialAnalysisRequest | undefined, + request: operations.GetBenchmarksRequest, options?: RequestOptions, ): Promise< [ Result< - models.BenchmarksAAResponse, + models.UnifiedBenchmarksResponse, | errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.TooManyRequestsResponseError @@ -88,9 +88,7 @@ async function $do( > { const parsed = safeParse( request, - (value) => - operations.GetBenchmarksArtificialAnalysisRequest$outboundSchema - .optional().parse(value), + (value) => operations.GetBenchmarksRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { @@ -99,27 +97,31 @@ async function $do( const payload = parsed.value; const body = null; - const path = pathToFunc("/datasets/benchmarks/artificial-analysis")(); + const path = pathToFunc("/benchmarks")(); const query = encodeFormQuery({ - "max_results": payload?.max_results, + "arena": payload.arena, + "category": payload.category, + "max_results": payload.max_results, + "source": payload.source, + "task_type": payload.task_type, }); const headers = new Headers(compactMap({ Accept: "application/json", "HTTP-Referer": encodeSimple( "HTTP-Referer", - payload?.["HTTP-Referer"] ?? client._options.httpReferer, + payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }, ), "X-OpenRouter-Categories": encodeSimple( "X-OpenRouter-Categories", - payload?.appCategories ?? client._options.appCategories, + payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }, ), "X-OpenRouter-Title": encodeSimple( "X-OpenRouter-Title", - payload?.appTitle ?? client._options.appTitle, + payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }, ), })); @@ -131,7 +133,7 @@ async function $do( const context = { options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getBenchmarksArtificialAnalysis", + operationID: "getBenchmarks", oAuth2Scopes: null, resolvedSecurity: requestSecurity, @@ -186,7 +188,7 @@ async function $do( }; const [result] = await M.match< - models.BenchmarksAAResponse, + models.UnifiedBenchmarksResponse, | errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.TooManyRequestsResponseError @@ -200,7 +202,7 @@ async function $do( | UnexpectedClientError | SDKValidationError >( - M.json(200, models.BenchmarksAAResponse$inboundSchema), + M.json(200, models.UnifiedBenchmarksResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), diff --git a/src/funcs/datasetsGetBenchmarksDesignArena.ts b/src/funcs/datasetsGetBenchmarksDesignArena.ts deleted file mode 100644 index db10a9f95..000000000 --- a/src/funcs/datasetsGetBenchmarksDesignArena.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 1e5ef73682ba - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Design Arena Benchmark Rankings - * - * @remarks - * Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - */ -export function datasetsGetBenchmarksDesignArena( - client: OpenRouterCore, - request?: operations.GetBenchmarksDesignArenaRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - models.BenchmarksDAResponse, - | errors.BadRequestResponseError - | errors.UnauthorizedResponseError - | errors.TooManyRequestsResponseError - | errors.InternalServerResponseError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request?: operations.GetBenchmarksDesignArenaRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - models.BenchmarksDAResponse, - | errors.BadRequestResponseError - | errors.UnauthorizedResponseError - | errors.TooManyRequestsResponseError - | errors.InternalServerResponseError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetBenchmarksDesignArenaRequest$outboundSchema.optional() - .parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/datasets/benchmarks/design-arena")(); - - const query = encodeFormQuery({ - "arena": payload?.arena, - "category": payload?.category, - "max_results": payload?.max_results, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload?.["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload?.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload?.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getBenchmarksDesignArena", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.BenchmarksDAResponse, - | errors.BadRequestResponseError - | errors.UnauthorizedResponseError - | errors.TooManyRequestsResponseError - | errors.InternalServerResponseError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.BenchmarksDAResponse$inboundSchema), - M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), - M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), - M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), - M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/lib/config.ts b/src/lib/config.ts index f9bb538d6..b932decc0 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.12", + sdkVersion: "0.13.13", genVersion: "2.884.4", - userAgent: "speakeasy-sdk/typescript 0.13.12 2.884.4 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.13.13 2.884.4 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/benchmarksaameta.ts b/src/models/benchmarksaameta.ts deleted file mode 100644 index c64ee9ca0..000000000 --- a/src/models/benchmarksaameta.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: ea7ac20c3f7c - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { ClosedEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * Data source identifier. - */ -export const BenchmarksAAMetaSource = { - ArtificialAnalysis: "artificial-analysis", -} as const; -/** - * Data source identifier. - */ -export type BenchmarksAAMetaSource = ClosedEnum; - -/** - * URL of the upstream data source. - */ -export const BenchmarksAAMetaSourceUrl = { - HttpsArtificialanalysisAi: "https://artificialanalysis.ai", -} as const; -/** - * URL of the upstream data source. - */ -export type BenchmarksAAMetaSourceUrl = ClosedEnum< - typeof BenchmarksAAMetaSourceUrl ->; - -/** - * Dataset version. - */ -export const BenchmarksAAMetaVersion = { - V1: "v1", -} as const; -/** - * Dataset version. - */ -export type BenchmarksAAMetaVersion = ClosedEnum< - typeof BenchmarksAAMetaVersion ->; - -export type BenchmarksAAMeta = { - /** - * ISO-8601 timestamp of when this data was last updated. - */ - asOf: string; - /** - * Required attribution when republishing this data. - */ - citation: string; - /** - * Number of unique models in the response. - */ - modelCount: number; - /** - * Data source identifier. - */ - source: BenchmarksAAMetaSource; - /** - * URL of the upstream data source. - */ - sourceUrl: BenchmarksAAMetaSourceUrl; - /** - * Dataset version. - */ - version: BenchmarksAAMetaVersion; -}; - -/** @internal */ -export const BenchmarksAAMetaSource$inboundSchema: z.ZodEnum< - typeof BenchmarksAAMetaSource -> = z.enum(BenchmarksAAMetaSource); - -/** @internal */ -export const BenchmarksAAMetaSourceUrl$inboundSchema: z.ZodEnum< - typeof BenchmarksAAMetaSourceUrl -> = z.enum(BenchmarksAAMetaSourceUrl); - -/** @internal */ -export const BenchmarksAAMetaVersion$inboundSchema: z.ZodEnum< - typeof BenchmarksAAMetaVersion -> = z.enum(BenchmarksAAMetaVersion); - -/** @internal */ -export const BenchmarksAAMeta$inboundSchema: z.ZodType< - BenchmarksAAMeta, - unknown -> = z.object({ - as_of: z.string(), - citation: z.string(), - model_count: z.int(), - source: BenchmarksAAMetaSource$inboundSchema, - source_url: BenchmarksAAMetaSourceUrl$inboundSchema, - version: BenchmarksAAMetaVersion$inboundSchema, -}).transform((v) => { - return remap$(v, { - "as_of": "asOf", - "model_count": "modelCount", - "source_url": "sourceUrl", - }); -}); - -export function benchmarksAAMetaFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BenchmarksAAMeta$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BenchmarksAAMeta' from JSON`, - ); -} diff --git a/src/models/benchmarksaaresponse.ts b/src/models/benchmarksaaresponse.ts deleted file mode 100644 index 39ae16b8e..000000000 --- a/src/models/benchmarksaaresponse.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 57a074171835 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { - BenchmarksAAItem, - BenchmarksAAItem$inboundSchema, -} from "./benchmarksaaitem.js"; -import { - BenchmarksAAMeta, - BenchmarksAAMeta$inboundSchema, -} from "./benchmarksaameta.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type BenchmarksAAResponse = { - data: Array; - meta: BenchmarksAAMeta; -}; - -/** @internal */ -export const BenchmarksAAResponse$inboundSchema: z.ZodType< - BenchmarksAAResponse, - unknown -> = z.object({ - data: z.array(BenchmarksAAItem$inboundSchema), - meta: BenchmarksAAMeta$inboundSchema, -}); - -export function benchmarksAAResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BenchmarksAAResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BenchmarksAAResponse' from JSON`, - ); -} diff --git a/src/models/benchmarksdameta.ts b/src/models/benchmarksdameta.ts deleted file mode 100644 index 3ae479d96..000000000 --- a/src/models/benchmarksdameta.ts +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: caee78d8918e - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { ClosedEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * ELO range across all returned models for normalization. - */ -export type EloBounds = { - /** - * Maximum ELO in the result set. - */ - max: number; - /** - * Minimum ELO in the result set. - */ - min: number; -}; - -/** - * Data source identifier. - */ -export const BenchmarksDAMetaSource = { - DesignArena: "design-arena", -} as const; -/** - * Data source identifier. - */ -export type BenchmarksDAMetaSource = ClosedEnum; - -/** - * URL of the upstream data source. - */ -export const BenchmarksDAMetaSourceUrl = { - HttpsWwwDesignarenaAi: "https://www.designarena.ai", -} as const; -/** - * URL of the upstream data source. - */ -export type BenchmarksDAMetaSourceUrl = ClosedEnum< - typeof BenchmarksDAMetaSourceUrl ->; - -/** - * Dataset version. - */ -export const BenchmarksDAMetaVersion = { - V1: "v1", -} as const; -/** - * Dataset version. - */ -export type BenchmarksDAMetaVersion = ClosedEnum< - typeof BenchmarksDAMetaVersion ->; - -export type BenchmarksDAMeta = { - /** - * The arena filter applied. - */ - arena: string; - /** - * ISO-8601 timestamp of when this data was generated. - */ - asOf: string; - /** - * The category filter applied, or null if showing all. - */ - category: string | null; - /** - * Required attribution when republishing this data. - */ - citation: string; - /** - * ELO range across all returned models for normalization. - */ - eloBounds: EloBounds; - /** - * Number of unique models in the response. - */ - modelCount: number; - /** - * Data source identifier. - */ - source: BenchmarksDAMetaSource; - /** - * URL of the upstream data source. - */ - sourceUrl: BenchmarksDAMetaSourceUrl; - /** - * Dataset version. - */ - version: BenchmarksDAMetaVersion; -}; - -/** @internal */ -export const EloBounds$inboundSchema: z.ZodType = z.object({ - max: z.number(), - min: z.number(), -}); - -export function eloBoundsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => EloBounds$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'EloBounds' from JSON`, - ); -} - -/** @internal */ -export const BenchmarksDAMetaSource$inboundSchema: z.ZodEnum< - typeof BenchmarksDAMetaSource -> = z.enum(BenchmarksDAMetaSource); - -/** @internal */ -export const BenchmarksDAMetaSourceUrl$inboundSchema: z.ZodEnum< - typeof BenchmarksDAMetaSourceUrl -> = z.enum(BenchmarksDAMetaSourceUrl); - -/** @internal */ -export const BenchmarksDAMetaVersion$inboundSchema: z.ZodEnum< - typeof BenchmarksDAMetaVersion -> = z.enum(BenchmarksDAMetaVersion); - -/** @internal */ -export const BenchmarksDAMeta$inboundSchema: z.ZodType< - BenchmarksDAMeta, - unknown -> = z.object({ - arena: z.string(), - as_of: z.string(), - category: z.nullable(z.string()), - citation: z.string(), - elo_bounds: z.lazy(() => EloBounds$inboundSchema), - model_count: z.int(), - source: BenchmarksDAMetaSource$inboundSchema, - source_url: BenchmarksDAMetaSourceUrl$inboundSchema, - version: BenchmarksDAMetaVersion$inboundSchema, -}).transform((v) => { - return remap$(v, { - "as_of": "asOf", - "elo_bounds": "eloBounds", - "model_count": "modelCount", - "source_url": "sourceUrl", - }); -}); - -export function benchmarksDAMetaFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BenchmarksDAMeta$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BenchmarksDAMeta' from JSON`, - ); -} diff --git a/src/models/benchmarksdaresponse.ts b/src/models/benchmarksdaresponse.ts deleted file mode 100644 index 7477dd447..000000000 --- a/src/models/benchmarksdaresponse.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: ea90fb0e8882 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { - BenchmarksDAItem, - BenchmarksDAItem$inboundSchema, -} from "./benchmarksdaitem.js"; -import { - BenchmarksDAMeta, - BenchmarksDAMeta$inboundSchema, -} from "./benchmarksdameta.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type BenchmarksDAResponse = { - data: Array; - meta: BenchmarksDAMeta; -}; - -/** @internal */ -export const BenchmarksDAResponse$inboundSchema: z.ZodType< - BenchmarksDAResponse, - unknown -> = z.object({ - data: z.array(BenchmarksDAItem$inboundSchema), - meta: BenchmarksDAMeta$inboundSchema, -}); - -export function benchmarksDAResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BenchmarksDAResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BenchmarksDAResponse' from JSON`, - ); -} diff --git a/src/models/index.ts b/src/models/index.ts index b6af20234..abd3def3e 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -62,13 +62,6 @@ export * from "./bashservertool.js"; export * from "./bashservertoolconfig.js"; export * from "./bashservertoolengine.js"; export * from "./bashservertoolenvironment.js"; -export * from "./benchmarkpricing.js"; -export * from "./benchmarksaaitem.js"; -export * from "./benchmarksaameta.js"; -export * from "./benchmarksaaresponse.js"; -export * from "./benchmarksdaitem.js"; -export * from "./benchmarksdameta.js"; -export * from "./benchmarksdaresponse.js"; export * from "./bulkaddworkspacemembersrequest.js"; export * from "./bulkaddworkspacemembersresponse.js"; export * from "./bulkassignkeysrequest.js"; @@ -276,6 +269,7 @@ export * from "./modelarchitecture.js"; export * from "./modelbenchmarks.js"; export * from "./modelgroup.js"; export * from "./modellinks.js"; +export * from "./modelreasoning.js"; export * from "./modelresponse.js"; export * from "./modelscountresponse.js"; export * from "./modelslistresponse.js"; @@ -461,6 +455,11 @@ export * from "./topproviderinfo.js"; export * from "./traceconfig.js"; export * from "./truncation.js"; export * from "./unauthorizedresponseerrordata.js"; +export * from "./unifiedbenchmarkpricing.js"; +export * from "./unifiedbenchmarksaaitem.js"; +export * from "./unifiedbenchmarksdaitem.js"; +export * from "./unifiedbenchmarksmeta.js"; +export * from "./unifiedbenchmarksresponse.js"; export * from "./unprocessableentityresponseerrordata.js"; export * from "./updatebyokkeyrequest.js"; export * from "./updatebyokkeyresponse.js"; diff --git a/src/models/model.ts b/src/models/model.ts index 414b0872a..36fc52455 100644 --- a/src/models/model.ts +++ b/src/models/model.ts @@ -21,6 +21,10 @@ import { ModelBenchmarks$inboundSchema, } from "./modelbenchmarks.js"; import { ModelLinks, ModelLinks$inboundSchema } from "./modellinks.js"; +import { + ModelReasoning, + ModelReasoning$inboundSchema, +} from "./modelreasoning.js"; import { Parameter, Parameter$inboundSchema } from "./parameter.js"; import { PerRequestLimits, @@ -96,6 +100,10 @@ export type Model = { * Pricing information for the model */ pricing: PublicPricing; + /** + * Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. + */ + reasoning?: ModelReasoning | undefined; /** * List of supported parameters for this model */ @@ -127,6 +135,7 @@ export const Model$inboundSchema: z.ZodType = z.object({ name: z.string(), per_request_limits: z.nullable(PerRequestLimits$inboundSchema), pricing: PublicPricing$inboundSchema, + reasoning: ModelReasoning$inboundSchema.optional(), supported_parameters: z.array(Parameter$inboundSchema), supported_voices: z.nullable(z.array(z.string())), top_provider: TopProviderInfo$inboundSchema, diff --git a/src/models/modelreasoning.ts b/src/models/modelreasoning.ts new file mode 100644 index 000000000..427b17cfb --- /dev/null +++ b/src/models/modelreasoning.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c7312e55417d + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ReasoningEffort, + ReasoningEffort$inboundSchema, +} from "./reasoningeffort.js"; + +/** + * Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning. + */ +export const DefaultEffort = { + Xhigh: "xhigh", + High: "high", + Medium: "medium", + Low: "low", + Minimal: "minimal", + None: "none", +} as const; +/** + * Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning. + */ +export type DefaultEffort = OpenEnum; + +/** + * Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. + */ +export type ModelReasoning = { + defaultEffort?: DefaultEffort | null | undefined; + /** + * Default reasoning enabled state when the client does not set `reasoning.enabled`. + */ + defaultEnabled?: boolean | undefined; + /** + * When true, reasoning cannot be disabled and effort "none" is rejected. + */ + mandatory: boolean; + /** + * Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted. + */ + supportedEfforts?: Array | null | undefined; + /** + * Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise. + */ + supportsMaxTokens?: boolean | undefined; +}; + +/** @internal */ +export const DefaultEffort$inboundSchema: z.ZodType = + openEnums.inboundSchema(DefaultEffort); + +/** @internal */ +export const ModelReasoning$inboundSchema: z.ZodType = + z.object({ + default_effort: z.nullable(DefaultEffort$inboundSchema).optional(), + default_enabled: z.boolean().optional(), + mandatory: z.boolean(), + supported_efforts: z.nullable( + z.array(z.nullable(ReasoningEffort$inboundSchema)), + ).optional(), + supports_max_tokens: z.boolean().optional(), + }).transform((v) => { + return remap$(v, { + "default_effort": "defaultEffort", + "default_enabled": "defaultEnabled", + "supported_efforts": "supportedEfforts", + "supports_max_tokens": "supportsMaxTokens", + }); + }); + +export function modelReasoningFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ModelReasoning$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ModelReasoning' from JSON`, + ); +} diff --git a/src/models/operations/getbenchmarks.ts b/src/models/operations/getbenchmarks.ts new file mode 100644 index 000000000..f8ad3f92c --- /dev/null +++ b/src/models/operations/getbenchmarks.ts @@ -0,0 +1,164 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 52eb1eb063ae + */ + +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 GetBenchmarksGlobals = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; +}; + +/** + * Benchmark source to query. Determines the shape of the returned items. + */ +export const Source = { + ArtificialAnalysis: "artificial-analysis", + DesignArena: "design-arena", +} as const; +/** + * Benchmark source to query. Determines the shape of the returned items. + */ +export type Source = OpenEnum; + +/** + * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + */ +export const TaskType = { + Coding: "coding", + Intelligence: "intelligence", + Agentic: "agentic", +} as const; +/** + * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + */ +export type TaskType = OpenEnum; + +/** + * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. + */ +export const Arena = { + Models: "models", + Builders: "builders", + Agents: "agents", +} as const; +/** + * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. + */ +export type Arena = OpenEnum; + +export type GetBenchmarksRequest = { + /** + * The app identifier should be your app's URL and is used as the primary identifier for rankings. + * + * @remarks + * This is used to track API usage per application. + */ + httpReferer?: string | undefined; + /** + * The app display name allows you to customize how your app appears in OpenRouter's dashboard. + * + * @remarks + */ + appTitle?: string | undefined; + /** + * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. + * + * @remarks + */ + appCategories?: string | undefined; + /** + * Benchmark source to query. Determines the shape of the returned items. + */ + source: Source; + /** + * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + */ + taskType?: TaskType | undefined; + /** + * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. + */ + arena?: Arena | undefined; + /** + * Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + */ + category?: string | undefined; + /** + * Max results to return (1–100, default 50). + */ + maxResults?: number | undefined; +}; + +/** @internal */ +export const Source$outboundSchema: z.ZodType = openEnums + .outboundSchema(Source); + +/** @internal */ +export const TaskType$outboundSchema: z.ZodType = openEnums + .outboundSchema(TaskType); + +/** @internal */ +export const Arena$outboundSchema: z.ZodType = openEnums + .outboundSchema(Arena); + +/** @internal */ +export type GetBenchmarksRequest$Outbound = { + "HTTP-Referer"?: string | undefined; + appTitle?: string | undefined; + appCategories?: string | undefined; + source: string; + task_type?: string | undefined; + arena?: string | undefined; + category?: string | undefined; + max_results: number; +}; + +/** @internal */ +export const GetBenchmarksRequest$outboundSchema: z.ZodType< + GetBenchmarksRequest$Outbound, + GetBenchmarksRequest +> = z.object({ + httpReferer: z.string().optional(), + appTitle: z.string().optional(), + appCategories: z.string().optional(), + source: Source$outboundSchema, + taskType: TaskType$outboundSchema.optional(), + arena: Arena$outboundSchema.optional(), + category: z.string().optional(), + maxResults: z.int().default(50), +}).transform((v) => { + return remap$(v, { + httpReferer: "HTTP-Referer", + taskType: "task_type", + maxResults: "max_results", + }); +}); + +export function getBenchmarksRequestToJSON( + getBenchmarksRequest: GetBenchmarksRequest, +): string { + return JSON.stringify( + GetBenchmarksRequest$outboundSchema.parse(getBenchmarksRequest), + ); +} diff --git a/src/models/operations/getbenchmarksartificialanalysis.ts b/src/models/operations/getbenchmarksartificialanalysis.ts deleted file mode 100644 index a510b9302..000000000 --- a/src/models/operations/getbenchmarksartificialanalysis.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 1b7863e0088a - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type GetBenchmarksArtificialAnalysisGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type GetBenchmarksArtificialAnalysisRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * Max results to return (1–100, default 50). - */ - maxResults?: number | undefined; -}; - -/** @internal */ -export type GetBenchmarksArtificialAnalysisRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - max_results: number; -}; - -/** @internal */ -export const GetBenchmarksArtificialAnalysisRequest$outboundSchema: z.ZodType< - GetBenchmarksArtificialAnalysisRequest$Outbound, - GetBenchmarksArtificialAnalysisRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - maxResults: z.int().default(50), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - maxResults: "max_results", - }); -}); - -export function getBenchmarksArtificialAnalysisRequestToJSON( - getBenchmarksArtificialAnalysisRequest: - GetBenchmarksArtificialAnalysisRequest, -): string { - return JSON.stringify( - GetBenchmarksArtificialAnalysisRequest$outboundSchema.parse( - getBenchmarksArtificialAnalysisRequest, - ), - ); -} diff --git a/src/models/operations/getbenchmarksdesignarena.ts b/src/models/operations/getbenchmarksdesignarena.ts deleted file mode 100644 index 09db903b1..000000000 --- a/src/models/operations/getbenchmarksdesignarena.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 86e27de57b33 - */ - -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 GetBenchmarksDesignArenaGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -/** - * Arena to query. Defaults to `models`. - */ -export const Arena = { - Models: "models", - Builders: "builders", - Agents: "agents", -} as const; -/** - * Arena to query. Defaults to `models`. - */ -export type Arena = OpenEnum; - -export type GetBenchmarksDesignArenaRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * Arena to query. Defaults to `models`. - */ - arena?: Arena | undefined; - /** - * Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - */ - category?: string | undefined; - /** - * Max results to return: per category when no category filter is applied (1–100, default 50). - */ - maxResults?: number | undefined; -}; - -/** @internal */ -export const Arena$outboundSchema: z.ZodType = openEnums - .outboundSchema(Arena); - -/** @internal */ -export type GetBenchmarksDesignArenaRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - arena: string; - category?: string | undefined; - max_results: number; -}; - -/** @internal */ -export const GetBenchmarksDesignArenaRequest$outboundSchema: z.ZodType< - GetBenchmarksDesignArenaRequest$Outbound, - GetBenchmarksDesignArenaRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - arena: Arena$outboundSchema.default("models"), - category: z.string().optional(), - maxResults: z.int().default(50), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - maxResults: "max_results", - }); -}); - -export function getBenchmarksDesignArenaRequestToJSON( - getBenchmarksDesignArenaRequest: GetBenchmarksDesignArenaRequest, -): string { - return JSON.stringify( - GetBenchmarksDesignArenaRequest$outboundSchema.parse( - getBenchmarksDesignArenaRequest, - ), - ); -} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 54f61e82e..3ac772bf8 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -35,8 +35,7 @@ export * from "./downloadfilecontent.js"; export * from "./exchangeauthcodeforapikey.js"; export * from "./getanalyticsmeta.js"; export * from "./getapprankings.js"; -export * from "./getbenchmarksartificialanalysis.js"; -export * from "./getbenchmarksdesignarena.js"; +export * from "./getbenchmarks.js"; export * from "./getbyokkey.js"; export * from "./getcredits.js"; export * from "./getcurrentkey.js"; diff --git a/src/models/benchmarkpricing.ts b/src/models/unifiedbenchmarkpricing.ts similarity index 63% rename from src/models/benchmarkpricing.ts rename to src/models/unifiedbenchmarkpricing.ts index 274450e53..0a39dad24 100644 --- a/src/models/benchmarkpricing.ts +++ b/src/models/unifiedbenchmarkpricing.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 74aab084b178 + * @generated-id: c6862b5223a1 */ import * as z from "zod/v4"; @@ -11,7 +11,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * OpenRouter pricing per token for this model. Null if pricing is unavailable. */ -export type BenchmarkPricing = { +export type UnifiedBenchmarkPricing = { /** * Cost per output token (USD, decimal string). */ @@ -23,20 +23,20 @@ export type BenchmarkPricing = { }; /** @internal */ -export const BenchmarkPricing$inboundSchema: z.ZodType< - BenchmarkPricing, +export const UnifiedBenchmarkPricing$inboundSchema: z.ZodType< + UnifiedBenchmarkPricing, unknown > = z.object({ completion: z.string(), prompt: z.string(), }); -export function benchmarkPricingFromJSON( +export function unifiedBenchmarkPricingFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => BenchmarkPricing$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BenchmarkPricing' from JSON`, + (x) => UnifiedBenchmarkPricing$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UnifiedBenchmarkPricing' from JSON`, ); } diff --git a/src/models/benchmarksaaitem.ts b/src/models/unifiedbenchmarksaaitem.ts similarity index 63% rename from src/models/benchmarksaaitem.ts rename to src/models/unifiedbenchmarksaaitem.ts index 54fbada85..b81f764c6 100644 --- a/src/models/benchmarksaaitem.ts +++ b/src/models/unifiedbenchmarksaaitem.ts @@ -1,23 +1,19 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 82b5c9f01e00 + * @generated-id: 436660899947 */ 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 { - BenchmarkPricing, - BenchmarkPricing$inboundSchema, -} from "./benchmarkpricing.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + UnifiedBenchmarkPricing, + UnifiedBenchmarkPricing$inboundSchema, +} from "./unifiedbenchmarkpricing.js"; -export type BenchmarksAAItem = { - /** - * Model name as listed on Artificial Analysis. - */ - aaName: string; +export type UnifiedBenchmarksAAItem = { /** * Artificial Analysis Agentic Index composite score. Higher is better. */ @@ -26,6 +22,10 @@ export type BenchmarksAAItem = { * Artificial Analysis Coding Index composite score. Higher is better. */ codingIndex: number | null; + /** + * Model name as listed on Artificial Analysis. + */ + displayName: string; /** * Artificial Analysis Intelligence Index composite score. Higher is better. */ @@ -37,36 +37,41 @@ export type BenchmarksAAItem = { /** * OpenRouter pricing per token for this model. Null if pricing is unavailable. */ - pricing: BenchmarkPricing | null; + pricing: UnifiedBenchmarkPricing | null; + /** + * Benchmark source discriminator. + */ + source: "artificial-analysis"; }; /** @internal */ -export const BenchmarksAAItem$inboundSchema: z.ZodType< - BenchmarksAAItem, +export const UnifiedBenchmarksAAItem$inboundSchema: z.ZodType< + UnifiedBenchmarksAAItem, unknown > = z.object({ - aa_name: z.string(), agentic_index: z.nullable(z.number()), coding_index: z.nullable(z.number()), + display_name: z.string(), intelligence_index: z.nullable(z.number()), model_permaslug: z.string(), - pricing: z.nullable(BenchmarkPricing$inboundSchema), + pricing: z.nullable(UnifiedBenchmarkPricing$inboundSchema), + source: z.literal("artificial-analysis"), }).transform((v) => { return remap$(v, { - "aa_name": "aaName", "agentic_index": "agenticIndex", "coding_index": "codingIndex", + "display_name": "displayName", "intelligence_index": "intelligenceIndex", "model_permaslug": "modelPermaslug", }); }); -export function benchmarksAAItemFromJSON( +export function unifiedBenchmarksAAItemFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => BenchmarksAAItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BenchmarksAAItem' from JSON`, + (x) => UnifiedBenchmarksAAItem$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UnifiedBenchmarksAAItem' from JSON`, ); } diff --git a/src/models/benchmarksdaitem.ts b/src/models/unifiedbenchmarksdaitem.ts similarity index 76% rename from src/models/benchmarksdaitem.ts rename to src/models/unifiedbenchmarksdaitem.ts index 60e0bed98..caebfff51 100644 --- a/src/models/benchmarksdaitem.ts +++ b/src/models/unifiedbenchmarksdaitem.ts @@ -1,17 +1,17 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: a8a7a42ac948 + * @generated-id: f911314affb3 */ 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 { - BenchmarkPricing, - BenchmarkPricing$inboundSchema, -} from "./benchmarkpricing.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + UnifiedBenchmarkPricing, + UnifiedBenchmarkPricing$inboundSchema, +} from "./unifiedbenchmarkpricing.js"; /** * Placement distribution from tournament matches. @@ -24,7 +24,7 @@ export type TournamentStats = { total: number | null; }; -export type BenchmarksDAItem = { +export type UnifiedBenchmarksDAItem = { /** * Arena this ranking belongs to. */ @@ -46,13 +46,17 @@ export type BenchmarksDAItem = { */ elo: number; /** - * Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. + * Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id. */ modelPermaslug: string; /** * OpenRouter pricing per token for this model. Null if pricing is unavailable. */ - pricing: BenchmarkPricing | null; + pricing: UnifiedBenchmarkPricing | null; + /** + * Benchmark source discriminator. + */ + source: "design-arena"; /** * Placement distribution from tournament matches. */ @@ -93,8 +97,8 @@ export function tournamentStatsFromJSON( } /** @internal */ -export const BenchmarksDAItem$inboundSchema: z.ZodType< - BenchmarksDAItem, +export const UnifiedBenchmarksDAItem$inboundSchema: z.ZodType< + UnifiedBenchmarksDAItem, unknown > = z.object({ arena: z.string(), @@ -103,7 +107,8 @@ export const BenchmarksDAItem$inboundSchema: z.ZodType< display_name: z.string(), elo: z.number(), model_permaslug: z.string(), - pricing: z.nullable(BenchmarkPricing$inboundSchema), + pricing: z.nullable(UnifiedBenchmarkPricing$inboundSchema), + source: z.literal("design-arena"), tournament_stats: z.lazy(() => TournamentStats$inboundSchema), win_rate: z.number(), }).transform((v) => { @@ -116,12 +121,12 @@ export const BenchmarksDAItem$inboundSchema: z.ZodType< }); }); -export function benchmarksDAItemFromJSON( +export function unifiedBenchmarksDAItemFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => BenchmarksDAItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BenchmarksDAItem' from JSON`, + (x) => UnifiedBenchmarksDAItem$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UnifiedBenchmarksDAItem' from JSON`, ); } diff --git a/src/models/unifiedbenchmarksmeta.ts b/src/models/unifiedbenchmarksmeta.ts new file mode 100644 index 000000000..75831c380 --- /dev/null +++ b/src/models/unifiedbenchmarksmeta.ts @@ -0,0 +1,108 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d146ee8b8956 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +/** + * The source filter applied. + */ +export const SourceEnum = { + ArtificialAnalysis: "artificial-analysis", + DesignArena: "design-arena", +} as const; +/** + * The source filter applied. + */ +export type SourceEnum = OpenEnum; + +/** + * Dataset version. + */ +export const UnifiedBenchmarksMetaVersion = { + V1: "v1", +} as const; +/** + * Dataset version. + */ +export type UnifiedBenchmarksMetaVersion = ClosedEnum< + typeof UnifiedBenchmarksMetaVersion +>; + +export type UnifiedBenchmarksMeta = { + /** + * ISO-8601 timestamp of when this data was last updated. + */ + asOf: string; + /** + * Required attribution when republishing this data. + */ + citation: string; + /** + * Number of unique models in the response. + */ + modelCount: number; + /** + * The source filter applied. + */ + source: SourceEnum; + /** + * URL of the upstream data source. + */ + sourceUrl: string; + /** + * The task_type filter applied, or null if showing all. + */ + taskType: string | null; + /** + * Dataset version. + */ + version: UnifiedBenchmarksMetaVersion; +}; + +/** @internal */ +export const SourceEnum$inboundSchema: z.ZodType = + openEnums.inboundSchema(SourceEnum); + +/** @internal */ +export const UnifiedBenchmarksMetaVersion$inboundSchema: z.ZodEnum< + typeof UnifiedBenchmarksMetaVersion +> = z.enum(UnifiedBenchmarksMetaVersion); + +/** @internal */ +export const UnifiedBenchmarksMeta$inboundSchema: z.ZodType< + UnifiedBenchmarksMeta, + unknown +> = z.object({ + as_of: z.string(), + citation: z.string(), + model_count: z.int(), + source: SourceEnum$inboundSchema, + source_url: z.string(), + task_type: z.nullable(z.string()), + version: UnifiedBenchmarksMetaVersion$inboundSchema, +}).transform((v) => { + return remap$(v, { + "as_of": "asOf", + "model_count": "modelCount", + "source_url": "sourceUrl", + "task_type": "taskType", + }); +}); + +export function unifiedBenchmarksMetaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UnifiedBenchmarksMeta$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UnifiedBenchmarksMeta' from JSON`, + ); +} diff --git a/src/models/unifiedbenchmarksresponse.ts b/src/models/unifiedbenchmarksresponse.ts new file mode 100644 index 000000000..3b2c430df --- /dev/null +++ b/src/models/unifiedbenchmarksresponse.ts @@ -0,0 +1,80 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b3f08556727b + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as discriminatedUnionTypes from "../types/discriminatedUnion.js"; +import { discriminatedUnion } from "../types/discriminatedUnion.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + UnifiedBenchmarksAAItem, + UnifiedBenchmarksAAItem$inboundSchema, +} from "./unifiedbenchmarksaaitem.js"; +import { + UnifiedBenchmarksDAItem, + UnifiedBenchmarksDAItem$inboundSchema, +} from "./unifiedbenchmarksdaitem.js"; +import { + UnifiedBenchmarksMeta, + UnifiedBenchmarksMeta$inboundSchema, +} from "./unifiedbenchmarksmeta.js"; + +export type Data = + | UnifiedBenchmarksAAItem + | UnifiedBenchmarksDAItem + | discriminatedUnionTypes.Unknown<"source">; + +export type UnifiedBenchmarksResponse = { + data: Array< + | UnifiedBenchmarksAAItem + | UnifiedBenchmarksDAItem + | discriminatedUnionTypes.Unknown<"source"> + >; + meta: UnifiedBenchmarksMeta; +}; + +/** @internal */ +export const Data$inboundSchema: z.ZodType = discriminatedUnion( + "source", + { + ["artificial-analysis"]: UnifiedBenchmarksAAItem$inboundSchema, + ["design-arena"]: UnifiedBenchmarksDAItem$inboundSchema, + }, +); + +export function dataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Data$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Data' from JSON`, + ); +} + +/** @internal */ +export const UnifiedBenchmarksResponse$inboundSchema: z.ZodType< + UnifiedBenchmarksResponse, + unknown +> = z.object({ + data: z.array( + discriminatedUnion("source", { + ["artificial-analysis"]: UnifiedBenchmarksAAItem$inboundSchema, + ["design-arena"]: UnifiedBenchmarksDAItem$inboundSchema, + }), + ), + meta: UnifiedBenchmarksMeta$inboundSchema, +}); + +export function unifiedBenchmarksResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UnifiedBenchmarksResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UnifiedBenchmarksResponse' from JSON`, + ); +} diff --git a/src/sdk/benchmarks.ts b/src/sdk/benchmarks.ts new file mode 100644 index 000000000..91a1625ea --- /dev/null +++ b/src/sdk/benchmarks.ts @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 72ce7b70fba8 + */ + +import { benchmarksGetBenchmarks } from "../funcs/benchmarksGetBenchmarks.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Benchmarks extends ClientSDK { + /** + * List Benchmarks + * + * @remarks + * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + */ + async getBenchmarks( + request: operations.GetBenchmarksRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(benchmarksGetBenchmarks( + this, + request, + options, + )); + } +} diff --git a/src/sdk/datasets.ts b/src/sdk/datasets.ts index a3f51a67e..487dc1477 100644 --- a/src/sdk/datasets.ts +++ b/src/sdk/datasets.ts @@ -4,8 +4,6 @@ */ import { datasetsGetAppRankings } from "../funcs/datasetsGetAppRankings.js"; -import { datasetsGetBenchmarksArtificialAnalysis } from "../funcs/datasetsGetBenchmarksArtificialAnalysis.js"; -import { datasetsGetBenchmarksDesignArena } from "../funcs/datasetsGetBenchmarksDesignArena.js"; import { datasetsGetRankingsDaily } from "../funcs/datasetsGetRankingsDaily.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; @@ -55,40 +53,6 @@ export class Datasets extends ClientSDK { )); } - /** - * Artificial Analysis Benchmark Indices - * - * @remarks - * Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - */ - async getBenchmarksArtificialAnalysis( - request?: operations.GetBenchmarksArtificialAnalysisRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(datasetsGetBenchmarksArtificialAnalysis( - this, - request, - options, - )); - } - - /** - * Design Arena Benchmark Rankings - * - * @remarks - * Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - */ - async getBenchmarksDesignArena( - request?: operations.GetBenchmarksDesignArenaRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(datasetsGetBenchmarksDesignArena( - this, - request, - options, - )); - } - /** * Daily token totals for top 50 models * diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 9bbf1d64d..d67732823 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -6,6 +6,7 @@ import { ClientSDK } from "../lib/sdks.js"; import { Analytics } from "./analytics.js"; import { APIKeys } from "./apikeys.js"; +import { Benchmarks } from "./benchmarks.js"; import { Beta } from "./beta.js"; import { Byok } from "./byok.js"; import { Chat } from "./chat.js"; @@ -66,6 +67,11 @@ export class OpenRouter extends ClientSDK { return (this._oAuth ??= new OAuth(this._options)); } + private _benchmarks?: Benchmarks; + get benchmarks(): Benchmarks { + return (this._benchmarks ??= new Benchmarks(this._options)); + } + private _byok?: Byok; get byok(): Byok { return (this._byok ??= new Byok(this._options));