路徑參數
模型名稱(例如:
gemini-2.5-pro、gemini-2.5-flash)。For production integrations, prefer URL-based fileData / file_data media parts with a public https URL.
LemonData will route supported Gemini-native channels through the native path when possible and automatically fall back to the compatible internal conversion path when a native-ready route is unavailable for that multimodal request.查詢參數
API key(標頭驗證的替代方案)。
驗證
Gemini 端點支援多種驗證方式:?key=YOUR_API_KEY查詢參數x-goog-api-key: YOUR_API_KEY標頭Authorization: Bearer YOUR_API_KEY標頭
請求主體
對話內容。每個內容物件包含:
role(string):user或modelparts(array):內容 part。LemonData 目前支援:- 文字 part:
{ "text": "..." } - 內嵌媒體 part:
inlineData/inline_data - 基於 URL 的檔案 part:
fileData/file_data
- 文字 part:
模型的系統指令。
生成配置:
temperature(number):取樣溫度topP(number):核取樣機率topK(integer):Top-K 取樣maxOutputTokens(integer):最大輸出 token 數stopSequences(array):停止序列
安全過濾器設定。
回應
生成的內容候選。
Token 使用資訊。
多模態輸入範例
對於 Gemini 多模態請求,請把媒體放在contents[].parts[] 中,可以使用「內嵌位元組」或「基於 URL 的檔案引用」兩種方式。
目前公共 Gemini 契約支援的媒體類別:
- 圖片
- 音訊
- 影片
inlineData 或 inline_data,並傳入檔案位元組的 Base64 內容。
對於 URL 媒體,請使用 fileData 或 file_data,並傳入可公開存取的 https URL。