/v1/chat/completions endpoint.gemini-3-pro-image-previewgemini-3-pro-image-preview-2kgemini-3-pro-image-preview-4kgemini-2.5-flash-imagegemini-3.1-flash-image-previewGET https://api.nexara.net/v1/models and the Portal model list page.aspect_ratio and image_size are optional -- images will be generated without themchat.completion structuremodel: Image model IDmessages: Conversation message array, following the standard OpenAI Chat Completions formatmax_tokens / max_completion_tokens: Mapped to Gemini's native maxOutputTokenstemperaturetop_ptop_kaspect_ratio: Mapped to Gemini's native imageConfig.aspectRatioimage_size: Mapped to Gemini's native imageConfig.imageSizemessages.content format:{
"model": "gemini-3-pro-image-preview",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Using this image as a composition reference, draw a cat sitting by a window"},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAA..."
}
}
]
}
],
"max_tokens": 4096
}data: URI format for image_url.url on the Gemini native pipelinechoices[0].message.content as an array rather than a plain string:{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"model": "gemini-3-pro-image-preview",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": [
{"type": "text", "text": "Here is the generated image:"},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,AAAA..."
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 456,
"total_tokens": 579
}
}image_url.url, typically in data:image/...;base64,... formatusage field is still returned, allowing you to cross-reference consumption in both the response and the console/v1/chat/completions is supported: Gemini image models do not support /v1/messagesstream must be false or omittedchoices[0].message.content is always a plain text stringgemini-3-pro-image-preview-2k or gemini-3-pro-image-preview-4k directly