Text Generation (Gemini)
Generate text with the Gemini-native generateContent format
POST
https://api.tokenbyte.ai/v1beta/models/{model}:generateContentUse streamGenerateContent for streaming. Authenticate with x-goog-api-key: <TOKENBYTE_API_KEY>.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
contents | array | Yes | Conversation turns containing role and parts |
systemInstruction | object | No | System instruction |
generationConfig | object | No | Sampling, output limit, and stop settings |
tools, toolConfig | array/object | No | Tools and calling policy |
safetySettings | array | No | Safety thresholds when supported |
Parts may contain text, inlineData, fileData, functionCall, or functionResponse. Read output from candidates[].content.parts; token usage is returned in usageMetadata.