> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorage.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate speech, sound effects, or music

> Send text to an audio model and download the audio it returns.

## Prerequisites

The same as for [calling a model](/agentic-banking/guides/call-a-model#prerequisites): an agent whose budget admits the inference provider, and that agent's API key.

## Choose a model

Pick a model on the **Audio** tab of the [Inference page](https://agentic.anchorage.com/inference), or from `GET https://inference.agentic.anchorage.com/v1/models`. Each callable audio model's `endpoint` names the route to send it to, and each route takes a different field for its text:

| Route | Produces | Text field |
| - | - | - |
| `/v1/audio/speech` | Speech read from your text | `input` |
| `/v1/audio/sound-effects` | A sound effect described by your text | `text` |
| `/v1/audio/generations` | A music track described by your text | `prompt` |

Use only entries whose `callable` is `true`, and skip entries whose `available` is `false`. See [Choose a model](/agentic-banking/guides/call-a-model#choose-a-model).

## Send the request

```
POST https://inference.agentic.anchorage.com/v1/audio/speech
Authorization: Bearer $AGENT_API_KEY
Content-Type: application/json
Idempotency-Key: <a new UUID per generation>

{"model": "...", "input": "Hello from my agent.", "voice": "..."}
```

* `model` is the identifier from the model list.
* The route's text field can't be blank.
* Any other field the model accepts, such as `voice` for speech, is passed to the provider unchanged.
* `Idempotency-Key` is optional. Keep it for retries of this request, and send a new one for the next generation.

## Collect the audio

Every audio route answers either `200` with the provider's answer, passed through unchanged, or `202` with a job, so handle both answers on every route. Speech and sound effects usually answer `200`, and music usually answers `202`. [Audio generation](/agentic-banking/concepts/inference#audio-generation) lists the answer shapes observed so far. Poll a job's `poll_url`, a path on `https://inference.agentic.anchorage.com`, the same way as [an image or video job](/agentic-banking/guides/generate-an-image-or-video#poll-for-the-result), which also covers when to stop polling. A `completed` job carries the provider's `data` array when the provider returned one.

Audio links expire, so download the audio as soon as you have them.

See [Audio generation](/agentic-banking/concepts/inference#audio-generation) for how audio is billed and how it differs from image and video.


## Related topics

- [Changelog](/agentic-banking/changelog.md)
- [Call a model](/agentic-banking/guides/call-a-model.md)
- [Paid inference](/agentic-banking/concepts/inference.md)
- [Generate an image or video](/agentic-banking/guides/generate-an-image-or-video.md)
- [Editing subquorums](/knowledge-base/porto/policies/editing-subquorums.md)
