Gemini native (generateContent)
POST https://gateway.mindproxy.ai/v1beta/models/<model>:generateContent
POST https://gateway.mindproxy.ai/v1beta/models/<model>:streamGenerateContentCompatible with Google Gemini's native API. The model goes in the path.
Authentication
Accepts the URL query parameter ?key=sk-..., or Authorization: Bearer sk-....
Request
bash
curl "https://gateway.mindproxy.ai/v1beta/models/gemini-1.5-pro:generateContent?key=$TT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{"parts": [{"text": "Introduce Guangzhou in one sentence."}]}
]
}'| Field | Description |
|---|---|
contents | Conversation content (parts array, supports text / multimodal) |
generationConfig | Sampling params (temperature, maxOutputTokens, etc.) |
systemInstruction | System instruction |
Response
json
{
"candidates": [
{
"content": {"parts": [{"text": "Guangzhou is the capital of Guangdong, a Lingnan culture hub."}], "role": "model"},
"finishReason": "STOP"
}
],
"usageMetadata": {"promptTokenCount": 12, "candidatesTokenCount": 14, "totalTokenCount": 26}
}usageMetadata is the billing basis.
Streaming
Switch the endpoint to :streamGenerateContent; output streams in Gemini's streaming format.
Path prefix
The branded equivalent path also works: /gemini/v1beta/models/<model>:generateContent.