> ## Documentation Index
> Fetch the complete documentation index at: https://evo-0136956d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 原生 API（/v1 前缀）

> Gemini 原生 API 接口（通过 /v1 前缀访问）。/v1/models/ 之后的路径直接透传（如 gemini-2.0-flash:generateContent）。



## OpenAPI

````yaml /zh/openapi/relay-api.mintlify.json post /v1/models/{model}
openapi: 3.0.1
info:
  title: AI 调用接口
  description: 统一的 AI 模型调用接口，支持 OpenAI、Claude、Gemini、Kling、即梦等多种格式
  version: 1.0.0
servers:
  - url: https://api.nusabase.com
    description: API Base URL
security:
  - BearerAuth: []
tags:
  - name: Models
    description: 获取可用模型列表（支持 OpenAI / Gemini / Anthropic 格式）
  - name: Chat
    description: 对话补全与文本补全（OpenAI Chat Completions 兼容）
  - name: Responses
    description: OpenAI Responses API（支持工具调用、推理、多轮对话）
  - name: Realtime
    description: WebSocket 实时对话（OpenAI Realtime API 兼容）
  - name: Claude
    description: Anthropic Claude Messages API 兼容格式
  - name: Gemini
    description: Google Gemini API 兼容格式
  - name: Images
    description: 图片生成与编辑
  - name: Video
    description: 视频生成（OpenAI Sora 兼容格式 + 通用格式）
  - name: Video / Kling
    description: Kling 视频生成（文生视频 / 图生视频）
  - name: Video / Jimeng
    description: 即梦（Jimeng）视频生成
  - name: Audio
    description: 语音转文字 / 语音翻译 / 文字转语音
  - name: Embeddings
    description: 文本向量嵌入
  - name: Rerank
    description: 文档相关性重排序
  - name: Moderations
    description: 内容安全审核
  - name: Not Implemented
    description: 暂未实现的接口（保留兼容性占位）
paths:
  /v1/models/{model}:
    post:
      tags:
        - Gemini
      summary: Gemini 原生 API（/v1 前缀）
      description: >-
        Gemini 原生 API 接口（通过 /v1 前缀访问）。/v1/models/ 之后的路径直接透传（如
        gemini-2.0-flash:generateContent）。
      operationId: post_v1_models_gemini_path
      parameters:
        - name: model
          in: path
          description: 模型模型名称
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeminiRequest'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeminiResponse'
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    GeminiRequest:
      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
        generationConfig:
          type: object
          properties:
            temperature:
              type: number
            topP:
              type: number
            topK:
              type: integer
            maxOutputTokens:
              type: integer
            stopSequences:
              type: array
              items:
                type: string
        safetySettings:
          type: array
          items:
            type: object
            properties:
              category:
                type: string
              threshold:
                type: string
        tools:
          type: array
          items:
            type: object
            properties: {}
        systemInstruction:
          type: object
          properties:
            parts:
              type: array
              items:
                type: object
                properties: {}
    GeminiResponse:
      type: object
      properties:
        candidates:
          type: array
          items:
            type: object
            properties:
              content:
                type: object
                properties:
                  role:
                    type: string
                  parts:
                    type: array
                    items:
                      type: object
                      properties: {}
              finishReason:
                type: string
              safetyRatings:
                type: array
                items:
                  type: object
                  properties: {}
        usageMetadata:
          type: object
          properties:
            promptTokenCount:
              type: integer
            candidatesTokenCount:
              type: integer
            totalTokenCount:
              type: integer
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: 错误信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数
              nullable: true
            code:
              type: string
              description: 错误代码
              nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        使用 Bearer Token 认证。
        格式: `Authorization: Bearer sk-xxxxxx`

````

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