curl "https://api.arouter.ai/v1beta/models/gemini-2.5-flash:streamGenerateContent?key=lr_live_xxxx&alt=sse" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "Tell me a story."}]}]
}'
model = genai.GenerativeModel("gemini-2.5-flash")
response = model.generate_content("Tell me a story.", stream=True)
for chunk in response:
print(chunk.text, end="")
Gemini 네이티브
스트리밍 콘텐츠 생성
Gemini 호환 스트리밍 generateContent 엔드포인트.
POST
/
v1beta
/
models
/
{model}
:streamGenerateContent
curl "https://api.arouter.ai/v1beta/models/gemini-2.5-flash:streamGenerateContent?key=lr_live_xxxx&alt=sse" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "Tell me a story."}]}]
}'
model = genai.GenerativeModel("gemini-2.5-flash")
response = model.generate_content("Tell me a story.", stream=True)
for chunk in response:
print(chunk.text, end="")
curl "https://api.arouter.ai/v1beta/models/gemini-2.5-flash:streamGenerateContent?key=lr_live_xxxx&alt=sse" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "Tell me a story."}]}]
}'
model = genai.GenerativeModel("gemini-2.5-flash")
response = model.generate_content("Tell me a story.", stream=True)
for chunk in response:
print(chunk.text, end="")
⌘I