From f7f6cea8634a2d223e42fef893725452a0c74834 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 30 Oct 2026 20:26:38 +0000 Subject: [PATCH 1/2] ## Go SDK Changes: * `OpenRouter.Endpoints.ListZdrEndpoints()`: `response.Data[].SafetyRetention` **Added** --- .speakeasy/gen.lock | 91 ++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 572 ++++++++++-------- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- docs/models/components/publiczdrendpoint.mdx | 38 ++ .../operations/listendpointszdrresponse.mdx | 6 +- models/components/decisions.go | 31 + models/components/embeddings.go | 31 + models/components/imagegeneration.go | 31 + models/components/nativetools.go | 15 + models/components/perflast30mbyworkload.go | 97 +++ models/components/pricing.go | 165 +++++ models/components/publicendpoint.go | 512 ---------------- models/components/publiczdrendpoint.go | 252 ++++++++ models/components/rerank.go | 31 + models/components/stt.go | 31 + models/components/textgeneration.go | 31 + models/components/tts.go | 31 + models/components/unknown.go | 31 + models/components/videogeneration.go | 31 + models/operations/listendpointszdr.go | 6 +- openrouter.go | 6 +- 23 files changed, 1268 insertions(+), 795 deletions(-) create mode 100644 docs/models/components/publiczdrendpoint.mdx create mode 100644 models/components/decisions.go create mode 100644 models/components/embeddings.go create mode 100644 models/components/imagegeneration.go create mode 100644 models/components/nativetools.go create mode 100644 models/components/perflast30mbyworkload.go create mode 100644 models/components/pricing.go create mode 100644 models/components/publiczdrendpoint.go create mode 100644 models/components/rerank.go create mode 100644 models/components/stt.go create mode 100644 models/components/textgeneration.go create mode 100644 models/components/tts.go create mode 100644 models/components/unknown.go create mode 100644 models/components/videogeneration.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index dfc6cf20f..d2f1dafaa 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,18 +1,18 @@ lockVersion: 2.0.0 id: 9eea3e30-2722-4060-973b-57b7f1f75dc0 management: - docChecksum: 5386ae563850b2c0914a747383a04549 + docChecksum: 1fe21cc86571bd560daf515494eb797c docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 0.9.98 - configChecksum: e0cf9e62f0ee408ce68bffed63538dc1 + releaseVersion: 0.9.99 + configChecksum: 02578f66d23e7ba51869a86f7c7b54df repoURL: https://github.com/OpenRouterTeam/go-sdk.git installationURL: https://github.com/OpenRouterTeam/go-sdk persistentEdits: - generation_id: 0cebef95-9c3a-4639-b97e-08b065006e6d - pristine_commit_hash: aa0edfe8c3f98a7f3953f57756f91792ffa8b4cd - pristine_tree_hash: c90cfd1978dbf3c4e365647aef40b87f16c7f5ba + generation_id: 2029b28b-bac9-49a2-8f41-4b4119c10c60 + pristine_commit_hash: 75ac1be55ae5299bfcc921b46e90f570e964c0c0 + pristine_tree_hash: b3e2f08c444a87429baaf4600e019e7a7d11147e features: go: acceptHeaders: 2.81.2 @@ -6875,6 +6875,10 @@ trackedFiles: id: fd20b4dcbaa1 last_write_checksum: sha1:3bc945b055fb494f193e122691f6ad912bfd583b pristine_git_object: a52c8f068a2bc75a79601afc44eb1a1733a553d7 + docs/models/components/publiczdrendpoint.mdx: + id: 64ba3a536afc + last_write_checksum: sha1:117bd151f131de534220cb6f6f46abca66b29db3 + pristine_git_object: d61401f9fcb34a28b6e2850c2e3e5fa36dca3458 docs/models/components/purpose.mdx: id: be80088842c3 last_write_checksum: sha1:462c268724e0a71d3140ba7289e12b7f2637789f @@ -9357,8 +9361,8 @@ trackedFiles: pristine_git_object: 199828ad793fe25b2abe710dcbddeceb3cd6c9b2 docs/models/operations/listendpointszdrresponse.mdx: id: d9ce10710845 - last_write_checksum: sha1:aeb2be3ee9b779c27aa7ee4ccd6410947b17028c - pristine_git_object: 1ddfd8e647959f2c4448ad37324b668205ca8271 + last_write_checksum: sha1:4ce3597aa24b404bb0a2c073ae1c3ff85642d081 + pristine_git_object: ebba26629e33e5c814a0980bc0f72930dce9a30d docs/models/operations/listexternalusersrequest.mdx: id: ae444ba4c0b8 last_write_checksum: sha1:2e3416af676d4dc2b9b0603b43f072399dbbab53 @@ -11383,6 +11387,10 @@ trackedFiles: id: 6026f8be8a88 last_write_checksum: sha1:401b2cdf213da3fdb98908e04f2d48b8e666dfc9 pristine_git_object: 8be4e41e27544c15b0177943d4e8a7a8d8f1b7b5 + models/components/decisions.go: + id: 5551a5a2f4d5 + last_write_checksum: sha1:0c7a07380d3aa72004809829e9264fb44dc6a3ab + pristine_git_object: 7f55a07eafca7ed6769ccd099e3eb340adf5f763 models/components/decisionsboxanswer.go: id: 3f154ce72bbf last_write_checksum: sha1:e453c0d5748f3e56ac1b3374dd9734db686aaa8b @@ -11487,6 +11495,10 @@ trackedFiles: id: 9f65363c8e00 last_write_checksum: sha1:afdc1280ad549dabaab317d7cf3a51c228b77c89 pristine_git_object: f65c45f9e931b44562939cf5d713b285be949957 + models/components/embeddings.go: + id: d25ca9583325 + last_write_checksum: sha1:c6c8cc8a70f41f70dc8f483971ef3fb113043de3 + pristine_git_object: afa990bba08ed2cddd287eb74e6147ac476cf9bc models/components/endpointinfo.go: id: 31130ea9f3fc last_write_checksum: sha1:7b716bb956579e5e78bd280dbf8782d43948eac2 @@ -11867,6 +11879,10 @@ trackedFiles: id: 1b8cfd75301e last_write_checksum: sha1:e1b9192fd882fc2ae76840382adcde55e03010c6 pristine_git_object: 777f7215d847acdc6f9b288970c1bc9339417cab + models/components/imagegeneration.go: + id: 87454da0a0d2 + last_write_checksum: sha1:ed20de76da388acd143aff48d835e97913fb0b07 + pristine_git_object: 674824caf7afd5b18351cf0462fd4aaa3c47fa29 models/components/imagegenerationproviderpreferences.go: id: 1e510281b908 last_write_checksum: sha1:59b124c50b333959de1c38bb55c2593f779ca976 @@ -12243,6 +12259,10 @@ trackedFiles: id: 2569ab47809e last_write_checksum: sha1:15f2dd6d7a2f2a9701d0d797114c725734c9b874 pristine_git_object: 87dcb0a364f579a9b6a2cdafca1c3e2f5dbb5471 + models/components/nativetools.go: + id: 6a992c6f8d85 + last_write_checksum: sha1:2739ecf1ce1fee9ee2536179fa2373de0fd01958 + pristine_git_object: a92a6a010636905907a78806aba65cb462204271 models/components/notfoundresponseerrordata.go: id: e2afd0ef5513 last_write_checksum: sha1:a3fef3abfc0b05feeb05e38b44408b8acce20988 @@ -12695,6 +12715,10 @@ trackedFiles: id: c32efb228087 last_write_checksum: sha1:ccfbe4b73a84a2067d8a5b1adc0d56365f701cce pristine_git_object: b8e72a5156ce5a18b0f3bc9df95eb3b0627a92a4 + models/components/perflast30mbyworkload.go: + id: 8454158a3d92 + last_write_checksum: sha1:efab9499da54ed2597a2a3b3832591d81301831f + pristine_git_object: 279384327ffcdeb0408323be0a8a3a3d503ddcc5 models/components/perrequestlimits.go: id: 1bb3a7374b22 last_write_checksum: sha1:bb106e3b25a00a549908e0eddc8aa66a3db5ce46 @@ -12751,6 +12775,10 @@ trackedFiles: id: c4cfcd741d0b last_write_checksum: sha1:b22b21f5e3b7584e5c68f03844de38166c2eda9f pristine_git_object: 9c5052dcbd4085210d64680aa3f0137c5f8ee116 + models/components/pricing.go: + id: 0fab598c3a92 + last_write_checksum: sha1:62dbfe6278bcc731b308203962631b2c59062112 + pristine_git_object: bd676b67d5b2ed50fed75b4dd47180065c9bcf81 models/components/pricingoverride.go: id: 12ed2ef32a6a last_write_checksum: sha1:edeb9a1491cb6b2657d910507135418610c77871 @@ -12873,8 +12901,8 @@ trackedFiles: pristine_git_object: d913116c1e97092574832d3b377d2d1735055cd7 models/components/publicendpoint.go: id: "32378212e204" - last_write_checksum: sha1:4a392ff16c0240a7e156d63f45b277c9a9cb2b20 - pristine_git_object: 40a152f32d908146fc6ff7c1a3d521ca50716e7f + last_write_checksum: sha1:55f5a631ad117a21a8ab958368de64bc93bb767e + pristine_git_object: f04d41841137f5b7e1d8db51eb8218da9bafc093 models/components/publicpricing.go: id: 8596f6c62439 last_write_checksum: sha1:27958df794cc170d479c41ce42c79839ce3118b3 @@ -12883,6 +12911,10 @@ trackedFiles: id: 945137c3f568 last_write_checksum: sha1:2b2927e923f07b3745f2fbb0868cbd2ed7d6c456 pristine_git_object: fcb28029a39916c42eebe5dacf8a9f1bfd85c45b + models/components/publiczdrendpoint.go: + id: 66a6146f7c52 + last_write_checksum: sha1:bd9163339cd173eddc70acd1e0692f6ab03c541d + pristine_git_object: 50fd2e0b4e1fabb2ca89e09edd4626a71940395f models/components/quantization.go: id: 601f1d07ead7 last_write_checksum: sha1:76c98003bbce7230ac03ac94fbf4862831dd2e8b @@ -12991,6 +13023,10 @@ trackedFiles: id: 99e94f779714 last_write_checksum: sha1:de05b7bbb83ae4a4f55070cf1d7d5ba838d5bf17 pristine_git_object: d5f9635ec18ad3b97efb98a2d1903f5446110181 + models/components/rerank.go: + id: a7c83967e693 + last_write_checksum: sha1:7067bf0896cdbd1de74408ffc85f6ecd4e050549 + pristine_git_object: 111b097b9a4afc2b826c35eb3b476de10192e275 models/components/responsehealingplugin.go: id: 4ddfc9364dc8 last_write_checksum: sha1:792188f53daf0cf9db5f950bf4a6f59bb87e7988 @@ -13259,6 +13295,10 @@ trackedFiles: id: 316c58cdec29 last_write_checksum: sha1:6979cae2a13203f4ff81a1f79ab98e7d83d6e216 pristine_git_object: 600c3aec2dcfffcb2842a553e496eced534f5b66 + models/components/stt.go: + id: c616c65b5bea + last_write_checksum: sha1:7d480fb9546312ad435dd4e6720ccab9c96a7d72 + pristine_git_object: d4da868aae78a87861547c27f6aa117eb37469bc models/components/sttentity.go: id: 1df5802e27c9 last_write_checksum: sha1:07c92801d0c53d8402350dc6e7b43130a4d398aa @@ -13355,6 +13395,10 @@ trackedFiles: id: 6be86b01e7bb last_write_checksum: sha1:8d5722f20ec9db21b10fde412b522b8ccdcfe641 pristine_git_object: ea804a04dfb6b4bbf08cc9a905f137eb3e5506bd + models/components/textgeneration.go: + id: b6ad7850a6ff + last_write_checksum: sha1:19590a32f16f768aba3d3a5b6378cabce91ed0f2 + pristine_git_object: 1582a7c9354e741e0752ce5b78016894ac7459e0 models/components/tokenexchangerequest.go: id: 6ba10a45d47a last_write_checksum: sha1:8937cd19e1c060b6286ef2fc3141e15e1cd3acbe @@ -13407,6 +13451,10 @@ trackedFiles: id: 0ee272268f8a last_write_checksum: sha1:15f762d72c73c99e6a7855b5465379c302573653 pristine_git_object: 310107f95d89e07e61965add82bfb832cbc7b65b + models/components/tts.go: + id: ea289d1ebaed + last_write_checksum: sha1:6a464a5bb38f313a14c71d232c375507593a4c62 + pristine_git_object: e32eea93b0cd7942ecd28e6fd814d1986aee2244 models/components/unauthorizedresponseerrordata.go: id: df4b3fa1c801 last_write_checksum: sha1:794c247ac70111de05f9cff9b72e749ec0f1dba0 @@ -13443,6 +13491,10 @@ trackedFiles: id: 4044177a129c last_write_checksum: sha1:bffb415c699450395fce0b43293c06a6fe6789dc pristine_git_object: c20b7e9fdf05ec29c71eba3451801574757fae35 + models/components/unknown.go: + id: f97b3e8c803a + last_write_checksum: sha1:0b59565175e04c920e340229d3695e1c369594b5 + pristine_git_object: e2998e9bb04a7dcf97258c13c7c3c5f82151706b models/components/unprocessableentityresponseerrordata.go: id: a8d1dd41f07f last_write_checksum: sha1:f530d32e638af837f70983e2ea2d148942b7dedb @@ -13567,6 +13619,10 @@ trackedFiles: id: a434ecb5fead last_write_checksum: sha1:43201b8d4e7c8540f3a284924004e3f936b9b1ed pristine_git_object: 8285e577441bb6696a80e906c3c0c815ea0cd3d0 + models/components/videogeneration.go: + id: b7100092b343 + last_write_checksum: sha1:1a9d98f34feae4297a07907a7142ff250e6a17f9 + pristine_git_object: 3c344f6030b9dda2bc7a9f7c97594f76cbd8f286 models/components/videogenerationrequest.go: id: 11162ee57e53 last_write_checksum: sha1:442688bb27d7661877a5641060c96066b74ef393 @@ -14005,8 +14061,8 @@ trackedFiles: pristine_git_object: 6fe817332f6c274fc3bedb046c5efeee74eff1b3 models/operations/listendpointszdr.go: id: 340c80c701c2 - last_write_checksum: sha1:369fd60ffdadd9a633f3b5086ef9d04c3a1e85c1 - pristine_git_object: de2caab374aa9b4b1e8378584e425e4f3a6b252e + last_write_checksum: sha1:fc0aab268b473ec16c17b33f88726189781034c1 + pristine_git_object: 84a3ce1352e43500f6354af7c8cdddbeed4052bf models/operations/listexternalusers.go: id: b09d5304164d last_write_checksum: sha1:bc77d586a216b96e0d234375d80cef4f7362caa1 @@ -14313,8 +14369,8 @@ trackedFiles: pristine_git_object: 742ef08e3a695f4aa613fc5f9e2d8ad55ae3d564 openrouter.go: id: 207ad004b774 - last_write_checksum: sha1:0b81fd759f163963d60090bff29a174d054ef8ac - pristine_git_object: d9d578fde1f4dfb5c44c90e70b2e4c160f459ffa + last_write_checksum: sha1:3ba3a8ff2b7259f8f81ac607cefb8917588df663 + pristine_git_object: 7d914d28eb351390cb39f8adc9d261975d7a5916 optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:b828c94c45116e632925027e4e2c211e971e04e2 @@ -14661,7 +14717,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": @@ -18955,7 +19011,4 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Go 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 6e9aa5ff0..5a8450224 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true go: - version: 0.9.98 + version: 0.9.99 additionalDependencies: {} baseErrorName: OpenRouterError clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 429963a49..aed657038 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -10994,6 +10994,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: @@ -11665,6 +11685,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' @@ -15174,6 +15214,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: @@ -19987,6 +20047,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: @@ -26359,6 +26427,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: @@ -26724,6 +26815,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: @@ -28602,260 +28750,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: @@ -29010,6 +28914,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' @@ -29556,6 +29510,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 @@ -31617,6 +31591,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: @@ -32467,6 +32461,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: @@ -32916,6 +32930,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: @@ -33425,6 +33459,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: @@ -35009,6 +35063,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' @@ -40975,6 +41049,7 @@ paths: request: '0' provider_name: 'OpenAI' quantization: 'fp16' + safety_retention: false status: 0 supported_parameters: - 'temperature' @@ -41016,6 +41091,7 @@ paths: request: '0' provider_name: 'OpenAI' quantization: 'fp16' + safety_retention: false status: 0 supported_parameters: - 'temperature' @@ -41038,7 +41114,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 11c12f125..64404c8ce 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:0fe07548818767ce5ffb5e6d054c6d3262825442b3d127cf9bda92d74338deba - sourceBlobDigest: sha256:84bca5490d88d47460d85855387b206b48dc81933f92094c1d94e89690ac7676 + sourceRevisionDigest: sha256:0cf2f13c3655a835a616a46d0bbb9e5aa3bbf82360d393cf4a078dfceb8bb143 + sourceBlobDigest: sha256:9bd86578f9d62d0d297bc94e56c201d080aed1e3d64e582d823fdd3de77ce91e tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0fe07548818767ce5ffb5e6d054c6d3262825442b3d127cf9bda92d74338deba - sourceBlobDigest: sha256:84bca5490d88d47460d85855387b206b48dc81933f92094c1d94e89690ac7676 + sourceRevisionDigest: sha256:0cf2f13c3655a835a616a46d0bbb9e5aa3bbf82360d393cf4a078dfceb8bb143 + sourceBlobDigest: sha256:9bd86578f9d62d0d297bc94e56c201d080aed1e3d64e582d823fdd3de77ce91e codeSamplesNamespace: open-router-chat-completions-api-go-code-samples - codeSamplesRevisionDigest: sha256:64c0b545e661e048334553f424adff6b46c8075008a83a40c1593c5844c1bc37 + codeSamplesRevisionDigest: sha256:567e2e69820a98369864ad0e2fc63fde445155bc804307ec3a3506130183f68e workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index c9c4d5930..83ca58247 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3498,4 +3498,14 @@ Based on: ### Generated - [go v0.9.98] . ### Releases -- [Go v0.9.98] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.98 - . \ No newline at end of file +- [Go v0.9.98] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.98 - . + +## 2026-10-30 20:21:25 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.9.99] . +### Releases +- [Go v0.9.99] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.99 - . \ No newline at end of file diff --git a/docs/models/components/publiczdrendpoint.mdx b/docs/models/components/publiczdrendpoint.mdx new file mode 100644 index 000000000..d61401f9f --- /dev/null +++ b/docs/models/components/publiczdrendpoint.mdx @@ -0,0 +1,38 @@ +--- +title: "PublicZdrEndpoint" +--- + +An endpoint whose data policy does not retain prompts by default + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContextLength` | `int64` | ✔️ | N/A | | +| `LatencyLast30m` | [*components.PercentileStats](../../models/components/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` | `*int64` | ✔️ | 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` | `*int64` | ✔️ | N/A | | +| `ModelID` | `string` | ✔️ | The unique identifier for the model (permaslug) | openai/gpt-4 | +| `ModelName` | `string` | ✔️ | N/A | | +| `Name` | `string` | ✔️ | N/A | | +| `NativeTools` | map[string][components.NativeTools](../../models/components/nativetools.mdx) | ✔️ | 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` | [*components.PerfLast30mByWorkload](../../models/components/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` | [components.Pricing](../../models/components/pricing.mdx) | ✔️ | N/A | | +| `ProviderName` | [components.ProviderName](../../models/components/providername.mdx) | ✔️ | N/A | OpenAI | +| `Quantization` | [*components.Quantization](../../models/components/quantization.mdx) | ✔️ | N/A | fp16 | +| `ServiceTier` | [*components.PublicServiceTier](../../models/components/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` | [*components.EndpointStatus](../../models/components/endpointstatus.mdx) | ➖ | N/A | 0 | +| `SupportedParameters` | [][components.Parameter](../../models/components/parameter.mdx) | ✔️ | N/A | | +| `SupportsDiarization` | `bool` | ✔️ | Whether this STT endpoint can label each transcript segment with a speaker (speaker diarization). False when the endpoint has not declared support. | | +| `SupportsImageReference` | `*bool` | ➖ | 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` | `bool` | ✔️ | N/A | | +| `SupportsMultipleAudioReferences` | `*bool` | ➖ | 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` | [components.ToolChoiceSupport](../../models/components/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` | `*bool` | ➖ | 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` | [*components.PercentileStats](../../models/components/percentilestats.mdx) | ✔️ | N/A | \{
"p50": 25.5,
"p75": 35.2,
"p90": 48.7,
"p99": 85.3
} | +| `UptimeLast1d` | `*float64` | ✔️ | 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` | `*float64` | ✔️ | N/A | | +| `UptimeLast5m` | `*float64` | ✔️ | 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` | `bool` | ✔️ | 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/docs/models/operations/listendpointszdrresponse.mdx b/docs/models/operations/listendpointszdrresponse.mdx index 1ddfd8e64..ebba26629 100644 --- a/docs/models/operations/listendpointszdrresponse.mdx +++ b/docs/models/operations/listendpointszdrresponse.mdx @@ -7,6 +7,6 @@ Returns a list of endpoints ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `Data` | [][components.PublicEndpoint](../../models/components/publicendpoint.mdx) | ✔️ | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Data` | [][components.PublicZdrEndpoint](../../models/components/publiczdrendpoint.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/models/components/decisions.go b/models/components/decisions.go new file mode 100644 index 000000000..7f55a07ea --- /dev/null +++ b/models/components/decisions.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Decisions struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (d *Decisions) GetLatency() *PercentileStats { + if d == nil { + return nil + } + return d.Latency +} + +func (d *Decisions) GetRequestCount() *int64 { + if d == nil { + return nil + } + return d.RequestCount +} + +func (d *Decisions) GetThroughput() *PercentileStats { + if d == nil { + return nil + } + return d.Throughput +} diff --git a/models/components/embeddings.go b/models/components/embeddings.go new file mode 100644 index 000000000..afa990bba --- /dev/null +++ b/models/components/embeddings.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Embeddings struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (e *Embeddings) GetLatency() *PercentileStats { + if e == nil { + return nil + } + return e.Latency +} + +func (e *Embeddings) GetRequestCount() *int64 { + if e == nil { + return nil + } + return e.RequestCount +} + +func (e *Embeddings) GetThroughput() *PercentileStats { + if e == nil { + return nil + } + return e.Throughput +} diff --git a/models/components/imagegeneration.go b/models/components/imagegeneration.go new file mode 100644 index 000000000..674824caf --- /dev/null +++ b/models/components/imagegeneration.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ImageGeneration struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (i *ImageGeneration) GetLatency() *PercentileStats { + if i == nil { + return nil + } + return i.Latency +} + +func (i *ImageGeneration) GetRequestCount() *int64 { + if i == nil { + return nil + } + return i.RequestCount +} + +func (i *ImageGeneration) GetThroughput() *PercentileStats { + if i == nil { + return nil + } + return i.Throughput +} diff --git a/models/components/nativetools.go b/models/components/nativetools.go new file mode 100644 index 000000000..a92a6a010 --- /dev/null +++ b/models/components/nativetools.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type NativeTools struct { + // 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 `json:"type"` +} + +func (n *NativeTools) GetType() string { + if n == nil { + return "" + } + return n.Type +} diff --git a/models/components/perflast30mbyworkload.go b/models/components/perflast30mbyworkload.go new file mode 100644 index 000000000..279384327 --- /dev/null +++ b/models/components/perflast30mbyworkload.go @@ -0,0 +1,97 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// PerfLast30mByWorkload - 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. +type PerfLast30mByWorkload struct { + Decisions *Decisions `json:"decisions,omitzero"` + Embeddings *Embeddings `json:"embeddings,omitzero"` + ImageGeneration *ImageGeneration `json:"image_generation,omitzero"` + Rerank *Rerank `json:"rerank,omitzero"` + STT *STT `json:"stt,omitzero"` + TextGeneration *TextGeneration `json:"text_generation,omitzero"` + TTS *TTS `json:"tts,omitzero"` + Unknown *Unknown `json:"unknown,omitzero"` + VideoGeneration *VideoGeneration `json:"video_generation,omitzero"` +} + +func (p PerfLast30mByWorkload) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PerfLast30mByWorkload) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PerfLast30mByWorkload) GetDecisions() *Decisions { + if p == nil { + return nil + } + return p.Decisions +} + +func (p *PerfLast30mByWorkload) GetEmbeddings() *Embeddings { + if p == nil { + return nil + } + return p.Embeddings +} + +func (p *PerfLast30mByWorkload) GetImageGeneration() *ImageGeneration { + if p == nil { + return nil + } + return p.ImageGeneration +} + +func (p *PerfLast30mByWorkload) GetRerank() *Rerank { + if p == nil { + return nil + } + return p.Rerank +} + +func (p *PerfLast30mByWorkload) GetSTT() *STT { + if p == nil { + return nil + } + return p.STT +} + +func (p *PerfLast30mByWorkload) GetTextGeneration() *TextGeneration { + if p == nil { + return nil + } + return p.TextGeneration +} + +func (p *PerfLast30mByWorkload) GetTTS() *TTS { + if p == nil { + return nil + } + return p.TTS +} + +func (p *PerfLast30mByWorkload) GetUnknown() *Unknown { + if p == nil { + return nil + } + return p.Unknown +} + +func (p *PerfLast30mByWorkload) GetVideoGeneration() *VideoGeneration { + if p == nil { + return nil + } + return p.VideoGeneration +} + +// #region class-body-perflast30mbyworkload +// #endregion class-body-perflast30mbyworkload diff --git a/models/components/pricing.go b/models/components/pricing.go new file mode 100644 index 000000000..bd676b67d --- /dev/null +++ b/models/components/pricing.go @@ -0,0 +1,165 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type Pricing struct { + // Price in USD per audio input token + Audio *string `json:"audio,omitzero"` + // Price in USD per audio output token + AudioOutput *string `json:"audio_output,omitzero"` + // Price in USD per token for completion (output) generation + Completion string `json:"completion"` + // Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) + Discount *float64 `json:"discount,omitzero"` + // Price in USD per input image + Image *string `json:"image,omitzero"` + // Price in USD per output image + ImageOutput *string `json:"image_output,omitzero"` + // Price in USD per image token + ImageToken *string `json:"image_token,omitzero"` + // Price in USD per cached audio input token + InputAudioCache *string `json:"input_audio_cache,omitzero"` + // Price in USD per cached input token (read) + InputCacheRead *string `json:"input_cache_read,omitzero"` + // 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 `json:"input_cache_write,omitzero"` + // 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 `json:"input_cache_write_1h,omitzero"` + // Price in USD per internal reasoning token + InternalReasoning *string `json:"internal_reasoning,omitzero"` + // 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 []PricingOverride `json:"overrides,omitzero"` + // Price in USD per token for prompt (input) processing + Prompt string `json:"prompt"` + // Price in USD per request + Request *string `json:"request,omitzero"` + // Price in USD per web search + WebSearch *string `json:"web_search,omitzero"` +} + +func (p Pricing) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *Pricing) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *Pricing) GetAudio() *string { + if p == nil { + return nil + } + return p.Audio +} + +func (p *Pricing) GetAudioOutput() *string { + if p == nil { + return nil + } + return p.AudioOutput +} + +func (p *Pricing) GetCompletion() string { + if p == nil { + return "" + } + return p.Completion +} + +func (p *Pricing) GetDiscount() *float64 { + if p == nil { + return nil + } + return p.Discount +} + +func (p *Pricing) GetImage() *string { + if p == nil { + return nil + } + return p.Image +} + +func (p *Pricing) GetImageOutput() *string { + if p == nil { + return nil + } + return p.ImageOutput +} + +func (p *Pricing) GetImageToken() *string { + if p == nil { + return nil + } + return p.ImageToken +} + +func (p *Pricing) GetInputAudioCache() *string { + if p == nil { + return nil + } + return p.InputAudioCache +} + +func (p *Pricing) GetInputCacheRead() *string { + if p == nil { + return nil + } + return p.InputCacheRead +} + +func (p *Pricing) GetInputCacheWrite() *string { + if p == nil { + return nil + } + return p.InputCacheWrite +} + +func (p *Pricing) GetInputCacheWrite1h() *string { + if p == nil { + return nil + } + return p.InputCacheWrite1h +} + +func (p *Pricing) GetInternalReasoning() *string { + if p == nil { + return nil + } + return p.InternalReasoning +} + +func (p *Pricing) GetOverrides() []PricingOverride { + if p == nil { + return nil + } + return p.Overrides +} + +func (p *Pricing) GetPrompt() string { + if p == nil { + return "" + } + return p.Prompt +} + +func (p *Pricing) GetRequest() *string { + if p == nil { + return nil + } + return p.Request +} + +func (p *Pricing) GetWebSearch() *string { + if p == nil { + return nil + } + return p.WebSearch +} diff --git a/models/components/publicendpoint.go b/models/components/publicendpoint.go index 40a152f32..f04d41841 100644 --- a/models/components/publicendpoint.go +++ b/models/components/publicendpoint.go @@ -6,518 +6,6 @@ import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" ) -type NativeTools struct { - // 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 `json:"type"` -} - -func (n *NativeTools) GetType() string { - if n == nil { - return "" - } - return n.Type -} - -type Decisions struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (d *Decisions) GetLatency() *PercentileStats { - if d == nil { - return nil - } - return d.Latency -} - -func (d *Decisions) GetRequestCount() *int64 { - if d == nil { - return nil - } - return d.RequestCount -} - -func (d *Decisions) GetThroughput() *PercentileStats { - if d == nil { - return nil - } - return d.Throughput -} - -type Embeddings struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (e *Embeddings) GetLatency() *PercentileStats { - if e == nil { - return nil - } - return e.Latency -} - -func (e *Embeddings) GetRequestCount() *int64 { - if e == nil { - return nil - } - return e.RequestCount -} - -func (e *Embeddings) GetThroughput() *PercentileStats { - if e == nil { - return nil - } - return e.Throughput -} - -type ImageGeneration struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (i *ImageGeneration) GetLatency() *PercentileStats { - if i == nil { - return nil - } - return i.Latency -} - -func (i *ImageGeneration) GetRequestCount() *int64 { - if i == nil { - return nil - } - return i.RequestCount -} - -func (i *ImageGeneration) GetThroughput() *PercentileStats { - if i == nil { - return nil - } - return i.Throughput -} - -type Rerank struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (r *Rerank) GetLatency() *PercentileStats { - if r == nil { - return nil - } - return r.Latency -} - -func (r *Rerank) GetRequestCount() *int64 { - if r == nil { - return nil - } - return r.RequestCount -} - -func (r *Rerank) GetThroughput() *PercentileStats { - if r == nil { - return nil - } - return r.Throughput -} - -type STT struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (s *STT) GetLatency() *PercentileStats { - if s == nil { - return nil - } - return s.Latency -} - -func (s *STT) GetRequestCount() *int64 { - if s == nil { - return nil - } - return s.RequestCount -} - -func (s *STT) GetThroughput() *PercentileStats { - if s == nil { - return nil - } - return s.Throughput -} - -type TextGeneration struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (t *TextGeneration) GetLatency() *PercentileStats { - if t == nil { - return nil - } - return t.Latency -} - -func (t *TextGeneration) GetRequestCount() *int64 { - if t == nil { - return nil - } - return t.RequestCount -} - -func (t *TextGeneration) GetThroughput() *PercentileStats { - if t == nil { - return nil - } - return t.Throughput -} - -type TTS struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (t *TTS) GetLatency() *PercentileStats { - if t == nil { - return nil - } - return t.Latency -} - -func (t *TTS) GetRequestCount() *int64 { - if t == nil { - return nil - } - return t.RequestCount -} - -func (t *TTS) GetThroughput() *PercentileStats { - if t == nil { - return nil - } - return t.Throughput -} - -type Unknown struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (u *Unknown) GetLatency() *PercentileStats { - if u == nil { - return nil - } - return u.Latency -} - -func (u *Unknown) GetRequestCount() *int64 { - if u == nil { - return nil - } - return u.RequestCount -} - -func (u *Unknown) GetThroughput() *PercentileStats { - if u == nil { - return nil - } - return u.Throughput -} - -type VideoGeneration struct { - Latency *PercentileStats `json:"latency"` - // Total requests admitted for this workload in the window. - RequestCount *int64 `json:"request_count"` - Throughput *PercentileStats `json:"throughput"` -} - -func (v *VideoGeneration) GetLatency() *PercentileStats { - if v == nil { - return nil - } - return v.Latency -} - -func (v *VideoGeneration) GetRequestCount() *int64 { - if v == nil { - return nil - } - return v.RequestCount -} - -func (v *VideoGeneration) GetThroughput() *PercentileStats { - if v == nil { - return nil - } - return v.Throughput -} - -// PerfLast30mByWorkload - 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. -type PerfLast30mByWorkload struct { - Decisions *Decisions `json:"decisions,omitzero"` - Embeddings *Embeddings `json:"embeddings,omitzero"` - ImageGeneration *ImageGeneration `json:"image_generation,omitzero"` - Rerank *Rerank `json:"rerank,omitzero"` - STT *STT `json:"stt,omitzero"` - TextGeneration *TextGeneration `json:"text_generation,omitzero"` - TTS *TTS `json:"tts,omitzero"` - Unknown *Unknown `json:"unknown,omitzero"` - VideoGeneration *VideoGeneration `json:"video_generation,omitzero"` -} - -func (p PerfLast30mByWorkload) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PerfLast30mByWorkload) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { - return err - } - return nil -} - -func (p *PerfLast30mByWorkload) GetDecisions() *Decisions { - if p == nil { - return nil - } - return p.Decisions -} - -func (p *PerfLast30mByWorkload) GetEmbeddings() *Embeddings { - if p == nil { - return nil - } - return p.Embeddings -} - -func (p *PerfLast30mByWorkload) GetImageGeneration() *ImageGeneration { - if p == nil { - return nil - } - return p.ImageGeneration -} - -func (p *PerfLast30mByWorkload) GetRerank() *Rerank { - if p == nil { - return nil - } - return p.Rerank -} - -func (p *PerfLast30mByWorkload) GetSTT() *STT { - if p == nil { - return nil - } - return p.STT -} - -func (p *PerfLast30mByWorkload) GetTextGeneration() *TextGeneration { - if p == nil { - return nil - } - return p.TextGeneration -} - -func (p *PerfLast30mByWorkload) GetTTS() *TTS { - if p == nil { - return nil - } - return p.TTS -} - -func (p *PerfLast30mByWorkload) GetUnknown() *Unknown { - if p == nil { - return nil - } - return p.Unknown -} - -func (p *PerfLast30mByWorkload) GetVideoGeneration() *VideoGeneration { - if p == nil { - return nil - } - return p.VideoGeneration -} - -// #region class-body-perflast30mbyworkload -// #endregion class-body-perflast30mbyworkload - -type Pricing struct { - // Price in USD per audio input token - Audio *string `json:"audio,omitzero"` - // Price in USD per audio output token - AudioOutput *string `json:"audio_output,omitzero"` - // Price in USD per token for completion (output) generation - Completion string `json:"completion"` - // Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) - Discount *float64 `json:"discount,omitzero"` - // Price in USD per input image - Image *string `json:"image,omitzero"` - // Price in USD per output image - ImageOutput *string `json:"image_output,omitzero"` - // Price in USD per image token - ImageToken *string `json:"image_token,omitzero"` - // Price in USD per cached audio input token - InputAudioCache *string `json:"input_audio_cache,omitzero"` - // Price in USD per cached input token (read) - InputCacheRead *string `json:"input_cache_read,omitzero"` - // 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 `json:"input_cache_write,omitzero"` - // 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 `json:"input_cache_write_1h,omitzero"` - // Price in USD per internal reasoning token - InternalReasoning *string `json:"internal_reasoning,omitzero"` - // 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 []PricingOverride `json:"overrides,omitzero"` - // Price in USD per token for prompt (input) processing - Prompt string `json:"prompt"` - // Price in USD per request - Request *string `json:"request,omitzero"` - // Price in USD per web search - WebSearch *string `json:"web_search,omitzero"` -} - -func (p Pricing) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Pricing) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { - return err - } - return nil -} - -func (p *Pricing) GetAudio() *string { - if p == nil { - return nil - } - return p.Audio -} - -func (p *Pricing) GetAudioOutput() *string { - if p == nil { - return nil - } - return p.AudioOutput -} - -func (p *Pricing) GetCompletion() string { - if p == nil { - return "" - } - return p.Completion -} - -func (p *Pricing) GetDiscount() *float64 { - if p == nil { - return nil - } - return p.Discount -} - -func (p *Pricing) GetImage() *string { - if p == nil { - return nil - } - return p.Image -} - -func (p *Pricing) GetImageOutput() *string { - if p == nil { - return nil - } - return p.ImageOutput -} - -func (p *Pricing) GetImageToken() *string { - if p == nil { - return nil - } - return p.ImageToken -} - -func (p *Pricing) GetInputAudioCache() *string { - if p == nil { - return nil - } - return p.InputAudioCache -} - -func (p *Pricing) GetInputCacheRead() *string { - if p == nil { - return nil - } - return p.InputCacheRead -} - -func (p *Pricing) GetInputCacheWrite() *string { - if p == nil { - return nil - } - return p.InputCacheWrite -} - -func (p *Pricing) GetInputCacheWrite1h() *string { - if p == nil { - return nil - } - return p.InputCacheWrite1h -} - -func (p *Pricing) GetInternalReasoning() *string { - if p == nil { - return nil - } - return p.InternalReasoning -} - -func (p *Pricing) GetOverrides() []PricingOverride { - if p == nil { - return nil - } - return p.Overrides -} - -func (p *Pricing) GetPrompt() string { - if p == nil { - return "" - } - return p.Prompt -} - -func (p *Pricing) GetRequest() *string { - if p == nil { - return nil - } - return p.Request -} - -func (p *Pricing) GetWebSearch() *string { - if p == nil { - return nil - } - return p.WebSearch -} - // PublicEndpoint - Information about a specific model endpoint type PublicEndpoint struct { ContextLength int64 `json:"context_length"` diff --git a/models/components/publiczdrendpoint.go b/models/components/publiczdrendpoint.go new file mode 100644 index 000000000..50fd2e0b4 --- /dev/null +++ b/models/components/publiczdrendpoint.go @@ -0,0 +1,252 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// PublicZdrEndpoint - An endpoint whose data policy does not retain prompts by default +type PublicZdrEndpoint struct { + ContextLength int64 `json:"context_length"` + // 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 `json:"latency_last_30m"` + // 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 *int64 `json:"max_completion_tokens"` + MaxPromptTokens *int64 `json:"max_prompt_tokens"` + // The unique identifier for the model (permaslug) + ModelID string `json:"model_id"` + ModelName string `json:"model_name"` + Name string `json:"name"` + // 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 map[string]NativeTools `json:"native_tools"` + // 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 `json:"perf_last_30m_by_workload,omitzero"` + Pricing Pricing `json:"pricing"` + ProviderName ProviderName `json:"provider_name"` + Quantization *Quantization `json:"quantization"` + // 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 `json:"service_tier"` + Status *EndpointStatus `json:"status,omitzero"` + SupportedParameters []Parameter `json:"supported_parameters"` + // Whether this STT endpoint can label each transcript segment with a speaker (speaker diarization). False when the endpoint has not declared support. + SupportsDiarization bool `json:"supports_diarization"` + // 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 *bool `default:"false" json:"supports_image_reference"` + SupportsImplicitCaching bool `json:"supports_implicit_caching"` + // 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 *bool `default:"false" json:"supports_multiple_audio_references"` + // 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 `json:"supports_tool_choice"` + // 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 *bool `default:"false" json:"supports_voice_cloning"` + Tag string `json:"tag"` + ThroughputLast30m *PercentileStats `json:"throughput_last_30m"` + // 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 *float64 `json:"uptime_last_1d"` + UptimeLast30m *float64 `json:"uptime_last_30m"` + // 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 *float64 `json:"uptime_last_5m"` + // 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 bool `json:"safety_retention"` +} + +func (p PublicZdrEndpoint) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PublicZdrEndpoint) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PublicZdrEndpoint) GetContextLength() int64 { + if p == nil { + return 0 + } + return p.ContextLength +} + +func (p *PublicZdrEndpoint) GetLatencyLast30m() *PercentileStats { + if p == nil { + return nil + } + return p.LatencyLast30m +} + +func (p *PublicZdrEndpoint) GetMaxCompletionTokens() *int64 { + if p == nil { + return nil + } + return p.MaxCompletionTokens +} + +func (p *PublicZdrEndpoint) GetMaxPromptTokens() *int64 { + if p == nil { + return nil + } + return p.MaxPromptTokens +} + +func (p *PublicZdrEndpoint) GetModelID() string { + if p == nil { + return "" + } + return p.ModelID +} + +func (p *PublicZdrEndpoint) GetModelName() string { + if p == nil { + return "" + } + return p.ModelName +} + +func (p *PublicZdrEndpoint) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *PublicZdrEndpoint) GetNativeTools() map[string]NativeTools { + if p == nil { + return map[string]NativeTools{} + } + return p.NativeTools +} + +func (p *PublicZdrEndpoint) GetPerfLast30mByWorkload() *PerfLast30mByWorkload { + if p == nil { + return nil + } + return p.PerfLast30mByWorkload +} + +func (p *PublicZdrEndpoint) GetPricing() Pricing { + if p == nil { + return Pricing{} + } + return p.Pricing +} + +func (p *PublicZdrEndpoint) GetProviderName() ProviderName { + if p == nil { + return ProviderName("") + } + return p.ProviderName +} + +func (p *PublicZdrEndpoint) GetQuantization() *Quantization { + if p == nil { + return nil + } + return p.Quantization +} + +func (p *PublicZdrEndpoint) GetServiceTier() *PublicServiceTier { + if p == nil { + return nil + } + return p.ServiceTier +} + +func (p *PublicZdrEndpoint) GetStatus() *EndpointStatus { + if p == nil { + return nil + } + return p.Status +} + +func (p *PublicZdrEndpoint) GetSupportedParameters() []Parameter { + if p == nil { + return []Parameter{} + } + return p.SupportedParameters +} + +func (p *PublicZdrEndpoint) GetSupportsDiarization() bool { + if p == nil { + return false + } + return p.SupportsDiarization +} + +func (p *PublicZdrEndpoint) GetSupportsImageReference() *bool { + if p == nil { + return nil + } + return p.SupportsImageReference +} + +func (p *PublicZdrEndpoint) GetSupportsImplicitCaching() bool { + if p == nil { + return false + } + return p.SupportsImplicitCaching +} + +func (p *PublicZdrEndpoint) GetSupportsMultipleAudioReferences() *bool { + if p == nil { + return nil + } + return p.SupportsMultipleAudioReferences +} + +func (p *PublicZdrEndpoint) GetSupportsToolChoice() ToolChoiceSupport { + if p == nil { + return ToolChoiceSupport{} + } + return p.SupportsToolChoice +} + +func (p *PublicZdrEndpoint) GetSupportsVoiceCloning() *bool { + if p == nil { + return nil + } + return p.SupportsVoiceCloning +} + +func (p *PublicZdrEndpoint) GetTag() string { + if p == nil { + return "" + } + return p.Tag +} + +func (p *PublicZdrEndpoint) GetThroughputLast30m() *PercentileStats { + if p == nil { + return nil + } + return p.ThroughputLast30m +} + +func (p *PublicZdrEndpoint) GetUptimeLast1d() *float64 { + if p == nil { + return nil + } + return p.UptimeLast1d +} + +func (p *PublicZdrEndpoint) GetUptimeLast30m() *float64 { + if p == nil { + return nil + } + return p.UptimeLast30m +} + +func (p *PublicZdrEndpoint) GetUptimeLast5m() *float64 { + if p == nil { + return nil + } + return p.UptimeLast5m +} + +func (p *PublicZdrEndpoint) GetSafetyRetention() bool { + if p == nil { + return false + } + return p.SafetyRetention +} diff --git a/models/components/rerank.go b/models/components/rerank.go new file mode 100644 index 000000000..111b097b9 --- /dev/null +++ b/models/components/rerank.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Rerank struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (r *Rerank) GetLatency() *PercentileStats { + if r == nil { + return nil + } + return r.Latency +} + +func (r *Rerank) GetRequestCount() *int64 { + if r == nil { + return nil + } + return r.RequestCount +} + +func (r *Rerank) GetThroughput() *PercentileStats { + if r == nil { + return nil + } + return r.Throughput +} diff --git a/models/components/stt.go b/models/components/stt.go new file mode 100644 index 000000000..d4da868aa --- /dev/null +++ b/models/components/stt.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type STT struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (s *STT) GetLatency() *PercentileStats { + if s == nil { + return nil + } + return s.Latency +} + +func (s *STT) GetRequestCount() *int64 { + if s == nil { + return nil + } + return s.RequestCount +} + +func (s *STT) GetThroughput() *PercentileStats { + if s == nil { + return nil + } + return s.Throughput +} diff --git a/models/components/textgeneration.go b/models/components/textgeneration.go new file mode 100644 index 000000000..1582a7c93 --- /dev/null +++ b/models/components/textgeneration.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TextGeneration struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (t *TextGeneration) GetLatency() *PercentileStats { + if t == nil { + return nil + } + return t.Latency +} + +func (t *TextGeneration) GetRequestCount() *int64 { + if t == nil { + return nil + } + return t.RequestCount +} + +func (t *TextGeneration) GetThroughput() *PercentileStats { + if t == nil { + return nil + } + return t.Throughput +} diff --git a/models/components/tts.go b/models/components/tts.go new file mode 100644 index 000000000..e32eea93b --- /dev/null +++ b/models/components/tts.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TTS struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (t *TTS) GetLatency() *PercentileStats { + if t == nil { + return nil + } + return t.Latency +} + +func (t *TTS) GetRequestCount() *int64 { + if t == nil { + return nil + } + return t.RequestCount +} + +func (t *TTS) GetThroughput() *PercentileStats { + if t == nil { + return nil + } + return t.Throughput +} diff --git a/models/components/unknown.go b/models/components/unknown.go new file mode 100644 index 000000000..e2998e9bb --- /dev/null +++ b/models/components/unknown.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Unknown struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (u *Unknown) GetLatency() *PercentileStats { + if u == nil { + return nil + } + return u.Latency +} + +func (u *Unknown) GetRequestCount() *int64 { + if u == nil { + return nil + } + return u.RequestCount +} + +func (u *Unknown) GetThroughput() *PercentileStats { + if u == nil { + return nil + } + return u.Throughput +} diff --git a/models/components/videogeneration.go b/models/components/videogeneration.go new file mode 100644 index 000000000..3c344f603 --- /dev/null +++ b/models/components/videogeneration.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type VideoGeneration struct { + Latency *PercentileStats `json:"latency"` + // Total requests admitted for this workload in the window. + RequestCount *int64 `json:"request_count"` + Throughput *PercentileStats `json:"throughput"` +} + +func (v *VideoGeneration) GetLatency() *PercentileStats { + if v == nil { + return nil + } + return v.Latency +} + +func (v *VideoGeneration) GetRequestCount() *int64 { + if v == nil { + return nil + } + return v.RequestCount +} + +func (v *VideoGeneration) GetThroughput() *PercentileStats { + if v == nil { + return nil + } + return v.Throughput +} diff --git a/models/operations/listendpointszdr.go b/models/operations/listendpointszdr.go index de2caab37..84a3ce135 100644 --- a/models/operations/listendpointszdr.go +++ b/models/operations/listendpointszdr.go @@ -8,12 +8,12 @@ import ( // ListEndpointsZdrResponse - Returns a list of endpoints type ListEndpointsZdrResponse struct { - Data []components.PublicEndpoint `json:"data"` + Data []components.PublicZdrEndpoint `json:"data"` } -func (l *ListEndpointsZdrResponse) GetData() []components.PublicEndpoint { +func (l *ListEndpointsZdrResponse) GetData() []components.PublicZdrEndpoint { if l == nil { - return []components.PublicEndpoint{} + return []components.PublicZdrEndpoint{} } return l.Data } diff --git a/openrouter.go b/openrouter.go index d9d578fde..7d914d28e 100644 --- a/openrouter.go +++ b/openrouter.go @@ -219,10 +219,10 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *OpenRouter { sdk := &OpenRouter{ - SDKVersion: "0.9.98", + SDKVersion: "0.9.99", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.9.98 2.950.13 1.0.0 github.com/OpenRouterTeam/go-sdk", - SDKVersion: "0.9.98", + UserAgent: "speakeasy-sdk/go 0.9.99 2.950.13 1.0.0 github.com/OpenRouterTeam/go-sdk", + SDKVersion: "0.9.99", GenVersion: "2.950.13", OpenAPIDocVersion: "1.0.0", Globals: globals.Globals{}, From e775320c8243fbccdd203f260e5996c56bbde662 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:29:04 +0000 Subject: [PATCH 2/2] docs: sync install snippets to v0.9.99 --- OVERVIEW.md | 2 +- README.md | 2 +- doc.go | 2 +- example_test.go | 2 +- examples/README.md | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OVERVIEW.md b/OVERVIEW.md index 7525afad6..83b15a0f7 100644 --- a/OVERVIEW.md +++ b/OVERVIEW.md @@ -117,7 +117,7 @@ go get github.com/OpenRouterTeam/go-sdk For beta releases, pin an explicit version: ```bash -go get github.com/OpenRouterTeam/go-sdk@v0.9.98 +go get github.com/OpenRouterTeam/go-sdk@v0.9.99 ``` **Requirements:** Go 1.26.10 or higher diff --git a/README.md b/README.md index 659f64b1d..ef8a70b99 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To learn more, see the [API Reference](https://openrouter.ai/docs/sdks/go/api-re > This SDK is in **beta**. Pin to a specific version to avoid unexpected breaking changes: > > ```bash -> go get github.com/OpenRouterTeam/go-sdk@v0.9.98 +> go get github.com/OpenRouterTeam/go-sdk@v0.9.99 > ``` diff --git a/doc.go b/doc.go index 271f1dfda..7d33243f1 100644 --- a/doc.go +++ b/doc.go @@ -6,7 +6,7 @@ provider selection, and unified billing. This SDK is in beta. Pin to a specific module version to avoid unexpected breaking changes: - go get github.com/OpenRouterTeam/go-sdk@v0.9.98 + go get github.com/OpenRouterTeam/go-sdk@v0.9.99 For full API documentation, visit: https://openrouter.ai/docs/client-sdks/go/overview diff --git a/example_test.go b/example_test.go index 5d634f080..c21680d20 100644 --- a/example_test.go +++ b/example_test.go @@ -18,7 +18,7 @@ func ExampleNew() { openrouter.WithSecurity("your-api-key"), ) fmt.Println(sdk.SDKVersion) - // Output: 0.9.98 + // Output: 0.9.99 } // Example demonstrates basic usage of the OpenRouter SDK for chat completions. diff --git a/examples/README.md b/examples/README.md index 18c281710..a2ccbe090 100644 --- a/examples/README.md +++ b/examples/README.md @@ -43,7 +43,7 @@ cd ../generation && go run . Each example pins a released SDK version in `go.mod`: ```go -require github.com/OpenRouterTeam/go-sdk v0.9.98 +require github.com/OpenRouterTeam/go-sdk v0.9.99 ``` This should match the version in [README.md](../README.md) and `.speakeasy/gen.lock` `releaseVersion`. CI runs `scripts/bump-examples.sh` after releases to keep these in sync. @@ -51,7 +51,7 @@ This should match the version in [README.md](../README.md) and `.speakeasy/gen.l To use a different version: ```bash -go get github.com/OpenRouterTeam/go-sdk@v0.9.98 +go get github.com/OpenRouterTeam/go-sdk@v0.9.99 go run . ```