# OpenRouter APIs — hexgrad: Kokoro 82M (hexgrad/kokoro-82m)

Guide for calling every confirmed OpenRouter API that serves `hexgrad/kokoro-82m`.

Model page: https://openrouter.ai/hexgrad/kokoro-82m
Create an API key: https://openrouter.ai/settings/keys

## Authentication

Send this header with every request:

- Authorization: Bearer $OPENROUTER_API_KEY

## Text-to-Speech API

Synthesize audio with `hexgrad/kokoro-82m` through OpenRouter's Text-to-Speech API.

Docs: https://openrouter.ai/docs/api/api-reference/tts/create-speech

### Endpoint

POST https://openrouter.ai/api/v1/audio/speech

Headers:
- Content-Type: application/json

### Request fields (hexgrad/kokoro-82m)

- model: string (required) — `"hexgrad/kokoro-82m"`
- input: string (required) — text to synthesize
- voice: "af_alloy" | "af_aoede" | "af_bella" | "af_heart" | "af_jessica" | "af_kore" | "af_nicole" | "af_nova" | "af_river" | "af_sarah" | "af_sky" | "am_adam" | "am_echo" | "am_eric" | "am_fenrir" | "am_liam" | "am_michael" | "am_onyx" | "am_puck" | "am_santa" | "bf_alice" | "bf_emma" | "bf_isabella" | "bf_lily" | "bm_daniel" | "bm_fable" | "bm_george" | "bm_lewis" | "ef_dora" | "em_alex" | "em_santa" | "ff_siwis" | "hf_alpha" | "hf_beta" | "hm_omega" | "hm_psi" | "if_sara" | "im_nicola" | "jf_alpha" | "jf_gongitsune" | "jf_nezumi" | "jf_tebukuro" | "jm_kumo" | "pf_dora" | "pm_alex" | "pm_santa" | "zf_xiaobei" | "zf_xiaoni" | "zf_xiaoxiao" | "zf_xiaoyi" | "zm_yunjian" | "zm_yunxi" | "zm_yunxia" | "zm_yunyang" (optional) — provider-specific voice identifier
- response_format: "mp3" | "pcm" (optional) — output audio encoding; defaults to pcm

### Response

Success returns raw audio bytes, not JSON.

- `Content-Type` identifies the audio encoding, such as `audio/mpeg` or `audio/pcm`.
- `X-Generation-Id` identifies the billed generation.
- Write the response body directly to an audio file; do not call `response.json()`.

### Examples

#### Text to Speech

```bash
curl https://openrouter.ai/api/v1/audio/speech \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  --output output.mp3 \
  -d '{
  "model": "hexgrad/kokoro-82m",
  "input": "The warm light flows across the OpenRouter office as the evening settles in and the routing never stops. One interface, hundreds of models. Ready when you are.",
  "voice": "am_onyx",
  "response_format": "mp3"
}'
```

### Error differences

- 400 — malformed audio input or an audio option the routed provider does not support
- 502 — the upstream audio operation failed

## Errors

Failures return `{"error": {"code": <number>, "message": <string>}}` with the HTTP status:

- 400 — malformed request or an unsupported parameter
- 401 — missing or invalid API key
- 402 — insufficient credits
- 403 — spend limit reached, key disabled, or access blocked
- 404 — unknown model or no provider can serve the request
- 429 — rate limited; retry with backoff
- 502 — the operation failed upstream; failed generations are not billed

---

Canonical version of this document: https://openrouter.ai/hexgrad/kokoro-82m/llms.txt
