REST APIPOST

Generate Image

Queue an image from a text prompt and poll for the result. Returns a job ID straight away rather than holding the connection open.

Images take roughly 10 to 40 seconds, too long to hold an HTTP request open. So generation is two calls: start a job, then poll it.

POST /api/v1/ai/images

POST /api/v1/ai/images
{
  "prompt": "a red bicycle leaning against a yellow wall, soft morning light",
  "aspectRatio": "16:9",
  "model": "premium"
}
FieldRequiredDescription
promptYesWhat to draw. Up to 2000 characters
aspectRatioNo1:1 (default), 16:9, 9:16, 3:2, 2:3, 4:5, 5:4, 21:9, 9:21
modelNostandard (default) or premium
qualityNoLOW, MEDIUM or HIGH
sessionIdNoGroups related images. Omit it and one is created for you
referenceImagesNoUp to 5 public image URLs to steer the result
{
  "jobId": "generate-image-8f2a1c40-6d3b-4e91-b7c2-0a5d9e13f846",
  "sessionId": "b31c7a44-2f19-4c85-9d60-7e2af4c81b93",
  "status": "queued"
}

Keep the sessionId and pass it on the next call to keep a set of images together, the way a conversation keeps its messages. Leave it out and every image starts its own session.

GET /api/v1/ai/images/{jobId}

GET /api/v1/ai/images/generate-image-8f2a1c40-6d3b-4e91-b7c2-0a5d9e13f846
{
  "jobId": "generate-image-8f2a1c40-6d3b-4e91-b7c2-0a5d9e13f846",
  "sessionId": "b31c7a44-2f19-4c85-9d60-7e2af4c81b93",
  "status": "completed",
  "imageUrl": "https://cdn.adaptlypost.com/ai-images/ai-studio-4c81b93.png",
  "imageId": "d7e44a10-93bc-4f27-8ae5-1b06c2f4d938",
  "error": null
}
StatusMeaning
queuedWaiting for a worker
generatingThe model is drawing
processingUploading the result
completedimageUrl is ready to use
failederror says why

Poll every 3 to 5 seconds. Anything faster just burns rate limit.

imageUrl points at the CDN and can go straight into the mediaUrls of a post, so generating and scheduling is: create the image, poll until completed, then create a post with that URL.

Credits

Credits are charged when generation starts and refunded automatically if it fails, so a failed job costs nothing. With your own OpenAI or Google key connected, images run on your key and skip credits entirely. premium and standard draw different amounts.