跳轉到主要內容
POST
Generate Content

授權

x-goog-api-key
string
header
必填

Used by Gemini-shaped endpoints (/v1beta/...). The value is the gateway API key, shared with other endpoint shapes. The google-genai SDK uses this header by default.

路徑參數

model
string
必填

Gemini model name, e.g. gemini-2.5-pro.

主體

application/json

Native Gemini generateContent request body. Field definitions here are illustrative — refer to https://ai.google.dev/api/rest/v1beta/models/generateContent as the authoritative reference.

contents
object[]
generationConfig
object
safetySettings
object[]
systemInstruction
object
tools
object[]

回應

ok

Native Gemini response body. Refer to Google's official documentation for the authoritative field reference.