Skip to main content
POST
/
v1beta
/
models
/
{model}
:streamGenerateContent
curl -X POST "https://api.lemondata.cc/v1beta/models/gemini-1.5-pro:streamGenerateContent?key=sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [{"text": "Tell me a story"}]
      }
    ]
  }'
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {"text": "Once upon a time"}
        ]
      }
    }
  ]
}
Streaming version of the Gemini generateContent endpoint. Returns Server-Sent Events.

Path Parameters

model
string
required
Model name (e.g., gemini-1.5-pro, gemini-2.0-flash).

Query Parameters

key
string
API key (alternative to header authentication).

Request Body

Same as Generate Content.

Response

Returns a stream of JSON objects, each containing a partial response.
curl -X POST "https://api.lemondata.cc/v1beta/models/gemini-1.5-pro:streamGenerateContent?key=sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [{"text": "Tell me a story"}]
      }
    ]
  }'
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {"text": "Once upon a time"}
        ]
      }
    }
  ]
}