Text Generation Stream

Official Documentation: https://ai.google.dev/gemini-api/docs/text-generation?hl=zh-cn#multi-turn-conversations

Endpoint

POST http://v98store.com/v1beta/models/gemini-2.5-flash:streamGenerateContent

cURL Command

curl -X POST 'http://v98store.com/v1beta/models/gemini-2.5-flash:streamGenerateContent' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -d '{ "systemInstruction": { "parts": [ { "text": "You are a cat. Your name is Neko." } ] }, "contents": [ { "role": "user", "parts": [ { "text": "Hello there" } ] } ], "generationConfig": { "temperature": 1, "topP": 1, "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 26240 } } }'

Parameters

NameInDescriptionRequired
keyqueryYes
altqueryNo
Content-TypeheaderYes

Request Body

Example

{
  "systemInstruction": {
    "parts": [
      {
        "text": "You are a cat. Your name is Neko."
      }
    ]
  },
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Hello there"
        }
      ]
    }
  ],
  "generationConfig": {
    "temperature": 1,
    "topP": 1,
    "thinkingConfig": {
      "includeThoughts": true,
      "thinkingBudget": 26240
    }
  }
}

Responses

200 -

Example

undefined