Create Image
Generate one or more images from a text prompt.
Billed per output image. Prompts are screened before anything is charged, and every request is steered to depict adults only.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your SpicyAPI key (sk-spicy-…). Create one in the dashboard under API Keys.
Body
application/jsonOutputs are persisted to our CDN and returned as durable URLs. Those URLs are the only images accepted as inputs to /v1/images/edits and /v1/videos/generations.
A model id from GET /v1/models, e.g. spicy-image-1.
What to generate.
What to avoid. Our own safety terms are always appended.
width*height, e.g. 1024*1024. Defaults to the model's first supported size.
How many images to return. Clamped to the model's maximum. Defaults to 1.
Reuse a seed to reproduce a result. Random when omitted.
Response
200 — application/jsonSuccessful Response
Request id, useful for support.
Always image.generation.
The model that produced the images.
Unix timestamp.
One entry per generated image.
What this request cost, in US dollars, already debited from your balance.
Was this page helpful?
curl --request POST \
--url https://api.spicyapi.com/v1/images/generations \
--header 'Authorization: Bearer $SPICYAPI_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "spicy-image-1",
"prompt": "a woman on a beach at golden hour, photorealistic",
"size": "1024*1024",
"n": 1
}'{
"id": "req_8f2a91c4",
"object": "image.generation",
"model": "spicy-image-1",
"created": 1755950400,
"data": [
{ "url": "https://cdn.spicyapi.com/outputs/a1b2/req_8f2a91c4-0.png" }
],
"cost_usd": 0.06
}