From a9d0286def895afe1c7054f82716475036ca2ba1 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 30 Oct 2026 20:34:58 +0000 Subject: [PATCH 1/2] ## Typescript SDK Changes: * `openrouter.endpoints.listZdrEndpoints()`: `response.data[].safetyRetention` **Added** --- .speakeasy/gen.lock | 103 +++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 572 ++++++++++-------- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- .../operations/listendpointszdrresponse.mdx | 7 +- docs/models/publiczdrendpoint.mdx | 80 +++ jsr.json | 2 +- package.json | 12 +- src/lib/config.ts | 4 +- src/models/decisions.ts | 44 ++ src/models/embeddings.ts | 45 ++ src/models/imagegeneration.ts | 47 ++ src/models/index.ts | 13 + src/models/nativetools.ts | 32 + src/models/operations/listendpointszdr.ts | 4 +- src/models/perflast30mbyworkload.ts | 75 +++ src/models/pricing.ts | 123 ++++ src/models/publicendpoint.ts | 472 +-------------- src/models/publiczdrendpoint.ts | 179 ++++++ src/models/rerank.ts | 44 ++ src/models/stt.ts | 44 ++ src/models/textgeneration.ts | 45 ++ src/models/tts.ts | 44 ++ src/models/unknown.ts | 44 ++ src/models/videogeneration.ts | 47 ++ 26 files changed, 1348 insertions(+), 758 deletions(-) create mode 100644 docs/models/publiczdrendpoint.mdx create mode 100644 src/models/decisions.ts create mode 100644 src/models/embeddings.ts create mode 100644 src/models/imagegeneration.ts create mode 100644 src/models/nativetools.ts create mode 100644 src/models/perflast30mbyworkload.ts create mode 100644 src/models/pricing.ts create mode 100644 src/models/publiczdrendpoint.ts create mode 100644 src/models/rerank.ts create mode 100644 src/models/stt.ts create mode 100644 src/models/textgeneration.ts create mode 100644 src/models/tts.ts create mode 100644 src/models/unknown.ts create mode 100644 src/models/videogeneration.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 8305f4be1..c925ab5ab 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 2035b8c4508c5267516f242071925582 + docChecksum: 533a322875050d25e25e9e1d799d6728 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.5.30 - configChecksum: a201cf9b651e2ad77ab05f10cfbc73c5 + releaseVersion: 1.5.31 + configChecksum: 661c106dfade53a4c2bab5afa71f1247 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: 223df3be-eea1-426e-bb01-5cc3c8598685 - pristine_commit_hash: f51ae28c637ba8818bf3195dea0a9cc2499aca6f - pristine_tree_hash: 9e48c1b5002ee6a7dfea729859c2705563809a11 + generation_id: ec94adb0-6c30-40f7-93a9-adb4a30f09b6 + pristine_commit_hash: d24c72d6ff0a4550d406f1b2f74093bf3e94e928 + pristine_tree_hash: ba4482c98db23aa4c12cb1216fb129965040dce6 features: typescript: acceptHeaders: 2.81.2 @@ -10166,8 +10166,8 @@ trackedFiles: pristine_git_object: fe22548b4e1a294acc781161910db80aefd39786 docs/models/operations/listendpointszdrresponse.mdx: id: d9ce10710845 - last_write_checksum: sha1:24efb86e6532751080f364dd2a64ddd1b2ed399f - pristine_git_object: cc1931c188d4e04f813ea8f3d8b3b5404d7999bd + last_write_checksum: sha1:9e9852f89f9aa4de5a3179720f688c96caab8660 + pristine_git_object: b5e8343bb717768b6e6b540bd367c5e812e12459 docs/models/operations/listexternalusersglobals.mdx: id: c21c2d8e0286 last_write_checksum: sha1:5d83542e8a39befff7b27db151b69208e51bc495 @@ -12863,6 +12863,10 @@ trackedFiles: id: 0780f20f2b6e last_write_checksum: sha1:378294e9fc929c0ccad6d6644a6efa655551390e pristine_git_object: b4ecd11d9f0c4ccbebb90dd9602af950103afd15 + docs/models/publiczdrendpoint.mdx: + id: 46c4f46c08a6 + last_write_checksum: sha1:6f5013e0e6a24b07491c64f565ba9e0abd158e5d + pristine_git_object: efe756cc6fe0211945901ee9d60103efbe06933c docs/models/purpose.mdx: id: 5e22dc2de8ea last_write_checksum: sha1:c38e5ce8bd2b4a2c8c789599361f74e3ac1f3bc0 @@ -16031,12 +16035,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:56e0cf60a5ef590ea25eed3930350661d1ccceef - pristine_git_object: c6c3e2bc80731f047ca48e2f9be5d2e27fa04d08 + last_write_checksum: sha1:b33934b8d23d5c8998d95196fecfcde4520b3e66 + pristine_git_object: bfe66f794a1081dbb13b0833bdf59a84d3ee903a package.json: id: 7030d0b2f71b - last_write_checksum: sha1:c10ae896842d25b3d07b08de471ce5c52fa3e342 - pristine_git_object: 029997537b52f1c533d5c23ba839697ab8074fbb + last_write_checksum: sha1:551316155ab2b80147e6507c9299aa00c1bacbeb + pristine_git_object: 410705b5c38b78e3cf59b852f4de01147a55d0bb src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -16643,8 +16647,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:66ebe77d5373440d8568200bb45e59a7254322a4 - pristine_git_object: 5148126b206294c5aa1655882fb8d05ffc0826e1 + last_write_checksum: sha1:51090403d80e47432685eb1ee8ea8108ab94cbc1 + pristine_git_object: c7f47efbf79bb485097f577d70bb2adbdcae7331 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -17907,6 +17911,10 @@ trackedFiles: id: 8afa2111f54c last_write_checksum: sha1:e33a4610eeee17efa29b0d9732770bb976b76ff9 pristine_git_object: ce8ac06d43540e4774a711f9453f5ee56002bf8a + src/models/decisions.ts: + id: 18025f274744 + last_write_checksum: sha1:af9b1afb2fef2ae0897fd1a6d239515d0264f45c + pristine_git_object: 7459600a879f1bb8ea8e05518bb02c925e718e0a src/models/decisionsboxanswer.ts: id: 3c99e6f4aecb last_write_checksum: sha1:2b847376e744c2e93d7d5c7886c7f903779182d4 @@ -18011,6 +18019,10 @@ trackedFiles: id: d86e84250105 last_write_checksum: sha1:b74a9a9c019fff934050e771c141802ed5284e31 pristine_git_object: 159ce4146365f42353f8535f29a96eb2d2d907c3 + src/models/embeddings.ts: + id: 2ae8548ed00e + last_write_checksum: sha1:ae5cc185e249be3b053f657ad00bab06cc6abb08 + pristine_git_object: f9ef4cfa9420606f78c55d200b12f61e2fb11842 src/models/endpointinfo.ts: id: 33effd05ad97 last_write_checksum: sha1:391e4a348e436c1a031fdc75818d37cdb0b31361 @@ -18507,6 +18519,10 @@ trackedFiles: id: df990f384b54 last_write_checksum: sha1:a4ec678a88215dfd4c6ee40d7c98c107594da342 pristine_git_object: 90f9f6f95c13c7e10612244efbca358a7377ed51 + src/models/imagegeneration.ts: + id: a157e2a02f24 + last_write_checksum: sha1:7fc8efa7cacdbcd591d2e579a374c9d674a07650 + pristine_git_object: 99b4113103adb9598a3bd88f555231fe55b3c43d src/models/imagegenerationproviderpreferences.ts: id: 55445c92cf9f last_write_checksum: sha1:b2c3408f0750ad751303f1ba474118bfc61f46b8 @@ -18593,8 +18609,8 @@ trackedFiles: pristine_git_object: 7abdfe096d3adff317db6837dc689c69db92e127 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:b65bcc606344dbcef251f7ad67dfe87a11c337c1 - pristine_git_object: 9cf7753275f3372e32414cc938921dead8cc5293 + last_write_checksum: sha1:e7274cf57d1db88d4b25d7a02da55e092fb55f37 + pristine_git_object: f0ec6515bb2d78d9a5ae7141d7476fe56333a56e src/models/inputaudio.ts: id: 9bdc14c7565f last_write_checksum: sha1:cc3b750b39a3c3563b76930fd2989f9bfdb24c1f @@ -18887,6 +18903,10 @@ trackedFiles: id: b430de21d6c4 last_write_checksum: sha1:787d25ab81607b94f1e0d13702fdb95ddf326055 pristine_git_object: 0cfa52df9081a108b806979df83d941a374c4059 + src/models/nativetools.ts: + id: c2b977a8024d + last_write_checksum: sha1:580d19bcfd02feec156f4f3465469046915459a5 + pristine_git_object: f9cf82e43c4f639408dd95d19d356e6370833e65 src/models/notfoundresponseerrordata.ts: id: 6c2943dd4f02 last_write_checksum: sha1:907a7ed401368081cc41f43411b11818b55819ff @@ -19453,8 +19473,8 @@ trackedFiles: pristine_git_object: f5cfb8be25fb1d43d1ba5d91bf1a64c129a125de src/models/operations/listendpointszdr.ts: id: d52e6aeefb5e - last_write_checksum: sha1:cc3ac1f58f408404223743f0d9119d12c8d8f942 - pristine_git_object: caa00bb10e50850762f9446f2674c7e71e3f3f58 + last_write_checksum: sha1:2158e7332c3b2dbcc24e0765a985edd8209ddd45 + pristine_git_object: f58a640190f1eb6c2e94e1ee73ceb602984dc2a9 src/models/operations/listexternalusers.ts: id: 54fe31dd43b6 last_write_checksum: sha1:dd329d65e11c71ae5fd5b74b96420bfcccfc8cd4 @@ -19923,6 +19943,10 @@ trackedFiles: id: 847aba8ff633 last_write_checksum: sha1:6b12d3bcc625d01a7741d60878db1dd2426b65c1 pristine_git_object: 64350cb96504a94daf1cfb8af7facf5b479c4cf3 + src/models/perflast30mbyworkload.ts: + id: 405fa4a81638 + last_write_checksum: sha1:e9799bedc207edd10310443972f621ecbb872e22 + pristine_git_object: ec797a1f1b09b3286ada9d46f15e4dc938cd05c6 src/models/perrequestlimits.ts: id: 2b2b6cf6a019 last_write_checksum: sha1:178d0719c00f964544f1ba7799453af7d0039bea @@ -19979,6 +20003,10 @@ trackedFiles: id: 64db0edfc37d last_write_checksum: sha1:1b9c4865d5245c791658f3e56df5ee257274d55a pristine_git_object: 789ab79f12eb208766f43c93c285d7ee49e08cac + src/models/pricing.ts: + id: a5c92262e20f + last_write_checksum: sha1:4093b857eeb329ed378df9f2fe8825a90763c07a + pristine_git_object: ba9973dcc6168fc01bc213de7e00f5ac7cb6d8b4 src/models/pricingoverride.ts: id: b1116f9327ef last_write_checksum: sha1:eca00827da27079b7974395d253ed63f8779c226 @@ -20101,8 +20129,8 @@ trackedFiles: pristine_git_object: fc796682165e0c6c8f0787ee2cb37c79671557f9 src/models/publicendpoint.ts: id: 396ce3186017 - last_write_checksum: sha1:a717573d2b2785923ad4822900917997258797fd - pristine_git_object: b0382c8fee3627fb7c314e8e345caf5fb1e5aab3 + last_write_checksum: sha1:3ad58bc7656a2a04761a6010db26477501ce8afa + pristine_git_object: 577e86526eefb48b7951ceeb0fbab63c98fdd106 src/models/publicpricing.ts: id: 0a44a1c3bab5 last_write_checksum: sha1:bd478f319c40ea705b9705d3c73a9e4992a16877 @@ -20111,6 +20139,10 @@ trackedFiles: id: b2568abb5c38 last_write_checksum: sha1:99d7aa89d2e07a029530b15d826bee4145c9d831 pristine_git_object: 97404d0d1673633166d4f7dc1291432234d5a9e0 + src/models/publiczdrendpoint.ts: + id: 965276f8cd2f + last_write_checksum: sha1:027ceb98f60e9e6e9c30b8debbc4cc37529121fd + pristine_git_object: 633d63e5a3163bf9e6cfc0cbed28bbac334d3f0a src/models/quantization.ts: id: b28328f1822c last_write_checksum: sha1:48d2e3f2cdb707fcecb3019ae0690e7dbc870ce5 @@ -20219,6 +20251,10 @@ trackedFiles: id: a08eeff8786c last_write_checksum: sha1:64192440cc7d5ebd74db3dd80684d9522fc95d2e pristine_git_object: 013ddf664b7d5aec7afea37045c5baaa843acc1d + src/models/rerank.ts: + id: 2b9cb6c3de15 + last_write_checksum: sha1:7e8c968c22ba7296d4d1416f4dc65f4d3eb19225 + pristine_git_object: db6a5f08aa0f7a20389b29987352d8295f55c860 src/models/responsehealingplugin.ts: id: 622c12ba88e2 last_write_checksum: sha1:675134561fff74a80c0bdc574614bc229efede62 @@ -20487,6 +20523,10 @@ trackedFiles: id: 3b88c304514b last_write_checksum: sha1:c4f9e0dd9deb1f175853307a6f42d9f51293169a pristine_git_object: c0a93469bdcf62d6e39ab4d4811befc965aa460c + src/models/stt.ts: + id: cce853695df0 + last_write_checksum: sha1:c9e30a4676fab5c0bf179aaedec7b28a1d52ba67 + pristine_git_object: eaf5122b18c6122fc4d6ea55cd467824671ca83a src/models/sttentity.ts: id: 7178554c1194 last_write_checksum: sha1:9232f4e645081546965bc6deffd80bbba9fd9f41 @@ -20583,6 +20623,10 @@ trackedFiles: id: e264e7981200 last_write_checksum: sha1:740823da11d6dc7209ca1ddbc3b96c585f7d2f41 pristine_git_object: 3896234004dafb4ef489fc1127b3fbcc5c78132d + src/models/textgeneration.ts: + id: 077e723dcb01 + last_write_checksum: sha1:b122963a8722a1ae7c457a24a3e6a50e64d0d04c + pristine_git_object: d31e2888a6ac4decb89f392b82560a1b44391961 src/models/tokenexchangerequest.ts: id: 27152e05f952 last_write_checksum: sha1:fd97f37d596b9b830297328b54e9d5b291ce2d28 @@ -20635,6 +20679,10 @@ trackedFiles: id: 8aa9a16a7a40 last_write_checksum: sha1:66ad3376d9c0bc83987301af9b72eb6b68a598c9 pristine_git_object: 26483639719d22695028d8bc8db5643386bf9eab + src/models/tts.ts: + id: 076814f3333a + last_write_checksum: sha1:da8c5d7216adc12400acb1632381f00b4abce41a + pristine_git_object: 23adba354cd341468a1e59d08023ccc14839152e src/models/unauthorizedresponseerrordata.ts: id: d335c48e0c3e last_write_checksum: sha1:f0fdda73bec1bd716461f2de7e6a28409c3450df @@ -20671,6 +20719,10 @@ trackedFiles: id: 3dc944947337 last_write_checksum: sha1:3fcf03a573851f35bf2b2b75f7d7a5f92176b1c4 pristine_git_object: 6ba7feb6a42899e737094805d84d7c6a95c780f2 + src/models/unknown.ts: + id: 57f38983ea28 + last_write_checksum: sha1:49ca12ff89b30a131ef273cc0edde093a8c421cc + pristine_git_object: 8b8d4f57b7b5d42e4cdc6505bd4438bc6f8314a5 src/models/unprocessableentityresponseerrordata.ts: id: "557063315301" last_write_checksum: sha1:29d0501a4acca81575ab49554f0cf37b7242dd43 @@ -20795,6 +20847,10 @@ trackedFiles: id: fa3836b8b8e1 last_write_checksum: sha1:f73a4c8ed43378227a2ceccd1b7aba3302831d60 pristine_git_object: 3f4ce36fdce427dd3f1feb9e96760f15a5a60161 + src/models/videogeneration.ts: + id: acac14163f87 + last_write_checksum: sha1:5b26ec933f8d47884854982624ef9d23174db68e + pristine_git_object: 6407ea1522468798b8cb892d6b2c85e101a28bb2 src/models/videogenerationrequest.ts: id: e72ea2e4c5b3 last_write_checksum: sha1:97f4519b0713aaccc597a47e92254b5c891526ab @@ -21434,7 +21490,7 @@ examples: speakeasy-default-list-endpoints-zdr: responses: "200": - application/json: {"data": [{"context_length": 8192, "latency_last_30m": {"p50": 0.25, "p75": 0.35, "p90": 0.48, "p99": 0.85}, "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "model_id": "openai/gpt-4", "model_name": "GPT-4", "name": "OpenAI: GPT-4", "native_tools": {}, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "provider_name": "OpenAI", "quantization": "fp16", "service_tier": "priority", "supported_parameters": ["temperature", "top_p", "max_tokens"], "supports_diarization": false, "supports_image_reference": false, "supports_implicit_caching": true, "supports_multiple_audio_references": false, "supports_tool_choice": {"auto": true, "function": true, "none": true, "required": true}, "supports_voice_cloning": false, "tag": "openai", "throughput_last_30m": {"p50": 45.2, "p75": 38.5, "p90": 28.3, "p99": 15.1}, "uptime_last_1d": 99.8, "uptime_last_30m": 99.5, "uptime_last_5m": 100}]} + application/json: {"data": [{"context_length": 8192, "latency_last_30m": {"p50": 0.25, "p75": 0.35, "p90": 0.48, "p99": 0.85}, "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "model_id": "openai/gpt-4", "model_name": "GPT-4", "name": "OpenAI: GPT-4", "native_tools": {}, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "provider_name": "OpenAI", "quantization": "fp16", "service_tier": "priority", "supported_parameters": ["temperature", "top_p", "max_tokens"], "supports_diarization": false, "supports_image_reference": false, "supports_implicit_caching": true, "supports_multiple_audio_references": false, "supports_tool_choice": {"auto": true, "function": true, "none": true, "required": true}, "supports_voice_cloning": false, "tag": "openai", "throughput_last_30m": {"p50": 45.2, "p75": 38.5, "p90": 28.3, "p99": 15.1}, "uptime_last_1d": 99.8, "uptime_last_30m": 99.5, "uptime_last_5m": 100, "safety_retention": false}]} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} "403": @@ -25710,7 +25766,4 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Typescript SDK Changes: - * `openrouter.embeddings.listModels()`: `response.data[].endpoints` **Added** - * `openrouter.models.get()`: `response.data.endpoints` **Added** - * `openrouter.models.list()`: `response.data[].endpoints` **Added** - * `openrouter.models.listForUser()`: `response.data[].endpoints` **Added** + * `openrouter.endpoints.listZdrEndpoints()`: `response.data[].safetyRetention` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index dd8f4da9a..a695027e6 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -38,7 +38,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.5.30 + version: 1.5.31 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index f6bd4c506..ec343fec2 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -11012,6 +11012,26 @@ components: - 'debug' - 'sequence_number' type: 'object' + Decisions: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' DecisionsBoxAnswer: properties: box: @@ -11688,6 +11708,26 @@ components: - 'code' - 'message' type: 'object' + Embeddings: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' EndpointInfo: example: model: 'openai/gpt-4o' @@ -15197,6 +15237,26 @@ components: - 'b64_json' - 'created' type: 'object' + ImageGeneration: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' ImageGenerationProviderPreferences: description: 'Provider routing preferences and provider-specific passthrough configuration.' example: @@ -20010,6 +20070,14 @@ components: - 'description' - 'tools' type: 'object' + NativeTools: + properties: + type: + description: 'The provider tool type the request is translated to when this tool runs natively, e.g. `web_search_20260209` on Anthropic or `google_search` on Gemini.' + type: 'string' + required: + - 'type' + type: 'object' NotFoundResponse: description: 'Not Found - Resource does not exist' example: @@ -26382,6 +26450,29 @@ components: - 'number' - 'null' type: 'object' + PerfLast30mByWorkload: + additionalProperties: false + description: 'Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie.' + properties: + decisions: + $ref: '#/components/schemas/Decisions' + embeddings: + $ref: '#/components/schemas/Embeddings' + image_generation: + $ref: '#/components/schemas/ImageGeneration' + rerank: + $ref: '#/components/schemas/Rerank' + stt: + $ref: '#/components/schemas/STT' + text_generation: + $ref: '#/components/schemas/TextGeneration' + tts: + $ref: '#/components/schemas/TTS' + unknown: + $ref: '#/components/schemas/Unknown' + video_generation: + $ref: '#/components/schemas/VideoGeneration' + type: 'object' PerRequestLimits: description: 'Per-request token limits' example: @@ -26747,6 +26838,63 @@ components: type: - 'object' - 'null' + Pricing: + properties: + audio: + description: 'Price in USD per audio input token' + type: 'string' + audio_output: + description: 'Price in USD per audio output token' + type: 'string' + completion: + description: 'Price in USD per token for completion (output) generation' + type: 'string' + discount: + description: 'Fractional discount applied to this endpoint''s pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)' + format: 'double' + type: 'number' + image: + description: 'Price in USD per input image' + type: 'string' + image_output: + description: 'Price in USD per output image' + type: 'string' + image_token: + description: 'Price in USD per image token' + type: 'string' + input_audio_cache: + description: 'Price in USD per cached audio input token' + type: 'string' + input_cache_read: + description: 'Price in USD per cached input token (read)' + type: 'string' + input_cache_write: + description: 'Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.' + type: 'string' + input_cache_write_1h: + description: 'Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.' + type: 'string' + internal_reasoning: + description: 'Price in USD per internal reasoning token' + type: 'string' + overrides: + description: 'Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.' + items: + $ref: '#/components/schemas/PricingOverride' + type: 'array' + prompt: + description: 'Price in USD per token for prompt (input) processing' + type: 'string' + request: + description: 'Price in USD per request' + type: 'string' + web_search: + description: 'Price in USD per web search' + type: 'string' + required: + - 'prompt' + - 'completion' + type: 'object' PricingOverride: description: 'A conditional override of the base pricing. An entry applies only when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per price key; price keys absent from an entry inherit the base price.' example: @@ -28625,260 +28773,16 @@ components: type: 'string' native_tools: additionalProperties: - properties: - type: - description: 'The provider tool type the request is translated to when this tool runs natively, e.g. `web_search_20260209` on Anthropic or `google_search` on Gemini.' - type: 'string' - required: - - 'type' - type: 'object' + $ref: '#/components/schemas/NativeTools' description: 'The server tools this endpoint accepts as the provider''s own built-in tool (`engine: "native"`) instead of an OpenRouter engine, keyed by canonical `openrouter:*` name. Each value names the provider tool type the request is translated to. Where that tool runs (provider-side, or returned to the client as with Anthropic bash) is documented per tool. Empty when the provider has none.' example: openrouter:web_search: type: 'web_search_20260209' type: 'object' perf_last_30m_by_workload: - additionalProperties: false - description: 'Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie.' - properties: - decisions: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - embeddings: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - image_generation: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - rerank: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - stt: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - text_generation: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - tts: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - unknown: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - video_generation: - properties: - latency: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' - request_count: - description: 'Total requests admitted for this workload in the window.' - type: - - 'integer' - - 'null' - throughput: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' - required: - - 'latency' - - 'throughput' - - 'request_count' - type: 'object' - type: 'object' + $ref: '#/components/schemas/PerfLast30mByWorkload' pricing: - properties: - audio: - description: 'Price in USD per audio input token' - type: 'string' - audio_output: - description: 'Price in USD per audio output token' - type: 'string' - completion: - description: 'Price in USD per token for completion (output) generation' - type: 'string' - discount: - description: 'Fractional discount applied to this endpoint''s pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)' - format: 'double' - type: 'number' - image: - description: 'Price in USD per input image' - type: 'string' - image_output: - description: 'Price in USD per output image' - type: 'string' - image_token: - description: 'Price in USD per image token' - type: 'string' - input_audio_cache: - description: 'Price in USD per cached audio input token' - type: 'string' - input_cache_read: - description: 'Price in USD per cached input token (read)' - type: 'string' - input_cache_write: - description: 'Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.' - type: 'string' - input_cache_write_1h: - description: 'Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.' - type: 'string' - internal_reasoning: - description: 'Price in USD per internal reasoning token' - type: 'string' - overrides: - description: 'Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.' - items: - $ref: '#/components/schemas/PricingOverride' - type: 'array' - prompt: - description: 'Price in USD per token for prompt (input) processing' - type: 'string' - request: - description: 'Price in USD per request' - type: 'string' - web_search: - description: 'Price in USD per web search' - type: 'string' - required: - - 'prompt' - - 'completion' - type: 'object' + $ref: '#/components/schemas/Pricing' provider_name: $ref: '#/components/schemas/ProviderName' quantization: @@ -29033,6 +28937,56 @@ components: - 'string' - 'null' x-speakeasy-unknown-values: allow + PublicZdrEndpoint: + allOf: + - $ref: '#/components/schemas/PublicEndpoint' + - properties: + safety_retention: + description: 'Whether the endpoint uses Safety Retention: prompts are not retained by default, but the provider may retain prompts its safety classifiers flag. A ZDR-enforced request reaches these endpoints only when the account allows Safety Retention and no applied guardrail disallows it.' + example: false + type: 'boolean' + required: + - 'safety_retention' + type: 'object' + description: 'An endpoint whose data policy does not retain prompts by default' + example: + context_length: 1048576 + latency_last_30m: null + max_completion_tokens: 65535 + max_prompt_tokens: null + model_id: 'google/gemini-2.5-flash' + model_name: 'Gemini 2.5 Flash' + name: 'Google: Gemini 2.5 Flash' + native_tools: {} + pricing: + completion: '0.0000025' + image: '0' + prompt: '0.0000003' + request: '0' + provider_name: 'Google' + quantization: null + safety_retention: true + service_tier: null + status: 0 + supported_parameters: + - 'temperature' + - 'top_p' + - 'max_tokens' + supports_diarization: false + supports_image_reference: false + supports_implicit_caching: true + supports_multiple_audio_references: false + supports_tool_choice: + auto: true + function: true + none: true + required: true + supports_voice_cloning: false + tag: 'google-vertex' + throughput_last_30m: null + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 Quantization: enum: - 'int4' @@ -29579,6 +29533,26 @@ components: - 'code' - 'message' type: 'object' + Rerank: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' ResponseHealingPlugin: example: enabled: true @@ -31640,6 +31614,26 @@ components: - 111 logprob: -0.5 token: 'Hello' + STT: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' STTEntity: description: 'A detected entity, returned when the provider runs entity detection' example: @@ -32490,6 +32484,26 @@ components: example: format: type: 'text' + TextGeneration: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' TokenExchangeRequest: description: 'RFC 8693 token exchange request body (application/x-www-form-urlencoded).' example: @@ -32941,6 +32955,26 @@ components: - 'string' - 'null' x-speakeasy-unknown-values: allow + TTS: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' UnauthorizedResponse: description: 'Unauthorized - Authentication required or invalid credentials' example: @@ -33450,6 +33484,26 @@ components: - 'reasoning_effort' - 'temperature' type: 'object' + Unknown: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' UnprocessableEntityResponse: description: 'Unprocessable Entity - Semantic validation failure' example: @@ -35034,6 +35088,26 @@ components: - 'value' - 'hosts' type: 'object' + VideoGeneration: + properties: + latency: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Latency percentiles in milliseconds for this workload. Image and video generation report full end-to-end generation time, because their raw latency only measures request acknowledgement; every other workload reports time to first token or result.' + request_count: + description: 'Total requests admitted for this workload in the window.' + type: + - 'integer' + - 'null' + throughput: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: 'Throughput percentiles in tokens per second; pN is the speed that N% of requests reached or exceeded, so p90 is lower than p50. Only meaningful for text generation; null for workloads without token throughput.' + required: + - 'latency' + - 'throughput' + - 'request_count' + type: 'object' VideoGenerationRequest: example: aspect_ratio: '16:9' @@ -41108,6 +41182,7 @@ paths: request: '0' provider_name: 'OpenAI' quantization: 'fp16' + safety_retention: false status: 0 supported_parameters: - 'temperature' @@ -41149,6 +41224,7 @@ paths: request: '0' provider_name: 'OpenAI' quantization: 'fp16' + safety_retention: false status: 0 supported_parameters: - 'temperature' @@ -41171,7 +41247,7 @@ paths: properties: data: items: - $ref: '#/components/schemas/PublicEndpoint' + $ref: '#/components/schemas/PublicZdrEndpoint' type: 'array' required: - 'data' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d8d3da556..3dae31f94 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:aa734cabb659194e72500c02a025eb3eb6781ee90039176589687040e27349e8 - sourceBlobDigest: sha256:1a2ccb9c226ddf2bfc07276dc7d987969fe27723cb70bbc0eb0248b1f90ca9be + sourceRevisionDigest: sha256:972e89a1c35def76457b7e15f6a7e181ff26a0ea88f171e0fe034609e722d13e + sourceBlobDigest: sha256:4368e5df1d0afbbfc08a9d78c01d4863cb9ad1e0718848c0e4f2b4eff7cc76ed tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:aa734cabb659194e72500c02a025eb3eb6781ee90039176589687040e27349e8 - sourceBlobDigest: sha256:1a2ccb9c226ddf2bfc07276dc7d987969fe27723cb70bbc0eb0248b1f90ca9be + sourceRevisionDigest: sha256:972e89a1c35def76457b7e15f6a7e181ff26a0ea88f171e0fe034609e722d13e + sourceBlobDigest: sha256:4368e5df1d0afbbfc08a9d78c01d4863cb9ad1e0718848c0e4f2b4eff7cc76ed codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:0732e3c18110e1dfd5cc2a5831efc411372ed92dceef10d4efb1cd6563f5d272 + codeSamplesRevisionDigest: sha256:5a2b459ce33de75521a94ebbd8dd694544021e77890256d64faa749654728f95 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 5c16c4361..b7b0e35a4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4686,4 +4686,14 @@ Based on: ### Generated - [typescript v1.5.30] . ### Releases -- [NPM v1.5.30] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.30 - . \ No newline at end of file +- [NPM v1.5.30] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.30 - . + +## 2026-10-30 20:32:27 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.5.31] . +### Releases +- [NPM v1.5.31] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.31 - . \ No newline at end of file diff --git a/docs/models/operations/listendpointszdrresponse.mdx b/docs/models/operations/listendpointszdrresponse.mdx index cc1931c18..b5e8343bb 100644 --- a/docs/models/operations/listendpointszdrresponse.mdx +++ b/docs/models/operations/listendpointszdrresponse.mdx @@ -55,6 +55,7 @@ let value: ListEndpointsZdrResponse = { uptimeLast1d: 99.8, uptimeLast30m: 99.5, uptimeLast5m: 100, + safetyRetention: false, }, ], }; @@ -62,6 +63,6 @@ let value: ListEndpointsZdrResponse = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `data` | [models.PublicEndpoint](../../models/publicendpoint.mdx)[] | ✔️ | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `data` | [models.PublicZdrEndpoint](../../models/publiczdrendpoint.mdx)[] | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/publiczdrendpoint.mdx b/docs/models/publiczdrendpoint.mdx new file mode 100644 index 000000000..efe756cc6 --- /dev/null +++ b/docs/models/publiczdrendpoint.mdx @@ -0,0 +1,80 @@ +--- +title: "PublicZdrEndpoint" +--- + +An endpoint whose data policy does not retain prompts by default + +## Example Usage + +```typescript +import { PublicZdrEndpoint } from "@openrouter/sdk/models"; + +let value: PublicZdrEndpoint = { + contextLength: 1048576, + latencyLast30m: null, + maxCompletionTokens: 65535, + maxPromptTokens: null, + modelId: "google/gemini-2.5-flash", + modelName: "Gemini 2.5 Flash", + name: "Google: Gemini 2.5 Flash", + nativeTools: {}, + pricing: { + completion: "0.0000025", + prompt: "0.0000003", + }, + providerName: "Google", + quantization: null, + serviceTier: null, + supportedParameters: [ + "temperature", + "top_p", + "max_tokens", + ], + supportsDiarization: false, + supportsImplicitCaching: true, + supportsToolChoice: { + auto: true, + function: true, + none: true, + required: true, + }, + tag: "google-vertex", + throughputLast30m: null, + uptimeLast1d: 99.8, + uptimeLast30m: 99.5, + uptimeLast5m: 100, + safetyRetention: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contextLength` | *number* | ✔️ | N/A | | +| `latencyLast30m` | [models.PercentileStats](../models/percentilestats.mdx) | ✔️ | Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. | \{
"p50": 25.5,
"p75": 35.2,
"p90": 48.7,
"p99": 85.3
} | +| `maxCompletionTokens` | *number* | ✔️ | Maximum completion tokens for this endpoint. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens. | | +| `maxPromptTokens` | *number* | ✔️ | N/A | | +| `modelId` | *string* | ✔️ | The unique identifier for the model (permaslug) | openai/gpt-4 | +| `modelName` | *string* | ✔️ | N/A | | +| `name` | *string* | ✔️ | N/A | | +| `nativeTools` | Record\ | ✔️ | The server tools this endpoint accepts as the provider's own built-in tool (`engine: "native"`) instead of an OpenRouter engine, keyed by canonical `openrouter:*` name. Each value names the provider tool type the request is translated to. Where that tool runs (provider-side, or returned to the client as with Anthropic bash) is documented per tool. Empty when the provider has none. | \{
"openrouter:web_search": \{
"type": "web_search_20260209"
}
} | +| `perfLast30mByWorkload` | [models.PerfLast30mByWorkload](../models/perflast30mbyworkload.mdx) | ➖ | Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie. | | +| `pricing` | [models.Pricing](../models/pricing.mdx) | ✔️ | N/A | | +| `providerName` | [models.ProviderName](../models/providername.mdx) | ✔️ | N/A | OpenAI | +| `quantization` | [models.Quantization](../models/quantization.mdx) | ✔️ | N/A | fp16 | +| `serviceTier` | [models.PublicServiceTier](../models/publicservicetier.mdx) | ✔️ | The service tier this endpoint sells, or null for a standard endpoint. The same value whether the provider selects the tier with a request parameter or with a dedicated model id. Always the canonical tier: priority covers the fast request alias and the turbo, highspeed, and prime provider model-id spellings, none of which this field reports. | priority | +| `status` | [models.EndpointStatus](../models/endpointstatus.mdx) | ➖ | N/A | 0 | +| `supportedParameters` | [models.Parameter](../models/parameter.mdx)[] | ✔️ | N/A | | +| `supportsDiarization` | *boolean* | ✔️ | Whether this STT endpoint can label each transcript segment with a speaker (speaker diarization). False when the endpoint has not declared support. | | +| `supportsImageReference` | *boolean* | ➖ | Whether this TTS endpoint accepts an `image_url` reference describing the desired voice. Requests carrying an image reference are only routed to endpoints where this is true. | | +| `supportsImplicitCaching` | *boolean* | ✔️ | N/A | | +| `supportsMultipleAudioReferences` | *boolean* | ➖ | Whether this TTS endpoint accepts more than one `input_audio` reference clip per request. Requests carrying several clips are only routed to endpoints where this is true. | | +| `supportsToolChoice` | [models.ToolChoiceSupport](../models/toolchoicesupport.mdx) | ✔️ | Per-variant `tool_choice` support. `tool_choice` in `supported_parameters` only says the parameter is accepted; these flags say which of its values passed testing. | \{
"auto": true,
"function": true,
"none": true,
"required": true
} | +| `supportsVoiceCloning` | *boolean* | ➖ | Whether this TTS endpoint accepts inline reference audio (`input_references`) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true. | | +| `tag` | *string* | ✔️ | N/A | | +| `throughputLast30m` | [models.PercentileStats](../models/percentilestats.mdx) | ✔️ | N/A | \{
"p50": 25.5,
"p75": 35.2,
"p90": 48.7,
"p99": 85.3
} | +| `uptimeLast1d` | *number* | ✔️ | Uptime percentage over the last day: the share of minutes in which at least 80% of provider attempts succeeded, counting only minutes with 10 or more attempts. Rate-limited and caller-caused failures are excluded. Null when no minute had enough traffic. | | +| `uptimeLast30m` | *number* | ✔️ | N/A | | +| `uptimeLast5m` | *number* | ✔️ | Uptime percentage over the last 5 minutes: the share of minutes in which at least 80% of provider attempts succeeded, counting only minutes with 10 or more attempts. Rate-limited and caller-caused failures are excluded. Null when no minute had enough traffic. | | +| `safetyRetention` | *boolean* | ✔️ | Whether the endpoint uses Safety Retention: prompts are not retained by default, but the provider may retain prompts its safety classifiers flag. A ZDR-enforced request reaches these endpoints only when the account allows Safety Retention and no applied guardrail disallows it. | false | \ No newline at end of file diff --git a/jsr.json b/jsr.json index c6c3e2bc8..bfe66f794 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.5.30", + "version": "1.5.31", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 029997537..410705b5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.5.30", + "version": "1.5.31", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -73,15 +73,15 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", + "typecheck:transit": "exit 0", "postinstall": "node scripts/check-types.js || true", - "test:e2e": "vitest --run --project e2e", - "test:transit": "exit 0", "prepare": "npm run build", "test": "vitest --run --project unit", - "test:watch": "vitest --watch --project unit", + "test:e2e": "vitest --run --project e2e", + "test:transit": "exit 0", "typecheck": "tsc --noEmit", - "typecheck:transit": "exit 0", - "compile": "tsc && node scripts/unbarrel-imports.js" + "compile": "tsc && node scripts/unbarrel-imports.js", + "test:watch": "vitest --watch --project unit" }, "peerDependencies": { diff --git a/src/lib/config.ts b/src/lib/config.ts index 755d00858..b792952ac 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.5.30", + sdkVersion: "1.5.31", genVersion: "2.950.13", - userAgent: "speakeasy-sdk/typescript 1.5.30 2.950.13 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.5.31 2.950.13 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/decisions.ts b/src/models/decisions.ts new file mode 100644 index 000000000..7459600a8 --- /dev/null +++ b/src/models/decisions.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 18025f274744 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type Decisions = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const Decisions$inboundSchema: z.ZodType = z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), +}).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); +}); + +export function decisionsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Decisions$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Decisions' from JSON`, + ); +} diff --git a/src/models/embeddings.ts b/src/models/embeddings.ts new file mode 100644 index 000000000..f9ef4cfa9 --- /dev/null +++ b/src/models/embeddings.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2ae8548ed00e + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type Embeddings = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const Embeddings$inboundSchema: z.ZodType = z + .object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), + }).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); + }); + +export function embeddingsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Embeddings$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Embeddings' from JSON`, + ); +} diff --git a/src/models/imagegeneration.ts b/src/models/imagegeneration.ts new file mode 100644 index 000000000..99b411310 --- /dev/null +++ b/src/models/imagegeneration.ts @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a157e2a02f24 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type ImageGeneration = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const ImageGeneration$inboundSchema: z.ZodType< + ImageGeneration, + unknown +> = z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), +}).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); +}); + +export function imageGenerationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ImageGeneration$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ImageGeneration' from JSON`, + ); +} diff --git a/src/models/index.ts b/src/models/index.ts index 9cf775327..f0ec6515b 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -303,6 +303,7 @@ export * from "./dabenchmarkentry.js"; export * from "./datetimeservertool.js"; export * from "./datetimeservertoolconfig.js"; export * from "./debugevent.js"; +export * from "./decisions.js"; export * from "./decisionsboxanswer.js"; export * from "./decisionsboxquestion.js"; export * from "./decisionschoiceanswer.js"; @@ -329,6 +330,7 @@ export * from "./deleteworkspacebudgetresponse.js"; export * from "./deleteworkspaceresponse.js"; export * from "./easyinputmessage.js"; export * from "./edgenetworktimeoutresponseerrordata.js"; +export * from "./embeddings.js"; export * from "./endpointinfo.js"; export * from "./endpointsmetadata.js"; export * from "./endpointstatus.js"; @@ -424,6 +426,7 @@ export * from "./imagegencallgeneratingevent.js"; export * from "./imagegencallinprogressevent.js"; export * from "./imagegencallpartialimageevent.js"; export * from "./imagegencompletedevent.js"; +export * from "./imagegeneration.js"; export * from "./imagegenerationproviderpreferences.js"; export * from "./imagegenerationrequest.js"; export * from "./imagegenerationresponse.js"; @@ -518,6 +521,7 @@ export * from "./moderationplugin.js"; export * from "./multimodalmedia.js"; export * from "./namespacefunctiontool.js"; export * from "./namespacetool.js"; +export * from "./nativetools.js"; export * from "./notfoundresponseerrordata.js"; export * from "./oautherrorresponse.js"; export * from "./oauthjwks.js"; @@ -631,6 +635,7 @@ export * from "./pdfparseroptions.js"; export * from "./percentilelatencycutoffs.js"; export * from "./percentilestats.js"; export * from "./percentilethroughputcutoffs.js"; +export * from "./perflast30mbyworkload.js"; export * from "./perrequestlimits.js"; export * from "./pipelinestage.js"; export * from "./pipelinestagetype.js"; @@ -645,6 +650,7 @@ export * from "./presetwithdesignatedversion.js"; export * from "./preview20250311websearchservertool.js"; export * from "./previewwebsearchservertool.js"; export * from "./previewwebsearchuserlocation.js"; +export * from "./pricing.js"; export * from "./pricingoverride.js"; export * from "./privateendpoint.js"; export * from "./privateendpointactivation.js"; @@ -678,6 +684,7 @@ export * from "./providersortconfig.js"; export * from "./publicendpoint.js"; export * from "./publicpricing.js"; export * from "./publicservicetier.js"; +export * from "./publiczdrendpoint.js"; export * from "./quantization.js"; export * from "./rangecapability.js"; export * from "./rankingsdailyitem.js"; @@ -705,6 +712,7 @@ export * from "./reasoningtextcontent.js"; export * from "./refusaldeltaevent.js"; export * from "./refusaldoneevent.js"; export * from "./requesttimeoutresponseerrordata.js"; +export * from "./rerank.js"; export * from "./responsehealingplugin.js"; export * from "./responseincludesenum.js"; export * from "./responseoutputtext.js"; @@ -772,6 +780,7 @@ export * from "./streameventsresponseoutputitemadded.js"; export * from "./streameventsresponseoutputitemdone.js"; export * from "./streamlogprob.js"; export * from "./streamlogprobtoplogprob.js"; +export * from "./stt.js"; export * from "./sttentity.js"; export * from "./sttinlineinputaudio.js"; export * from "./sttinputaudio.js"; @@ -796,6 +805,7 @@ export * from "./taskclassificationresponse.js"; export * from "./textdeltaevent.js"; export * from "./textdoneevent.js"; export * from "./textextendedconfig.js"; +export * from "./textgeneration.js"; export * from "./tokenexchangerequest.js"; export * from "./tokenexchangeresponse.js"; export * from "./toolcallstatus.js"; @@ -809,6 +819,7 @@ export * from "./toomanyrequestsresponseerrordata.js"; export * from "./topproviderinfo.js"; export * from "./traceconfig.js"; export * from "./truncation.js"; +export * from "./tts.js"; export * from "./unauthorizedresponseerrordata.js"; export * from "./unifiedbenchmarkpricing.js"; export * from "./unifiedbenchmarksaaitem.js"; @@ -818,6 +829,7 @@ export * from "./unifiedbenchmarksoritem.js"; export * from "./unifiedbenchmarksresponse.js"; export * from "./unifiedbenchmarkssearchitem.js"; export * from "./unifiedbenchmarkssearchrunconfig.js"; +export * from "./unknown.js"; export * from "./unprocessableentityresponseerrordata.js"; export * from "./updatebyokkeyrequest.js"; export * from "./updatebyokkeyresponse.js"; @@ -849,6 +861,7 @@ export * from "./vaultsecretcopyresponse.js"; export * from "./vaultsecretlistresponse.js"; export * from "./vaultsecretresponse.js"; export * from "./vaultsecretwriterequest.js"; +export * from "./videogeneration.js"; export * from "./videogenerationrequest.js"; export * from "./videogenerationresponse.js"; export * from "./videogenerationusage.js"; diff --git a/src/models/nativetools.ts b/src/models/nativetools.ts new file mode 100644 index 000000000..f9cf82e43 --- /dev/null +++ b/src/models/nativetools.ts @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c2b977a8024d + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type NativeTools = { + /** + * The provider tool type the request is translated to when this tool runs natively, e.g. `web_search_20260209` on Anthropic or `google_search` on Gemini. + */ + type: string; +}; + +/** @internal */ +export const NativeTools$inboundSchema: z.ZodType = z + .object({ + type: z.string(), + }); + +export function nativeToolsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => NativeTools$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'NativeTools' from JSON`, + ); +} diff --git a/src/models/operations/listendpointszdr.ts b/src/models/operations/listendpointszdr.ts index caa00bb10..f58a64019 100644 --- a/src/models/operations/listendpointszdr.ts +++ b/src/models/operations/listendpointszdr.ts @@ -58,7 +58,7 @@ export type ListEndpointsZdrRequest = { * Returns a list of endpoints */ export type ListEndpointsZdrResponse = { - data: Array; + data: Array; }; /** @internal */ @@ -95,7 +95,7 @@ export const ListEndpointsZdrResponse$inboundSchema: z.ZodType< ListEndpointsZdrResponse, unknown > = z.object({ - data: z.array(models.PublicEndpoint$inboundSchema), + data: z.array(models.PublicZdrEndpoint$inboundSchema), }); export function listEndpointsZdrResponseFromJSON( diff --git a/src/models/perflast30mbyworkload.ts b/src/models/perflast30mbyworkload.ts new file mode 100644 index 000000000..ec797a1f1 --- /dev/null +++ b/src/models/perflast30mbyworkload.ts @@ -0,0 +1,75 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 405fa4a81638 + */ + +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 { Decisions, Decisions$inboundSchema } from "./decisions.js"; +import { Embeddings, Embeddings$inboundSchema } from "./embeddings.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ImageGeneration, + ImageGeneration$inboundSchema, +} from "./imagegeneration.js"; +import { Rerank, Rerank$inboundSchema } from "./rerank.js"; +import { STT, STT$inboundSchema } from "./stt.js"; +import { + TextGeneration, + TextGeneration$inboundSchema, +} from "./textgeneration.js"; +import { TTS, TTS$inboundSchema } from "./tts.js"; +import { Unknown, Unknown$inboundSchema } from "./unknown.js"; +import { + VideoGeneration, + VideoGeneration$inboundSchema, +} from "./videogeneration.js"; + +/** + * Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie. + */ +export type PerfLast30mByWorkload = { + decisions?: Decisions | undefined; + embeddings?: Embeddings | undefined; + imageGeneration?: ImageGeneration | undefined; + rerank?: Rerank | undefined; + stt?: STT | undefined; + textGeneration?: TextGeneration | undefined; + tts?: TTS | undefined; + unknown?: Unknown | undefined; + videoGeneration?: VideoGeneration | undefined; +}; + +/** @internal */ +export const PerfLast30mByWorkload$inboundSchema: z.ZodType< + PerfLast30mByWorkload, + unknown +> = z.object({ + decisions: Decisions$inboundSchema.optional(), + embeddings: Embeddings$inboundSchema.optional(), + image_generation: ImageGeneration$inboundSchema.optional(), + rerank: Rerank$inboundSchema.optional(), + stt: STT$inboundSchema.optional(), + text_generation: TextGeneration$inboundSchema.optional(), + tts: TTS$inboundSchema.optional(), + unknown: Unknown$inboundSchema.optional(), + video_generation: VideoGeneration$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "image_generation": "imageGeneration", + "text_generation": "textGeneration", + "video_generation": "videoGeneration", + }); +}); + +export function perfLast30mByWorkloadFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerfLast30mByWorkload$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerfLast30mByWorkload' from JSON`, + ); +} diff --git a/src/models/pricing.ts b/src/models/pricing.ts new file mode 100644 index 000000000..ba9973dcc --- /dev/null +++ b/src/models/pricing.ts @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a5c92262e20f + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PricingOverride, + PricingOverride$inboundSchema, +} from "./pricingoverride.js"; + +export type Pricing = { + /** + * Price in USD per audio input token + */ + audio?: string | undefined; + /** + * Price in USD per audio output token + */ + audioOutput?: string | undefined; + /** + * Price in USD per token for completion (output) generation + */ + completion: string; + /** + * Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) + */ + discount?: number | undefined; + /** + * Price in USD per input image + */ + image?: string | undefined; + /** + * Price in USD per output image + */ + imageOutput?: string | undefined; + /** + * Price in USD per image token + */ + imageToken?: string | undefined; + /** + * Price in USD per cached audio input token + */ + inputAudioCache?: string | undefined; + /** + * Price in USD per cached input token (read) + */ + inputCacheRead?: string | undefined; + /** + * Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. + */ + inputCacheWrite?: string | undefined; + /** + * Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. + */ + inputCacheWrite1h?: string | undefined; + /** + * Price in USD per internal reasoning token + */ + internalReasoning?: string | undefined; + /** + * Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. + */ + overrides?: Array | undefined; + /** + * Price in USD per token for prompt (input) processing + */ + prompt: string; + /** + * Price in USD per request + */ + request?: string | undefined; + /** + * Price in USD per web search + */ + webSearch?: string | undefined; +}; + +/** @internal */ +export const Pricing$inboundSchema: z.ZodType = z.object({ + audio: z.string().optional(), + audio_output: z.string().optional(), + completion: z.string(), + discount: z.number().optional(), + image: z.string().optional(), + image_output: z.string().optional(), + image_token: z.string().optional(), + input_audio_cache: z.string().optional(), + input_cache_read: z.string().optional(), + input_cache_write: z.string().optional(), + input_cache_write_1h: z.string().optional(), + internal_reasoning: z.string().optional(), + overrides: z.array(PricingOverride$inboundSchema).optional(), + prompt: z.string(), + request: z.string().optional(), + web_search: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "audio_output": "audioOutput", + "image_output": "imageOutput", + "image_token": "imageToken", + "input_audio_cache": "inputAudioCache", + "input_cache_read": "inputCacheRead", + "input_cache_write": "inputCacheWrite", + "input_cache_write_1h": "inputCacheWrite1h", + "internal_reasoning": "internalReasoning", + "web_search": "webSearch", + }); +}); + +export function pricingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Pricing$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Pricing' from JSON`, + ); +} diff --git a/src/models/publicendpoint.ts b/src/models/publicendpoint.ts index b0382c8fe..577e86526 100644 --- a/src/models/publicendpoint.ts +++ b/src/models/publicendpoint.ts @@ -12,15 +12,17 @@ import { EndpointStatus$inboundSchema, } from "./endpointstatus.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { NativeTools, NativeTools$inboundSchema } from "./nativetools.js"; import { Parameter, Parameter$inboundSchema } from "./parameter.js"; import { PercentileStats, PercentileStats$inboundSchema, } from "./percentilestats.js"; import { - PricingOverride, - PricingOverride$inboundSchema, -} from "./pricingoverride.js"; + PerfLast30mByWorkload, + PerfLast30mByWorkload$inboundSchema, +} from "./perflast30mbyworkload.js"; +import { Pricing, Pricing$inboundSchema } from "./pricing.js"; import { ProviderName, ProviderName$inboundSchema } from "./providername.js"; import { PublicServiceTier, @@ -32,176 +34,6 @@ import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js"; -export type NativeTools = { - /** - * The provider tool type the request is translated to when this tool runs natively, e.g. `web_search_20260209` on Anthropic or `google_search` on Gemini. - */ - type: string; -}; - -export type Decisions = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type Embeddings = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type ImageGeneration = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type Rerank = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type STT = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type TextGeneration = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type TTS = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type Unknown = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -export type VideoGeneration = { - latency: PercentileStats | null; - /** - * Total requests admitted for this workload in the window. - */ - requestCount: number | null; - throughput: PercentileStats | null; -}; - -/** - * Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie. - */ -export type PerfLast30mByWorkload = { - decisions?: Decisions | undefined; - embeddings?: Embeddings | undefined; - imageGeneration?: ImageGeneration | undefined; - rerank?: Rerank | undefined; - stt?: STT | undefined; - textGeneration?: TextGeneration | undefined; - tts?: TTS | undefined; - unknown?: Unknown | undefined; - videoGeneration?: VideoGeneration | undefined; -}; - -export type Pricing = { - /** - * Price in USD per audio input token - */ - audio?: string | undefined; - /** - * Price in USD per audio output token - */ - audioOutput?: string | undefined; - /** - * Price in USD per token for completion (output) generation - */ - completion: string; - /** - * Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) - */ - discount?: number | undefined; - /** - * Price in USD per input image - */ - image?: string | undefined; - /** - * Price in USD per output image - */ - imageOutput?: string | undefined; - /** - * Price in USD per image token - */ - imageToken?: string | undefined; - /** - * Price in USD per cached audio input token - */ - inputAudioCache?: string | undefined; - /** - * Price in USD per cached input token (read) - */ - inputCacheRead?: string | undefined; - /** - * Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. - */ - inputCacheWrite?: string | undefined; - /** - * Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. - */ - inputCacheWrite1h?: string | undefined; - /** - * Price in USD per internal reasoning token - */ - internalReasoning?: string | undefined; - /** - * Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions. - */ - overrides?: Array | undefined; - /** - * Price in USD per token for prompt (input) processing - */ - prompt: string; - /** - * Price in USD per request - */ - request?: string | undefined; - /** - * Price in USD per web search - */ - webSearch?: string | undefined; -}; - /** * Information about a specific model endpoint */ @@ -273,293 +105,6 @@ export type PublicEndpoint = { uptimeLast5m: number | null; }; -/** @internal */ -export const NativeTools$inboundSchema: z.ZodType = z - .object({ - type: z.string(), - }); - -export function nativeToolsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => NativeTools$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'NativeTools' from JSON`, - ); -} - -/** @internal */ -export const Decisions$inboundSchema: z.ZodType = z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), -}).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); -}); - -export function decisionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Decisions$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Decisions' from JSON`, - ); -} - -/** @internal */ -export const Embeddings$inboundSchema: z.ZodType = z - .object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), - }).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); - }); - -export function embeddingsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Embeddings$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Embeddings' from JSON`, - ); -} - -/** @internal */ -export const ImageGeneration$inboundSchema: z.ZodType< - ImageGeneration, - unknown -> = z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), -}).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); -}); - -export function imageGenerationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ImageGeneration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ImageGeneration' from JSON`, - ); -} - -/** @internal */ -export const Rerank$inboundSchema: z.ZodType = z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), -}).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); -}); - -export function rerankFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Rerank$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Rerank' from JSON`, - ); -} - -/** @internal */ -export const STT$inboundSchema: z.ZodType = z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), -}).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); -}); - -export function sttFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => STT$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'STT' from JSON`, - ); -} - -/** @internal */ -export const TextGeneration$inboundSchema: z.ZodType = - z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), - }).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); - }); - -export function textGenerationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TextGeneration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TextGeneration' from JSON`, - ); -} - -/** @internal */ -export const TTS$inboundSchema: z.ZodType = z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), -}).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); -}); - -export function ttsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TTS$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TTS' from JSON`, - ); -} - -/** @internal */ -export const Unknown$inboundSchema: z.ZodType = z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), -}).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); -}); - -export function unknownFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Unknown$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Unknown' from JSON`, - ); -} - -/** @internal */ -export const VideoGeneration$inboundSchema: z.ZodType< - VideoGeneration, - unknown -> = z.object({ - latency: z.nullable(PercentileStats$inboundSchema), - request_count: z.nullable(z.int()), - throughput: z.nullable(PercentileStats$inboundSchema), -}).transform((v) => { - return remap$(v, { - "request_count": "requestCount", - }); -}); - -export function videoGenerationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => VideoGeneration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'VideoGeneration' from JSON`, - ); -} - -/** @internal */ -export const PerfLast30mByWorkload$inboundSchema: z.ZodType< - PerfLast30mByWorkload, - unknown -> = z.object({ - decisions: z.lazy(() => Decisions$inboundSchema).optional(), - embeddings: z.lazy(() => Embeddings$inboundSchema).optional(), - image_generation: z.lazy(() => ImageGeneration$inboundSchema).optional(), - rerank: z.lazy(() => Rerank$inboundSchema).optional(), - stt: z.lazy(() => STT$inboundSchema).optional(), - text_generation: z.lazy(() => TextGeneration$inboundSchema).optional(), - tts: z.lazy(() => TTS$inboundSchema).optional(), - unknown: z.lazy(() => Unknown$inboundSchema).optional(), - video_generation: z.lazy(() => VideoGeneration$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "image_generation": "imageGeneration", - "text_generation": "textGeneration", - "video_generation": "videoGeneration", - }); -}); - -export function perfLast30mByWorkloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PerfLast30mByWorkload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PerfLast30mByWorkload' from JSON`, - ); -} - -/** @internal */ -export const Pricing$inboundSchema: z.ZodType = z.object({ - audio: z.string().optional(), - audio_output: z.string().optional(), - completion: z.string(), - discount: z.number().optional(), - image: z.string().optional(), - image_output: z.string().optional(), - image_token: z.string().optional(), - input_audio_cache: z.string().optional(), - input_cache_read: z.string().optional(), - input_cache_write: z.string().optional(), - input_cache_write_1h: z.string().optional(), - internal_reasoning: z.string().optional(), - overrides: z.array(PricingOverride$inboundSchema).optional(), - prompt: z.string(), - request: z.string().optional(), - web_search: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "audio_output": "audioOutput", - "image_output": "imageOutput", - "image_token": "imageToken", - "input_audio_cache": "inputAudioCache", - "input_cache_read": "inputCacheRead", - "input_cache_write": "inputCacheWrite", - "input_cache_write_1h": "inputCacheWrite1h", - "internal_reasoning": "internalReasoning", - "web_search": "webSearch", - }); -}); - -export function pricingFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Pricing$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Pricing' from JSON`, - ); -} - /** @internal */ export const PublicEndpoint$inboundSchema: z.ZodType = z.object({ @@ -570,10 +115,9 @@ export const PublicEndpoint$inboundSchema: z.ZodType = model_id: z.string(), model_name: z.string(), name: z.string(), - native_tools: z.record(z.string(), z.lazy(() => NativeTools$inboundSchema)), - perf_last_30m_by_workload: z.lazy(() => PerfLast30mByWorkload$inboundSchema) - .optional(), - pricing: z.lazy(() => Pricing$inboundSchema), + native_tools: z.record(z.string(), NativeTools$inboundSchema), + perf_last_30m_by_workload: PerfLast30mByWorkload$inboundSchema.optional(), + pricing: Pricing$inboundSchema, provider_name: ProviderName$inboundSchema, quantization: z.nullable(Quantization$inboundSchema), service_tier: z.nullable(PublicServiceTier$inboundSchema), diff --git a/src/models/publiczdrendpoint.ts b/src/models/publiczdrendpoint.ts new file mode 100644 index 000000000..633d63e5a --- /dev/null +++ b/src/models/publiczdrendpoint.ts @@ -0,0 +1,179 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 965276f8cd2f + */ + +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 { + EndpointStatus, + EndpointStatus$inboundSchema, +} from "./endpointstatus.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { NativeTools, NativeTools$inboundSchema } from "./nativetools.js"; +import { Parameter, Parameter$inboundSchema } from "./parameter.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; +import { + PerfLast30mByWorkload, + PerfLast30mByWorkload$inboundSchema, +} from "./perflast30mbyworkload.js"; +import { Pricing, Pricing$inboundSchema } from "./pricing.js"; +import { ProviderName, ProviderName$inboundSchema } from "./providername.js"; +import { + PublicServiceTier, + PublicServiceTier$inboundSchema, +} from "./publicservicetier.js"; +import { Quantization, Quantization$inboundSchema } from "./quantization.js"; +import { + ToolChoiceSupport, + ToolChoiceSupport$inboundSchema, +} from "./toolchoicesupport.js"; + +/** + * An endpoint whose data policy does not retain prompts by default + */ +export type PublicZdrEndpoint = { + contextLength: number; + /** + * Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. + */ + latencyLast30m: PercentileStats | null; + /** + * Maximum completion tokens for this endpoint. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens. + */ + maxCompletionTokens: number | null; + maxPromptTokens: number | null; + /** + * The unique identifier for the model (permaslug) + */ + modelId: string; + modelName: string; + name: string; + /** + * The server tools this endpoint accepts as the provider's own built-in tool (`engine: "native"`) instead of an OpenRouter engine, keyed by canonical `openrouter:*` name. Each value names the provider tool type the request is translated to. Where that tool runs (provider-side, or returned to the client as with Anthropic bash) is documented per tool. Empty when the provider has none. + */ + nativeTools: { [k: string]: NativeTools }; + /** + * Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie. + */ + perfLast30mByWorkload?: PerfLast30mByWorkload | undefined; + pricing: Pricing; + providerName: ProviderName; + quantization: Quantization | null; + /** + * The service tier this endpoint sells, or null for a standard endpoint. The same value whether the provider selects the tier with a request parameter or with a dedicated model id. Always the canonical tier: priority covers the fast request alias and the turbo, highspeed, and prime provider model-id spellings, none of which this field reports. + */ + serviceTier: PublicServiceTier | null; + status?: EndpointStatus | undefined; + supportedParameters: Array; + /** + * Whether this STT endpoint can label each transcript segment with a speaker (speaker diarization). False when the endpoint has not declared support. + */ + supportsDiarization: boolean; + /** + * Whether this TTS endpoint accepts an `image_url` reference describing the desired voice. Requests carrying an image reference are only routed to endpoints where this is true. + */ + supportsImageReference: boolean; + supportsImplicitCaching: boolean; + /** + * Whether this TTS endpoint accepts more than one `input_audio` reference clip per request. Requests carrying several clips are only routed to endpoints where this is true. + */ + supportsMultipleAudioReferences: boolean; + /** + * Per-variant `tool_choice` support. `tool_choice` in `supported_parameters` only says the parameter is accepted; these flags say which of its values passed testing. + */ + supportsToolChoice: ToolChoiceSupport; + /** + * Whether this TTS endpoint accepts inline reference audio (`input_references`) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true. + */ + supportsVoiceCloning: boolean; + tag: string; + throughputLast30m: PercentileStats | null; + /** + * Uptime percentage over the last day: the share of minutes in which at least 80% of provider attempts succeeded, counting only minutes with 10 or more attempts. Rate-limited and caller-caused failures are excluded. Null when no minute had enough traffic. + */ + uptimeLast1d: number | null; + uptimeLast30m: number | null; + /** + * Uptime percentage over the last 5 minutes: the share of minutes in which at least 80% of provider attempts succeeded, counting only minutes with 10 or more attempts. Rate-limited and caller-caused failures are excluded. Null when no minute had enough traffic. + */ + uptimeLast5m: number | null; + /** + * Whether the endpoint uses Safety Retention: prompts are not retained by default, but the provider may retain prompts its safety classifiers flag. A ZDR-enforced request reaches these endpoints only when the account allows Safety Retention and no applied guardrail disallows it. + */ + safetyRetention: boolean; +}; + +/** @internal */ +export const PublicZdrEndpoint$inboundSchema: z.ZodType< + PublicZdrEndpoint, + unknown +> = z.object({ + context_length: z.int(), + latency_last_30m: z.nullable(PercentileStats$inboundSchema), + max_completion_tokens: z.nullable(z.int()), + max_prompt_tokens: z.nullable(z.int()), + model_id: z.string(), + model_name: z.string(), + name: z.string(), + native_tools: z.record(z.string(), NativeTools$inboundSchema), + perf_last_30m_by_workload: PerfLast30mByWorkload$inboundSchema.optional(), + pricing: Pricing$inboundSchema, + provider_name: ProviderName$inboundSchema, + quantization: z.nullable(Quantization$inboundSchema), + service_tier: z.nullable(PublicServiceTier$inboundSchema), + status: EndpointStatus$inboundSchema.optional(), + supported_parameters: z.array(Parameter$inboundSchema), + supports_diarization: z.boolean(), + supports_image_reference: z.boolean().default(false), + supports_implicit_caching: z.boolean(), + supports_multiple_audio_references: z.boolean().default(false), + supports_tool_choice: ToolChoiceSupport$inboundSchema, + supports_voice_cloning: z.boolean().default(false), + tag: z.string(), + throughput_last_30m: z.nullable(PercentileStats$inboundSchema), + uptime_last_1d: z.nullable(z.number()), + uptime_last_30m: z.nullable(z.number()), + uptime_last_5m: z.nullable(z.number()), + safety_retention: z.boolean(), +}).transform((v) => { + return remap$(v, { + "context_length": "contextLength", + "latency_last_30m": "latencyLast30m", + "max_completion_tokens": "maxCompletionTokens", + "max_prompt_tokens": "maxPromptTokens", + "model_id": "modelId", + "model_name": "modelName", + "native_tools": "nativeTools", + "perf_last_30m_by_workload": "perfLast30mByWorkload", + "provider_name": "providerName", + "service_tier": "serviceTier", + "supported_parameters": "supportedParameters", + "supports_diarization": "supportsDiarization", + "supports_image_reference": "supportsImageReference", + "supports_implicit_caching": "supportsImplicitCaching", + "supports_multiple_audio_references": "supportsMultipleAudioReferences", + "supports_tool_choice": "supportsToolChoice", + "supports_voice_cloning": "supportsVoiceCloning", + "throughput_last_30m": "throughputLast30m", + "uptime_last_1d": "uptimeLast1d", + "uptime_last_30m": "uptimeLast30m", + "uptime_last_5m": "uptimeLast5m", + "safety_retention": "safetyRetention", + }); +}); + +export function publicZdrEndpointFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PublicZdrEndpoint$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PublicZdrEndpoint' from JSON`, + ); +} diff --git a/src/models/rerank.ts b/src/models/rerank.ts new file mode 100644 index 000000000..db6a5f08a --- /dev/null +++ b/src/models/rerank.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2b9cb6c3de15 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type Rerank = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const Rerank$inboundSchema: z.ZodType = z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), +}).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); +}); + +export function rerankFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Rerank$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Rerank' from JSON`, + ); +} diff --git a/src/models/stt.ts b/src/models/stt.ts new file mode 100644 index 000000000..eaf5122b1 --- /dev/null +++ b/src/models/stt.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cce853695df0 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type STT = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const STT$inboundSchema: z.ZodType = z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), +}).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); +}); + +export function sttFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => STT$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'STT' from JSON`, + ); +} diff --git a/src/models/textgeneration.ts b/src/models/textgeneration.ts new file mode 100644 index 000000000..d31e2888a --- /dev/null +++ b/src/models/textgeneration.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 077e723dcb01 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type TextGeneration = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const TextGeneration$inboundSchema: z.ZodType = + z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), + }).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); + }); + +export function textGenerationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => TextGeneration$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TextGeneration' from JSON`, + ); +} diff --git a/src/models/tts.ts b/src/models/tts.ts new file mode 100644 index 000000000..23adba354 --- /dev/null +++ b/src/models/tts.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 076814f3333a + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type TTS = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const TTS$inboundSchema: z.ZodType = z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), +}).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); +}); + +export function ttsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => TTS$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TTS' from JSON`, + ); +} diff --git a/src/models/unknown.ts b/src/models/unknown.ts new file mode 100644 index 000000000..8b8d4f57b --- /dev/null +++ b/src/models/unknown.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 57f38983ea28 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type Unknown = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const Unknown$inboundSchema: z.ZodType = z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), +}).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); +}); + +export function unknownFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Unknown$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Unknown' from JSON`, + ); +} diff --git a/src/models/videogeneration.ts b/src/models/videogeneration.ts new file mode 100644 index 000000000..6407ea152 --- /dev/null +++ b/src/models/videogeneration.ts @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: acac14163f87 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + PercentileStats, + PercentileStats$inboundSchema, +} from "./percentilestats.js"; + +export type VideoGeneration = { + latency: PercentileStats | null; + /** + * Total requests admitted for this workload in the window. + */ + requestCount: number | null; + throughput: PercentileStats | null; +}; + +/** @internal */ +export const VideoGeneration$inboundSchema: z.ZodType< + VideoGeneration, + unknown +> = z.object({ + latency: z.nullable(PercentileStats$inboundSchema), + request_count: z.nullable(z.int()), + throughput: z.nullable(PercentileStats$inboundSchema), +}).transform((v) => { + return remap$(v, { + "request_count": "requestCount", + }); +}); + +export function videoGenerationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => VideoGeneration$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'VideoGeneration' from JSON`, + ); +} From 63a051fdf657908426a955f972e1f15ce875659c Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:35:07 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow