Let any model draw a picture mid-answer, billed on the picture model's meter.
The opendunes:image_generation helper lets any model make a picture. When the model decides a picture is needed, it writes a prompt; a picture model draws it, and the picture's address goes back to the model, which places it in its answer.
curl https://opendunes.com/v1/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [{ "role": "user", "content": "Design a logo idea for a couscous restaurant in Oran, then describe it." }],
"tools": [{
"type": "opendunes:image_generation",
"parameters": { "model": "openai/gpt-5-image-mini", "aspect_ratio": "1:1" }
}]
}'It works the same on /v1/responses and /v1/messages.
| Parameter | Does |
|---|---|
model | the picture model — any on /v1/images/models. Default openai/gpt-5-image |
size · aspect_ratio | the picture's dimensions, such as 1024x1024, or its shape, such as 16:9 |
quality | such as low, medium, high |
background | such as transparent |
output_format · output_compression | png, jpeg, webp, and a compression from 0 to 100 |
moderation | such as auto or low |
Every parameter but model goes to the picture model as you send it; which ones it honours depends on the model.
Each picture is billed in DA on the picture model's own meter, as on its model page, on top of the calling model's tokens. The request's usage.cost carries the whole charge. A picture counts as one of the request's 30 helper steps.