Status, Polling, and Billing
Some generation tasks do not return a final result in a single request. A successful submission only means the task has been accepted. Continue querying until it succeeds or fails.
When this applies
Asynchronous tasks apply to video, music, and other generation endpoints that are enabled on the platform and accessible to your account. Check the model catalog or the platform's corresponding endpoint instructions before integrating. A model's name alone does not establish that it supports asynchronous tasks.
Ordinary Chat Completions requests and streaming output that arrives incrementally do not use the “submit, then query by task ID” process described here. If you only use chat clients or coding assistants, you can skip this page. Do not add asynchronous parameters to ordinary chat requests without a documented reason.
Standard workflow
Submit a task → Save the returned task ID → Query status at intervals → Read the final result or errorSubmission paths, query paths, task ID fields, and result fields depend on the endpoint. Obtain the relevant model's API instructions before integrating. This page explains the task lifecycle, not the complete request body for a particular video or music API. Do not guess endpoint paths and submit requests.
Different endpoints use different task identifiers and status fields. Select the matching set first:
| API | Save after submission | Check when querying | Success / failure |
|---|---|---|---|
| Video | id | status | completed / failed |
| Generic tasks | task_id | status | SUCCESS / FAILURE |
| Native SunoAPI | data | data.status | SUCCESS / FAILURE |
| Background Responses | id; also keep metadata.task_id | status | completed / failed, incomplete |
| Midjourney | result | status | SUCCESS / FAILURE |
For request examples, see Video, Music and Lyrics, Midjourney, Generic Tasks, and Background Responses.
Common OpenAI-compatible video paths are:
| Action | Method and path |
|---|---|
| Submit a video generation task | POST /v1/videos |
| Query task status | GET /v1/videos/{task_id} |
| Read a successful task's content | GET /v1/videos/{task_id}/content |
These are complete endpoint paths, relative to the service root https://certaedge.com. Query with the public task ID from the submission response and authenticate with a valid API Key from the same account. Do not substitute an upstream service's internal ID. Music and vendor-native APIs have their own paths; do not reuse video paths for them.
View tasks in the console
After submitting a task through a tool or the API, open task logs. Find the task by time and check its ID, status, and results. If no record appears, first confirm you used a key belonging to the current account. Keep the ID returned by the client when contacting support.
Handle statuses
| Status category | What to do |
|---|---|
| Waiting or processing | Keep the task ID and wait for the next query |
| Success | Read the returned result or file URL |
| Failure | Record the error, check parameters and inputs, then decide whether to resubmit |
OpenAI-compatible video queries typically use queued, in_progress, completed, and failed for queued, processing, completed, and failed tasks. Other APIs or the console may use different names; follow the relevant API instructions. HTTP 200 does not necessarily mean generation succeeded. Always inspect the response body too.
Control polling frequency
- Start with one query every 15 seconds and increase the interval if rate-limited. Follow any explicit endpoint requirements. Task status may update periodically, so repeated identical responses do not necessarily mean a task is stuck.
- Set an overall waiting limit in your application. After it expires, keep the task ID for later queries and troubleshooting.
- After a client timeout, check whether you already received a task ID before submitting again.
- Resubmitting can create a separate task and incur additional charges.
Set a polling limit
Applications and workflows must set a maximum number of queries or an overall waiting limit. For example, query every 15 seconds, up to 60 times, then keep the task ID and stop waiting. This is an application waiting policy, not a guarantee that the service will finish within that time.
Route HTTP errors and unrecognized statuses to error handling. Do not wait indefinitely or treat a failed query as failed generation and immediately resubmit.
Results and billing
Save result files promptly if you need to keep them. If input or result URLs expire, retrieve their content before expiry.
Charges and billing adjustments after failure follow console records and the platform's current rules. Do not infer that a refund has occurred from a client timeout or failed task status.
Troubleshooting
| Problem | What to check |
|---|---|
| Task not found | Does the ID come from this submission? Are you using the same account and the matching query endpoint? |
| Task keeps processing | Is it still queued? Are the polling interval and application timeout reasonable? |
| Input cannot be retrieved | Can the server reach the URL? Do the file format and size meet the requirements? |
| 429 response | Reduce concurrency and polling frequency, then back off as directed by the error |
| Failed task status | Save the full error and task ID, then check parameters and model capabilities |
See FAQ and Troubleshooting for more status codes. For assistance, provide the task ID, time, and error details to CertaEdge support. Do not send your complete API Key.