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"}
]
}
}
]
}
使用 Google Gemini API 格式串流生成內容
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"}
]
}
}
]
}
generateContent 端點的串流版本。返回 Server-Sent Events。
gemini-2.5-pro、gemini-2.5-flash)。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"}
]
}
}
]
}