429 and 5xx responses, as a reference for client-side polling implementations.
Scope
GET /v1/videos/:task_idGET /kling/v1/videos/:action/:task_idGET /kling/v1/images/:action/:task_idGET /vidu/ent/v2/tasks/:task_id/creationsGET /minimax/v1/query/video_generationGET /minimax/v2/query/video_generation/:task_idGET /byteplus/api/v3/contents/generations/tasks/:id
429 Too Many Requests
- Semantics: transient rate limiting (request frequency, concurrency, or per-group load) does NOT mean the task has failed.
Retry-After: baze platform guarantees that all429responses carry aRetry-Afterresponse header with an integer second value (default5). If the downstream provider has explicitly set this header, its value is preserved as-is.- Expected client handling:
- Read
Retry-After, wait for that many seconds, then issue the next query. - Do not treat
429as a terminal task status, and do not count it towards any “task failure” counter. - If
Retry-Afteris missing (e.g. stripped by an opaque proxy), fall back to a default5second backoff.
- Read
5xx Internal Error / Gateway Error / Service Unavailable
- Semantics: a transient failure in the platform or upstream provider. The task may still be running normally upstream, or it may have already failed — a
5xxresponse does not directly imply the task’s terminal state. - Expected handling: fail fast or retry with a bounded limit. Do not retry indefinitely.
- Exponential backoff is recommended (e.g.
5s,10s,20s… with an upper bound of60s). - Enforce a maximum retry count or total duration; once the threshold is exceeded, stop polling and surface a clear error to the user while preserving the
task_idso it can be queried again later once the service recovers. - Do not keep retrying forever just because you did not receive a
statusfield — the absence of a status is not the same as “still queued”.
- Exponential backoff is recommended (e.g.
- Response body convention: async task query endpoints still return a JSON response body on
5xx, with astatusfield and error details to distinguish “endpoint error” from “task still queued”, for example:
Retry-After: async task query endpoints also returnRetry-Afteron5xx(default5seconds), but this header is globally guaranteed only for429. Clients should not rely on5xxresponses always including it.
Other 4xx
4xx responses other than 429 (e.g. task_not_exist, parameter errors, auth failures) are deterministic errors. Stop polling immediately and handle them according to the error details.