[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openrouter-openrouter-tts":3,"mdc--ol0yrg-key":33,"related-org-openrouter-openrouter-tts":2948,"related-repo-openrouter-openrouter-tts":3091},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":31,"mdContent":32},"openrouter-tts","generate speech audio with OpenRouter","Generate speech audio from text using OpenRouter's text-to-speech API. Use when the user asks to synthesize speech, narrate text, create a voiceover, generate an audiobook clip, read text aloud, convert text to an audio file, or mentions TTS, text-to-speech, or voice synthesis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"openrouter","OpenRouter","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fopenrouter.png","OpenRouterTeam",[13,17,20],{"name":14,"slug":15,"type":16},"LLM","llm","tag",{"name":18,"slug":19,"type":16},"Text-to-Speech","text-to-speech",{"name":21,"slug":22,"type":16},"Audio","audio",187,"https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Fskills","2026-07-14T05:38:14.965825",null,26,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":26},[],"https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Fopenrouter-tts","---\nname: openrouter-tts\ndescription: Generate speech audio from text using OpenRouter's text-to-speech API. Use when the user asks to synthesize speech, narrate text, create a voiceover, generate an audiobook clip, read text aloud, convert text to an audio file, or mentions TTS, text-to-speech, or voice synthesis.\n---\n\n# OpenRouter Text-to-Speech\n\nSynthesize speech via `POST \u002Fapi\u002Fv1\u002Faudio\u002Fspeech` using `curl`. The endpoint is OpenAI-compatible, so the OpenAI SDKs work by pointing them at `https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1`. Requires `OPENROUTER_API_KEY` (get one at https:\u002F\u002Fopenrouter.ai\u002Fkeys). If unset, stop and ask.\n\n## One call, raw bytes back\n\nThe response body is the audio bytes — write them to a file with the extension matching `response_format`. It is **not JSON**; error responses are, so only try to parse JSON when the status is non-200.\n\nTwo response headers are worth keeping:\n\n- `Content-Type` — `audio\u002Fmpeg` for mp3; for pcm it includes the sample rate and channel count, e.g. `audio\u002Fpcm;rate=24000;channels=1`. Parse these parameters if you need to wrap the raw bytes into a WAV container.\n- `X-Generation-Id` — the generation ID (format `gen-tts-\u003Ctimestamp>-\u003Csuffix>`), useful for tracking, debugging, and cost lookups.\n\n## Drop-in workflow\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\nMODEL=\"openai\u002Fgpt-4o-mini-tts-2025-12-15\"\nVOICE=\"alloy\"\nFORMAT=\"mp3\"                          # mp3 or pcm\nINPUT=\"Hello! This is a text-to-speech test.\"\nOUTPUT=\"speech-$(date +%Y%m%d-%H%M%S).${FORMAT}\"\nHEADERS=$(mktemp)\n\npayload=$(jq -n --arg model \"$MODEL\" --arg input \"$INPUT\" \\\n               --arg voice \"$VOICE\" --arg fmt \"$FORMAT\" \\\n  '{model: $model, input: $input, voice: $voice, response_format: $fmt}')\n\nhttp_code=$(curl -sS -X POST https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Faudio\u002Fspeech \\\n  -H \"Authorization: Bearer $OPENROUTER_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -D \"$HEADERS\" \\\n  --output \"$OUTPUT\" \\\n  -w '%{http_code}' \\\n  -d \"$payload\")\n\nif [[ \"$http_code\" != \"200\" ]]; then\n  echo \"TTS failed (HTTP $http_code):\" >&2\n  cat \"$OUTPUT\" >&2                   # error body is JSON, not audio\n  rm -f \"$OUTPUT\" \"$HEADERS\"\n  exit 1\nfi\n\ngen_id=$(grep -i '^x-generation-id:' \"$HEADERS\" | awk '{print $2}' | tr -d '\\r')\nrm -f \"$HEADERS\"\necho \"Saved $(realpath \"$OUTPUT\") (generation_id=${gen_id:-unknown})\"\n```\n\n## Discovering TTS models and voices\n\nFilter the models endpoint by output modality to list speech models. Each model carries a `supported_voices` array with the exact voice IDs that provider accepts.\n\n```bash\n# Models + voices in one shot\ncurl -sS \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Fmodels?output_modalities=speech\" \\\n  | jq '.data[] | {id, name, supported_voices, pricing}'\n\n# Just the voices for a specific model\ncurl -sS \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Fmodels?output_modalities=speech\" \\\n  | jq -r '.data[] | select(.id==\"openai\u002Fgpt-4o-mini-tts-2025-12-15\") | .supported_voices[]'\n```\n\nVoices are provider-namespaced: OpenAI uses short names (`alloy`, `nova`), Voxtral encodes language + persona + emotion (`en_paul_happy`), Kokoro prefixes with language\u002Fgender (`af_bella` = American female Bella).\n\n## Parameters\n\n| Field             | Required | Notes                                                                                                             |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| `model`           | yes      | TTS model slug (e.g. `openai\u002Fgpt-4o-mini-tts-2025-12-15`, `mistralai\u002Fvoxtral-mini-tts-2603`).                     |\n| `input`           | yes      | The text to synthesize.                                                                                           |\n| `voice`           | yes      | Voice identifier. Look up the exact set for your model in `supported_voices` on the models endpoint (see the discovery section above). Voices are provider-namespaced — e.g. `alloy` is an OpenAI voice and will not work on Voxtral or Kokoro. |\n| `response_format` | no       | `mp3` or `pcm`. Default is `pcm`. **Set this explicitly** — the default is usually not what a user wants to save. |\n| `speed`           | no       | Playback multiplier (e.g. `1.25`). Honored by OpenAI TTS. Other providers may accept and ignore it, or reject unknown fields — check the provider's behavior if it matters. |\n| `provider`        | no       | Provider passthrough — see below.                                                                                 |\n\n### Picking a format\n\n- **`mp3`** (`audio\u002Fmpeg`) — compressed, ready to play in any audio app. Default choice for files the user will listen to or share.\n- **`pcm`** (`audio\u002Fpcm;rate=\u003Crate>;channels=\u003Cn>`) — uncompressed raw samples. The response `Content-Type` carries the sample rate and channel count (e.g. `rate=24000;channels=1` for OpenAI TTS), which you'll need if you wrap the bytes into a WAV container. Lower latency for real-time streaming pipelines, but not directly playable on its own. Pick this only when the user explicitly wants raw audio or is piping into a streaming system.\n\nMatch the file extension to the format — saving pcm bytes as `.mp3` produces a file no player will open, and this is the most common cause of \"empty\u002Fcorrupted audio\" reports.\n\n## Provider-specific options\n\nProvider passthrough goes under `provider.options.\u003Cslug>` and is only forwarded when that provider handles the request. The most useful one is OpenAI's `instructions`, which steers tone, accent, pacing, or emotion without retraining:\n\n```json\n{\n  \"model\": \"openai\u002Fgpt-4o-mini-tts-2025-12-15\",\n  \"input\": \"Welcome to the show.\",\n  \"voice\": \"alloy\",\n  \"response_format\": \"mp3\",\n  \"provider\": {\n    \"options\": {\n      \"openai\": {\n        \"instructions\": \"Speak in a warm, friendly tone with a slow pace.\"\n      }\n    }\n  }\n}\n```\n\nFor other providers, check each provider's upstream docs for available passthrough keys — naming conventions vary (camelCase for OpenAI\u002FGoogle, snake_case for most others).\n\n## OpenAI SDK compatibility\n\nBecause the endpoint mirrors OpenAI's `\u002Faudio\u002Fspeech`, both OpenAI SDKs work by swapping the base URL. Prefer this when the user is already in a Python\u002FTypeScript project and doesn't want to shell out.\n\n```python\n# Python — streaming write to file\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\",\n                api_key=os.environ[\"OPENROUTER_API_KEY\"])\n\nwith client.audio.speech.with_streaming_response.create(\n    model=\"openai\u002Fgpt-4o-mini-tts-2025-12-15\",\n    input=\"The quick brown fox jumps over the lazy dog.\",\n    voice=\"nova\",\n    response_format=\"mp3\",\n) as response:\n    response.stream_to_file(\"output.mp3\")\n```\n\n```typescript\n\u002F\u002F TypeScript — collect bytes, write once\nimport OpenAI from \"openai\";\nimport fs from \"fs\";\n\nconst client = new OpenAI({\n  baseURL: \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\",\n  apiKey: process.env.OPENROUTER_API_KEY!,\n});\n\nconst response = await client.audio.speech.create({\n  model: \"openai\u002Fgpt-4o-mini-tts-2025-12-15\",\n  input: \"The quick brown fox jumps over the lazy dog.\",\n  voice: \"nova\",\n  response_format: \"mp3\",\n});\n\nawait fs.promises.writeFile(\n  \"output.mp3\",\n  Buffer.from(await response.arrayBuffer()),\n);\n```\n\n## Long inputs\n\nTTS models have per-request character limits (usually a few thousand characters) and are priced **per character of input**, so there's no penalty to splitting. For anything long (chapters, articles, scripts):\n\n1. Split the text at sentence or paragraph boundaries — never mid-word.\n2. Synthesize each chunk with the same `model` + `voice` so prosody stays consistent.\n3. Concatenate the resulting audio files. For mp3, `ffmpeg -i \"concat:part1.mp3|part2.mp3\" -c copy out.mp3` works for simple cases; for mixed bitrates or tight seams, re-encode via `ffmpeg -f concat -safe 0 -i list.txt output.mp3`.\n\nSplitting also improves time-to-first-audio if you stream chunks to a user as they're generated.\n\n## Troubleshooting\n\n**\"Empty\" or unplayable audio file** — almost always a format\u002Fextension mismatch. Check `Content-Type` in the response headers: `audio\u002Fpcm` saved as `.mp3` will not play. Either re-request with `response_format: \"mp3\"` or save with the matching extension.\n\n**400 with `\"Model X does not exist\"`** — the slug is wrong. Use the full dated slug from the models endpoint (`openai\u002Fgpt-4o-mini-tts-2025-12-15`, not `gpt-4o-mini-tts`).\n\n**400 with a `ZodError`** — a required field is missing or the wrong type. The body looks like `{\"success\":false,\"error\":{\"name\":\"ZodError\",\"message\":\"[...]\"}}` — the nested `message` JSON string names the bad path (e.g. `\"path\":[\"voice\"]`).\n\n**`speed` has no effect** — the provider probably doesn't support it. OpenAI TTS honors it; for other providers, check upstream docs before relying on it.\n\n## References\n\n- [TTS guide](https:\u002F\u002Fopenrouter.ai\u002Fdocs\u002Fguides\u002Foverview\u002Fmultimodal\u002Ftts)\n- [Models page — filter to speech output](https:\u002F\u002Fopenrouter.ai\u002Fmodels?output_modalities=speech)\n",{"data":34,"body":35},{"name":4,"description":6},{"type":36,"children":37},"root",[38,47,96,103,124,129,180,186,1211,1217,1230,1371,1407,1413,1636,1643,1701,1714,1720,1741,2043,2048,2054,2067,2186,2712,2718,2730,2778,2783,2789,2829,2859,2898,2913,2919,2942],{"type":39,"tag":40,"props":41,"children":43},"element","h1",{"id":42},"openrouter-text-to-speech",[44],{"type":45,"value":46},"text","OpenRouter Text-to-Speech",{"type":39,"tag":48,"props":49,"children":50},"p",{},[51,53,60,62,68,70,76,78,84,86,94],{"type":45,"value":52},"Synthesize speech via ",{"type":39,"tag":54,"props":55,"children":57},"code",{"className":56},[],[58],{"type":45,"value":59},"POST \u002Fapi\u002Fv1\u002Faudio\u002Fspeech",{"type":45,"value":61}," using ",{"type":39,"tag":54,"props":63,"children":65},{"className":64},[],[66],{"type":45,"value":67},"curl",{"type":45,"value":69},". The endpoint is OpenAI-compatible, so the OpenAI SDKs work by pointing them at ",{"type":39,"tag":54,"props":71,"children":73},{"className":72},[],[74],{"type":45,"value":75},"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1",{"type":45,"value":77},". Requires ",{"type":39,"tag":54,"props":79,"children":81},{"className":80},[],[82],{"type":45,"value":83},"OPENROUTER_API_KEY",{"type":45,"value":85}," (get one at ",{"type":39,"tag":87,"props":88,"children":92},"a",{"href":89,"rel":90},"https:\u002F\u002Fopenrouter.ai\u002Fkeys",[91],"nofollow",[93],{"type":45,"value":89},{"type":45,"value":95},"). If unset, stop and ask.",{"type":39,"tag":97,"props":98,"children":100},"h2",{"id":99},"one-call-raw-bytes-back",[101],{"type":45,"value":102},"One call, raw bytes back",{"type":39,"tag":48,"props":104,"children":105},{},[106,108,114,116,122],{"type":45,"value":107},"The response body is the audio bytes — write them to a file with the extension matching ",{"type":39,"tag":54,"props":109,"children":111},{"className":110},[],[112],{"type":45,"value":113},"response_format",{"type":45,"value":115},". It is ",{"type":39,"tag":117,"props":118,"children":119},"strong",{},[120],{"type":45,"value":121},"not JSON",{"type":45,"value":123},"; error responses are, so only try to parse JSON when the status is non-200.",{"type":39,"tag":48,"props":125,"children":126},{},[127],{"type":45,"value":128},"Two response headers are worth keeping:",{"type":39,"tag":130,"props":131,"children":132},"ul",{},[133,161],{"type":39,"tag":134,"props":135,"children":136},"li",{},[137,143,145,151,153,159],{"type":39,"tag":54,"props":138,"children":140},{"className":139},[],[141],{"type":45,"value":142},"Content-Type",{"type":45,"value":144}," — ",{"type":39,"tag":54,"props":146,"children":148},{"className":147},[],[149],{"type":45,"value":150},"audio\u002Fmpeg",{"type":45,"value":152}," for mp3; for pcm it includes the sample rate and channel count, e.g. ",{"type":39,"tag":54,"props":154,"children":156},{"className":155},[],[157],{"type":45,"value":158},"audio\u002Fpcm;rate=24000;channels=1",{"type":45,"value":160},". Parse these parameters if you need to wrap the raw bytes into a WAV container.",{"type":39,"tag":134,"props":162,"children":163},{},[164,170,172,178],{"type":39,"tag":54,"props":165,"children":167},{"className":166},[],[168],{"type":45,"value":169},"X-Generation-Id",{"type":45,"value":171}," — the generation ID (format ",{"type":39,"tag":54,"props":173,"children":175},{"className":174},[],[176],{"type":45,"value":177},"gen-tts-\u003Ctimestamp>-\u003Csuffix>",{"type":45,"value":179},"), useful for tracking, debugging, and cost lookups.",{"type":39,"tag":97,"props":181,"children":183},{"id":182},"drop-in-workflow",[184],{"type":45,"value":185},"Drop-in workflow",{"type":39,"tag":187,"props":188,"children":193},"pre",{"className":189,"code":190,"language":191,"meta":192,"style":192},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\nMODEL=\"openai\u002Fgpt-4o-mini-tts-2025-12-15\"\nVOICE=\"alloy\"\nFORMAT=\"mp3\"                          # mp3 or pcm\nINPUT=\"Hello! This is a text-to-speech test.\"\nOUTPUT=\"speech-$(date +%Y%m%d-%H%M%S).${FORMAT}\"\nHEADERS=$(mktemp)\n\npayload=$(jq -n --arg model \"$MODEL\" --arg input \"$INPUT\" \\\n               --arg voice \"$VOICE\" --arg fmt \"$FORMAT\" \\\n  '{model: $model, input: $input, voice: $voice, response_format: $fmt}')\n\nhttp_code=$(curl -sS -X POST https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Faudio\u002Fspeech \\\n  -H \"Authorization: Bearer $OPENROUTER_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -D \"$HEADERS\" \\\n  --output \"$OUTPUT\" \\\n  -w '%{http_code}' \\\n  -d \"$payload\")\n\nif [[ \"$http_code\" != \"200\" ]]; then\n  echo \"TTS failed (HTTP $http_code):\" >&2\n  cat \"$OUTPUT\" >&2                   # error body is JSON, not audio\n  rm -f \"$OUTPUT\" \"$HEADERS\"\n  exit 1\nfi\n\ngen_id=$(grep -i '^x-generation-id:' \"$HEADERS\" | awk '{print $2}' | tr -d '\\r')\nrm -f \"$HEADERS\"\necho \"Saved $(realpath \"$OUTPUT\") (generation_id=${gen_id:-unknown})\"\n","bash","",[194],{"type":39,"tag":54,"props":195,"children":196},{"__ignoreMap":192},[197,209,230,240,271,297,328,354,416,440,448,522,575,598,606,647,678,703,729,755,782,808,816,872,908,939,976,991,1000,1008,1110,1135],{"type":39,"tag":198,"props":199,"children":202},"span",{"class":200,"line":201},"line",1,[203],{"type":39,"tag":198,"props":204,"children":206},{"style":205},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[207],{"type":45,"value":208},"#!\u002Fusr\u002Fbin\u002Fenv bash\n",{"type":39,"tag":198,"props":210,"children":212},{"class":200,"line":211},2,[213,219,225],{"type":39,"tag":198,"props":214,"children":216},{"style":215},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[217],{"type":45,"value":218},"set",{"type":39,"tag":198,"props":220,"children":222},{"style":221},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[223],{"type":45,"value":224}," -euo",{"type":39,"tag":198,"props":226,"children":227},{"style":221},[228],{"type":45,"value":229}," pipefail\n",{"type":39,"tag":198,"props":231,"children":233},{"class":200,"line":232},3,[234],{"type":39,"tag":198,"props":235,"children":237},{"emptyLinePlaceholder":236},true,[238],{"type":45,"value":239},"\n",{"type":39,"tag":198,"props":241,"children":243},{"class":200,"line":242},4,[244,250,256,261,266],{"type":39,"tag":198,"props":245,"children":247},{"style":246},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[248],{"type":45,"value":249},"MODEL",{"type":39,"tag":198,"props":251,"children":253},{"style":252},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[254],{"type":45,"value":255},"=",{"type":39,"tag":198,"props":257,"children":258},{"style":252},[259],{"type":45,"value":260},"\"",{"type":39,"tag":198,"props":262,"children":263},{"style":221},[264],{"type":45,"value":265},"openai\u002Fgpt-4o-mini-tts-2025-12-15",{"type":39,"tag":198,"props":267,"children":268},{"style":252},[269],{"type":45,"value":270},"\"\n",{"type":39,"tag":198,"props":272,"children":274},{"class":200,"line":273},5,[275,280,284,288,293],{"type":39,"tag":198,"props":276,"children":277},{"style":246},[278],{"type":45,"value":279},"VOICE",{"type":39,"tag":198,"props":281,"children":282},{"style":252},[283],{"type":45,"value":255},{"type":39,"tag":198,"props":285,"children":286},{"style":252},[287],{"type":45,"value":260},{"type":39,"tag":198,"props":289,"children":290},{"style":221},[291],{"type":45,"value":292},"alloy",{"type":39,"tag":198,"props":294,"children":295},{"style":252},[296],{"type":45,"value":270},{"type":39,"tag":198,"props":298,"children":300},{"class":200,"line":299},6,[301,306,310,314,319,323],{"type":39,"tag":198,"props":302,"children":303},{"style":246},[304],{"type":45,"value":305},"FORMAT",{"type":39,"tag":198,"props":307,"children":308},{"style":252},[309],{"type":45,"value":255},{"type":39,"tag":198,"props":311,"children":312},{"style":252},[313],{"type":45,"value":260},{"type":39,"tag":198,"props":315,"children":316},{"style":221},[317],{"type":45,"value":318},"mp3",{"type":39,"tag":198,"props":320,"children":321},{"style":252},[322],{"type":45,"value":260},{"type":39,"tag":198,"props":324,"children":325},{"style":205},[326],{"type":45,"value":327},"                          # mp3 or pcm\n",{"type":39,"tag":198,"props":329,"children":331},{"class":200,"line":330},7,[332,337,341,345,350],{"type":39,"tag":198,"props":333,"children":334},{"style":246},[335],{"type":45,"value":336},"INPUT",{"type":39,"tag":198,"props":338,"children":339},{"style":252},[340],{"type":45,"value":255},{"type":39,"tag":198,"props":342,"children":343},{"style":252},[344],{"type":45,"value":260},{"type":39,"tag":198,"props":346,"children":347},{"style":221},[348],{"type":45,"value":349},"Hello! This is a text-to-speech test.",{"type":39,"tag":198,"props":351,"children":352},{"style":252},[353],{"type":45,"value":270},{"type":39,"tag":198,"props":355,"children":357},{"class":200,"line":356},8,[358,363,367,371,376,381,387,392,397,402,407,411],{"type":39,"tag":198,"props":359,"children":360},{"style":246},[361],{"type":45,"value":362},"OUTPUT",{"type":39,"tag":198,"props":364,"children":365},{"style":252},[366],{"type":45,"value":255},{"type":39,"tag":198,"props":368,"children":369},{"style":252},[370],{"type":45,"value":260},{"type":39,"tag":198,"props":372,"children":373},{"style":221},[374],{"type":45,"value":375},"speech-",{"type":39,"tag":198,"props":377,"children":378},{"style":252},[379],{"type":45,"value":380},"$(",{"type":39,"tag":198,"props":382,"children":384},{"style":383},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[385],{"type":45,"value":386},"date",{"type":39,"tag":198,"props":388,"children":389},{"style":221},[390],{"type":45,"value":391}," +%Y%m%d-%H%M%S",{"type":39,"tag":198,"props":393,"children":394},{"style":252},[395],{"type":45,"value":396},")",{"type":39,"tag":198,"props":398,"children":399},{"style":221},[400],{"type":45,"value":401},".",{"type":39,"tag":198,"props":403,"children":404},{"style":252},[405],{"type":45,"value":406},"${",{"type":39,"tag":198,"props":408,"children":409},{"style":246},[410],{"type":45,"value":305},{"type":39,"tag":198,"props":412,"children":413},{"style":252},[414],{"type":45,"value":415},"}\"\n",{"type":39,"tag":198,"props":417,"children":419},{"class":200,"line":418},9,[420,425,430,435],{"type":39,"tag":198,"props":421,"children":422},{"style":246},[423],{"type":45,"value":424},"HEADERS",{"type":39,"tag":198,"props":426,"children":427},{"style":252},[428],{"type":45,"value":429},"=$(",{"type":39,"tag":198,"props":431,"children":432},{"style":383},[433],{"type":45,"value":434},"mktemp",{"type":39,"tag":198,"props":436,"children":437},{"style":252},[438],{"type":45,"value":439},")\n",{"type":39,"tag":198,"props":441,"children":443},{"class":200,"line":442},10,[444],{"type":39,"tag":198,"props":445,"children":446},{"emptyLinePlaceholder":236},[447],{"type":45,"value":239},{"type":39,"tag":198,"props":449,"children":451},{"class":200,"line":450},11,[452,457,461,466,471,476,481,486,491,495,499,504,508,513,517],{"type":39,"tag":198,"props":453,"children":454},{"style":246},[455],{"type":45,"value":456},"payload",{"type":39,"tag":198,"props":458,"children":459},{"style":252},[460],{"type":45,"value":429},{"type":39,"tag":198,"props":462,"children":463},{"style":383},[464],{"type":45,"value":465},"jq",{"type":39,"tag":198,"props":467,"children":468},{"style":221},[469],{"type":45,"value":470}," -n",{"type":39,"tag":198,"props":472,"children":473},{"style":221},[474],{"type":45,"value":475}," --arg",{"type":39,"tag":198,"props":477,"children":478},{"style":221},[479],{"type":45,"value":480}," model",{"type":39,"tag":198,"props":482,"children":483},{"style":252},[484],{"type":45,"value":485}," \"",{"type":39,"tag":198,"props":487,"children":488},{"style":246},[489],{"type":45,"value":490},"$MODEL",{"type":39,"tag":198,"props":492,"children":493},{"style":252},[494],{"type":45,"value":260},{"type":39,"tag":198,"props":496,"children":497},{"style":221},[498],{"type":45,"value":475},{"type":39,"tag":198,"props":500,"children":501},{"style":221},[502],{"type":45,"value":503}," input",{"type":39,"tag":198,"props":505,"children":506},{"style":252},[507],{"type":45,"value":485},{"type":39,"tag":198,"props":509,"children":510},{"style":246},[511],{"type":45,"value":512},"$INPUT",{"type":39,"tag":198,"props":514,"children":515},{"style":252},[516],{"type":45,"value":260},{"type":39,"tag":198,"props":518,"children":519},{"style":246},[520],{"type":45,"value":521}," \\\n",{"type":39,"tag":198,"props":523,"children":525},{"class":200,"line":524},12,[526,531,536,540,545,549,553,558,562,567,571],{"type":39,"tag":198,"props":527,"children":528},{"style":221},[529],{"type":45,"value":530},"               --arg",{"type":39,"tag":198,"props":532,"children":533},{"style":221},[534],{"type":45,"value":535}," voice",{"type":39,"tag":198,"props":537,"children":538},{"style":252},[539],{"type":45,"value":485},{"type":39,"tag":198,"props":541,"children":542},{"style":246},[543],{"type":45,"value":544},"$VOICE",{"type":39,"tag":198,"props":546,"children":547},{"style":252},[548],{"type":45,"value":260},{"type":39,"tag":198,"props":550,"children":551},{"style":221},[552],{"type":45,"value":475},{"type":39,"tag":198,"props":554,"children":555},{"style":221},[556],{"type":45,"value":557}," fmt",{"type":39,"tag":198,"props":559,"children":560},{"style":252},[561],{"type":45,"value":485},{"type":39,"tag":198,"props":563,"children":564},{"style":246},[565],{"type":45,"value":566},"$FORMAT",{"type":39,"tag":198,"props":568,"children":569},{"style":252},[570],{"type":45,"value":260},{"type":39,"tag":198,"props":572,"children":573},{"style":246},[574],{"type":45,"value":521},{"type":39,"tag":198,"props":576,"children":578},{"class":200,"line":577},13,[579,584,589,594],{"type":39,"tag":198,"props":580,"children":581},{"style":252},[582],{"type":45,"value":583},"  '",{"type":39,"tag":198,"props":585,"children":586},{"style":221},[587],{"type":45,"value":588},"{model: $model, input: $input, voice: $voice, response_format: $fmt}",{"type":39,"tag":198,"props":590,"children":591},{"style":252},[592],{"type":45,"value":593},"'",{"type":39,"tag":198,"props":595,"children":596},{"style":252},[597],{"type":45,"value":439},{"type":39,"tag":198,"props":599,"children":601},{"class":200,"line":600},14,[602],{"type":39,"tag":198,"props":603,"children":604},{"emptyLinePlaceholder":236},[605],{"type":45,"value":239},{"type":39,"tag":198,"props":607,"children":609},{"class":200,"line":608},15,[610,615,619,623,628,633,638,643],{"type":39,"tag":198,"props":611,"children":612},{"style":246},[613],{"type":45,"value":614},"http_code",{"type":39,"tag":198,"props":616,"children":617},{"style":252},[618],{"type":45,"value":429},{"type":39,"tag":198,"props":620,"children":621},{"style":383},[622],{"type":45,"value":67},{"type":39,"tag":198,"props":624,"children":625},{"style":221},[626],{"type":45,"value":627}," -sS",{"type":39,"tag":198,"props":629,"children":630},{"style":221},[631],{"type":45,"value":632}," -X",{"type":39,"tag":198,"props":634,"children":635},{"style":221},[636],{"type":45,"value":637}," POST",{"type":39,"tag":198,"props":639,"children":640},{"style":221},[641],{"type":45,"value":642}," https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Faudio\u002Fspeech",{"type":39,"tag":198,"props":644,"children":645},{"style":246},[646],{"type":45,"value":521},{"type":39,"tag":198,"props":648,"children":650},{"class":200,"line":649},16,[651,656,660,665,670,674],{"type":39,"tag":198,"props":652,"children":653},{"style":221},[654],{"type":45,"value":655},"  -H",{"type":39,"tag":198,"props":657,"children":658},{"style":252},[659],{"type":45,"value":485},{"type":39,"tag":198,"props":661,"children":662},{"style":221},[663],{"type":45,"value":664},"Authorization: Bearer ",{"type":39,"tag":198,"props":666,"children":667},{"style":246},[668],{"type":45,"value":669},"$OPENROUTER_API_KEY",{"type":39,"tag":198,"props":671,"children":672},{"style":252},[673],{"type":45,"value":260},{"type":39,"tag":198,"props":675,"children":676},{"style":246},[677],{"type":45,"value":521},{"type":39,"tag":198,"props":679,"children":681},{"class":200,"line":680},17,[682,686,690,695,699],{"type":39,"tag":198,"props":683,"children":684},{"style":221},[685],{"type":45,"value":655},{"type":39,"tag":198,"props":687,"children":688},{"style":252},[689],{"type":45,"value":485},{"type":39,"tag":198,"props":691,"children":692},{"style":221},[693],{"type":45,"value":694},"Content-Type: application\u002Fjson",{"type":39,"tag":198,"props":696,"children":697},{"style":252},[698],{"type":45,"value":260},{"type":39,"tag":198,"props":700,"children":701},{"style":246},[702],{"type":45,"value":521},{"type":39,"tag":198,"props":704,"children":706},{"class":200,"line":705},18,[707,712,716,721,725],{"type":39,"tag":198,"props":708,"children":709},{"style":221},[710],{"type":45,"value":711},"  -D",{"type":39,"tag":198,"props":713,"children":714},{"style":252},[715],{"type":45,"value":485},{"type":39,"tag":198,"props":717,"children":718},{"style":246},[719],{"type":45,"value":720},"$HEADERS",{"type":39,"tag":198,"props":722,"children":723},{"style":252},[724],{"type":45,"value":260},{"type":39,"tag":198,"props":726,"children":727},{"style":246},[728],{"type":45,"value":521},{"type":39,"tag":198,"props":730,"children":732},{"class":200,"line":731},19,[733,738,742,747,751],{"type":39,"tag":198,"props":734,"children":735},{"style":221},[736],{"type":45,"value":737},"  --output",{"type":39,"tag":198,"props":739,"children":740},{"style":252},[741],{"type":45,"value":485},{"type":39,"tag":198,"props":743,"children":744},{"style":246},[745],{"type":45,"value":746},"$OUTPUT",{"type":39,"tag":198,"props":748,"children":749},{"style":252},[750],{"type":45,"value":260},{"type":39,"tag":198,"props":752,"children":753},{"style":246},[754],{"type":45,"value":521},{"type":39,"tag":198,"props":756,"children":758},{"class":200,"line":757},20,[759,764,769,774,778],{"type":39,"tag":198,"props":760,"children":761},{"style":221},[762],{"type":45,"value":763},"  -w",{"type":39,"tag":198,"props":765,"children":766},{"style":252},[767],{"type":45,"value":768}," '",{"type":39,"tag":198,"props":770,"children":771},{"style":221},[772],{"type":45,"value":773},"%{http_code}",{"type":39,"tag":198,"props":775,"children":776},{"style":252},[777],{"type":45,"value":593},{"type":39,"tag":198,"props":779,"children":780},{"style":246},[781],{"type":45,"value":521},{"type":39,"tag":198,"props":783,"children":785},{"class":200,"line":784},21,[786,791,795,800,804],{"type":39,"tag":198,"props":787,"children":788},{"style":221},[789],{"type":45,"value":790},"  -d",{"type":39,"tag":198,"props":792,"children":793},{"style":252},[794],{"type":45,"value":485},{"type":39,"tag":198,"props":796,"children":797},{"style":246},[798],{"type":45,"value":799},"$payload",{"type":39,"tag":198,"props":801,"children":802},{"style":252},[803],{"type":45,"value":260},{"type":39,"tag":198,"props":805,"children":806},{"style":252},[807],{"type":45,"value":439},{"type":39,"tag":198,"props":809,"children":811},{"class":200,"line":810},22,[812],{"type":39,"tag":198,"props":813,"children":814},{"emptyLinePlaceholder":236},[815],{"type":45,"value":239},{"type":39,"tag":198,"props":817,"children":819},{"class":200,"line":818},23,[820,826,831,835,840,844,849,853,858,862,867],{"type":39,"tag":198,"props":821,"children":823},{"style":822},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[824],{"type":45,"value":825},"if",{"type":39,"tag":198,"props":827,"children":828},{"style":252},[829],{"type":45,"value":830}," [[",{"type":39,"tag":198,"props":832,"children":833},{"style":252},[834],{"type":45,"value":485},{"type":39,"tag":198,"props":836,"children":837},{"style":246},[838],{"type":45,"value":839},"$http_code",{"type":39,"tag":198,"props":841,"children":842},{"style":252},[843],{"type":45,"value":260},{"type":39,"tag":198,"props":845,"children":846},{"style":252},[847],{"type":45,"value":848}," !=",{"type":39,"tag":198,"props":850,"children":851},{"style":252},[852],{"type":45,"value":485},{"type":39,"tag":198,"props":854,"children":855},{"style":221},[856],{"type":45,"value":857},"200",{"type":39,"tag":198,"props":859,"children":860},{"style":252},[861],{"type":45,"value":260},{"type":39,"tag":198,"props":863,"children":864},{"style":252},[865],{"type":45,"value":866}," ]];",{"type":39,"tag":198,"props":868,"children":869},{"style":822},[870],{"type":45,"value":871}," then\n",{"type":39,"tag":198,"props":873,"children":875},{"class":200,"line":874},24,[876,881,885,890,894,899,903],{"type":39,"tag":198,"props":877,"children":878},{"style":215},[879],{"type":45,"value":880},"  echo",{"type":39,"tag":198,"props":882,"children":883},{"style":252},[884],{"type":45,"value":485},{"type":39,"tag":198,"props":886,"children":887},{"style":221},[888],{"type":45,"value":889},"TTS failed (HTTP ",{"type":39,"tag":198,"props":891,"children":892},{"style":246},[893],{"type":45,"value":839},{"type":39,"tag":198,"props":895,"children":896},{"style":221},[897],{"type":45,"value":898},"):",{"type":39,"tag":198,"props":900,"children":901},{"style":252},[902],{"type":45,"value":260},{"type":39,"tag":198,"props":904,"children":905},{"style":252},[906],{"type":45,"value":907}," >&2\n",{"type":39,"tag":198,"props":909,"children":911},{"class":200,"line":910},25,[912,917,921,925,929,934],{"type":39,"tag":198,"props":913,"children":914},{"style":383},[915],{"type":45,"value":916},"  cat",{"type":39,"tag":198,"props":918,"children":919},{"style":252},[920],{"type":45,"value":485},{"type":39,"tag":198,"props":922,"children":923},{"style":246},[924],{"type":45,"value":746},{"type":39,"tag":198,"props":926,"children":927},{"style":252},[928],{"type":45,"value":260},{"type":39,"tag":198,"props":930,"children":931},{"style":252},[932],{"type":45,"value":933}," >&2",{"type":39,"tag":198,"props":935,"children":936},{"style":205},[937],{"type":45,"value":938},"                   # error body is JSON, not audio\n",{"type":39,"tag":198,"props":940,"children":941},{"class":200,"line":27},[942,947,952,956,960,964,968,972],{"type":39,"tag":198,"props":943,"children":944},{"style":383},[945],{"type":45,"value":946},"  rm",{"type":39,"tag":198,"props":948,"children":949},{"style":221},[950],{"type":45,"value":951}," -f",{"type":39,"tag":198,"props":953,"children":954},{"style":252},[955],{"type":45,"value":485},{"type":39,"tag":198,"props":957,"children":958},{"style":246},[959],{"type":45,"value":746},{"type":39,"tag":198,"props":961,"children":962},{"style":252},[963],{"type":45,"value":260},{"type":39,"tag":198,"props":965,"children":966},{"style":252},[967],{"type":45,"value":485},{"type":39,"tag":198,"props":969,"children":970},{"style":246},[971],{"type":45,"value":720},{"type":39,"tag":198,"props":973,"children":974},{"style":252},[975],{"type":45,"value":270},{"type":39,"tag":198,"props":977,"children":979},{"class":200,"line":978},27,[980,985],{"type":39,"tag":198,"props":981,"children":982},{"style":215},[983],{"type":45,"value":984},"  exit",{"type":39,"tag":198,"props":986,"children":988},{"style":987},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[989],{"type":45,"value":990}," 1\n",{"type":39,"tag":198,"props":992,"children":994},{"class":200,"line":993},28,[995],{"type":39,"tag":198,"props":996,"children":997},{"style":822},[998],{"type":45,"value":999},"fi\n",{"type":39,"tag":198,"props":1001,"children":1003},{"class":200,"line":1002},29,[1004],{"type":39,"tag":198,"props":1005,"children":1006},{"emptyLinePlaceholder":236},[1007],{"type":45,"value":239},{"type":39,"tag":198,"props":1009,"children":1011},{"class":200,"line":1010},30,[1012,1017,1021,1026,1031,1035,1040,1044,1048,1052,1056,1061,1066,1070,1075,1079,1083,1088,1093,1097,1102,1106],{"type":39,"tag":198,"props":1013,"children":1014},{"style":246},[1015],{"type":45,"value":1016},"gen_id",{"type":39,"tag":198,"props":1018,"children":1019},{"style":252},[1020],{"type":45,"value":429},{"type":39,"tag":198,"props":1022,"children":1023},{"style":383},[1024],{"type":45,"value":1025},"grep",{"type":39,"tag":198,"props":1027,"children":1028},{"style":221},[1029],{"type":45,"value":1030}," -i",{"type":39,"tag":198,"props":1032,"children":1033},{"style":252},[1034],{"type":45,"value":768},{"type":39,"tag":198,"props":1036,"children":1037},{"style":221},[1038],{"type":45,"value":1039},"^x-generation-id:",{"type":39,"tag":198,"props":1041,"children":1042},{"style":252},[1043],{"type":45,"value":593},{"type":39,"tag":198,"props":1045,"children":1046},{"style":252},[1047],{"type":45,"value":485},{"type":39,"tag":198,"props":1049,"children":1050},{"style":246},[1051],{"type":45,"value":720},{"type":39,"tag":198,"props":1053,"children":1054},{"style":252},[1055],{"type":45,"value":260},{"type":39,"tag":198,"props":1057,"children":1058},{"style":252},[1059],{"type":45,"value":1060}," |",{"type":39,"tag":198,"props":1062,"children":1063},{"style":383},[1064],{"type":45,"value":1065}," awk",{"type":39,"tag":198,"props":1067,"children":1068},{"style":252},[1069],{"type":45,"value":768},{"type":39,"tag":198,"props":1071,"children":1072},{"style":221},[1073],{"type":45,"value":1074},"{print $2}",{"type":39,"tag":198,"props":1076,"children":1077},{"style":252},[1078],{"type":45,"value":593},{"type":39,"tag":198,"props":1080,"children":1081},{"style":252},[1082],{"type":45,"value":1060},{"type":39,"tag":198,"props":1084,"children":1085},{"style":383},[1086],{"type":45,"value":1087}," tr",{"type":39,"tag":198,"props":1089,"children":1090},{"style":221},[1091],{"type":45,"value":1092}," -d",{"type":39,"tag":198,"props":1094,"children":1095},{"style":252},[1096],{"type":45,"value":768},{"type":39,"tag":198,"props":1098,"children":1099},{"style":221},[1100],{"type":45,"value":1101},"\\r",{"type":39,"tag":198,"props":1103,"children":1104},{"style":252},[1105],{"type":45,"value":593},{"type":39,"tag":198,"props":1107,"children":1108},{"style":252},[1109],{"type":45,"value":439},{"type":39,"tag":198,"props":1111,"children":1113},{"class":200,"line":1112},31,[1114,1119,1123,1127,1131],{"type":39,"tag":198,"props":1115,"children":1116},{"style":383},[1117],{"type":45,"value":1118},"rm",{"type":39,"tag":198,"props":1120,"children":1121},{"style":221},[1122],{"type":45,"value":951},{"type":39,"tag":198,"props":1124,"children":1125},{"style":252},[1126],{"type":45,"value":485},{"type":39,"tag":198,"props":1128,"children":1129},{"style":246},[1130],{"type":45,"value":720},{"type":39,"tag":198,"props":1132,"children":1133},{"style":252},[1134],{"type":45,"value":270},{"type":39,"tag":198,"props":1136,"children":1138},{"class":200,"line":1137},32,[1139,1144,1148,1153,1157,1162,1166,1170,1175,1180,1184,1188,1193,1198,1203,1207],{"type":39,"tag":198,"props":1140,"children":1141},{"style":215},[1142],{"type":45,"value":1143},"echo",{"type":39,"tag":198,"props":1145,"children":1146},{"style":252},[1147],{"type":45,"value":485},{"type":39,"tag":198,"props":1149,"children":1150},{"style":221},[1151],{"type":45,"value":1152},"Saved ",{"type":39,"tag":198,"props":1154,"children":1155},{"style":252},[1156],{"type":45,"value":380},{"type":39,"tag":198,"props":1158,"children":1159},{"style":383},[1160],{"type":45,"value":1161},"realpath",{"type":39,"tag":198,"props":1163,"children":1164},{"style":252},[1165],{"type":45,"value":485},{"type":39,"tag":198,"props":1167,"children":1168},{"style":246},[1169],{"type":45,"value":746},{"type":39,"tag":198,"props":1171,"children":1172},{"style":252},[1173],{"type":45,"value":1174},"\")",{"type":39,"tag":198,"props":1176,"children":1177},{"style":221},[1178],{"type":45,"value":1179}," (generation_id=",{"type":39,"tag":198,"props":1181,"children":1182},{"style":252},[1183],{"type":45,"value":406},{"type":39,"tag":198,"props":1185,"children":1186},{"style":246},[1187],{"type":45,"value":1016},{"type":39,"tag":198,"props":1189,"children":1190},{"style":252},[1191],{"type":45,"value":1192},":-",{"type":39,"tag":198,"props":1194,"children":1195},{"style":246},[1196],{"type":45,"value":1197},"unknown",{"type":39,"tag":198,"props":1199,"children":1200},{"style":252},[1201],{"type":45,"value":1202},"}",{"type":39,"tag":198,"props":1204,"children":1205},{"style":221},[1206],{"type":45,"value":396},{"type":39,"tag":198,"props":1208,"children":1209},{"style":252},[1210],{"type":45,"value":270},{"type":39,"tag":97,"props":1212,"children":1214},{"id":1213},"discovering-tts-models-and-voices",[1215],{"type":45,"value":1216},"Discovering TTS models and voices",{"type":39,"tag":48,"props":1218,"children":1219},{},[1220,1222,1228],{"type":45,"value":1221},"Filter the models endpoint by output modality to list speech models. Each model carries a ",{"type":39,"tag":54,"props":1223,"children":1225},{"className":1224},[],[1226],{"type":45,"value":1227},"supported_voices",{"type":45,"value":1229}," array with the exact voice IDs that provider accepts.",{"type":39,"tag":187,"props":1231,"children":1233},{"className":189,"code":1232,"language":191,"meta":192,"style":192},"# Models + voices in one shot\ncurl -sS \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Fmodels?output_modalities=speech\" \\\n  | jq '.data[] | {id, name, supported_voices, pricing}'\n\n# Just the voices for a specific model\ncurl -sS \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Fmodels?output_modalities=speech\" \\\n  | jq -r '.data[] | select(.id==\"openai\u002Fgpt-4o-mini-tts-2025-12-15\") | .supported_voices[]'\n",[1234],{"type":39,"tag":54,"props":1235,"children":1236},{"__ignoreMap":192},[1237,1245,1273,1300,1307,1315,1342],{"type":39,"tag":198,"props":1238,"children":1239},{"class":200,"line":201},[1240],{"type":39,"tag":198,"props":1241,"children":1242},{"style":205},[1243],{"type":45,"value":1244},"# Models + voices in one shot\n",{"type":39,"tag":198,"props":1246,"children":1247},{"class":200,"line":211},[1248,1252,1256,1260,1265,1269],{"type":39,"tag":198,"props":1249,"children":1250},{"style":383},[1251],{"type":45,"value":67},{"type":39,"tag":198,"props":1253,"children":1254},{"style":221},[1255],{"type":45,"value":627},{"type":39,"tag":198,"props":1257,"children":1258},{"style":252},[1259],{"type":45,"value":485},{"type":39,"tag":198,"props":1261,"children":1262},{"style":221},[1263],{"type":45,"value":1264},"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\u002Fmodels?output_modalities=speech",{"type":39,"tag":198,"props":1266,"children":1267},{"style":252},[1268],{"type":45,"value":260},{"type":39,"tag":198,"props":1270,"children":1271},{"style":246},[1272],{"type":45,"value":521},{"type":39,"tag":198,"props":1274,"children":1275},{"class":200,"line":232},[1276,1281,1286,1290,1295],{"type":39,"tag":198,"props":1277,"children":1278},{"style":252},[1279],{"type":45,"value":1280},"  |",{"type":39,"tag":198,"props":1282,"children":1283},{"style":383},[1284],{"type":45,"value":1285}," jq",{"type":39,"tag":198,"props":1287,"children":1288},{"style":252},[1289],{"type":45,"value":768},{"type":39,"tag":198,"props":1291,"children":1292},{"style":221},[1293],{"type":45,"value":1294},".data[] | {id, name, supported_voices, pricing}",{"type":39,"tag":198,"props":1296,"children":1297},{"style":252},[1298],{"type":45,"value":1299},"'\n",{"type":39,"tag":198,"props":1301,"children":1302},{"class":200,"line":242},[1303],{"type":39,"tag":198,"props":1304,"children":1305},{"emptyLinePlaceholder":236},[1306],{"type":45,"value":239},{"type":39,"tag":198,"props":1308,"children":1309},{"class":200,"line":273},[1310],{"type":39,"tag":198,"props":1311,"children":1312},{"style":205},[1313],{"type":45,"value":1314},"# Just the voices for a specific model\n",{"type":39,"tag":198,"props":1316,"children":1317},{"class":200,"line":299},[1318,1322,1326,1330,1334,1338],{"type":39,"tag":198,"props":1319,"children":1320},{"style":383},[1321],{"type":45,"value":67},{"type":39,"tag":198,"props":1323,"children":1324},{"style":221},[1325],{"type":45,"value":627},{"type":39,"tag":198,"props":1327,"children":1328},{"style":252},[1329],{"type":45,"value":485},{"type":39,"tag":198,"props":1331,"children":1332},{"style":221},[1333],{"type":45,"value":1264},{"type":39,"tag":198,"props":1335,"children":1336},{"style":252},[1337],{"type":45,"value":260},{"type":39,"tag":198,"props":1339,"children":1340},{"style":246},[1341],{"type":45,"value":521},{"type":39,"tag":198,"props":1343,"children":1344},{"class":200,"line":330},[1345,1349,1353,1358,1362,1367],{"type":39,"tag":198,"props":1346,"children":1347},{"style":252},[1348],{"type":45,"value":1280},{"type":39,"tag":198,"props":1350,"children":1351},{"style":383},[1352],{"type":45,"value":1285},{"type":39,"tag":198,"props":1354,"children":1355},{"style":221},[1356],{"type":45,"value":1357}," -r",{"type":39,"tag":198,"props":1359,"children":1360},{"style":252},[1361],{"type":45,"value":768},{"type":39,"tag":198,"props":1363,"children":1364},{"style":221},[1365],{"type":45,"value":1366},".data[] | select(.id==\"openai\u002Fgpt-4o-mini-tts-2025-12-15\") | .supported_voices[]",{"type":39,"tag":198,"props":1368,"children":1369},{"style":252},[1370],{"type":45,"value":1299},{"type":39,"tag":48,"props":1372,"children":1373},{},[1374,1376,1381,1383,1389,1391,1397,1399,1405],{"type":45,"value":1375},"Voices are provider-namespaced: OpenAI uses short names (",{"type":39,"tag":54,"props":1377,"children":1379},{"className":1378},[],[1380],{"type":45,"value":292},{"type":45,"value":1382},", ",{"type":39,"tag":54,"props":1384,"children":1386},{"className":1385},[],[1387],{"type":45,"value":1388},"nova",{"type":45,"value":1390},"), Voxtral encodes language + persona + emotion (",{"type":39,"tag":54,"props":1392,"children":1394},{"className":1393},[],[1395],{"type":45,"value":1396},"en_paul_happy",{"type":45,"value":1398},"), Kokoro prefixes with language\u002Fgender (",{"type":39,"tag":54,"props":1400,"children":1402},{"className":1401},[],[1403],{"type":45,"value":1404},"af_bella",{"type":45,"value":1406}," = American female Bella).",{"type":39,"tag":97,"props":1408,"children":1410},{"id":1409},"parameters",[1411],{"type":45,"value":1412},"Parameters",{"type":39,"tag":1414,"props":1415,"children":1416},"table",{},[1417,1441],{"type":39,"tag":1418,"props":1419,"children":1420},"thead",{},[1421],{"type":39,"tag":1422,"props":1423,"children":1424},"tr",{},[1425,1431,1436],{"type":39,"tag":1426,"props":1427,"children":1428},"th",{},[1429],{"type":45,"value":1430},"Field",{"type":39,"tag":1426,"props":1432,"children":1433},{},[1434],{"type":45,"value":1435},"Required",{"type":39,"tag":1426,"props":1437,"children":1438},{},[1439],{"type":45,"value":1440},"Notes",{"type":39,"tag":1442,"props":1443,"children":1444},"tbody",{},[1445,1482,1503,1538,1586,1615],{"type":39,"tag":1422,"props":1446,"children":1447},{},[1448,1458,1463],{"type":39,"tag":1449,"props":1450,"children":1451},"td",{},[1452],{"type":39,"tag":54,"props":1453,"children":1455},{"className":1454},[],[1456],{"type":45,"value":1457},"model",{"type":39,"tag":1449,"props":1459,"children":1460},{},[1461],{"type":45,"value":1462},"yes",{"type":39,"tag":1449,"props":1464,"children":1465},{},[1466,1468,1473,1474,1480],{"type":45,"value":1467},"TTS model slug (e.g. ",{"type":39,"tag":54,"props":1469,"children":1471},{"className":1470},[],[1472],{"type":45,"value":265},{"type":45,"value":1382},{"type":39,"tag":54,"props":1475,"children":1477},{"className":1476},[],[1478],{"type":45,"value":1479},"mistralai\u002Fvoxtral-mini-tts-2603",{"type":45,"value":1481},").",{"type":39,"tag":1422,"props":1483,"children":1484},{},[1485,1494,1498],{"type":39,"tag":1449,"props":1486,"children":1487},{},[1488],{"type":39,"tag":54,"props":1489,"children":1491},{"className":1490},[],[1492],{"type":45,"value":1493},"input",{"type":39,"tag":1449,"props":1495,"children":1496},{},[1497],{"type":45,"value":1462},{"type":39,"tag":1449,"props":1499,"children":1500},{},[1501],{"type":45,"value":1502},"The text to synthesize.",{"type":39,"tag":1422,"props":1504,"children":1505},{},[1506,1515,1519],{"type":39,"tag":1449,"props":1507,"children":1508},{},[1509],{"type":39,"tag":54,"props":1510,"children":1512},{"className":1511},[],[1513],{"type":45,"value":1514},"voice",{"type":39,"tag":1449,"props":1516,"children":1517},{},[1518],{"type":45,"value":1462},{"type":39,"tag":1449,"props":1520,"children":1521},{},[1522,1524,1529,1531,1536],{"type":45,"value":1523},"Voice identifier. Look up the exact set for your model in ",{"type":39,"tag":54,"props":1525,"children":1527},{"className":1526},[],[1528],{"type":45,"value":1227},{"type":45,"value":1530}," on the models endpoint (see the discovery section above). Voices are provider-namespaced — e.g. ",{"type":39,"tag":54,"props":1532,"children":1534},{"className":1533},[],[1535],{"type":45,"value":292},{"type":45,"value":1537}," is an OpenAI voice and will not work on Voxtral or Kokoro.",{"type":39,"tag":1422,"props":1539,"children":1540},{},[1541,1549,1554],{"type":39,"tag":1449,"props":1542,"children":1543},{},[1544],{"type":39,"tag":54,"props":1545,"children":1547},{"className":1546},[],[1548],{"type":45,"value":113},{"type":39,"tag":1449,"props":1550,"children":1551},{},[1552],{"type":45,"value":1553},"no",{"type":39,"tag":1449,"props":1555,"children":1556},{},[1557,1562,1564,1570,1572,1577,1579,1584],{"type":39,"tag":54,"props":1558,"children":1560},{"className":1559},[],[1561],{"type":45,"value":318},{"type":45,"value":1563}," or ",{"type":39,"tag":54,"props":1565,"children":1567},{"className":1566},[],[1568],{"type":45,"value":1569},"pcm",{"type":45,"value":1571},". Default is ",{"type":39,"tag":54,"props":1573,"children":1575},{"className":1574},[],[1576],{"type":45,"value":1569},{"type":45,"value":1578},". ",{"type":39,"tag":117,"props":1580,"children":1581},{},[1582],{"type":45,"value":1583},"Set this explicitly",{"type":45,"value":1585}," — the default is usually not what a user wants to save.",{"type":39,"tag":1422,"props":1587,"children":1588},{},[1589,1598,1602],{"type":39,"tag":1449,"props":1590,"children":1591},{},[1592],{"type":39,"tag":54,"props":1593,"children":1595},{"className":1594},[],[1596],{"type":45,"value":1597},"speed",{"type":39,"tag":1449,"props":1599,"children":1600},{},[1601],{"type":45,"value":1553},{"type":39,"tag":1449,"props":1603,"children":1604},{},[1605,1607,1613],{"type":45,"value":1606},"Playback multiplier (e.g. ",{"type":39,"tag":54,"props":1608,"children":1610},{"className":1609},[],[1611],{"type":45,"value":1612},"1.25",{"type":45,"value":1614},"). Honored by OpenAI TTS. Other providers may accept and ignore it, or reject unknown fields — check the provider's behavior if it matters.",{"type":39,"tag":1422,"props":1616,"children":1617},{},[1618,1627,1631],{"type":39,"tag":1449,"props":1619,"children":1620},{},[1621],{"type":39,"tag":54,"props":1622,"children":1624},{"className":1623},[],[1625],{"type":45,"value":1626},"provider",{"type":39,"tag":1449,"props":1628,"children":1629},{},[1630],{"type":45,"value":1553},{"type":39,"tag":1449,"props":1632,"children":1633},{},[1634],{"type":45,"value":1635},"Provider passthrough — see below.",{"type":39,"tag":1637,"props":1638,"children":1640},"h3",{"id":1639},"picking-a-format",[1641],{"type":45,"value":1642},"Picking a format",{"type":39,"tag":130,"props":1644,"children":1645},{},[1646,1666],{"type":39,"tag":134,"props":1647,"children":1648},{},[1649,1657,1659,1664],{"type":39,"tag":117,"props":1650,"children":1651},{},[1652],{"type":39,"tag":54,"props":1653,"children":1655},{"className":1654},[],[1656],{"type":45,"value":318},{"type":45,"value":1658}," (",{"type":39,"tag":54,"props":1660,"children":1662},{"className":1661},[],[1663],{"type":45,"value":150},{"type":45,"value":1665},") — compressed, ready to play in any audio app. Default choice for files the user will listen to or share.",{"type":39,"tag":134,"props":1667,"children":1668},{},[1669,1677,1678,1684,1686,1691,1693,1699],{"type":39,"tag":117,"props":1670,"children":1671},{},[1672],{"type":39,"tag":54,"props":1673,"children":1675},{"className":1674},[],[1676],{"type":45,"value":1569},{"type":45,"value":1658},{"type":39,"tag":54,"props":1679,"children":1681},{"className":1680},[],[1682],{"type":45,"value":1683},"audio\u002Fpcm;rate=\u003Crate>;channels=\u003Cn>",{"type":45,"value":1685},") — uncompressed raw samples. The response ",{"type":39,"tag":54,"props":1687,"children":1689},{"className":1688},[],[1690],{"type":45,"value":142},{"type":45,"value":1692}," carries the sample rate and channel count (e.g. ",{"type":39,"tag":54,"props":1694,"children":1696},{"className":1695},[],[1697],{"type":45,"value":1698},"rate=24000;channels=1",{"type":45,"value":1700}," for OpenAI TTS), which you'll need if you wrap the bytes into a WAV container. Lower latency for real-time streaming pipelines, but not directly playable on its own. Pick this only when the user explicitly wants raw audio or is piping into a streaming system.",{"type":39,"tag":48,"props":1702,"children":1703},{},[1704,1706,1712],{"type":45,"value":1705},"Match the file extension to the format — saving pcm bytes as ",{"type":39,"tag":54,"props":1707,"children":1709},{"className":1708},[],[1710],{"type":45,"value":1711},".mp3",{"type":45,"value":1713}," produces a file no player will open, and this is the most common cause of \"empty\u002Fcorrupted audio\" reports.",{"type":39,"tag":97,"props":1715,"children":1717},{"id":1716},"provider-specific-options",[1718],{"type":45,"value":1719},"Provider-specific options",{"type":39,"tag":48,"props":1721,"children":1722},{},[1723,1725,1731,1733,1739],{"type":45,"value":1724},"Provider passthrough goes under ",{"type":39,"tag":54,"props":1726,"children":1728},{"className":1727},[],[1729],{"type":45,"value":1730},"provider.options.\u003Cslug>",{"type":45,"value":1732}," and is only forwarded when that provider handles the request. The most useful one is OpenAI's ",{"type":39,"tag":54,"props":1734,"children":1736},{"className":1735},[],[1737],{"type":45,"value":1738},"instructions",{"type":45,"value":1740},", which steers tone, accent, pacing, or emotion without retraining:",{"type":39,"tag":187,"props":1742,"children":1746},{"className":1743,"code":1744,"language":1745,"meta":192,"style":192},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"model\": \"openai\u002Fgpt-4o-mini-tts-2025-12-15\",\n  \"input\": \"Welcome to the show.\",\n  \"voice\": \"alloy\",\n  \"response_format\": \"mp3\",\n  \"provider\": {\n    \"options\": {\n      \"openai\": {\n        \"instructions\": \"Speak in a warm, friendly tone with a slow pace.\"\n      }\n    }\n  }\n}\n","json",[1747],{"type":39,"tag":54,"props":1748,"children":1749},{"__ignoreMap":192},[1750,1758,1797,1833,1868,1903,1927,1952,1977,2011,2019,2027,2035],{"type":39,"tag":198,"props":1751,"children":1752},{"class":200,"line":201},[1753],{"type":39,"tag":198,"props":1754,"children":1755},{"style":252},[1756],{"type":45,"value":1757},"{\n",{"type":39,"tag":198,"props":1759,"children":1760},{"class":200,"line":211},[1761,1766,1771,1775,1780,1784,1788,1792],{"type":39,"tag":198,"props":1762,"children":1763},{"style":252},[1764],{"type":45,"value":1765},"  \"",{"type":39,"tag":198,"props":1767,"children":1769},{"style":1768},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1770],{"type":45,"value":1457},{"type":39,"tag":198,"props":1772,"children":1773},{"style":252},[1774],{"type":45,"value":260},{"type":39,"tag":198,"props":1776,"children":1777},{"style":252},[1778],{"type":45,"value":1779},":",{"type":39,"tag":198,"props":1781,"children":1782},{"style":252},[1783],{"type":45,"value":485},{"type":39,"tag":198,"props":1785,"children":1786},{"style":221},[1787],{"type":45,"value":265},{"type":39,"tag":198,"props":1789,"children":1790},{"style":252},[1791],{"type":45,"value":260},{"type":39,"tag":198,"props":1793,"children":1794},{"style":252},[1795],{"type":45,"value":1796},",\n",{"type":39,"tag":198,"props":1798,"children":1799},{"class":200,"line":232},[1800,1804,1808,1812,1816,1820,1825,1829],{"type":39,"tag":198,"props":1801,"children":1802},{"style":252},[1803],{"type":45,"value":1765},{"type":39,"tag":198,"props":1805,"children":1806},{"style":1768},[1807],{"type":45,"value":1493},{"type":39,"tag":198,"props":1809,"children":1810},{"style":252},[1811],{"type":45,"value":260},{"type":39,"tag":198,"props":1813,"children":1814},{"style":252},[1815],{"type":45,"value":1779},{"type":39,"tag":198,"props":1817,"children":1818},{"style":252},[1819],{"type":45,"value":485},{"type":39,"tag":198,"props":1821,"children":1822},{"style":221},[1823],{"type":45,"value":1824},"Welcome to the show.",{"type":39,"tag":198,"props":1826,"children":1827},{"style":252},[1828],{"type":45,"value":260},{"type":39,"tag":198,"props":1830,"children":1831},{"style":252},[1832],{"type":45,"value":1796},{"type":39,"tag":198,"props":1834,"children":1835},{"class":200,"line":242},[1836,1840,1844,1848,1852,1856,1860,1864],{"type":39,"tag":198,"props":1837,"children":1838},{"style":252},[1839],{"type":45,"value":1765},{"type":39,"tag":198,"props":1841,"children":1842},{"style":1768},[1843],{"type":45,"value":1514},{"type":39,"tag":198,"props":1845,"children":1846},{"style":252},[1847],{"type":45,"value":260},{"type":39,"tag":198,"props":1849,"children":1850},{"style":252},[1851],{"type":45,"value":1779},{"type":39,"tag":198,"props":1853,"children":1854},{"style":252},[1855],{"type":45,"value":485},{"type":39,"tag":198,"props":1857,"children":1858},{"style":221},[1859],{"type":45,"value":292},{"type":39,"tag":198,"props":1861,"children":1862},{"style":252},[1863],{"type":45,"value":260},{"type":39,"tag":198,"props":1865,"children":1866},{"style":252},[1867],{"type":45,"value":1796},{"type":39,"tag":198,"props":1869,"children":1870},{"class":200,"line":273},[1871,1875,1879,1883,1887,1891,1895,1899],{"type":39,"tag":198,"props":1872,"children":1873},{"style":252},[1874],{"type":45,"value":1765},{"type":39,"tag":198,"props":1876,"children":1877},{"style":1768},[1878],{"type":45,"value":113},{"type":39,"tag":198,"props":1880,"children":1881},{"style":252},[1882],{"type":45,"value":260},{"type":39,"tag":198,"props":1884,"children":1885},{"style":252},[1886],{"type":45,"value":1779},{"type":39,"tag":198,"props":1888,"children":1889},{"style":252},[1890],{"type":45,"value":485},{"type":39,"tag":198,"props":1892,"children":1893},{"style":221},[1894],{"type":45,"value":318},{"type":39,"tag":198,"props":1896,"children":1897},{"style":252},[1898],{"type":45,"value":260},{"type":39,"tag":198,"props":1900,"children":1901},{"style":252},[1902],{"type":45,"value":1796},{"type":39,"tag":198,"props":1904,"children":1905},{"class":200,"line":299},[1906,1910,1914,1918,1922],{"type":39,"tag":198,"props":1907,"children":1908},{"style":252},[1909],{"type":45,"value":1765},{"type":39,"tag":198,"props":1911,"children":1912},{"style":1768},[1913],{"type":45,"value":1626},{"type":39,"tag":198,"props":1915,"children":1916},{"style":252},[1917],{"type":45,"value":260},{"type":39,"tag":198,"props":1919,"children":1920},{"style":252},[1921],{"type":45,"value":1779},{"type":39,"tag":198,"props":1923,"children":1924},{"style":252},[1925],{"type":45,"value":1926}," {\n",{"type":39,"tag":198,"props":1928,"children":1929},{"class":200,"line":330},[1930,1935,1940,1944,1948],{"type":39,"tag":198,"props":1931,"children":1932},{"style":252},[1933],{"type":45,"value":1934},"    \"",{"type":39,"tag":198,"props":1936,"children":1937},{"style":383},[1938],{"type":45,"value":1939},"options",{"type":39,"tag":198,"props":1941,"children":1942},{"style":252},[1943],{"type":45,"value":260},{"type":39,"tag":198,"props":1945,"children":1946},{"style":252},[1947],{"type":45,"value":1779},{"type":39,"tag":198,"props":1949,"children":1950},{"style":252},[1951],{"type":45,"value":1926},{"type":39,"tag":198,"props":1953,"children":1954},{"class":200,"line":356},[1955,1960,1965,1969,1973],{"type":39,"tag":198,"props":1956,"children":1957},{"style":252},[1958],{"type":45,"value":1959},"      \"",{"type":39,"tag":198,"props":1961,"children":1962},{"style":987},[1963],{"type":45,"value":1964},"openai",{"type":39,"tag":198,"props":1966,"children":1967},{"style":252},[1968],{"type":45,"value":260},{"type":39,"tag":198,"props":1970,"children":1971},{"style":252},[1972],{"type":45,"value":1779},{"type":39,"tag":198,"props":1974,"children":1975},{"style":252},[1976],{"type":45,"value":1926},{"type":39,"tag":198,"props":1978,"children":1979},{"class":200,"line":418},[1980,1985,1990,1994,1998,2002,2007],{"type":39,"tag":198,"props":1981,"children":1982},{"style":252},[1983],{"type":45,"value":1984},"        \"",{"type":39,"tag":198,"props":1986,"children":1988},{"style":1987},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1989],{"type":45,"value":1738},{"type":39,"tag":198,"props":1991,"children":1992},{"style":252},[1993],{"type":45,"value":260},{"type":39,"tag":198,"props":1995,"children":1996},{"style":252},[1997],{"type":45,"value":1779},{"type":39,"tag":198,"props":1999,"children":2000},{"style":252},[2001],{"type":45,"value":485},{"type":39,"tag":198,"props":2003,"children":2004},{"style":221},[2005],{"type":45,"value":2006},"Speak in a warm, friendly tone with a slow pace.",{"type":39,"tag":198,"props":2008,"children":2009},{"style":252},[2010],{"type":45,"value":270},{"type":39,"tag":198,"props":2012,"children":2013},{"class":200,"line":442},[2014],{"type":39,"tag":198,"props":2015,"children":2016},{"style":252},[2017],{"type":45,"value":2018},"      }\n",{"type":39,"tag":198,"props":2020,"children":2021},{"class":200,"line":450},[2022],{"type":39,"tag":198,"props":2023,"children":2024},{"style":252},[2025],{"type":45,"value":2026},"    }\n",{"type":39,"tag":198,"props":2028,"children":2029},{"class":200,"line":524},[2030],{"type":39,"tag":198,"props":2031,"children":2032},{"style":252},[2033],{"type":45,"value":2034},"  }\n",{"type":39,"tag":198,"props":2036,"children":2037},{"class":200,"line":577},[2038],{"type":39,"tag":198,"props":2039,"children":2040},{"style":252},[2041],{"type":45,"value":2042},"}\n",{"type":39,"tag":48,"props":2044,"children":2045},{},[2046],{"type":45,"value":2047},"For other providers, check each provider's upstream docs for available passthrough keys — naming conventions vary (camelCase for OpenAI\u002FGoogle, snake_case for most others).",{"type":39,"tag":97,"props":2049,"children":2051},{"id":2050},"openai-sdk-compatibility",[2052],{"type":45,"value":2053},"OpenAI SDK compatibility",{"type":39,"tag":48,"props":2055,"children":2056},{},[2057,2059,2065],{"type":45,"value":2058},"Because the endpoint mirrors OpenAI's ",{"type":39,"tag":54,"props":2060,"children":2062},{"className":2061},[],[2063],{"type":45,"value":2064},"\u002Faudio\u002Fspeech",{"type":45,"value":2066},", both OpenAI SDKs work by swapping the base URL. Prefer this when the user is already in a Python\u002FTypeScript project and doesn't want to shell out.",{"type":39,"tag":187,"props":2068,"children":2072},{"className":2069,"code":2070,"language":2071,"meta":192,"style":192},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Python — streaming write to file\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\",\n                api_key=os.environ[\"OPENROUTER_API_KEY\"])\n\nwith client.audio.speech.with_streaming_response.create(\n    model=\"openai\u002Fgpt-4o-mini-tts-2025-12-15\",\n    input=\"The quick brown fox jumps over the lazy dog.\",\n    voice=\"nova\",\n    response_format=\"mp3\",\n) as response:\n    response.stream_to_file(\"output.mp3\")\n","python",[2073],{"type":39,"tag":54,"props":2074,"children":2075},{"__ignoreMap":192},[2076,2084,2092,2100,2107,2115,2123,2130,2138,2146,2154,2162,2170,2178],{"type":39,"tag":198,"props":2077,"children":2078},{"class":200,"line":201},[2079],{"type":39,"tag":198,"props":2080,"children":2081},{},[2082],{"type":45,"value":2083},"# Python — streaming write to file\n",{"type":39,"tag":198,"props":2085,"children":2086},{"class":200,"line":211},[2087],{"type":39,"tag":198,"props":2088,"children":2089},{},[2090],{"type":45,"value":2091},"import os\n",{"type":39,"tag":198,"props":2093,"children":2094},{"class":200,"line":232},[2095],{"type":39,"tag":198,"props":2096,"children":2097},{},[2098],{"type":45,"value":2099},"from openai import OpenAI\n",{"type":39,"tag":198,"props":2101,"children":2102},{"class":200,"line":242},[2103],{"type":39,"tag":198,"props":2104,"children":2105},{"emptyLinePlaceholder":236},[2106],{"type":45,"value":239},{"type":39,"tag":198,"props":2108,"children":2109},{"class":200,"line":273},[2110],{"type":39,"tag":198,"props":2111,"children":2112},{},[2113],{"type":45,"value":2114},"client = OpenAI(base_url=\"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\",\n",{"type":39,"tag":198,"props":2116,"children":2117},{"class":200,"line":299},[2118],{"type":39,"tag":198,"props":2119,"children":2120},{},[2121],{"type":45,"value":2122},"                api_key=os.environ[\"OPENROUTER_API_KEY\"])\n",{"type":39,"tag":198,"props":2124,"children":2125},{"class":200,"line":330},[2126],{"type":39,"tag":198,"props":2127,"children":2128},{"emptyLinePlaceholder":236},[2129],{"type":45,"value":239},{"type":39,"tag":198,"props":2131,"children":2132},{"class":200,"line":356},[2133],{"type":39,"tag":198,"props":2134,"children":2135},{},[2136],{"type":45,"value":2137},"with client.audio.speech.with_streaming_response.create(\n",{"type":39,"tag":198,"props":2139,"children":2140},{"class":200,"line":418},[2141],{"type":39,"tag":198,"props":2142,"children":2143},{},[2144],{"type":45,"value":2145},"    model=\"openai\u002Fgpt-4o-mini-tts-2025-12-15\",\n",{"type":39,"tag":198,"props":2147,"children":2148},{"class":200,"line":442},[2149],{"type":39,"tag":198,"props":2150,"children":2151},{},[2152],{"type":45,"value":2153},"    input=\"The quick brown fox jumps over the lazy dog.\",\n",{"type":39,"tag":198,"props":2155,"children":2156},{"class":200,"line":450},[2157],{"type":39,"tag":198,"props":2158,"children":2159},{},[2160],{"type":45,"value":2161},"    voice=\"nova\",\n",{"type":39,"tag":198,"props":2163,"children":2164},{"class":200,"line":524},[2165],{"type":39,"tag":198,"props":2166,"children":2167},{},[2168],{"type":45,"value":2169},"    response_format=\"mp3\",\n",{"type":39,"tag":198,"props":2171,"children":2172},{"class":200,"line":577},[2173],{"type":39,"tag":198,"props":2174,"children":2175},{},[2176],{"type":45,"value":2177},") as response:\n",{"type":39,"tag":198,"props":2179,"children":2180},{"class":200,"line":600},[2181],{"type":39,"tag":198,"props":2182,"children":2183},{},[2184],{"type":45,"value":2185},"    response.stream_to_file(\"output.mp3\")\n",{"type":39,"tag":187,"props":2187,"children":2191},{"className":2188,"code":2189,"language":2190,"meta":192,"style":192},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F TypeScript — collect bytes, write once\nimport OpenAI from \"openai\";\nimport fs from \"fs\";\n\nconst client = new OpenAI({\n  baseURL: \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\",\n  apiKey: process.env.OPENROUTER_API_KEY!,\n});\n\nconst response = await client.audio.speech.create({\n  model: \"openai\u002Fgpt-4o-mini-tts-2025-12-15\",\n  input: \"The quick brown fox jumps over the lazy dog.\",\n  voice: \"nova\",\n  response_format: \"mp3\",\n});\n\nawait fs.promises.writeFile(\n  \"output.mp3\",\n  Buffer.from(await response.arrayBuffer()),\n);\n","typescript",[2192],{"type":39,"tag":54,"props":2193,"children":2194},{"__ignoreMap":192},[2195,2203,2238,2271,2278,2314,2342,2381,2396,2403,2463,2491,2520,2548,2576,2591,2598,2634,2654,2701],{"type":39,"tag":198,"props":2196,"children":2197},{"class":200,"line":201},[2198],{"type":39,"tag":198,"props":2199,"children":2200},{"style":205},[2201],{"type":45,"value":2202},"\u002F\u002F TypeScript — collect bytes, write once\n",{"type":39,"tag":198,"props":2204,"children":2205},{"class":200,"line":211},[2206,2211,2216,2221,2225,2229,2233],{"type":39,"tag":198,"props":2207,"children":2208},{"style":822},[2209],{"type":45,"value":2210},"import",{"type":39,"tag":198,"props":2212,"children":2213},{"style":246},[2214],{"type":45,"value":2215}," OpenAI ",{"type":39,"tag":198,"props":2217,"children":2218},{"style":822},[2219],{"type":45,"value":2220},"from",{"type":39,"tag":198,"props":2222,"children":2223},{"style":252},[2224],{"type":45,"value":485},{"type":39,"tag":198,"props":2226,"children":2227},{"style":221},[2228],{"type":45,"value":1964},{"type":39,"tag":198,"props":2230,"children":2231},{"style":252},[2232],{"type":45,"value":260},{"type":39,"tag":198,"props":2234,"children":2235},{"style":252},[2236],{"type":45,"value":2237},";\n",{"type":39,"tag":198,"props":2239,"children":2240},{"class":200,"line":232},[2241,2245,2250,2254,2258,2263,2267],{"type":39,"tag":198,"props":2242,"children":2243},{"style":822},[2244],{"type":45,"value":2210},{"type":39,"tag":198,"props":2246,"children":2247},{"style":246},[2248],{"type":45,"value":2249}," fs ",{"type":39,"tag":198,"props":2251,"children":2252},{"style":822},[2253],{"type":45,"value":2220},{"type":39,"tag":198,"props":2255,"children":2256},{"style":252},[2257],{"type":45,"value":485},{"type":39,"tag":198,"props":2259,"children":2260},{"style":221},[2261],{"type":45,"value":2262},"fs",{"type":39,"tag":198,"props":2264,"children":2265},{"style":252},[2266],{"type":45,"value":260},{"type":39,"tag":198,"props":2268,"children":2269},{"style":252},[2270],{"type":45,"value":2237},{"type":39,"tag":198,"props":2272,"children":2273},{"class":200,"line":242},[2274],{"type":39,"tag":198,"props":2275,"children":2276},{"emptyLinePlaceholder":236},[2277],{"type":45,"value":239},{"type":39,"tag":198,"props":2279,"children":2280},{"class":200,"line":273},[2281,2286,2291,2295,2300,2305,2310],{"type":39,"tag":198,"props":2282,"children":2283},{"style":1768},[2284],{"type":45,"value":2285},"const",{"type":39,"tag":198,"props":2287,"children":2288},{"style":246},[2289],{"type":45,"value":2290}," client ",{"type":39,"tag":198,"props":2292,"children":2293},{"style":252},[2294],{"type":45,"value":255},{"type":39,"tag":198,"props":2296,"children":2297},{"style":252},[2298],{"type":45,"value":2299}," new",{"type":39,"tag":198,"props":2301,"children":2302},{"style":215},[2303],{"type":45,"value":2304}," OpenAI",{"type":39,"tag":198,"props":2306,"children":2307},{"style":246},[2308],{"type":45,"value":2309},"(",{"type":39,"tag":198,"props":2311,"children":2312},{"style":252},[2313],{"type":45,"value":1757},{"type":39,"tag":198,"props":2315,"children":2316},{"class":200,"line":299},[2317,2322,2326,2330,2334,2338],{"type":39,"tag":198,"props":2318,"children":2319},{"style":1987},[2320],{"type":45,"value":2321},"  baseURL",{"type":39,"tag":198,"props":2323,"children":2324},{"style":252},[2325],{"type":45,"value":1779},{"type":39,"tag":198,"props":2327,"children":2328},{"style":252},[2329],{"type":45,"value":485},{"type":39,"tag":198,"props":2331,"children":2332},{"style":221},[2333],{"type":45,"value":75},{"type":39,"tag":198,"props":2335,"children":2336},{"style":252},[2337],{"type":45,"value":260},{"type":39,"tag":198,"props":2339,"children":2340},{"style":252},[2341],{"type":45,"value":1796},{"type":39,"tag":198,"props":2343,"children":2344},{"class":200,"line":330},[2345,2350,2354,2359,2363,2368,2372,2376],{"type":39,"tag":198,"props":2346,"children":2347},{"style":1987},[2348],{"type":45,"value":2349},"  apiKey",{"type":39,"tag":198,"props":2351,"children":2352},{"style":252},[2353],{"type":45,"value":1779},{"type":39,"tag":198,"props":2355,"children":2356},{"style":246},[2357],{"type":45,"value":2358}," process",{"type":39,"tag":198,"props":2360,"children":2361},{"style":252},[2362],{"type":45,"value":401},{"type":39,"tag":198,"props":2364,"children":2365},{"style":246},[2366],{"type":45,"value":2367},"env",{"type":39,"tag":198,"props":2369,"children":2370},{"style":252},[2371],{"type":45,"value":401},{"type":39,"tag":198,"props":2373,"children":2374},{"style":246},[2375],{"type":45,"value":83},{"type":39,"tag":198,"props":2377,"children":2378},{"style":252},[2379],{"type":45,"value":2380},"!,\n",{"type":39,"tag":198,"props":2382,"children":2383},{"class":200,"line":356},[2384,2388,2392],{"type":39,"tag":198,"props":2385,"children":2386},{"style":252},[2387],{"type":45,"value":1202},{"type":39,"tag":198,"props":2389,"children":2390},{"style":246},[2391],{"type":45,"value":396},{"type":39,"tag":198,"props":2393,"children":2394},{"style":252},[2395],{"type":45,"value":2237},{"type":39,"tag":198,"props":2397,"children":2398},{"class":200,"line":418},[2399],{"type":39,"tag":198,"props":2400,"children":2401},{"emptyLinePlaceholder":236},[2402],{"type":45,"value":239},{"type":39,"tag":198,"props":2404,"children":2405},{"class":200,"line":442},[2406,2410,2415,2419,2424,2429,2433,2437,2441,2446,2450,2455,2459],{"type":39,"tag":198,"props":2407,"children":2408},{"style":1768},[2409],{"type":45,"value":2285},{"type":39,"tag":198,"props":2411,"children":2412},{"style":246},[2413],{"type":45,"value":2414}," response ",{"type":39,"tag":198,"props":2416,"children":2417},{"style":252},[2418],{"type":45,"value":255},{"type":39,"tag":198,"props":2420,"children":2421},{"style":822},[2422],{"type":45,"value":2423}," await",{"type":39,"tag":198,"props":2425,"children":2426},{"style":246},[2427],{"type":45,"value":2428}," client",{"type":39,"tag":198,"props":2430,"children":2431},{"style":252},[2432],{"type":45,"value":401},{"type":39,"tag":198,"props":2434,"children":2435},{"style":246},[2436],{"type":45,"value":22},{"type":39,"tag":198,"props":2438,"children":2439},{"style":252},[2440],{"type":45,"value":401},{"type":39,"tag":198,"props":2442,"children":2443},{"style":246},[2444],{"type":45,"value":2445},"speech",{"type":39,"tag":198,"props":2447,"children":2448},{"style":252},[2449],{"type":45,"value":401},{"type":39,"tag":198,"props":2451,"children":2452},{"style":215},[2453],{"type":45,"value":2454},"create",{"type":39,"tag":198,"props":2456,"children":2457},{"style":246},[2458],{"type":45,"value":2309},{"type":39,"tag":198,"props":2460,"children":2461},{"style":252},[2462],{"type":45,"value":1757},{"type":39,"tag":198,"props":2464,"children":2465},{"class":200,"line":450},[2466,2471,2475,2479,2483,2487],{"type":39,"tag":198,"props":2467,"children":2468},{"style":1987},[2469],{"type":45,"value":2470},"  model",{"type":39,"tag":198,"props":2472,"children":2473},{"style":252},[2474],{"type":45,"value":1779},{"type":39,"tag":198,"props":2476,"children":2477},{"style":252},[2478],{"type":45,"value":485},{"type":39,"tag":198,"props":2480,"children":2481},{"style":221},[2482],{"type":45,"value":265},{"type":39,"tag":198,"props":2484,"children":2485},{"style":252},[2486],{"type":45,"value":260},{"type":39,"tag":198,"props":2488,"children":2489},{"style":252},[2490],{"type":45,"value":1796},{"type":39,"tag":198,"props":2492,"children":2493},{"class":200,"line":524},[2494,2499,2503,2507,2512,2516],{"type":39,"tag":198,"props":2495,"children":2496},{"style":1987},[2497],{"type":45,"value":2498},"  input",{"type":39,"tag":198,"props":2500,"children":2501},{"style":252},[2502],{"type":45,"value":1779},{"type":39,"tag":198,"props":2504,"children":2505},{"style":252},[2506],{"type":45,"value":485},{"type":39,"tag":198,"props":2508,"children":2509},{"style":221},[2510],{"type":45,"value":2511},"The quick brown fox jumps over the lazy dog.",{"type":39,"tag":198,"props":2513,"children":2514},{"style":252},[2515],{"type":45,"value":260},{"type":39,"tag":198,"props":2517,"children":2518},{"style":252},[2519],{"type":45,"value":1796},{"type":39,"tag":198,"props":2521,"children":2522},{"class":200,"line":577},[2523,2528,2532,2536,2540,2544],{"type":39,"tag":198,"props":2524,"children":2525},{"style":1987},[2526],{"type":45,"value":2527},"  voice",{"type":39,"tag":198,"props":2529,"children":2530},{"style":252},[2531],{"type":45,"value":1779},{"type":39,"tag":198,"props":2533,"children":2534},{"style":252},[2535],{"type":45,"value":485},{"type":39,"tag":198,"props":2537,"children":2538},{"style":221},[2539],{"type":45,"value":1388},{"type":39,"tag":198,"props":2541,"children":2542},{"style":252},[2543],{"type":45,"value":260},{"type":39,"tag":198,"props":2545,"children":2546},{"style":252},[2547],{"type":45,"value":1796},{"type":39,"tag":198,"props":2549,"children":2550},{"class":200,"line":600},[2551,2556,2560,2564,2568,2572],{"type":39,"tag":198,"props":2552,"children":2553},{"style":1987},[2554],{"type":45,"value":2555},"  response_format",{"type":39,"tag":198,"props":2557,"children":2558},{"style":252},[2559],{"type":45,"value":1779},{"type":39,"tag":198,"props":2561,"children":2562},{"style":252},[2563],{"type":45,"value":485},{"type":39,"tag":198,"props":2565,"children":2566},{"style":221},[2567],{"type":45,"value":318},{"type":39,"tag":198,"props":2569,"children":2570},{"style":252},[2571],{"type":45,"value":260},{"type":39,"tag":198,"props":2573,"children":2574},{"style":252},[2575],{"type":45,"value":1796},{"type":39,"tag":198,"props":2577,"children":2578},{"class":200,"line":608},[2579,2583,2587],{"type":39,"tag":198,"props":2580,"children":2581},{"style":252},[2582],{"type":45,"value":1202},{"type":39,"tag":198,"props":2584,"children":2585},{"style":246},[2586],{"type":45,"value":396},{"type":39,"tag":198,"props":2588,"children":2589},{"style":252},[2590],{"type":45,"value":2237},{"type":39,"tag":198,"props":2592,"children":2593},{"class":200,"line":649},[2594],{"type":39,"tag":198,"props":2595,"children":2596},{"emptyLinePlaceholder":236},[2597],{"type":45,"value":239},{"type":39,"tag":198,"props":2599,"children":2600},{"class":200,"line":680},[2601,2606,2611,2615,2620,2624,2629],{"type":39,"tag":198,"props":2602,"children":2603},{"style":822},[2604],{"type":45,"value":2605},"await",{"type":39,"tag":198,"props":2607,"children":2608},{"style":246},[2609],{"type":45,"value":2610}," fs",{"type":39,"tag":198,"props":2612,"children":2613},{"style":252},[2614],{"type":45,"value":401},{"type":39,"tag":198,"props":2616,"children":2617},{"style":246},[2618],{"type":45,"value":2619},"promises",{"type":39,"tag":198,"props":2621,"children":2622},{"style":252},[2623],{"type":45,"value":401},{"type":39,"tag":198,"props":2625,"children":2626},{"style":215},[2627],{"type":45,"value":2628},"writeFile",{"type":39,"tag":198,"props":2630,"children":2631},{"style":246},[2632],{"type":45,"value":2633},"(\n",{"type":39,"tag":198,"props":2635,"children":2636},{"class":200,"line":705},[2637,2641,2646,2650],{"type":39,"tag":198,"props":2638,"children":2639},{"style":252},[2640],{"type":45,"value":1765},{"type":39,"tag":198,"props":2642,"children":2643},{"style":221},[2644],{"type":45,"value":2645},"output.mp3",{"type":39,"tag":198,"props":2647,"children":2648},{"style":252},[2649],{"type":45,"value":260},{"type":39,"tag":198,"props":2651,"children":2652},{"style":252},[2653],{"type":45,"value":1796},{"type":39,"tag":198,"props":2655,"children":2656},{"class":200,"line":731},[2657,2662,2666,2670,2674,2678,2683,2687,2692,2697],{"type":39,"tag":198,"props":2658,"children":2659},{"style":246},[2660],{"type":45,"value":2661},"  Buffer",{"type":39,"tag":198,"props":2663,"children":2664},{"style":252},[2665],{"type":45,"value":401},{"type":39,"tag":198,"props":2667,"children":2668},{"style":215},[2669],{"type":45,"value":2220},{"type":39,"tag":198,"props":2671,"children":2672},{"style":246},[2673],{"type":45,"value":2309},{"type":39,"tag":198,"props":2675,"children":2676},{"style":822},[2677],{"type":45,"value":2605},{"type":39,"tag":198,"props":2679,"children":2680},{"style":246},[2681],{"type":45,"value":2682}," response",{"type":39,"tag":198,"props":2684,"children":2685},{"style":252},[2686],{"type":45,"value":401},{"type":39,"tag":198,"props":2688,"children":2689},{"style":215},[2690],{"type":45,"value":2691},"arrayBuffer",{"type":39,"tag":198,"props":2693,"children":2694},{"style":246},[2695],{"type":45,"value":2696},"())",{"type":39,"tag":198,"props":2698,"children":2699},{"style":252},[2700],{"type":45,"value":1796},{"type":39,"tag":198,"props":2702,"children":2703},{"class":200,"line":757},[2704,2708],{"type":39,"tag":198,"props":2705,"children":2706},{"style":246},[2707],{"type":45,"value":396},{"type":39,"tag":198,"props":2709,"children":2710},{"style":252},[2711],{"type":45,"value":2237},{"type":39,"tag":97,"props":2713,"children":2715},{"id":2714},"long-inputs",[2716],{"type":45,"value":2717},"Long inputs",{"type":39,"tag":48,"props":2719,"children":2720},{},[2721,2723,2728],{"type":45,"value":2722},"TTS models have per-request character limits (usually a few thousand characters) and are priced ",{"type":39,"tag":117,"props":2724,"children":2725},{},[2726],{"type":45,"value":2727},"per character of input",{"type":45,"value":2729},", so there's no penalty to splitting. For anything long (chapters, articles, scripts):",{"type":39,"tag":2731,"props":2732,"children":2733},"ol",{},[2734,2739,2758],{"type":39,"tag":134,"props":2735,"children":2736},{},[2737],{"type":45,"value":2738},"Split the text at sentence or paragraph boundaries — never mid-word.",{"type":39,"tag":134,"props":2740,"children":2741},{},[2742,2744,2749,2751,2756],{"type":45,"value":2743},"Synthesize each chunk with the same ",{"type":39,"tag":54,"props":2745,"children":2747},{"className":2746},[],[2748],{"type":45,"value":1457},{"type":45,"value":2750}," + ",{"type":39,"tag":54,"props":2752,"children":2754},{"className":2753},[],[2755],{"type":45,"value":1514},{"type":45,"value":2757}," so prosody stays consistent.",{"type":39,"tag":134,"props":2759,"children":2760},{},[2761,2763,2769,2771,2777],{"type":45,"value":2762},"Concatenate the resulting audio files. For mp3, ",{"type":39,"tag":54,"props":2764,"children":2766},{"className":2765},[],[2767],{"type":45,"value":2768},"ffmpeg -i \"concat:part1.mp3|part2.mp3\" -c copy out.mp3",{"type":45,"value":2770}," works for simple cases; for mixed bitrates or tight seams, re-encode via ",{"type":39,"tag":54,"props":2772,"children":2774},{"className":2773},[],[2775],{"type":45,"value":2776},"ffmpeg -f concat -safe 0 -i list.txt output.mp3",{"type":45,"value":401},{"type":39,"tag":48,"props":2779,"children":2780},{},[2781],{"type":45,"value":2782},"Splitting also improves time-to-first-audio if you stream chunks to a user as they're generated.",{"type":39,"tag":97,"props":2784,"children":2786},{"id":2785},"troubleshooting",[2787],{"type":45,"value":2788},"Troubleshooting",{"type":39,"tag":48,"props":2790,"children":2791},{},[2792,2797,2799,2804,2806,2812,2814,2819,2821,2827],{"type":39,"tag":117,"props":2793,"children":2794},{},[2795],{"type":45,"value":2796},"\"Empty\" or unplayable audio file",{"type":45,"value":2798}," — almost always a format\u002Fextension mismatch. Check ",{"type":39,"tag":54,"props":2800,"children":2802},{"className":2801},[],[2803],{"type":45,"value":142},{"type":45,"value":2805}," in the response headers: ",{"type":39,"tag":54,"props":2807,"children":2809},{"className":2808},[],[2810],{"type":45,"value":2811},"audio\u002Fpcm",{"type":45,"value":2813}," saved as ",{"type":39,"tag":54,"props":2815,"children":2817},{"className":2816},[],[2818],{"type":45,"value":1711},{"type":45,"value":2820}," will not play. Either re-request with ",{"type":39,"tag":54,"props":2822,"children":2824},{"className":2823},[],[2825],{"type":45,"value":2826},"response_format: \"mp3\"",{"type":45,"value":2828}," or save with the matching extension.",{"type":39,"tag":48,"props":2830,"children":2831},{},[2832,2843,2845,2850,2852,2858],{"type":39,"tag":117,"props":2833,"children":2834},{},[2835,2837],{"type":45,"value":2836},"400 with ",{"type":39,"tag":54,"props":2838,"children":2840},{"className":2839},[],[2841],{"type":45,"value":2842},"\"Model X does not exist\"",{"type":45,"value":2844}," — the slug is wrong. Use the full dated slug from the models endpoint (",{"type":39,"tag":54,"props":2846,"children":2848},{"className":2847},[],[2849],{"type":45,"value":265},{"type":45,"value":2851},", not ",{"type":39,"tag":54,"props":2853,"children":2855},{"className":2854},[],[2856],{"type":45,"value":2857},"gpt-4o-mini-tts",{"type":45,"value":1481},{"type":39,"tag":48,"props":2860,"children":2861},{},[2862,2873,2875,2881,2883,2889,2891,2897],{"type":39,"tag":117,"props":2863,"children":2864},{},[2865,2867],{"type":45,"value":2866},"400 with a ",{"type":39,"tag":54,"props":2868,"children":2870},{"className":2869},[],[2871],{"type":45,"value":2872},"ZodError",{"type":45,"value":2874}," — a required field is missing or the wrong type. The body looks like ",{"type":39,"tag":54,"props":2876,"children":2878},{"className":2877},[],[2879],{"type":45,"value":2880},"{\"success\":false,\"error\":{\"name\":\"ZodError\",\"message\":\"[...]\"}}",{"type":45,"value":2882}," — the nested ",{"type":39,"tag":54,"props":2884,"children":2886},{"className":2885},[],[2887],{"type":45,"value":2888},"message",{"type":45,"value":2890}," JSON string names the bad path (e.g. ",{"type":39,"tag":54,"props":2892,"children":2894},{"className":2893},[],[2895],{"type":45,"value":2896},"\"path\":[\"voice\"]",{"type":45,"value":1481},{"type":39,"tag":48,"props":2899,"children":2900},{},[2901,2911],{"type":39,"tag":117,"props":2902,"children":2903},{},[2904,2909],{"type":39,"tag":54,"props":2905,"children":2907},{"className":2906},[],[2908],{"type":45,"value":1597},{"type":45,"value":2910}," has no effect",{"type":45,"value":2912}," — the provider probably doesn't support it. OpenAI TTS honors it; for other providers, check upstream docs before relying on it.",{"type":39,"tag":97,"props":2914,"children":2916},{"id":2915},"references",[2917],{"type":45,"value":2918},"References",{"type":39,"tag":130,"props":2920,"children":2921},{},[2922,2932],{"type":39,"tag":134,"props":2923,"children":2924},{},[2925],{"type":39,"tag":87,"props":2926,"children":2929},{"href":2927,"rel":2928},"https:\u002F\u002Fopenrouter.ai\u002Fdocs\u002Fguides\u002Foverview\u002Fmultimodal\u002Ftts",[91],[2930],{"type":45,"value":2931},"TTS guide",{"type":39,"tag":134,"props":2933,"children":2934},{},[2935],{"type":39,"tag":87,"props":2936,"children":2939},{"href":2937,"rel":2938},"https:\u002F\u002Fopenrouter.ai\u002Fmodels?output_modalities=speech",[91],[2940],{"type":45,"value":2941},"Models page — filter to speech output",{"type":39,"tag":2943,"props":2944,"children":2945},"style",{},[2946],{"type":45,"value":2947},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2949,"total":680},[2950,2966,2976,2990,3004,3015,3024,3036,3048,3057,3068,3077],{"slug":2951,"name":2951,"fn":2952,"description":2953,"org":2954,"tags":2955,"stars":23,"repoUrl":24,"updatedAt":2965},"create-agent-tui","scaffold terminal agents with OpenRouter","Scaffolds a complete agent TUI in TypeScript using @openrouter\u002Fagent — like create-react-app for terminal agents. Generates a customizable terminal interface with three input styles, four tool display modes, ASCII banners, streaming output, session persistence, and configurable tools. Use when building an agent, creating a TUI, scaffolding an agent project, or building a coding assistant.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2956,2959,2962,2963],{"name":2957,"slug":2958,"type":16},"Agents","agents",{"name":2960,"slug":2961,"type":16},"CLI","cli",{"name":9,"slug":8,"type":16},{"name":2964,"slug":2190,"type":16},"TypeScript","2026-07-14T05:38:18.849741",{"slug":2967,"name":2967,"fn":2968,"description":2969,"org":2970,"tags":2971,"stars":23,"repoUrl":24,"updatedAt":2975},"create-headless-agent","scaffold headless agents with OpenRouter","Scaffolds a headless agent in TypeScript using @openrouter\u002Fagent and Bun — for CLI tools, API servers, queue workers, and pipelines. No terminal UI. Use when building a headless agent, programmatic agent, CLI tool that uses AI, batch agent, pipeline agent, API agent, agent without a UI, or agent service.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2972,2973,2974],{"name":2957,"slug":2958,"type":16},{"name":2960,"slug":2961,"type":16},{"name":2964,"slug":2190,"type":16},"2026-07-14T05:38:30.178029",{"slug":2977,"name":2977,"fn":2978,"description":2979,"org":2980,"tags":2981,"stars":23,"repoUrl":24,"updatedAt":2989},"open-responses","implement Open Responses-compliant APIs","This skill should be used when implementing, consuming, or debugging an Open Responses-compliant API — the open standard for multi-provider LLM interoperability. Covers protocol, items, state machines, streaming events, tools, the agentic loop pattern, and extensions. Triggers on: Open Responses, open-responses, \u002Fv1\u002Fresponses endpoint, multi-provider LLM API, Open Responses compliance.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2982,2985,2988],{"name":2983,"slug":2984,"type":16},"API Development","api-development",{"name":2986,"slug":2987,"type":16},"Interoperability","interoperability",{"name":14,"slug":15,"type":16},"2026-07-14T05:38:13.153467",{"slug":2991,"name":2991,"fn":2992,"description":2993,"org":2994,"tags":2995,"stars":23,"repoUrl":24,"updatedAt":3003},"openrouter-agent-migration","migrate OpenRouter SDK to agent patterns","Migration guide from @openrouter\u002Fsdk to @openrouter\u002Fagent for callModel, tool(), stop conditions, and agent features. This skill should be used when code imports callModel, tool(), or stop conditions from @openrouter\u002Fsdk and needs to migrate to @openrouter\u002Fagent.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2996,2999,3002],{"name":2997,"slug":2998,"type":16},"Migration","migration",{"name":3000,"slug":3001,"type":16},"SDK","sdk",{"name":2964,"slug":2190,"type":16},"2026-07-14T05:38:28.914981",{"slug":3005,"name":3005,"fn":3006,"description":3007,"org":3008,"tags":3009,"stars":23,"repoUrl":24,"updatedAt":3014},"openrouter-analytics","analyze OpenRouter usage and spend","Answer natural-language questions about a user's OpenRouter usage data — spend, request volume, model breakdown, latency, token usage, and cost optimization. Use when the user asks about their API usage, billing, costs, top models, traffic patterns, or wants to optimize their OpenRouter spend.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3010,3013],{"name":3011,"slug":3012,"type":16},"Analytics","analytics",{"name":9,"slug":8,"type":16},"2026-07-30T05:30:15.098344",{"slug":3016,"name":3016,"fn":3017,"description":3018,"org":3019,"tags":3020,"stars":23,"repoUrl":24,"updatedAt":3023},"openrouter-analytics-query","execute analytics queries against OpenRouter","Construct and execute analytics queries against the OpenRouter API — full parameter reference for metrics, dimensions, filters, time ranges, ordering, and pagination. Use when building or debugging an analytics query, understanding the request\u002Fresponse shape, or handling query errors.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3021,3022],{"name":3011,"slug":3012,"type":16},{"name":2983,"slug":2984,"type":16},"2026-07-14T05:38:26.402047",{"slug":3025,"name":3025,"fn":3026,"description":3027,"org":3028,"tags":3029,"stars":23,"repoUrl":24,"updatedAt":3035},"openrouter-analytics-schema","query OpenRouter analytics schema","Discover the OpenRouter analytics schema — available metrics, dimensions, filter operators, and granularities. Use when you need to know what analytics data is queryable, what dimensions you can break down by, or how to map a user's question to the right metric\u002Fdimension combination.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3030,3031,3032],{"name":3011,"slug":3012,"type":16},{"name":14,"slug":15,"type":16},{"name":3033,"slug":3034,"type":16},"Reporting","reporting","2026-07-14T05:38:32.721796",{"slug":3037,"name":3037,"fn":3038,"description":3039,"org":3040,"tags":3041,"stars":23,"repoUrl":24,"updatedAt":3047},"openrouter-benchmarks","query OpenRouter model benchmarks","Query OpenRouter's Benchmarks API for model benchmark rankings and scores. Use when the user asks for benchmark-backed model selection, model rankings by coding\u002Fintelligence\u002Fagentic ability, Artificial Analysis or Design Arena ELO\u002Fwin-rate results, benchmark citations, or wants to call GET \u002Fapi\u002Fv1\u002Fbenchmarks. Also use alongside openrouter-models when the user asks what model should power an app, product, workflow, or use case and benchmark evidence could inform or rule out part of the recommendation, including creative writing, editing, coding, design, agentic, or intelligence-heavy apps. Do not use for OpenRouter usage analytics, billing\u002Fspend analysis, generation metadata, provider uptime\u002Flatency, generic model pricing\u002Fcapability lookup without any selection or benchmark-relevance decision, or creating an evaluation suite for a local app.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3042,3043,3046],{"name":3011,"slug":3012,"type":16},{"name":3044,"slug":3045,"type":16},"Benchmarking","benchmarking",{"name":14,"slug":15,"type":16},"2026-07-14T05:38:27.658475",{"slug":3049,"name":3049,"fn":3050,"description":3051,"org":3052,"tags":3053,"stars":23,"repoUrl":24,"updatedAt":3056},"openrouter-generations","retrieve metadata for OpenRouter generations","Retrieve detailed metadata and stored content for individual OpenRouter generations. Use when the user wants to inspect a specific request — its cost, latency, token usage, provider routing, or the actual prompt\u002Fcompletion text — or is debugging a failed or unexpected generation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3054,3055],{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-14T05:38:25.132801",{"slug":3058,"name":3058,"fn":3059,"description":3060,"org":3061,"tags":3062,"stars":23,"repoUrl":24,"updatedAt":3067},"openrouter-images","generate images with OpenRouter","Generate images from text prompts and edit existing images using OpenRouter's dedicated Image API. Use when the user asks to create, generate, or make an image, picture, or illustration from a description, or wants to edit, modify, transform, or alter an existing image with a text prompt.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3063,3066],{"name":3064,"slug":3065,"type":16},"Image Generation","image-generation",{"name":9,"slug":8,"type":16},"2026-07-14T05:38:21.393411",{"slug":3069,"name":3069,"fn":3070,"description":3071,"org":3072,"tags":3073,"stars":23,"repoUrl":24,"updatedAt":3076},"openrouter-models","query OpenRouter model metadata and pricing","Query OpenRouter for available AI models, pricing, capabilities, throughput, and provider performance. Use when the user asks about available OpenRouter models, model pricing, model context lengths, model capabilities, provider latency or uptime, throughput limits, supported parameters, wants to search\u002Ffilter\u002Fcompare models, or find the fastest provider for a model.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3074,3075],{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-14T05:38:22.650307",{"slug":3078,"name":3078,"fn":3079,"description":3080,"org":3081,"tags":3082,"stars":23,"repoUrl":24,"updatedAt":3090},"openrouter-oauth","implement OpenRouter OAuth authentication","Implement \"Sign In with OpenRouter\" using OAuth PKCE — framework-agnostic, no SDK or client registration required. Use when the user wants to add OpenRouter login, authentication, sign-in buttons, OAuth, or AI model inference API keys for browser-based apps. No client registration, no backend, no secrets required.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3083,3086,3089],{"name":3084,"slug":3085,"type":16},"Auth","auth",{"name":3087,"slug":3088,"type":16},"OAuth","oauth",{"name":9,"slug":8,"type":16},"2026-07-14T05:38:20.116308",{"items":3092,"total":680},[3093,3100,3106,3112,3118,3123,3128],{"slug":2951,"name":2951,"fn":2952,"description":2953,"org":3094,"tags":3095,"stars":23,"repoUrl":24,"updatedAt":2965},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3096,3097,3098,3099],{"name":2957,"slug":2958,"type":16},{"name":2960,"slug":2961,"type":16},{"name":9,"slug":8,"type":16},{"name":2964,"slug":2190,"type":16},{"slug":2967,"name":2967,"fn":2968,"description":2969,"org":3101,"tags":3102,"stars":23,"repoUrl":24,"updatedAt":2975},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3103,3104,3105],{"name":2957,"slug":2958,"type":16},{"name":2960,"slug":2961,"type":16},{"name":2964,"slug":2190,"type":16},{"slug":2977,"name":2977,"fn":2978,"description":2979,"org":3107,"tags":3108,"stars":23,"repoUrl":24,"updatedAt":2989},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3109,3110,3111],{"name":2983,"slug":2984,"type":16},{"name":2986,"slug":2987,"type":16},{"name":14,"slug":15,"type":16},{"slug":2991,"name":2991,"fn":2992,"description":2993,"org":3113,"tags":3114,"stars":23,"repoUrl":24,"updatedAt":3003},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3115,3116,3117],{"name":2997,"slug":2998,"type":16},{"name":3000,"slug":3001,"type":16},{"name":2964,"slug":2190,"type":16},{"slug":3005,"name":3005,"fn":3006,"description":3007,"org":3119,"tags":3120,"stars":23,"repoUrl":24,"updatedAt":3014},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3121,3122],{"name":3011,"slug":3012,"type":16},{"name":9,"slug":8,"type":16},{"slug":3016,"name":3016,"fn":3017,"description":3018,"org":3124,"tags":3125,"stars":23,"repoUrl":24,"updatedAt":3023},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3126,3127],{"name":3011,"slug":3012,"type":16},{"name":2983,"slug":2984,"type":16},{"slug":3025,"name":3025,"fn":3026,"description":3027,"org":3129,"tags":3130,"stars":23,"repoUrl":24,"updatedAt":3035},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3131,3132,3133],{"name":3011,"slug":3012,"type":16},{"name":14,"slug":15,"type":16},{"name":3033,"slug":3034,"type":16}]