# Create speech

> Convert text into spoken audio, streamed back as raw audio bytes.

`POST https://api.numes.ai/api/v1/audio/speech`

Source: https://0.0.0.0:3000/docs/api-reference/media/create-speech
Authorization: Bearer inference key

The response body is raw audio in the requested `response_format` (`mp3`, `wav` or `pcm`; `mp3` by default), with the audio `Content-Type` and an `X-Generation-Id` header. Once audio has started, a failure ends the response early without an in-band error; check the generation's `outcome` to confirm a complete result. Voices depend on the model. Usage counts the input characters sent to the model, after your account's [request policy](/docs/privacy/request-policy) applies its replacements, and output audio seconds. Guide: [Speech and transcription](/docs/multimodal/speech).

```request
{
  "method": "POST",
  "path": "/audio/speech",
  "body": {
    "model": "author/speech-model",
    "input": "Your build finished successfully.",
    "voice": "alloy",
    "response_format": "mp3"
  }
}
```

## Headers

- `X-Request-Id` (string; Length 1–128): Correlation ID, not an idempotency key. Inference request IDs recorded with a generation are unique per account. A traffic-admitted request reusing a recorded ID returns 400 invalid_request. Traffic admission rejection takes precedence over this conflict, including for reused IDs; it performs no generation lookup and writes no generation, result or attempt. Rate-limit rejection returns 429 rate_limited with Retry-After; an inference limiter outage retains 500 server.

## Request body (application/json)

- `model` (string; required; Length ≤ 393; Pattern ^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$)
- `input` (string; required; Length 1–4,096)
- `voice` (string; required)
- `response_format` (enum<string>; default "mp3"; one of mp3, pcm, wav)
- `speed` (number; default 1; Range 0.25–4)

## Response 503 (application/json)

- `error` (object; required)
  - `code` (integer; required)
  - `message` (string; required)
  - `metadata` (object)
- `openrouter_metadata` (object)

## Response default (application/json)

- `error` (object; required)
  - `code` (integer; required)
  - `message` (string; required)
  - `metadata` (object)
- `openrouter_metadata` (object)
