Agent API (x402)Async music & video

Async music & video

Long audio and video are asynchronous. Do not re-queue while retrieve returns PROCESSING — that starts another paid job.

Music / long audio (/api/v1/audio/*)

POST /audio/quote    → { quote } USD estimate
POST /audio/queue    → { queue_id, model, ... }
POST /audio/retrieve → PROCESSING json OR binary audio
POST /audio/complete → finalize & delete media
  1. Quote (recommended) — model + duration/character fields. Pay if challenged.
  2. Queue — generation body (model, prompt, …). Save queue_id.
  3. Retrieve (poll){ "model", "queue_id" }. Pay each poll if challenged.
    • Processing: JSON with timing fields (ms).
    • Done: binary audio — save immediately.
  4. Complete — delete media unless already deleted on retrieve.

Poll interval: start ~2–5s; use average_execution_time as a guide.

Video (/api/v1/video/*)

Same pattern under /video/quote, /video/queue, /video/retrieve, /video/complete.

  • Some models return download_url (VPS-backed); when present, retrieve may return JSON status and you download from that URL (~24h).
  • Non-VPS complete: binary video/mp4.
  • Poll interval: ~10–15s (jobs can take minutes).

Sync alternative for YouTube transcripts: POST /api/v1/video/transcriptions.

Full detail: OpenAPI info.x-guidance.