Skip to main content
POST
/
images
/
generate
Generate a new image
curl --request POST \
  --url https://app.dafty.ai/api/v1/images/generate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "prompt": "A minimalist logo of a mountain at sunrise, flat vector style",
  "aspectRatio": "1:1",
  "quality": "high",
  "resolution": "2K",
  "variations": 2
}
'
{
  "data": {
    "id": "3f9a4c2e-7b1d-4e8a-9c3f-2a1b0c9d8e7f",
    "type": "image.generate",
    "status": "pending",
    "createdAt": "2026-06-16T10:00:00.000Z"
  }
}

Authorizations

x-api-key
string
header
required

Headers

Idempotency-Key
string

Optional unique key (≤255 chars) that makes this create idempotent: a retry with the same key returns the original job rather than starting a new one. Scoped to your API key; retained ~24h.

Maximum string length: 255

Body

application/json
prompt
string
required

The text prompt. Up to 2000 characters.

Required string length: 1 - 2000
aspectRatio
enum<string>
default:1:1

Aspect ratio of the generated image.

Available options:
1:1,
3:2,
2:3,
4:3,
3:4,
4:5,
5:4,
16:9,
9:16
quality
enum<string>
default:medium

Output quality tier. Higher quality costs more credits and takes longer.

Available options:
low,
medium,
high
resolution
enum<string>
default:1K

Output resolution. Higher resolutions cost more credits.

Available options:
1K,
2K,
4K
styleId
string<uuid>

Apply one of your saved styles (brand colours, type, logo) to the generation.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
references
string[]

Up to 4 reference images to guide the generation.

Maximum array length: 4

A reference image: either an https URL we ingest (SSRF-guarded, then re-hosted) or the id/url of one of your uploads or prior generations. Resolved server-side to our storage.

Required string length: 1 - 2048
variations
integer
default:1

How many variations to generate from this single request (1-4). All are returned in result.images; each carries an id you can edit/resize/upscale independently.

Required range: 1 <= x <= 4

Response

Accepted

data
object
required