Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xingchaoyiqing.com/llms.txt

Use this file to discover all available pages before exploring further.

After creating a GPT Image 2 generation task, poll this endpoint with the task ID to check progress and retrieve the generated image URL when the task is complete. Because generation is asynchronous, you’ll need to call this endpoint periodically until the task reaches a terminal state (completed or failed).

Base URL

https://zcbservice.aizfw.cn/kyyReactApiServer

Endpoint

GET /v1/result/{id}

Authentication

Include your API key as a Bearer token in the Authorization header on every request:
Authorization: Bearer YOUR_API_KEY

Path Parameters

id
string
required
The task ID returned by the Create Image Task endpoint. Example: image_fd35ee52-2a98-44a6-b930-29a88ce9b8fd.

Response Fields

id
string
The unique task ID for this generation job.
object
string
The object type. Always image.generation.
created
integer
Unix timestamp indicating when the task was created.
model
string
The model name used for this generation task.
status
string
The current task status.
ValueMeaning
queuedTask is waiting in the queue
processingTask is actively being processed
completedGeneration succeeded — image_url is now available
failedGeneration failed — see the error field
image_url
string
The URL of the generated image. Only present (and non-null) when status is completed. Image URLs are valid for 24 hours — download and store the image promptly.
error
string
An error message describing what went wrong. Only present when status is failed.

Status Flow

Tasks move through the following states in order. Once a task reaches completed or failed, it will not change again.
queued  →  processing  →  completed
                       ↘  failed
StageDescription
queuedTask has been created and is waiting for a worker
processingA worker has picked up the task and is generating your image
completedImage generation succeeded — retrieve the URL from image_url
failedImage generation failed — retrieve the reason from error

Code Example

cURL
curl -X GET https://zcbservice.aizfw.cn/kyyReactApiServer/v1/result/image_fd35ee52-2a98-44a6-b930-29a88ce9b8fd \
  -H "Authorization: Bearer YOUR_API_KEY"

Response: Processing

{
  "id": "image_fd35ee52-2a98-44a6-b930-29a88ce9b8fd",
  "object": "image.generation",
  "created": 1774836724,
  "model": "gpt-image-2",
  "status": "processing",
  "image_url": null,
  "error": null
}

Response: Completed

{
  "id": "image_fd35ee52-2a98-44a6-b930-29a88ce9b8fd",
  "object": "image.generation",
  "created": 1774836724,
  "model": "gpt-image-2",
  "status": "completed",
  "image_url": "https://cdn.example.com/generated/image_fd35ee52-2a98-44a6-b930-29a88ce9b8fd.png",
  "error": null
}

Response: Failed

{
  "id": "image_fd35ee52-2a98-44a6-b930-29a88ce9b8fd",
  "object": "image.generation",
  "created": 1774836724,
  "model": "gpt-image-2",
  "status": "failed",
  "image_url": null,
  "error": "Generation failed: content policy violation"
}

Image URLs expire in 24 hours. Once status is completed, download and save the image to your own storage immediately. After expiry, the URL will become inaccessible and the image cannot be recovered.
Polling strategy: Request the status every 2–5 seconds. Stop polling as soon as status is either completed or failed — further requests after a terminal state will return the same response without change.