메인 콘텐츠로 건너뛰기
POST
/
v1beta
/
models
/
{model}
:generateContent
Gemini 호환 콘텐츠 생성
curl --request POST \
  --url https://apiany.ai/v1beta/models/{model}:generateContent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contents": [
    {
      "parts": [
        {}
      ],
      "role": "<string>"
    }
  ],
  "generationConfig": {
    "temperature": 1,
    "topP": 123,
    "topK": 123,
    "maxOutputTokens": 123,
    "stopSequences": [
      "<string>"
    ],
    "responseMimeType": "<string>",
    "responseSchema": {},
    "responseModalities": [
      "<string>"
    ]
  },
  "tools": [
    {}
  ],
  "systemInstruction": {}
}
'
{
  "candidates": [
    {}
  ],
  "usageMetadata": {}
}

인증

Authorization
string
header
필수

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

경로 매개변수

model
string
필수

본문

application/json
contents
object[]
필수
generationConfig
object

생성 설정입니다. 참고로, :generateContent 대신 :streamGenerateContent를 호출하면 Gemini SSE 스트림을 받을 수 있습니다.

tools
object[]

모델이 호출할 수 있는 functionDeclarations를 포함하는 도구입니다.

systemInstruction
object

시스템 지침으로, Gemini Content 객체({ parts: [{ text }] }) 형식입니다.

응답

Gemini 호환 응답입니다.

candidates
object[]
필수
usageMetadata
object