Query task result
curl --request GET \
--url https://apistable.ai/api/v1/tasks/{task_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apistable.ai/api/v1/tasks/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "task_example",
"model": "prism-image-2",
"status": "succeeded",
"message": "",
"created_at": "2026-11-01T08:30:00Z",
"completed_at": "2026-11-01T08:31:20Z",
"duration": 80000,
"charged_credits": 80,
"input": "{\"prompt\":\"A red fox\",\"output_count\":3,\"fallback\":true}",
"result": {
"urls": [
"https://cdn.example.com/a.png",
"https://cdn.example.com/b.png"
]
}
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}Common APIs and guides
Query task
Read the final task result and total charged Credits.
GET
/
api
/
v1
/
tasks
/
{task_id}
Query task result
curl --request GET \
--url https://apistable.ai/api/v1/tasks/{task_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apistable.ai/api/v1/tasks/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "task_example",
"model": "prism-image-2",
"status": "succeeded",
"message": "",
"created_at": "2026-11-01T08:30:00Z",
"completed_at": "2026-11-01T08:31:20Z",
"duration": 80000,
"charged_credits": 80,
"input": "{\"prompt\":\"A red fox\",\"output_count\":3,\"fallback\":true}",
"result": {
"urls": [
"https://cdn.example.com/a.png",
"https://cdn.example.com/b.png"
]
}
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}Operations are enabled individually by server configuration. Disabled operations return 503 without a task. Music credit deduction is currently disabled.
Task response
status is processing, succeeded or failed. All queue/fallback/reconciliation phases are processing. Once all work ends, at least one success means succeeded; zero successes means failed. Partial success has no separate public status. duration is integer milliseconds from creation to completion. completed_at, duration and charged_credits are null until the task is terminal. A failed task charges 0. A succeeded task exposes only its final total charge. message passes through the supplier error for a failed task; after all routes fail, it contains the last supplier error. Success/processing use an empty string. The outer msg remains success when the query itself worked.{
"code": 200,
"msg": "success",
"data": {
"task_id": "task_example",
"model": "prism-image-2",
"status": "succeeded",
"message": "",
"created_at": "2026-11-01T08:30:00Z",
"completed_at": "2026-11-01T08:31:20Z",
"duration": 80000,
"charged_credits": 80,
"input": "{\"prompt\":\"A red fox in a snowy forest\",\"output_count\":3,\"fallback\":true}",
"result": {
"urls": [
"https://cdn.example.com/a.png",
"https://cdn.example.com/b.png"
]
}
}
}