> ## 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.

# /v1beta/models/{model}:generateContent

> Gemini를 사용하여 동기식 텍스트 또는 다중 모드 출력을 생성합니다.

Gemini의 공식 문서는 이미지 이해, 이미지 생성 및 이미지 편집을 위해 동일한 `generateContent` 제품군을 사용합니다.

* 이미지는 `inlineData` 또는 Files API를 통해 전달될 수 있습니다.
* 작은 자산은 일반적으로 인라인으로 전송되는 반면, 크거나 재사용 가능한 자산은 Files API 참조를 통해 더 잘 처리됩니다.
* 이 경로는 이미지 QA, OCR 지원 분석, UI 이해 및 다중 모드 추론에 적합합니다.
* 기본 이미지 생성 및 이미지 편집에서는 여전히 `generateContent`를 사용합니다.
* 텍스트와 생성된 이미지는 모두 `candidates[].content.parts[]`를 통해 반환됩니다.
* Google의 공식 문서에는 생성된 이미지에 SynthID 워터마크가 포함되어 있다고 나와 있습니다.


## OpenAPI

````yaml POST /v1beta/models/{model}:generateContent
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://maas.apigo.ai
security:
  - bearerAuth: []
paths:
  /v1beta/models/{model}:generateContent:
    post:
      summary: Gemini generateContent
      description: Generates synchronous text or multimodal output with Gemini.
      parameters:
        - name: model
          in: path
          description: Gemini model name.
          required: true
          schema:
            type: string
            example: gemini-2.5-pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeminiGenerateContentRequest'
            example:
              contents:
                - role: user
                  parts:
                    - text: 请总结这段内容
      responses:
        '200':
          description: Successful Gemini content response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeminiGenerateContentResponse'
              example:
                candidates:
                  - content:
                      role: model
                      parts:
                        - text: 这里是总结结果。
                    finishReason: STOP
                usageMetadata:
                  promptTokenCount: 24
                  candidatesTokenCount: 36
                  totalTokenCount: 60
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - googleApiKey: []
components:
  schemas:
    GeminiGenerateContentRequest:
      type: object
      required:
        - contents
      properties:
        contents:
          type: array
          items:
            $ref: '#/components/schemas/GeminiContent'
        systemInstruction:
          $ref: '#/components/schemas/GeminiContent'
        generationConfig:
          $ref: '#/components/schemas/GeminiGenerationConfig'
        safetySettings:
          type: array
          items:
            $ref: '#/components/schemas/GeminiSafetySetting'
        tools:
          type: array
          items:
            type: object
            additionalProperties: true
    GeminiGenerateContentResponse:
      type: object
      properties:
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/GeminiCandidate'
        usageMetadata:
          $ref: '#/components/schemas/GeminiUsageMetadata'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    GeminiContent:
      type: object
      properties:
        role:
          type: string
        parts:
          type: array
          items:
            $ref: '#/components/schemas/GeminiPart'
    GeminiGenerationConfig:
      type: object
      properties:
        temperature:
          type: number
        topP:
          type: number
        maxOutputTokens:
          type: integer
        responseMimeType:
          type: string
    GeminiSafetySetting:
      type: object
      properties:
        category:
          type: string
        threshold:
          type: string
    GeminiCandidate:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/GeminiContent'
        finishReason:
          type: string
        safetyRatings:
          type: array
          items:
            $ref: '#/components/schemas/GeminiSafetyRating'
    GeminiUsageMetadata:
      type: object
      properties:
        promptTokenCount:
          type: integer
        candidatesTokenCount:
          type: integer
        totalTokenCount:
          type: integer
    GeminiPart:
      type: object
      properties:
        text:
          type: string
        inlineData:
          $ref: '#/components/schemas/GeminiInlineData'
        fileData:
          $ref: '#/components/schemas/GeminiFileData'
    GeminiSafetyRating:
      type: object
      properties:
        category:
          type: string
        probability:
          type: string
    GeminiInlineData:
      type: object
      properties:
        mimeType:
          type: string
        data:
          type: string
    GeminiFileData:
      type: object
      properties:
        mimeType:
          type: string
        fileUri:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    googleApiKey:
      type: apiKey
      in: header
      name: x-goog-api-key

````