TextGeminiGemini.2.5.Flash.LiteNative.API
Gemini 2.5 Flash Lite - Native API - API Reference
- Call gemini-2.5-flash-lite model using Google Native API format
- Can use synchronous processing mode, returns conversation content in real-time
- Plain text conversation: Single-turn or multi-turn contextual dialogue, see simple_text and multi_turn examples in code samples
- Multimodal input: Supports text + image/audio/video mixed input, see audio_analysis, image_understanding, and multi_file examples in code samples
- Parameter tuning: Control generation quality via generationConfig
- Streaming: Replace
generateContentwithstreamGenerateContentin the URL
Authorization
AuthorizationstringheaderRequired
##All APIs require Bearer Token authentication## **Get API Key:** Visit [API Key Management Page](https://starmagic.ai/app/api-keys) to get your API Key **Add to request header:** ``` Authorization: Bearer YOUR_API_KEY ```
Authorization: Bearer YOUR_API_KEYRequest body
application/jsoncontentsobject[]Required
List of conversation contents, supports multi-turn dialogue and multimodal input
[
{
"role": "user",
"parts": [
null
]
}
]generationConfigobject
Generation configuration parameters
{
"temperature": 0.7,
"maxOutputTokens": 2000,
"topP": 0.9,
"topK": 40,
"candidateCount": 1,
"responseMimeType": "application/json",
"responseSchema": {},
"responseJsonSchema": {},
"thinkingConfig": {}
}systemInstructionobject
{
"role": "user",
"parts": [
null
]
}toolsobject[]
List of tools the model can call, such as function calling or code execution
[
{}
]toolConfigobject
Tool calling configuration (optional)
{}safetySettingsobject[]
Safety settings list (optional)
[
{}
]cachedContentstring
Cached content name, in the form cachedContents/{cachedContent}
"string"Response
application/json请求错误
Response body
errorobject
{
"code": 0,
"message": "string",
"type": "string",
"fallback_suggestion": "string"
}
