Send image inputs and receive image outputs via the OpenDunes API from Go.
OpenDunes supports image inputs on vision-capable models (pass them inline in messages[].content), and image generation from text on dedicated image models.
Image inputs follow the OpenAI chat-completions content-part schema, so an OpenAI-compatible Go client pointed at https://opendunes.com/v1 sends them through its chat service — check your installed SDK version's own documentation for the exact content-part helpers, since they change between releases. The wire surface below is the contract any Go HTTP client can target directly.
Send a user message whose content is an array mixing an image_url part (an HTTPS URL or a data: base64 URL) and a text part:
curl https://opendunes.com/v1/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.5-pro",
"messages": [
{ "role": "user", "content": [
{ "type": "image_url", "image_url": { "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Sahara_desert.jpg/800px-Sahara_desert.jpg" } },
{ "type": "text", "text": "Describe this landscape." }
] }
]
}'The reply comes back in choices[0].message.content, exactly like a text completion.
Generate images from text prompts via POST /v1/images/generations — see Generations for the Go example.
Filter the catalog for vision-capable models: GET /api/models?capability=vision. Any model with the vision capability accepts image content parts in the messages array.