Text to Speech

Get batch

Retrieve a batch with the status, audio URL and cost of every item.

GET/v1/batches/{id}

Returns a batch and its items. Poll it until status is no longer processing. Read-only keys can call it.

from wistfareai import WistfareAI

client = WistfareAI()  # reads WISTFARE_API_KEY

batch = client.text_to_speech.batches.get("batch_4d81f7")
print(batch.status, batch.totals)

# Or poll until it finishes:
batch = client.text_to_speech.batches.wait("batch_4d81f7")

Path parameters

ParameterTypeDescription
idstringThe batch id, batch_….

Response

200 OK:

{
  "id": "batch_4d81f7",
  "status": "completed",
  "created_at": "2026-10-11T08:15:00Z",
  "completed_at": "2026-10-11T08:16:42Z",
  "items": [
    {
      "ref": "welcome",
      "status": "succeeded",
      "audio_url": "/v1/batches/batch_4d81f7/items/welcome/audio",
      "seconds": 2.1,
      "cost_cents": 1,
      "error": null
    },
    {
      "ref": "menu-1",
      "status": "succeeded",
      "audio_url": "/v1/batches/batch_4d81f7/items/menu-1/audio",
      "seconds": 3.4,
      "cost_cents": 1,
      "error": null
    }
  ],
  "totals": { "succeeded": 2, "failed": 0, "audio_seconds": 5.5, "cost_cents": 2 }
}
FieldTypeDescription
statusstringprocessing, completed (all succeeded), partial (some failed) or failed (all failed).
completed_atstring | nullWhen the batch finished.
items[].refstringYour item id.
items[].statusstringpending, processing, succeeded or failed.
items[].audio_urlstring | nullPath of the item's audio once it succeeded. Fetch it with your API key.
items[].secondsnumber | nullDuration of the generated audio.
items[].cost_centsinteger | nullWhat the item cost.
items[].errorobject | null{code, message} for failed items, which cost nothing.
totalsobjectsucceeded, failed, audio_seconds and cost_cents across the batch.

Errors

StatusCodeMeaning
401unauthorizedMissing, invalid or revoked API key.
404not_foundNo batch with this id in the key's project.

On this page