Gemini
https://api.tokenbay.com/v1beta/models/{model}:generateContentNative Gemini paths
Gemini Paths
Gemini generation paths carry the model name and action in the URL. The model name is not parsed from a JSON body model field.
/v1beta/models/{model}:generateContent/v1beta/models/{model}:streamGenerateContent/v1/models/{model}:generateContent/v1/models/{model}:streamGenerateContentRequest
schemamodelpath stringRequiredThe model name comes from the URL path.
contentsarray<object>Required
Native Gemini contents. parts may include text, inlineData, fileData, and more.
contents[].rolestringOptionaluser or model.
contents[].parts[]array<object>OptionalContent block array.
parts[].textstringOptionalText content.
parts[].inlineDataobjectOptionalBase64 inline data, usually containing mimeType and data.
parts[].fileDataobjectOptionalFile input, usually containing mimeType and fileUri.
parts[].functionCallobjectOptionalFunction call initiated by the model.
parts[].functionResponseobjectOptionalFunction call result returned by the client.
systemInstructionobjectOptional
System instruction.
systemInstruction.parts[].textstringOptionalSystem instruction text.
generationConfigobjectOptional
Generation settings such as temperature, topP, topK, maxOutputTokens, stopSequences, responseMimeType, responseSchema, and thinkingConfig.
generationConfig.temperaturenumberOptionalSampling temperature.
generationConfig.topP / topKnumberOptionalSampling controls.
generationConfig.maxOutputTokensintegerOptionalMaximum output tokens.
generationConfig.stopSequencesstring[]OptionalStop sequences.
generationConfig.responseMimeTypestringOptionalResponse MIME type, such as application/json.
generationConfig.responseSchemaobjectOptionalStructured output schema.
generationConfig.responseModalitiesstring[]OptionalRequested output modalities.
generationConfig.thinkingConfigobjectOptionalThinking/reasoning configuration.
safetySettingsarray<object>Optional
Safety policy configuration.
safetySettings[].categorystringOptionalSafety category.
safetySettings[].thresholdstringOptionalBlocking threshold.
tools / toolConfigarray<object> | objectOptional
Function calling or tool configuration.
tools[].functionDeclarations[]array<object>OptionalFunction declarations.
functionDeclarations[].namestringOptionalFunction name.
functionDeclarations[].descriptionstringOptionalFunction description.
functionDeclarations[].parametersobjectOptionalFunction parameter schema.
toolConfig.functionCallingConfig.modestringOptionalFunction calling mode.
Response
schemaNon-streaming responses keep the Gemini generateContent shape. Streaming calls return Gemini streaming events.
candidates[]array<object>Optional
Candidate outputs, usually containing content, finishReason, safetyRatings, and similar fields.
candidates[].content.parts[]array<object>OptionalOutput content blocks.
parts[].textstringOptionalText output.
parts[].functionCallobjectOptionalFunction call output.
candidates[].finishReasonstringOptionalStop reason.
candidates[].safetyRatings[]array<object>OptionalSafety ratings.
usageMetadataobjectOptional
Token usage statistics.
usageMetadata.promptTokenCountintegerOptionalInput token count.
usageMetadata.candidatesTokenCountintegerOptionalCandidate output token count.
usageMetadata.totalTokenCountintegerOptionalTotal token count.
modelVersionstringOptionalModel version when returned upstream.
