Recommended endpoint
Minimal request
cURL example
Python example
Node.js example
Best practices
- Gemini uses the same family of APIs for image understanding and generation
- Generated images usually come back through
inlineData, so decode server-side first - Reused reference images are better managed with the Files API
