Gemini-compatible API
The Gemini-compatible route accepts Google-style generateContent requests and translates them to rout.my routing internally.
text
POST https://api.rout.my/compatible/v1beta/models/{model}:generateContent
POST https://api.rout.my/compatible/v1beta/models/{model}:streamGenerateContentThe /gemini/... alias is also available for clients that expect that prefix.
Authentication
Both styles are accepted:
http
Authorization: Bearer sk_your_key_hereor:
text
?key=sk_your_key_hereGenerate content
bash
curl "https://api.rout.my/compatible/v1beta/models/provider%2Fmodel-id:generateContent?key=$ROUTMY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Write a short greeting." }
]
}
]
}'If the client cannot include slashes in the path model name, use a short alias only when that alias is configured. The exact model ID from /v1/models is still the safest value for OpenAI-compatible endpoints.
Image output
For Gemini-style image generation, include IMAGE in responseModalities:
json
{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Create a square icon of a blue glass cube." }
]
}
],
"generationConfig": {
"responseModalities": ["IMAGE", "TEXT"],
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "1K"
}
}
}Generated images are returned as Gemini-style inlineData parts when available.
Streaming
text
POST /compatible/v1beta/models/{model}:streamGenerateContentStreaming responses are sent as Server-Sent Events in Gemini-compatible shape.
Models list
Gemini-compatible clients can also call:
text
GET https://api.rout.my/compatible/v1/modelsor:
text
GET https://api.rout.my/compatible/models