Generate images from text prompts using OpenDunes image generation models.
OpenDunes generates images through the dedicated POST /v1/images/generations endpoint, using models built for image output. Describe what you want in a text prompt and receive the image in the response.
POST https://opendunes.com/v1/images/generationsThe request and response are compatible with the OpenAI images API, so any SDK targeting that spec works unchanged.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | An image-generation model slug — filter the catalog with ?modality=image |
prompt | string | Yes | Text description of the image to generate |
n | integer | No | Number of images to generate (1–10, model-dependent) |
size | string | No | Output dimensions, e.g. "1024x1024", "1792x1024" |
curl https://opendunes.com/v1/images/generations \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.5-flash-image",
"prompt": "A terracotta geometric gate in a Saharan dune landscape, golden hour, architectural illustration.",
"n": 1,
"size": "1024x1024"
}'Each image comes back in the response itself: its bytes base64-encoded in b64_json, its type in media_type. OpenDunes also keeps a copy in Files and puts its id in file_id beside each image, so you can fetch it again later with GET /v1/files/{id}/content. A kept image never expires; it stays until you delete it.
{
"created": 1750000000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
"media_type": "image/png",
"file_id": "019383ac-5678-7000-b000-000000000002"
}
]
}A key with storage switched off keeps nothing it gets back, so its images carry no file_id.
If the provider returns no image, the request fails with 502 no_image and you are not charged.
Image generation is billed in DA per image — n images cost n × the model's per-image rate. Rates vary by model; see the pricing reference and the model detail page.
Some chat models can also return images inline by setting "modalities": ["image", "text"] on a POST /v1/chat/completions request — the image arrives as an images[] part on the assistant message. That is a chat capability, distinct from this dedicated image surface.
GET https://opendunes.com/api/models?modality=imageBrowse results at /models filtered to the image surface.