Video generation, music, 3D assets, and other heavy jobs can take anywhere from seconds to minutes — too long to hold an HTTP connection open. For these, the Huzz API uses a submit-and-poll lifecycle called predictions:
  1. Submit the job to the model’s capability endpoint and get back a prediction id immediately.
  2. Poll the result endpoint with that id until the job completes.
Every model that works this way is marked Async: Yes on its page in the catalog.

1. Submit a job

Send a POST to the model’s capability endpoint:
POST /api/v3/{provider}/{model}/{capability}
For example, /api/v3/kling/kling-v2.6-pro/text-to-video. The exact path for every model is listed in the Endpoints table on its catalog page. The response returns right away with an id and an initial status:
{
  "id": "pred_8f3a1c",
  "status": "queued"
}

2. Poll for the result

Fetch the result endpoint until the prediction reaches a terminal state:
GET /api/v3/predictions/{id}/result
StatusMeaning
queuedAccepted and waiting for capacity.
processingThe model is generating.
completedDone — the response includes the output (typically URLs for media).
failedThe job errored; the response includes an error body.

Full example

# 1) Submit the job
curl https://api.huzz.ai/api/v3/kling/kling-v2.6-pro/text-to-video \
  -H "Authorization: Bearer $HUZZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A timelapse of city lights at night"}'

# 2) Poll for the result (repeat until completed or failed)
curl https://api.huzz.ai/api/v3/predictions/pred_8f3a1c/result \
  -H "Authorization: Bearer $HUZZ_API_KEY"

Polling guidance

  • Poll every 2–5 seconds for short jobs (images, audio clips); stretch to 10–15 seconds for long video renders.
  • Set an overall deadline. Give up and surface an error after a sensible ceiling for the media type rather than polling forever.
  • Retry the poll, not the submit. A dropped poll request is harmless to retry; resubmitting the job creates (and bills) a second generation.
  • Download outputs promptly. Completed predictions typically return media URLs — fetch and persist them on your side rather than hotlinking.