Nano Banana 2 (text to image)
Use your MyRouter API key with an OpenAI-compatible base URL, then pick the example that matches your stack.
Direct HTTP request for quick testing.
curl https://api.myrouter.ai/openai/v1/chat/completions \
-H "Authorization: Bearer $MYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-image-text-to-image",
"messages": [
{
"role": "user",
"content": "Hello from MyRouter"
}
]
}'