Skip to main content
POST
/
pictoryapis
/
v1
/
aistudio
/
images
Generate Image
curl --request POST \
  --url https://api.pictory.ai/pictoryapis/v1/aistudio/images \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "prompt": "<string>",
  "model": "<string>",
  "aspectRatio": "<string>",
  "style": "<string>",
  "referenceImageUrl": "<string>",
  "webhook": "<string>"
}
'
{
    "success": true,
    "data": {
        "jobId": "4d82d040-4394-4371-867d-72ae1dd62b6d"
    }
}

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

POST https://api.pictory.ai/pictoryapis/v1/aistudio/images

Request Headers

Authorization
string
required
API key for authentication (starts with pictai_)
Authorization: YOUR_API_KEY
Content-Type
string
required
Must be application/json

Request Body

prompt
string
required
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"
model
string
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:
ModelSupported Aspect RatiosAI Credits per Image
seedream3.01:1, 16:9, 9:162
flux-schnell1:1, 16:9, 9:160.6
nanobanana1:1, 16:9, 9:164
nanobanana-pro1:1, 16:9, 9:1614
aspectRatio
string
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.
style
string
An optional visual style to apply to the generated image.Supported values: photorealistic, artistic, cartoon, minimalist, vintage, futuristic
referenceImageUrl
string
An optional URL of a reference image to guide the generation. The URL must be a valid, publicly accessible URI.
webhook
string
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)

success
boolean
true when the job has been created successfully
data
object
jobId
string
The 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

{
    "success": true,
    "data": {
        "jobId": "4d82d040-4394-4371-867d-72ae1dd62b6d"
    }
}

Status Codes

Status CodeDescription
200Job created successfully. Use the returned jobId to poll for the result.
400Invalid request body. Check the fields array for specific validation errors.
401Unauthorized. The API key in the Authorization header is missing or invalid.
500Internal server error. Retry the request after a brief delay.

Code Examples

Replace YOUR_API_KEY with your actual API key from the API Access page.
curl --request POST \
  --url 'https://api.pictory.ai/pictoryapis/v1/aistudio/images' \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "A serene mountain landscape at sunset with a reflective lake in the foreground",
    "model": "seedream3.0",
    "aspectRatio": "16:9",
    "style": "photorealistic"
  }'

Next Steps

After receiving the jobId, 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.