Phiên bản streaming của endpoint Gemini generateContent. Trả về Server-Sent Events.
Tham số đường dẫn (Path Parameters)
Tên model (ví dụ: gemini-2.5-pro, gemini-2.5-flash).
Tham số truy vấn (Query Parameters)
API key (phương thức thay thế cho xác thực qua header).
Request Body
Tương tự như Generate Content.
Phản hồi (Response)
Trả về một luồng (stream) các đối tượng JSON, mỗi đối tượng chứa một phần của phản hồi.
curl -X POST "https://api.lemondata.cc/v1beta/models/gemini-2.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"}
]
}
}
]
}