Guides
Generate Images
Create AI images from a prompt, reference images, or existing caption generations.
Use the image API when you need visuals to go with captions before you publish.
Prerequisites
- API key with
images:generate(andimages:readto poll) - Workspace ID
- A credit purchase on the account (signup bonus is not enough) and enough credits
1. Start an image generation
Minimal text-to-image example:
curl -X POST https://powerpost.ai/api/v1/images/generate \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Product photo of a phone app UI in dark mode, soft studio light"
}'Other modes (reference images, generate from a caption generation) are documented on the Images reference. Upload references with Upload Media first.
2. Poll until complete
curl https://powerpost.ai/api/v1/images/generations/GENERATION_ID \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID"Or subscribe to image_generation.completed / image_generation.failed via webhooks.
When complete, the response includes media IDs you can attach to a post.
3. Attach to a post
Pass those media_ids on post items when you create a post, then publish or schedule.
Related
- Images API
- Videos API
- Post types — media rules per surface