메인 콘텐츠로 건너뛰기
POST
/
v1beta
/
models
/
{model}
:generateContent
Gemini Generate Content
curl --request POST \
  --url https://api.acedata.cloud/v1beta/models/{model}:generateContent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contents": [
    {
      "parts": [
        {
          "text": "<string>",
          "inlineData": {
            "mimeType": "<string>",
            "data": "<string>"
          },
          "fileData": {
            "mimeType": "<string>",
            "fileUri": "<string>"
          },
          "functionCall": {
            "name": "<string>",
            "args": {}
          },
          "functionResponse": {
            "name": "<string>",
            "response": {}
          }
        }
      ],
      "role": "user"
    }
  ]
}
'
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "<string>",
            "thought": true
          }
        ],
        "role": "<string>"
      },
      "finishReason": "STOP",
      "index": 123,
      "safetyRatings": [
        {
          "category": "<string>",
          "probability": "<string>",
          "blocked": true
        }
      ]
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 123,
    "candidatesTokenCount": 123,
    "totalTokenCount": 123,
    "thoughtsTokenCount": 123,
    "promptTokensDetails": [
      {
        "modality": "<string>",
        "tokenCount": 123
      }
    ],
    "candidatesTokensDetails": [
      {
        "modality": "<string>",
        "tokenCount": 123
      }
    ]
  },
  "modelVersion": "<string>",
  "responseId": "<string>"
}

인증

Authorization
string
header
필수

경로 매개변수

model
enum<string>
필수

The model to use for content generation. Format: model name (without models/ prefix).

사용 가능한 옵션:
gemini-2.5-flash,
gemini-2.5-pro,
gemini-2.5-flash-lite,
gemini-3-flash-preview,
gemini-3.1-pro,
gemini-2.0-flash
예시:

"gemini-2.5-flash"

본문

application/json
contents
object[]
필수

The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries (chat), this is a repeated field that contains conversation history and the latest request.

systemInstruction
object

Developer set system instruction.

generationConfig
object

Configuration options for model generation and outputs.

tools
object[]

A list of Tools the model may use to generate the next response.

toolConfig
object

Tool configuration for the request.

safetySettings
object[]

Safety settings to block unsafe content.

cachedContent
string

The name of the cached content to use. Format: cachedContents/{cachedContent}

응답

OK

candidates
object[]
usageMetadata
object
modelVersion
string
responseId
string