Core concepts

Jobs and status

Every generation is a job you submit and then follow to the end.

pending → processing → completed (or succeeded for music) | failed.

Poll until the job reaches completed (succeeded for music) or failed. A failed job refunds its credits automatically.

Polling helper

Python
import time
while True:
    j = requests.get(
      f"https://www.dubvoice.ai/api/v1/tts?task_id={task_id}",
      headers={"Authorization": f"Bearer {api_key}"},
    ).json()
    if j["status"] in ("completed", "failed"): break
    time.sleep(3)
print(j["result"])

Search docs

Find a page or an endpoint