Generate Image
AI Studio
Generate Image
Generate an AI image from a text prompt using a selection of AI image models
POST
Generate Image
Overview
The Generate Image API creates an AI-generated image based on a text prompt. You can choose from multiple AI image models, specify an aspect ratio, apply a visual style, and optionally provide a reference image to guide the output. The API returns a job ID that you can use to poll for the result once the image generation is complete.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 Headers
API key for authentication (starts with
pictai_)Must be
application/jsonRequest Body
A text description of the image you want to generate. The prompt must be between 5 and 5,000 characters.Example:
"A serene mountain landscape at sunset with a reflective lake in the foreground"The AI model to use for image generation. Each model produces different visual styles and quality levels. Defaults to
seedream3.0 if not specified.Supported models: seedream3.0, flux-schnell, nanobanana, nanobanana-proModel Capabilities and Pricing:| Model | Supported Aspect Ratios | AI Credits per Image |
|---|---|---|
seedream3.0 | 1:1, 16:9, 9:16 | 2 |
flux-schnell | 1:1, 16:9, 9:16 | 0.6 |
nanobanana | 1:1, 16:9, 9:16 | 4 |
nanobanana-pro | 1:1, 16:9, 9:16 | 14 |
The aspect ratio for the generated image. The available values depend on the selected model. Defaults to the first supported aspect ratio of the chosen model. Refer to the model table above for supported aspect ratios per model.
An optional visual style to apply to the generated image.Supported values:
photorealistic, artistic, cartoon, minimalist, vintage, futuristicAn optional URL of a reference image to guide the generation. The URL must be a valid, publicly accessible URI.
An optional webhook URL that will receive a notification when the image generation job completes. The URL must be a valid URI.
Response
Success Response (200)
true when the job has been created successfullyThe unique identifier (UUID) of the image generation job. Use this ID to poll for the result using the Get Image Generation Job endpoint.
Response Examples
Status Codes
| Status Code | Description |
|---|---|
| 200 | Job created successfully. Use the returned jobId to poll for the result. |
| 400 | Invalid request body. Check the fields array for specific validation errors. |
| 401 | Unauthorized. The API key in the Authorization header is missing or invalid. |
| 500 | Internal server error. Retry the request after a brief delay. |
Code Examples
Next Steps
After receiving thejobId, poll for the image generation result using the Get Image Generation Job endpoint. Use a polling interval of 10–30 seconds to check the job status.