Skip to main content
POST
Gemini streamGenerateContent
Gemini 스트리밍 텍스트 생성 및 증분 이벤트 출력에 이 끝점을 사용합니다.
  • 일반적인 인증 패턴은 x-goog-api-key: {API_KEY}이지만 쿼리 문자열 API 키도 지원됩니다.
  • 요청 구조는 generateContent와 대부분 동일하며 contents가 핵심 필드입니다.
  • 응답은 하나의 최종 JSON 페이로드가 아닌 이벤트 스트림입니다.
  • 완료 상태 및 안전 메타데이터는 이후 청크에서만 완전해질 수 있습니다.

인증

x-goog-api-key
string
header
필수

경로 매개변수

model
string
필수

Gemini model name.

예시:

"gemini-2.5-pro"

본문

application/json
contents
object[]
필수
systemInstruction
object
generationConfig
object
safetySettings
object[]
tools
object[]

응답

Successful Gemini streaming response

The response is of type string.