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

# Gemini

> Call Gemini models using Google Native API format. Synchronous processing with minimal parameters for quick start.



## OpenAPI

````yaml post /v1beta/models/{model}:generateContent
openapi: 3.1.0
info:
  title: General Chat API
  version: 1.0.0
  description: >-
    Unified chat API interface supporting multiple text-generation models.
    Compatible with OpenAI Chat Completions API format.
servers:
  - url: https://apiif.com
    description: Primary API server
security:
  - bearerAuth: []
paths:
  /v1beta/models/{model}:generateContent:
    post:
      summary: Gemini
      description: >-
        Call Gemini models using Google Native API format. Synchronous
        processing with minimal parameters for quick start.
      operationId: generateGeminiContent
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
          description: Model name (e.g. gemini-2.5-pro)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - model
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                            inlineData:
                              type: object
                              properties:
                                mimeType:
                                  type: string
                                data:
                                  type: string
                    required:
                      - role
                      - parts
                  minItems: 1
                generationConfig:
                  type: object
                  properties:
                    temperature:
                      type: number
                    maxOutputTokens:
                      type: integer
                    topP:
                      type: number
                    topK:
                      type: integer
                    stopSequences:
                      type: array
                      items:
                        type: string
                safetySettings:
                  type: array
                  items:
                    type: object
                    properties:
                      category:
                        type: string
                      threshold:
                        type: string
              required:
                - contents
            examples:
              basic:
                value:
                  contents:
                    - role: user
                      parts:
                        - text: Hello, please introduce yourself
      responses:
        '200':
          description: Successful Gemini response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  data:
                    type: object
                    properties:
                      candidates:
                        type: array
                        items:
                          type: object
                          properties:
                            content:
                              type: object
                              properties:
                                role:
                                  type: string
                                parts:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      text:
                                        type: string
                            finishReason:
                              type: string
                            index:
                              type: integer
                            safetyRatings:
                              type: array
                      promptFeedback:
                        type: object
                  usageMetadata:
                    type: object
              examples:
                success:
                  value:
                    code: 200
                    data:
                      candidates:
                        - content:
                            role: model
                            parts:
                              - text: >-
                                  Hello! I'm pleased to introduce myself.


                                  I am a large language model, trained and
                                  developed by Google...
                          finishReason: STOP
                          index: 0
                          safetyRatings:
                            - category: HARM_CATEGORY_HATE_SPEECH
                              probability: NEGLIGIBLE
                      promptFeedback:
                        safetyRatings:
                          - category: HARM_CATEGORY_HATE_SPEECH
                            probability: NEGLIGIBLE
                    usageMetadata:
                      promptTokenCount: 4
                      candidatesTokenCount: 611
                      totalTokenCount: 2422
                      thoughtsTokenCount: 1807
                      promptTokensDetails:
                        - modality: TEXT
                          tokenCount: 4
        '400':
          description: Invalid request parameters
          content:
            application/json:
              examples:
                bad_request:
                  value:
                    error:
                      code: 400
                      message: Invalid request parameters
                      status: INVALID_ARGUMENT
        '401':
          description: Authentication failed
          content:
            application/json:
              examples:
                unauthorized:
                  value:
                    error:
                      code: 401
                      message: Authentication failed, please check your API Key
                      status: UNAUTHENTICATED
        '402':
          description: Payment required / insufficient balance
          content:
            application/json:
              examples:
                payment_required:
                  value:
                    error:
                      code: 402
                      message: Insufficient balance, please recharge
                      status: PAYMENT_REQUIRED
        '403':
          description: Access denied
          content:
            application/json:
              examples:
                forbidden:
                  value:
                    error:
                      code: 403
                      message: Access denied
                      status: PERMISSION_DENIED
        '404':
          description: Model not found
          content:
            application/json:
              examples:
                not_found:
                  value:
                    error:
                      code: 404
                      message: Model not found
                      status: NOT_FOUND
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              examples:
                rate_limited:
                  value:
                    error:
                      code: 429
                      message: Rate limit exceeded, please try again later
                      status: RESOURCE_EXHAUSTED
        '500':
          description: Internal server error
          content:
            application/json:
              examples:
                server_error:
                  value:
                    error:
                      code: 500
                      message: Internal server error
                      status: INTERNAL
        '502':
          description: Bad gateway
          content:
            application/json:
              examples:
                bad_gateway:
                  value:
                    error:
                      code: 502
                      message: Bad gateway, service temporarily unavailable
                      status: BAD_GATEWAY
        '503':
          description: Service unavailable
          content:
            application/json:
              examples:
                unavailable:
                  value:
                    error:
                      code: 503
                      message: Service temporarily unavailable
                      status: UNAVAILABLE
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'All endpoints require `Authorization: Bearer YOUR_API_KEY`.'

````