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

# Gemini All-Model API - OpenAI-Compatible Format

> Select the Gemini text model to call via `model` in the request body (see the reference table for the `model` parameter for all available values).

- Uses the OpenAI SDK / Chat Completions format and returns conversation content synchronously
- **Plain text / multimodal input**: mixed text + image input (`messages[].content`)
- **Streaming**: set `stream: true` to return content chunk by chunk

---

**Model specs and differences**
- **3.8 behavior**: compared with 3.7, it improves software engineering, agents, multi-step reasoning, and multimodal accuracy; it may consume more reasoning / output tokens, especially at `high`. Use `low` for latency-sensitive workloads, the default `medium` for general use, and `high` for complex code, long video, or multi-step reasoning.
- **Gemini 4 Argon behavior**: `reasoning_effort` accepts `low` / `medium` / `high`; when omitted, the model determines how much to think. `minimal` is downgraded to `low`. Use `max_tokens` to limit output; current Gemini routes do not guarantee that `max_completion_tokens` takes effect. `max_tokens` accepts up to 1,048,576, but a single streaming request returns up to 65,536 thinking and answer tokens, or 32,768 non-streaming; reaching the cap returns `finish_reason: length`. The OpenAI-compatible format does not support long-output continuation; for longer output, use [Native API reference](/en/api-manual/language-series/gemini/native-api/native-api-reference). `extra_body.google.thinking_config.thinking_budget` has no effect on this model. In multi-turn tool calls, return the previous `tool_calls[]` entries’ `thought_signature` unchanged, or the request returns 400.
- **Sampling / penalty parameters** `temperature` / `top_p` / `frequency_penalty` / `presence_penalty`: consistent across the entire Gemini 3.x series, custom values do not affect the output; a `temperature` / `top_p` value outside the range returns a 400, and `frequency_penalty` / `presence_penalty` are ignored and have no effect (no error is raised).
- **Thinking control** `reasoning_effort`: `minimal` / `low` / `medium` / `high` (see the `reasoning_effort` parameter for the levels supported and the default of each model); effective for the Gemini 3.x / 4 series. `gemini-4-argon` / `gemini-3.8-flash` / `gemini-3.7-flash` and the Pro models do not support `minimal`; a passed value is automatically downgraded to `low`.
- **Last-turn role**: the `role` of the last message must not be `assistant` (Gemini 3.5+ will error).
- **Token limits**: `gemini-3.8-flash` / `gemini-3.7-flash` / `gemini-3.6-flash` / `gemini-3.5-flash-lite` have a 1,048,576-token context and a maximum output of 65,536. `gemini-4-argon` shares a 1,048,576-token context across input, thinking, and output; each streaming request returns up to 65,536 tokens, or 32,768 non-streaming, including thinking and the answer. Actual output is also limited by remaining context space. This format does not support continuation. Other models follow their own specifications.
- **Gemini 2.5 IDs**: from 2026-10-19, `gemini-2.5-pro` / `gemini-2.5-flash` / `gemini-2.5-flash-lite` are served by `gemini-3.8-flash` / `gemini-3.5-flash-lite` / `gemini-3.1-flash-lite-preview` and billed at their rates; responses show the new model ID, and parameter behavior follows the new model. `extra_body.google.thinking_config.thinking_budget` is converted to `reasoning_effort` (see `extra_body`).

> [!NOTE]
>
> **BaseURL**: The default BaseURL is `https://direct.evolink.ai`, which has better support for text models and long-lived connections. `https://api.evolink.ai` is the primary endpoint for multimodal services and serves as a fallback address for text models.


## OpenAPI

````yaml en/api-manual/language-series/gemini/openai-sdk/openai-sdk-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Gemini All-Model API (OpenAI-Compatible Format)
  description: >-
    A unified OpenAI-compatible API for all Gemini text models. Select the
    specific model via the model parameter. Supports text and image input.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: Production (recommended)
  - url: https://api.evolink.ai
    description: Alternative URL
security:
  - bearerAuth: []
tags:
  - name: Chat Completion
    description: AI chat completion related APIs
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat Completion
      summary: Gemini Chat Completions (All Models)
      description: >-
        Select the Gemini text model to call via `model` in the request body
        (see the reference table for the `model` parameter for all available
        values).


        - Uses the OpenAI SDK / Chat Completions format and returns conversation
        content synchronously

        - **Plain text / multimodal input**: mixed text + image input
        (`messages[].content`)

        - **Streaming**: set `stream: true` to return content chunk by chunk


        ---


        **Model specs and differences**

        - **3.8 behavior**: compared with 3.7, it improves software engineering,
        agents, multi-step reasoning, and multimodal accuracy; it may consume
        more reasoning / output tokens, especially at `high`. Use `low` for
        latency-sensitive workloads, the default `medium` for general use, and
        `high` for complex code, long video, or multi-step reasoning.

        - **Gemini 4 Argon behavior**: `reasoning_effort` accepts `low` /
        `medium` / `high`; when omitted, the model determines how much to think.
        `minimal` is downgraded to `low`. Use `max_tokens` to limit output;
        current Gemini routes do not guarantee that `max_completion_tokens`
        takes effect. `max_tokens` accepts up to 1,048,576, but a single
        streaming request returns up to 65,536 thinking and answer tokens, or
        32,768 non-streaming; reaching the cap returns `finish_reason: length`.
        The OpenAI-compatible format does not support long-output continuation;
        for longer output, use [Native API
        reference](/en/api-manual/language-series/gemini/native-api/native-api-reference).
        `extra_body.google.thinking_config.thinking_budget` has no effect on
        this model. In multi-turn tool calls, return the previous `tool_calls[]`
        entries’ `thought_signature` unchanged, or the request returns 400.

        - **Sampling / penalty parameters** `temperature` / `top_p` /
        `frequency_penalty` / `presence_penalty`: consistent across the entire
        Gemini 3.x series, custom values do not affect the output; a
        `temperature` / `top_p` value outside the range returns a 400, and
        `frequency_penalty` / `presence_penalty` are ignored and have no effect
        (no error is raised).

        - **Thinking control** `reasoning_effort`: `minimal` / `low` / `medium`
        / `high` (see the `reasoning_effort` parameter for the levels supported
        and the default of each model); effective for the Gemini 3.x / 4 series.
        `gemini-4-argon` / `gemini-3.8-flash` / `gemini-3.7-flash` and the Pro
        models do not support `minimal`; a passed value is automatically
        downgraded to `low`.

        - **Last-turn role**: the `role` of the last message must not be
        `assistant` (Gemini 3.5+ will error).

        - **Token limits**: `gemini-3.8-flash` / `gemini-3.7-flash` /
        `gemini-3.6-flash` / `gemini-3.5-flash-lite` have a 1,048,576-token
        context and a maximum output of 65,536. `gemini-4-argon` shares a
        1,048,576-token context across input, thinking, and output; each
        streaming request returns up to 65,536 tokens, or 32,768 non-streaming,
        including thinking and the answer. Actual output is also limited by
        remaining context space. This format does not support continuation.
        Other models follow their own specifications.

        - **Gemini 2.5 IDs**: from 2026-10-19, `gemini-2.5-pro` /
        `gemini-2.5-flash` / `gemini-2.5-flash-lite` are served by
        `gemini-3.8-flash` / `gemini-3.5-flash-lite` /
        `gemini-3.1-flash-lite-preview` and billed at their rates; responses
        show the new model ID, and parameter behavior follows the new model.
        `extra_body.google.thinking_config.thinking_budget` is converted to
        `reasoning_effort` (see `extra_body`).
      operationId: geminiChatCompletions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: Single-turn text conversation
                value:
                  model: gemini-3.6-flash
                  messages:
                    - role: user
                      content: Please introduce yourself
              multi_turn:
                summary: Multi-turn conversation (context understanding)
                value:
                  model: gemini-3.6-flash
                  messages:
                    - role: user
                      content: What is Python?
                    - role: assistant
                      content: Python is a high-level programming language...
                    - role: user
                      content: What are its advantages?
              system_prompt:
                summary: Using system prompt
                value:
                  model: gemini-3.6-flash
                  messages:
                    - role: system
                      content: >-
                        You are a professional Python programming assistant,
                        answering questions concisely.
                    - role: user
                      content: How to read a file?
              vision:
                summary: Multimodal input (text + image)
                value:
                  model: gemini-3.6-flash
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: >-
                            Please describe the scene and main elements in this
                            image in detail.
                        - type: image_url
                          image_url:
                            url: https://example.com/image.png
              multi_image:
                summary: Multiple images input
                value:
                  model: gemini-3.6-flash
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Compare the differences between these two images
                        - type: image_url
                          image_url:
                            url: https://example.com/image1.png
                        - type: image_url
                          image_url:
                            url: https://example.com/image2.png
              output_limit:
                summary: Limit output length (Gemini 4 Argon; may truncate)
                value:
                  model: gemini-4-argon
                  messages:
                    - role: user
                      content: >-
                        Output integers 1 through 100, one per line. Start
                        immediately.
                  max_tokens: 64
                  reasoning_effort: low
      responses:
        '200':
          description: Chat completion generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: Unauthorized, invalid or expired token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: Insufficient quota, recharge required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota_error
                  fallback_suggestion: https://evolink.ai/dashboard/credits
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
                  fallback_suggestion: gemini-3.6-flash
        '413':
          description: Request body too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Image file too large
                  type: request_too_large_error
                  param: content
                  fallback_suggestion: compress image to under 10MB
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: Upstream service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
                  fallback_suggestion: try different model
        '503':
          description: Service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: >-
            Select the Gemini text model to call:


            | Model ID | Series | Positioning |

            |---|---|---|

            | `gemini-4-argon` | 4 Argon | Long reports and large coding tasks;
            up to 65,536 tokens per streaming request / 32,768 non-streaming;
            use native API continuation for longer output |

            | `gemini-3.8-flash` | 3.8 Flash | Enhanced software engineering /
            agents / multi-step reasoning / multimodal accuracy |

            | `gemini-3.7-flash` | 3.7 Flash | Pro-level agentic / code
            generation / terminal execution |

            | `gemini-3.6-flash` | 3.6 Flash | Multi-step orchestration / code
            refactoring / general reasoning |

            | `gemini-3.5-flash` | 3.5 Flash | General-purpose Flash |

            | `gemini-3.5-flash-lite` | 3.5 Flash-Lite | Low cost / high
            throughput / lightweight agent |

            | `gemini-3.1-pro-preview` | 3.1 Pro (Preview) | Advanced reasoning
            |

            | `gemini-3.1-pro-preview-customtools` | 3.1 Pro · CustomTools |
            Advanced reasoning + custom tools |

            | `gemini-3.1-flash-lite-preview` | 3.1 Flash-Lite (Preview) | Low
            cost |

            | `gemini-3-pro-preview` | 3.0 Pro (Preview) | Advanced reasoning |

            | `gemini-3-flash-preview` | 3.0 Flash (Preview) | General-purpose
            Flash |

            | `gemini-2.5-pro` | 2.5 Pro | Legacy ID; from 2026-10-19 served by
            `gemini-3.8-flash` and billed at its rates |

            | `gemini-2.5-flash` | 2.5 Flash | Legacy ID; from 2026-10-19 served
            by `gemini-3.5-flash-lite` and billed at its rates |

            | `gemini-2.5-flash-lite` | 2.5 Flash-Lite | Legacy ID; from
            2026-10-19 served by `gemini-3.1-flash-lite-preview` and billed at
            its rates |
          enum:
            - gemini-4-argon
            - gemini-3.8-flash
            - gemini-3.7-flash
            - gemini-3.6-flash
            - gemini-3.5-flash
            - gemini-3.5-flash-lite
            - gemini-3.1-pro-preview
            - gemini-3.1-pro-preview-customtools
            - gemini-3.1-flash-lite-preview
            - gemini-3-pro-preview
            - gemini-3-flash-preview
            - gemini-2.5-pro
            - gemini-2.5-flash
            - gemini-2.5-flash-lite
          example: gemini-3.6-flash
        messages:
          type: array
          description: >-
            List of chat messages, supports multi-turn dialogue and multimodal
            input
          items:
            $ref: '#/components/schemas/Message'
          minItems: 1
        stream:
          type: boolean
          description: |-
            Whether to return response in streaming mode

            - `true`: Streaming return, receives content in real-time chunks
            - `false`: Returns complete response at once
          example: false
          default: false
        max_tokens:
          type: integer
          description: >-
            Maximum generated tokens, including thinking and the answer. Use
            this parameter to limit output length on current Gemini routes.


            `gemini-3.8-flash` / `gemini-3.7-flash` / `gemini-3.6-flash` /
            `gemini-3.5-flash-lite` support up to 65,536 tokens. For
            `gemini-4-argon`, the parameter accepts up to 1,048,576, but a
            single streaming request returns up to 65,536 tokens, or 32,768
            non-streaming, and actual output is limited by remaining context
            space. Reaching the output limit returns `finish_reason: length`;
            this format does not support continuation. Other models follow their
            own specifications.
          minimum: 1
          example: 2000
          maximum: 1048576
        max_completion_tokens:
          type: integer
          nullable: true
          description: >-
            OpenAI compatibility field. Current Gemini routes do not guarantee
            that this field limits output length, and output may exceed the
            specified value. Use `max_tokens` to control output length.
          minimum: 1
          example: 2000
          maximum: 1048576
          deprecated: true
        temperature:
          type: number
          description: >-
            Sampling temperature, controls output randomness


            **Description**:

            - Lower values (e.g., 0.2): More deterministic, focused output

            - Higher values (e.g., 1.5): More random, creative output


            **Consistent across the entire Gemini 3.x series** (does not vary by
            model): custom values within the valid range do not affect the
            output; a value outside this parameter's valid range returns a 400
            rather than being silently ignored.
          minimum: 0
          maximum: 2
          example: 0.7
          default: 1
        top_p:
          type: number
          description: >-
            Nucleus Sampling parameter


            **Description**:

            - Controls sampling from tokens within the top cumulative
            probability

            - For example, 0.9 means selecting from tokens whose cumulative
            probability reaches 90%

            - Default: 0.95


            **Recommendation**: Do not adjust temperature and top_p
            simultaneously


            **Consistent across the entire Gemini 3.x series** (does not vary by
            model): custom values within the valid range do not affect the
            output; a value outside this parameter's valid range returns a 400
            rather than being silently ignored.
          minimum: 0
          maximum: 1
          example: 0.9
          default: 0.95
        frequency_penalty:
          type: number
          nullable: true
          description: >-
            Frequency penalty coefficient. Range: -2.0 to 2.0. Corresponds to
            Gemini's frequencyPenalty.


            **Consistent across the entire Gemini 3.x / 4 series**: passed
            values are ignored and have no effect (no error is raised).
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        presence_penalty:
          type: number
          nullable: true
          description: >-
            Presence penalty coefficient. Range: -2.0 to 2.0. Corresponds to
            Gemini's presencePenalty.


            **Consistent across the entire Gemini 3.x / 4 series**: passed
            values are ignored and have no effect (no error is raised).
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        stop:
          nullable: true
          description: >-
            Stop sequences. Supports a string or string array, corresponding to
            Gemini's stopSequences.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        'n':
          type: integer
          nullable: true
          description: >-
            Number of candidates to generate


            Gemini 3.x only supports `1`; passing >1 returns a 400 (equivalent
            to the `candidateCount` that has been removed from the native API).


            `gemini-4-argon`: passing >1 does not raise an error; only 1
            candidate is returned.
          minimum: 1
          default: 1
          example: 1
          maximum: 1
        reasoning_effort:
          type: string
          nullable: true
          description: >-
            Limits the thinking effort, corresponding to Gemini's thinking
            level:

            - `minimal`: near-zero thinking, high throughput / low latency

            - `low`: less thinking, simple tasks

            - `medium`: balanced quality and speed

            - `high`: deep multi-step reasoning


            **Effective for the Gemini 3.x / 4 series**, with different
            supported levels and defaults per model (consistent with the native
            API):


            | Model | Supported levels | Default |

            |---|---|---|

            | `gemini-4-argon` | `low` / `medium` / `high` | Long reports and
            large coding tasks; up to 65,536 tokens per streaming request /
            32,768 non-streaming; use native API continuation for longer output
            |

            | `gemini-3.8-flash` | `low` / `medium` / `high` | `medium` |

            | `gemini-3.7-flash` | `low` / `medium` / `high` | `medium` |

            | `gemini-3.6-flash` | `minimal` / `low` / `medium` / `high` |
            `medium` |

            | `gemini-3.5-flash` | `minimal` / `low` / `medium` / `high` |
            `medium` |

            | `gemini-3.5-flash-lite` | `minimal` / `low` / `medium` / `high` |
            `minimal` |

            | `gemini-3.1-flash-lite-preview` | `minimal` / `low` / `medium` /
            `high` | `minimal` |

            | `gemini-3-flash-preview` | `minimal` / `low` / `medium` / `high` |
            `medium` |

            | `gemini-3.1-pro-preview` | `low` / `medium` / `high` | `high` |

            | `gemini-3.1-pro-preview-customtools` | `low` / `medium` / `high` |
            `high` |

            | `gemini-3-pro-preview` | `low` / `medium` / `high` | `high` |


            Passing a level a model does not support (e.g., passing `minimal` to
            a Pro model or to `gemini-4-argon` / `gemini-3.8-flash` /
            `gemini-3.7-flash`) is automatically downgraded to `low` and does
            not raise an error.
          enum:
            - minimal
            - low
            - medium
            - high
          example: minimal
        seed:
          type: integer
          nullable: true
          description: >-
            Random seed used to make output as reproducible as possible,
            corresponding to Gemini's seed.
          example: 12345
        response_format:
          description: >-
            Response format settings, supporting JSON mode and JSON Schema,
            corresponding to Gemini's responseMimeType, responseSchema and
            responseJsonSchema.
          oneOf:
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - json_object
                  example: json_object
                  description: Response format type.
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - json_schema
                  example: json_schema
                  description: Response format type.
                json_schema:
                  type: object
                  nullable: true
                  description: JSON Schema definition.
        stream_options:
          type: object
          nullable: true
          description: Streaming response options. Can be set when stream is true.
          properties:
            include_usage:
              type: boolean
              nullable: true
              description: >-
                Whether to include token usage for this request before streaming
                finishes.
              default: false
              example: true
        tools:
          type: array
          nullable: true
          description: List of tool definitions for Function Calling.
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          description: Controls tool-calling behavior.
          oneOf:
            - type: string
              enum:
                - none
                - auto
                - required
            - $ref: '#/components/schemas/ToolChoiceObject'
        extra_body:
          type: object
          nullable: true
          description: Gemini extension parameters.
          properties:
            google:
              type: object
              nullable: true
              description: Gemini-specific extension parameters.
              properties:
                cached_content:
                  type: string
                  nullable: true
                  description: Gemini content cache.
                thinking_config:
                  type: object
                  nullable: true
                  description: >-
                    Gemini ThinkingConfig.


                    From 2026-10-19, `thinking_budget` sent with the 2.5 IDs is
                    converted to `reasoning_effort` using the table below (the
                    requests are served by newer models; see the `model`
                    parameter). We recommend switching to `reasoning_effort`.


                    | Legacy model (documented range) | New model |
                    `thinking_budget` → `reasoning_effort` |

                    |---|---|---|

                    | `gemini-2.5-pro` (128–32,768) | `gemini-3.8-flash` |
                    128–11,007 → `low`; 11,008–21,888 → `medium`; 21,889–32,768
                    → `high` |

                    | `gemini-2.5-flash` (0–24,576) | `gemini-3.5-flash-lite` |
                    0 (thinking off) → `minimal`; 1–8,192 → `low`; 8,193–16,384
                    → `medium`; 16,385–24,576 → `high` |

                    | `gemini-2.5-flash-lite` (512–24,576, or 0) |
                    `gemini-3.1-flash-lite-preview` | 0 (thinking off) →
                    `minimal`; 512–8,533 → `low`; 8,534–16,554 → `medium`;
                    16,555–24,576 → `high` |


                    Values outside the range are clamped to the nearest end of
                    the table. `-1` (dynamic) uses the new model's default level
                    (see `reasoning_effort`). The conversion applies only to
                    requests that use the 2.5 model IDs; requests to the 3.x IDs
                    are not changed.
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the chat completion
          example: chatcmpl-20251010015944503180122WJNB8Eid
        model:
          type: string
          description: Model name actually used
          example: gemini-3.6-flash
        object:
          type: string
          enum:
            - chat.completion
          description: Response type
          example: chat.completion
        created:
          type: integer
          description: Creation timestamp
          example: 1760032810
        choices:
          type: array
          description: List of chat completion choices
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP status error code
            message:
              type: string
              description: Error description
            type:
              type: string
              description: Error type
            param:
              type: string
              description: Related parameter name
            fallback_suggestion:
              type: string
              description: Suggestion when error occurs
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: |-
            Message role

            - `user`: User message
            - `assistant`: AI assistant message (for multi-turn conversation)
            - `system`: System prompt (sets AI's role and behavior)
          enum:
            - user
            - assistant
            - system
            - tool
          example: user
        content:
          description: >-
            Message content. Supports two formats:


            **1. Plain text string**: You can pass a string directly, e.g.
            `"content":"Please introduce yourself"`


            **2. Object array** (supports text and multimodal input): see the
            example structure below
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentPart'
        tool_call_id:
          type: string
          nullable: true
          description: Tool call ID, used only when role=tool.
    Tool:
      type: object
      required:
        - type
        - function
      description: Tool definition for Function Calling.
      properties:
        type:
          type: string
          enum:
            - function
          description: Tool type. Currently only function is supported.
        function:
          type: object
          required:
            - name
          description: Function definition.
          properties:
            name:
              type: string
              description: Name of the function to call.
            description:
              type: string
              description: >-
                Function description used by the model to decide whether to call
                the tool.
            parameters:
              type: object
              description: Function request parameters described in JSON Schema format.
    ToolChoiceObject:
      type: object
      required:
        - type
        - function
      description: Scope of the tool to call.
      properties:
        type:
          type: string
          enum:
            - function
          description: Call type.
        function:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              description: Name of the tool to call.
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: Choice index
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        logprobs:
          type: object
          nullable: true
          description: Token logprob information for this choice.
          properties:
            content:
              type: array
              nullable: true
              description: Logprob details for each output token.
              items:
                $ref: '#/components/schemas/LogProbToken'
        finish_reason:
          type: string
          description: Finish reason
          enum:
            - stop
            - length
            - content_filter
            - tool_calls
          example: stop
    Usage:
      type: object
      description: Token usage statistics
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in input content
          example: 13
        completion_tokens:
          type: integer
          description: Number of tokens in output content
          example: 1891
        total_tokens:
          type: integer
          description: Total number of tokens
          example: 1904
        prompt_tokens_details:
          type: object
          description: Detailed input token information
          properties:
            cached_tokens:
              type: integer
              description: Number of cached tokens hit
              example: 0
            text_tokens:
              type: integer
              description: Number of text tokens
              example: 13
            audio_tokens:
              type: integer
              description: Number of audio tokens
              example: 0
            image_tokens:
              type: integer
              description: Number of image tokens
              example: 0
        completion_tokens_details:
          type: object
          description: Detailed completion token information.
          properties:
            text_tokens:
              type: integer
              description: Number of text tokens.
              example: 0
            audio_tokens:
              type: integer
              description: Number of audio tokens.
              example: 0
            reasoning_tokens:
              type: integer
              description: Number of reasoning tokens.
              example: 1480
        input_tokens:
          type: integer
          description: Input token count (compatibility field).
          example: 0
        output_tokens:
          type: integer
          description: Output token count (compatibility field).
          example: 0
        input_tokens_details:
          type: object
          nullable: true
          description: Detailed input token information (compatibility field).
          example: null
    ContentPart:
      oneOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/ImageContent'
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: Message sender role
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI response message content
          example: >-
            Hello! I'm pleased to introduce myself.


            I'm a Large Language Model, trained and developed by Google.


            Simply put, you can think of me as a "smart brain" that has been
            trained on massive amounts of text data and is able to understand
            and generate human language. My core capability is processing and
            generating text. Specifically, I can do the following:


            **1. Information Query & Knowledge Answering**

            I can act like a "talking encyclopedia," answering various
            questions, whether they're about scientific knowledge, historical
            events, or everyday facts.


            **2. Creative Writing & Text Generation**

            I can create various types of text based on your requirements, such
            as:

            *   **Writing**: Poetry, stories, scripts, emails, speeches,
            advertising copy, etc.

            *   **Planning**: Travel plans, study outlines, event proposals,
            etc.

            *   **Brainstorming**: Working with you to generate new ideas and
            spark creativity.


            **3. Translation & Language Processing**

            I'm proficient in multiple languages and can provide fast, fluent
            translation services. I can also help you polish, proofread,
            summarize, or rewrite text to make your expression clearer and more
            professional.


            **4. Programming & Code Assistance**

            I can write code snippets, explain code logic, debug errors, or
            "translate" code from one programming language to another, making me
            a helpful companion for programmers.


            **5. Logical Analysis & Reasoning**

            I can help you analyze complex problems, organize logical chains,
            and make inferences and summaries based on the information you
            provide.


            ---


            **In summary**, my goal is to be a powerful and useful tool that
            helps you obtain information more efficiently, complete tasks, and
            spark creativity through natural language communication.


            **Remember:** I'm an artificial intelligence, my knowledge comes
            from the data I've learned, and it may not be the most up-to-date.
            Sometimes I may also make mistakes, so for very important
            information, I recommend you verify it again.
          nullable: true
        tool_calls:
          type: array
          nullable: true
          description: List of tool calls.
          items:
            $ref: '#/components/schemas/ToolCall'
    LogProbToken:
      type: object
      description: Logprob details for a single token.
      properties:
        token:
          type: string
          description: Token text.
        logprob:
          type: number
          description: Logprob value of the token.
        bytes:
          type: array
          nullable: true
          description: UTF-8 byte sequence of the token.
          items:
            type: integer
        top_logprobs:
          type: array
          nullable: true
          description: Candidate tokens at the same position and their logprobs.
          items:
            $ref: '#/components/schemas/TopLogProb'
    TextContent:
      title: Text Content
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: Content type
        text:
          type: string
          description: Text content
          example: Please describe this image in detail
    ImageContent:
      title: Image Content
      type: object
      required:
        - type
        - image_url
      properties:
        type:
          type: string
          enum:
            - image_url
          description: Content type
        image_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: >-
                Image URL address


                **Limits**:

                - Maximum size per image: `10MB`

                - Supported formats: `.jpeg`, `.jpg`, `.png`, `.webp`

                - URL requirements: Must be publicly accessible, generally ends
                with image extension
              example: https://example.com/image.png
    ToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
          description: Tool call ID.
        type:
          type: string
          enum:
            - function
          description: Tool call type.
        function:
          type: object
          required:
            - name
            - arguments
          properties:
            name:
              type: string
              description: Function name.
            arguments:
              type: string
              description: Function arguments as a JSON string.
    TopLogProb:
      type: object
      description: Logprob details for a candidate token.
      properties:
        token:
          type: string
          description: Candidate token text.
        logprob:
          type: number
          description: Logprob value of the candidate token.
        bytes:
          type: array
          nullable: true
          description: UTF-8 byte sequence of the candidate token.
          items:
            type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##All APIs require Bearer Token authentication##


        **Get API Key:**


        Visit [API Key Management Page](https://evolink.ai/dashboard/keys) to
        get your API Key


        **Add to request header:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.