Documentation

Text Generation (Gemini)

Generate text with the Gemini-native generateContent format

POSThttps://api.tokenbyte.ai/v1beta/models/{model}:generateContent

Use streamGenerateContent for streaming. Authenticate with x-goog-api-key: <TOKENBYTE_API_KEY>.

Request body

FieldTypeRequiredDescription
contentsarrayYesConversation turns containing role and parts
systemInstructionobjectNoSystem instruction
generationConfigobjectNoSampling, output limit, and stop settings
tools, toolConfigarray/objectNoTools and calling policy
safetySettingsarrayNoSafety thresholds when supported

Parts may contain text, inlineData, fileData, functionCall, or functionResponse. Read output from candidates[].content.parts; token usage is returned in usageMetadata.