Skip to main content
POST
/
generate
/
image
Generate Image
curl --request POST \
  --url https://api.supapost.so/generate/image \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "model": "<string>",
  "aspectRatio": "<string>",
  "referenceImageUrl": "<string>",
  "referenceStrength": 123,
  "influencerId": "<string>"
}
'
{
  "jobId": "0b1e9a5f-1234-4d8c-b2a0-...",
  "status": "pending"
}
Generates an image from a text prompt. This endpoint is always async — it returns a jobId immediately and the actual generation happens on a background queue. Poll GET /jobs/:id until status is completed, then read result.url. The completed image is automatically uploaded to R2 storage and saved to the team’s asset library.

Authentication

Authorization
string
Bearer token. Bearer <api-key-or-jwt>.

Body

prompt
string
required
Text description of the image to generate.
model
string
default:"fal:flux-schnell"
Model identifier in provider:model format. Use GET /models to list options.
aspectRatio
string
Aspect ratio for the generated image, e.g. "9:16", "1:1", "16:9".
referenceImageUrl
string
URL of a reference image for image-to-image generation.
referenceStrength
number
How closely to follow the reference image (0-1). Only used when referenceImageUrl is provided.
influencerId
string
If provided, the completed image is automatically appended to this influencer’s image array. Survives the user navigating away mid-generation.

Polling pattern

# 1. Submit
curl -X POST https://api.supapost.so/generate/image \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "sunset over tokyo", "aspectRatio": "9:16"}'
# → 202 { "jobId": "0b1e...", "status": "pending" }

# 2. Poll every 1-2 seconds
curl https://api.supapost.so/jobs/0b1e... \
  -H "Authorization: Bearer $KEY"
# → { "status": "processing", ... }
# → { "status": "completed", "result": { "url": "https://cdn.supapost.so/...jpg" } }
{
  "jobId": "0b1e9a5f-1234-4d8c-b2a0-...",
  "status": "pending"
}