Gemini generateContent
Gemini REST-shaped compatible endpoint with streaming (alt=sse).
Endpoint
POST/gemini/v1beta/models/{model}:generateContent
Use :streamGenerateContent?alt=sse for streaming. The request body is the standard Gemini shape {contents:[{role, parts:[{text}]}], systemInstruction?, generationConfig?, tools?}.
curl "https://www.link42.ai/gemini/v1beta/models/gemini-3-pro:generateContent" \
-H "x-goog-api-key: $LINK42_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents": [{"role": "user", "parts": [{"text": "Summarise the benefits of an AI gateway."}]}]}'- promptTokenCount / candidatesTokenCount in usageMetadata are the billing basis.
- The older /v1beta/models/... path still works. /gemini is a REST Base URL; custom endpoint support in Google GenAI SDKs varies by version and mode.
Model reference
Gemini bodies are not rewritten across protocols; contents[] reaches the upstream as sent.
| Model id | Name | Upstream | Billing | Fields that differ | Limits and gotchas |
|---|---|---|---|---|---|
| gemini-3-pro-preview | Gemini3-pro | Vertex AI | Per token | generationConfig accepts thinkingConfig (thinkingLevel or thinkingBudget), temperature, topP and maxOutputTokens, plus optional safetySettings; candidates[].content.parts[] may carry thoughtSignature | Billing reads usageMetadata.promptTokenCount and candidatesTokenCount; thoughtsTokenCount is reported as a reasoning subset but is not billed under either compatibility profile |