메인 콘텐츠로 건너뛰기
POST
/
v1beta
/
models
/
{model}
:streamGenerateContent
Gemini streamGenerateContent
curl --request POST \
  --url https://maas.apigo.ai/v1beta/models/{model}:streamGenerateContent \
  --header 'Content-Type: application/json' \
  --header 'x-goog-api-key: <api-key>' \
  --data '
{
  "contents": [
    {
      "role": "<string>",
      "parts": [
        {
          "text": "<string>",
          "inlineData": {
            "mimeType": "<string>",
            "data": "<string>"
          },
          "fileData": {
            "mimeType": "<string>",
            "fileUri": "<string>"
          }
        }
      ]
    }
  ],
  "systemInstruction": {
    "role": "<string>",
    "parts": [
      {
        "text": "<string>",
        "inlineData": {
          "mimeType": "<string>",
          "data": "<string>"
        },
        "fileData": {
          "mimeType": "<string>",
          "fileUri": "<string>"
        }
      }
    ]
  },
  "generationConfig": {
    "temperature": 123,
    "topP": 123,
    "maxOutputTokens": 123,
    "responseMimeType": "<string>"
  },
  "safetySettings": [
    {
      "category": "<string>",
      "threshold": "<string>"
    }
  ],
  "tools": [
    {}
  ]
}
'
"data: {\"candidates\":[{\"content\":{\"parts\":[{\"text\":\"这里是第一段\"}]}}]}\n\n"

Documentation Index

Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt

Use this file to discover all available pages before exploring further.

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.