Gemini-compatible API
GetRouter exposes Gemini-compatible model listing and content generation endpoints.
Replace {model} with the exact model ID.
List models
The response uses a Gemini-compatible model list shape.
Generate content
Generated content is returned in the Gemini-compatible candidates structure. Usage can be returned in usageMetadata.
Request fields
The generateContent schema includes:
contentswithuserormodelroles- Text parts
- Inline data parts with
mimeTypeand Base64data generationConfig, including temperature, top-p, top-k, maximum output tokens, and stop sequencessafetySettingstoolssystemInstruction
Model support varies. Start with text-only content before adding multimodal input, tools, or model-specific configuration.
Inline data example
A compatible multimodal model can accept an inline data part:
Gemini image generation payloads
The same generateContent path can expose image-oriented response configuration for compatible models, including response modalities and image configuration. Use the exact model documentation and API Reference example for those requests.
Compatibility notes
- Gemini-compatible clients may construct URLs differently from OpenAI-compatible clients.
- Do not enter
https://getrouter.ai/v1into a Gemini client unless its integration guide explicitly asks for that value. - Confirm whether the client expects an API root, an API version path, or a complete operation endpoint.
