Skip to content

Text Generation - Stream

POST https://www.kkiai.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent

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

Request Parameters

Authorization

Add the Authorization parameter to the Header. Its value is the Token concatenated after Bearer.

Example: Authorization: Bearer ********************

Query Parameters

ParameterTypeRequiredDescriptionExample
keystringRequired{{YOUR_API_KEY}}
altstringOptionalsse

Header Parameters

ParameterTypeRequiredDescriptionExample
Content-TypestringRequiredapplication/json

Body Parameters (application/json)

ParameterTypeRequiredDescription
contentsarray[object]Required
  └ partsarray[object]Optional

Request Example

json
{
  "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
    }
  }
}

cURL Example

bash
curl --location -g --request POST 'https://www.kkiai.com/v1beta/models/gemini-3-pro-preview:streamGenerateContent?key=&alt=sse' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "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
    }
  }
}'

Response

🟢 200 Success

Response Example

json
{}