Get image task
Poll the status and result of async GPT Image / Gemini image tasks (`Prefer: respond-async`).
/v1/images/tasksCreate image or Edit image with Prefer: respond-async returns 202 and a task_id immediately; then query it with this endpoint. The task ID can only go in the task_id query parameter, not in the path.
The status goes through pending / processing / retrying; the terminal states are completed and failed. When done, read result_content: one line per image, , as a relative path; prepend https://api.hop-base.com to access it. The URL opens without a key, so do not share it publicly; download it to your own storage soon after completion and do not treat it as long-term storage.
Only problems found during generation (such as a Gemini reference image failing to download or the model refusing) make the task fail; in that case only an error string is returned, with no error code. Submission only checks that the balance is above 0 and reserves nothing; after a terminal state, usage shows the actual charge, visible only to the key that created the task.
Kling and Midjourney images do not use this endpoint; use Get video task.
Headers
Bearer sk-…: an API key created in the console under API keys; its group must include the requested model
Query parameters
The task_id returned at submission
Length≥ 1 chars
Returns
200Task object (including failed tasks)
Task ID
pending / processing / retrying are in progress; completed / failed are terminal
Valuespendingprocessingretryingcompletedfailed
Result when done: Markdown, one line per image, . The URL is a relative path; prepend https://api.hop-base.com to access it. It opens without a key, so do not share it publicly, and download it soon
Failure reason (an English string, no error code); present only when failed
Present once the task is completed or failed; visible only to the key that created the task
Amount actually deducted from the balance for this task; usually 0 if generation failed, or the actual charge if it failed after billing was settled
Ledger currency, currently CNY
Amount in CNY (fixed 1 USD = 6.8 CNY), for reconciliation
Amount in USD, for reconciliation
Errors
missing_api_key / invalid_api_key / api_key_expired)