Gemini-compatible generateContent
When to use this page
Use this page when your client expects the Gemini generateContent API shape.
Base URL
https://api.quotaflow.ai
Endpoint
POST https://api.quotaflow.ai/v1beta/models/{model}:generateContent
Supported models
Text, multimodal, and reasoning-capable Gemini models:
gemini-3.5-flashgemini-3.1-pro-previewgemini-3-flash-previewgemini-2.5-progemini-2.5-flashgemini-2.5-flash-litegemini-3.1-flash-lite
Reasoning-capable models support Gemini-style thinking controls where the model family exposes them. Use generationConfig.maxOutputTokens when you need a hard output cap.
Use Gemini-native generationConfig.thinkingConfig for Gemini thinking controls. Do not send a top-level thinking field to Gemini-compatible endpoints; Quotaflow returns a clear 400 invalid_request_error for unsupported parameter shapes instead of retrying the request on another execution path.
Protocol surfaces
Quotaflow supports Gemini text models on two customer-facing surfaces when your key/package enables the model:
- Gemini-compatible:
:generateContent,:streamGenerateContent?alt=sse, and:countTokens. Use this surface for Gemini SDKs, cached-content workflows, and token counting. - OpenAI-compatible chat:
/openai/v1/chat/completionswith the same Gemini model ids andstream: truefor SSE. Use this surface when your app already speaks Chat Completions. Quotaflow preserves the Chat Completions request and response shape on this path instead of requiring Gemini-native fields.
Cached-content and countTokens requests require a Gemini-compatible route. OpenAI-compatible Gemini chat/SSE is for chat generation, not Gemini native cache management.
Capability availability and retries
Gemini availability is evaluated per model, protocol surface, and capability. Seeing a model in authenticated /models confirms key access, not that every combination of plain generation, streaming, function tools, hosted tools, image, document, audio, and video input is currently enabled. A valid request with no verified compatible supply returns 503, whether the known candidates are explicitly unavailable or still unverified. An unknown model returns 404, while malformed or protocol-incompatible parameters return 400. Retry only temporary 429, 503, and network failures; do not retry 400 request-shape errors on another model.
Image-capable Gemini models:
gemini-3-pro-image-previewgemini-3.1-flash-image-previewgemini-2.5-flash-image
When you call an image-capable model to generate an image, include generationConfig.responseModalities: ["IMAGE"] and an imageConfig size/aspect ratio. Quotaflow also fills safe defaults for image-preview models when these fields are omitted, but explicit fields make model behavior deterministic.
The google/ prefix is accepted for compatible Gemini model ids when your key/package enables that alias. Call your model discovery endpoint to confirm what your key can use.
For practical image examples, see Gemini 3.1 Flash Image reference and Gemini 3 Pro Image reference.
Curl
curl "https://api.quotaflow.ai/v1beta/models/gemini-3-pro-image-preview:generateContent" \
-H "x-goog-api-key: $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Create a clean teal product dashboard illustration." }
]
}
],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "1K"
}
}
}'
Quotaflow returns a Gemini-compatible response for Gemini-style clients.