Get Image Generation Job
AI Studio
Get Image Generation Job
Retrieve the status and output of an AI image generation job
GET
Get Image Generation Job
Overview
This endpoint retrieves the current status and output of an AI image generation job using its unique job ID. While the generation is in progress, it returns the job status. Once the image generation completes, it returns the output including the image URL, dimensions, and AI credits consumed.A valid API key is required to use this endpoint. Obtain your API key from the API Access page in your Pictory dashboard.
API Endpoint
Request Parameters
Path Parameters
The unique identifier (UUID) of the image generation job. This is the
jobId returned by the Generate Image endpoint.Example: "4d82d040-4394-4371-867d-72ae1dd62b6d"Headers
API key for authentication (starts with
pictai_)Response
In-Progress Response
Returned while the image is being generated:The unique identifier of the image generation job
true while the job is processingCompleted Response
Returned when the image has been generated successfully:The unique identifier of the image generation job
true when the job has completed successfullyContains the image generation output.
"completed" when the image has been generated successfullyDirect download URL for the generated image file (PNG)
Width of the generated image in pixels
Height of the generated image in pixels
Number of AI credits consumed for this image generation
Failed Response
Returned when the image generation job has failed:The unique identifier of the image generation job
false when the job has failedResponse Examples
Status Codes
| Status Code | Description |
|---|---|
| 200 | Request processed successfully. Check the status field in data to determine the job state (in-progress, completed, or failed). |
| 401 | Unauthorized. The API key in the Authorization header is missing or invalid. |
| 404 | Job not found. The provided jobid does not match any existing job. |
| 500 | Internal server error. Retry the request after a brief delay. |
Completed Response Fields
| Field | Description |
|---|---|
url | Direct download link for the generated PNG image file |
width | Width of the generated image in pixels |
height | Height of the generated image in pixels |
aiCreditsUsed | Number of AI credits consumed for this generation |
Code Examples
Polling Best Practices
-
Use webhooks when possible. Configure a
webhookURL in the original generate image request to receive automatic notification when the job completes, rather than polling. - Implement timeouts. Set a reasonable maximum wait time. Image generation typically completes within a few minutes.
-
Handle failures gracefully. Inspect
error_codeanderror_messagein failed responses to determine the cause and whether the request can be retried.
