GET
/
v1
/
tasks
/
{task_id}
Image generation - query task result
curl --request GET \
  --url https://coder.api.visioncoder.cn/v1/tasks/{task_id} \
  --header 'Authorization: Bearer <token>'
{
  "code": 200,
  "data": {
    "id": "task_01HZY3K8Q2W7X9V4",
    "status": "completed",
    "progress": 100,
    "created": 123,
    "completed": 123,
    "error": "<string>",
    "result": {
      "images": [
        {
          "url": [
            "<string>"
          ]
        }
      ]
    }
  }
}
查询 图片生成 提交的异步任务结果。任务状态流转:submittedprocessingcompleted / failed

调用示例

curl https://coder.api.visioncoder.cn/v1/tasks/task_01HZY3K8Q2W7X9V4 \
  -H "Authorization: Bearer $VISIONCODER_API_KEY"

响应示例

生成完成(status = completed):
{
  "code": 200,
  "data": {
    "id": "task_01HZY3K8Q2W7X9V4",
    "status": "completed",
    "progress": 100,
    "created": 1779438767,
    "completed": 1779438792,
    "result": {
      "images": [
        {
          "url": [
            "https://cdn.visioncoder.cn/images/task_01HZY3K8Q2W7X9V4/0.png"
          ]
        }
      ]
    }
  }
}
生成中(status = processing):
{
  "code": 200,
  "data": {
    "id": "task_01HZY3K8Q2W7X9V4",
    "status": "processing",
    "progress": 0,
    "created": 1779438767
  }
}
生成失败(status = failed):
{
  "code": 200,
  "data": {
    "id": "task_01HZY3K8Q2W7X9V4",
    "status": "failed",
    "progress": 0,
    "created": 1779438767,
    "error": "prompt rejected by content policy"
  }
}
图片 URL 有时效性,请在生成完成后尽快下载保存。

加群 & 客服

AI 技术交流群二维码
专属客服二维码

Authorizations

Authorization
string
header
required

Use the API key created at https://coder.visioncoder.cn/key as the Bearer token. Anthropic clients can pass the same key via the x-api-key header.

Path Parameters

task_id
string
required

Task ID returned by POST /v1/images/generations

Response

200 - application/json

A successful response.

code
integer
required

Status code; 200 means success.

Example:

200

data
TaskData · object
required