Skip to main content

Prerequisites

The same as for calling a model: 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, 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: Use only entries whose callable is true, and skip entries whose available is false. See Choose a model.

Send the request

  • 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 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, 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 for how audio is billed and how it differs from image and video.