[API Change Notice] Asynchronous Task Retrieval — Response Envelope Removal #92
tensornull
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
[API Change Notice] Asynchronous Task Retrieval — Response Envelope Removal
retrieve/pollendpoints1. Summary
To improve consistency with upstream providers and to align the
retrievepath with the already-unwrapped
createpath, CometAPI will remove the{code, message, data: {...}}wrapper envelope from the response body ofall asynchronous task retrieve / poll endpoints.
Starting from the effective date, retrieve endpoints will return the
upstream provider's native JSON body at the top level, identical in
shape to what the respective model provider's official API returns.
2. Scope
2.1 Affected endpoints
The change applies to the GET / poll side of the following asynchronous
suppliers:
GET /kling/v1/videos/{action}/{task_id}and related pathsGET /replicate/v1/predictions/{id}POST /runway/feedand related retrieve pathsGET /bria/{request_id}GET /flux/v1/get_resultGET /grok/v1/videos/{request_id}2.2 Not affected
create(POST) endpoints — the request and response formats remain unchanged.3. Technical details
3.1 Current behavior (before 2026-04-28)
Retrieve responses are wrapped in a CometAPI-specific envelope that
embeds the upstream body at
.data.data:{ "code": "success", "message": "", "data": { "task_id": "<id>", "action": "<normalized_action>", "status": "<normalized_status>", "fail_reason": "", "submit_time": 0, "start_time": 0, "finish_time": 0, "progress": "<percent>", "data": { /* upstream provider's native body */ } } }3.2 New behavior (on and after 2026-04-28)
The envelope and all CometAPI-normalized fields are removed. The response
body is the upstream provider's native JSON, served directly:
{ /* upstream provider's native body */ }3.3 Reference example — Kling text-to-video retrieve
Before:
{ "code": "success", "message": "", "data": { "task_id": "2046194428712378368", "action": "TEXT2VIDEO", "status": "NOT_START", "fail_reason": "", "submit_time": 1776685744, "start_time": 0, "finish_time": 0, "progress": "0%", "data": { "task_id": "2046194428712378368", "task_info": {}, "created_at": 1776685742916, "updated_at": 1776685742916, "task_status": "submitted" } } }After:
{ "task_id": "2046194428712378368", "task_info": {}, "created_at": 1776685742916, "updated_at": 1776685742916, "task_status": "submitted" }3.4 Additional example — xAI (Grok) video retrieve
Before:
{ "code": "success", "message": "", "data": { "task_id": "<request_id>", "action": "VIDEO_GENERATION", "status": "NOT_START", "fail_reason": "", "submit_time": 0, "start_time": 0, "finish_time": 0, "progress": "0%", "data": { "request_id": "<request_id>" } } }After:
{ "request_id": "<request_id>" }3.5 Field-level impact
code,message(root)data.actiondata.statustask_status,status)data.progressdata.fail_reasondata.submit_time/start_time/finish_timecreated_at,updated_at, etc.)data.data.*(upstream body)4. Migration guide
upstream provider's native body. Remove any access to
response.data.data.*and read fields directly fromresponse.*.fields (
status,progress,fail_reason) to the upstreamprovider's own state fields, which vary per supplier.
TypeScript interfaces, Go structs, Java DTOs, etc.) against the new
shape.
native error semantics — HTTP status codes and the provider's own
error body — rather than the CometAPI
{code, message}envelope.the wrapper removal is purely a response-shape change, you can
validate the new parser against the upstream body nested at
response.data.datatoday.5. Recommended timeline
6. Support
If you encounter any issue during migration, please contact the CometAPI
support team through your usual channel. Please include:
task_id/request_id.We apologize for the disruption this change may cause and appreciate
your cooperation in making the CometAPI platform more consistent and
standards-aligned.
— The CometAPI Engineering Team
All reactions