テキストGeminiGemini.2.5.Flash.LiteNative.API
Gemini 2.5 Flash Lite - Native API - APIリファレンス
- Google Native API形式でgemini-2.5-flash-liteモデルを呼び出し
- 同期処理モードを使用可能、会話内容をリアルタイムで返却
- プレーンテキスト会話:シングルターンまたはマルチターンのコンテキスト対話、コードサンプルのsimple_textとmulti_turnの例を参照
- マルチモーダル入力:テキスト+画像/音声/動画の混合入力に対応、コードサンプルのaudio_analysis、image_understanding、multi_fileの例を参照
- パラメータ調整:generationConfigで生成品質を制御
- ストリーミング:URL の
generateContentをstreamGenerateContentに置き換えてください
認証
Authorizationstringheader必須
##すべてのAPIにBearer Token認証が必要です## **APIキーの取得:** [APIキー管理ページ](https://starmagic.ai/app/api-keys)にアクセスしてAPIキーを取得してください **リクエストヘッダーに追加:** ``` Authorization: Bearer YOUR_API_KEY ```
Authorization: Bearer YOUR_API_KEYリクエストボディ
application/jsoncontentsobject[]必須
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"レスポンス
application/json请求错误
レスポンスボディ
errorobject
{
"code": 0,
"message": "string",
"type": "string",
"fallback_suggestion": "string"
}
