ImageOut
imageimageThe generation's identifier.
generate (from a description) or edit (from the caller's images).
Possible values: [generate, edit]
queued, then running; it ends completed, failed or canceled and does not change after that.
Possible values: [queued, running, completed, failed, canceled]
error object
Why it failed, when status is failed.
- GenerationErrorOut
- null
Why the generation failed: content_blocked (a content safety check refused the request or an input), insufficient_credits (the billing account ran out), invalid_input (an input could not be used), generation_failed (it did not produce a result) or timeout (it did not finish in time).
Possible values: [content_blocked, insufficient_credits, insufficient_available_credits, invalid_input, generation_failed, timeout]
A human-readable explanation.
files object[]
The results, once completed — the caller's own files from then on.
filefileA link to download the file's content, signed afresh on every read and valid for 60 minutes (until download_url_expires_at). Fetch the file again for a new link. null when a link cannot be made right now.
When download_url stops working.
When the file expires: from then on it can no longer be read or used, and its content is deleted. null when it never expires — a file sent in a message is kept with that conversation, a file a generation uses is kept, and a generation's output is kept. An uploaded file expires 30 days after its upload unless it is sent in a message or used by a generation first.
{
"object": "image",
"id": "string",
"type": "generate",
"status": "queued",
"error": {
"code": "content_blocked",
"message": "string"
},
"files": [
{
"object": "file",
"id": "string",
"filename": "string",
"size": 0,
"content_type": "string",
"created_at": "2024-07-29T15:51:28.071Z",
"download_url": "string",
"download_url_expires_at": "2024-07-29T15:51:28.071Z",
"expires_at": "2024-07-29T15:51:28.071Z"
}
],
"created_at": "2024-07-29T15:51:28.071Z",
"completed_at": "2024-07-29T15:51:28.071Z"
}