> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkmodel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini GenerateContent

> Use the Gemini-native request and response format for multimodal understanding. For an uploaded video, wait until the Gemini file resource is `active`, then pass its `gs://` URI unchanged as `fileData.fileUri` with the matching MIME type.

This file reference is only supported by compatible Google Gemini models. It cannot be sent to OpenAI, Anthropic, `/chat/completions`, `/messages`, image-generation, or video-generation endpoints.




## OpenAPI

````yaml /openapi/chat/_gemini-generate-content.yaml post /models/{model}:generateContent
openapi: 3.0.3
info:
  title: Gemini GenerateContent
  version: 1.0.0
  description: >-
    Send text and an active Gemini file URI to Google's native generateContent
    interface through LinkModel.
servers:
  - url: https://api.linkmodel.ai/v1beta
    description: Production
security:
  - bearerAuth: []
tags:
  - name: chat
paths:
  /models/{model}:generateContent:
    post:
      tags:
        - chat
      summary: Gemini GenerateContent
      description: >
        Use the Gemini-native request and response format for multimodal
        understanding. For an uploaded video, wait until the Gemini file
        resource is `active`, then pass its `gs://` URI unchanged as
        `fileData.fileUri` with the matching MIME type.


        This file reference is only supported by compatible Google Gemini
        models. It cannot be sent to OpenAI, Anthropic, `/chat/completions`,
        `/messages`, image-generation, or video-generation endpoints.
      operationId: generate-gemini-content
      parameters:
        - name: model
          in: path
          required: true
          description: Google Gemini model with native video and `fileData` support.
          schema:
            type: string
          example: gemini-3.1-flash-lite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contents
              properties:
                contents:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    required:
                      - role
                      - parts
                    properties:
                      role:
                        type: string
                        example: user
                      parts:
                        type: array
                        minItems: 1
                        items:
                          oneOf:
                            - type: object
                              required:
                                - text
                              properties:
                                text:
                                  type: string
                                  example: Describe the important events in this video.
                            - type: object
                              required:
                                - fileData
                              properties:
                                fileData:
                                  type: object
                                  required:
                                    - fileUri
                                    - mimeType
                                  properties:
                                    fileUri:
                                      type: string
                                      description: >-
                                        Active account-scoped `gs://` URI
                                        returned by the Gemini file resource.
                                      example: >-
                                        gs://managed-gemini-files/.../file_example123-sample.mp4
                                    mimeType:
                                      type: string
                                      example: video/mp4
            example:
              contents:
                - role: user
                  parts:
                    - text: Explain how photosynthesis works.
      responses:
        '200':
          description: Gemini-native generation response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  createTime:
                    type: string
                    format: date-time
                  candidates:
                    type: array
                    items:
                      type: object
                      properties:
                        content:
                          type: object
                          properties:
                            role:
                              type: string
                              example: model
                            parts:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                        finishReason:
                          type: string
                          example: STOP
                  modelVersion:
                    type: string
                    example: gemini-3.1-flash-lite
                  responseId:
                    type: string
                  usageMetadata:
                    type: object
                    additionalProperties: true
        '400':
          description: >-
            Invalid native Gemini request, inactive file URI, unsupported MIME
            type, or incompatible model.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - request_id
                properties:
                  code:
                    type: integer
                    example: 400
                  msg:
                    type: string
                    example: The request could not be completed. Please try again.
                  request_id:
                    type: string
                    description: Reference to provide when contacting LinkModel support.
                    example: request_example123
        '401':
          description: >-
            Missing or invalid LinkModel API key, or model access is not
            enabled.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - request_id
                properties:
                  code:
                    type: integer
                    example: 401
                  msg:
                    type: string
                    example: Missing or invalid LinkModel API key.
                  request_id:
                    type: string
                    description: Reference to provide when contacting LinkModel support.
                    example: request_example123
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````