API 文档AI 模型接口图像Gemini

OpenAI聊天格式

Gemini 图片生成

OpenAI聊天格式

Gemini 图片生成

Base URL

  • https://autorouter.top — Production

Authentication

BearerAuth: http (bearer) 使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

Endpoints

POST /v1/chat/completions

OpenAI聊天格式

Gemini 图片生成

Request Body

Content-Type: application/json

Properties:

NameTypeRequiredDescription
modelstringYes-
streambooleanYes-
messagesarrayYes-
extra_bodyobjectNo-
contentsarrayYes-

Responses

200: 成功

Content-Type: application/json

请求示例

curl -X POST "https://autorouter.top/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-image-preview",
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": "生成一张宇航员在奥宇宙中飘浮的图片"
    }
  ],
  "modalities": [
    "text",
    "image"
  ]
}'

响应示例

{
  "id": "string",
  "model": "string",
  "object": "string",
  "created": 0,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "string",
        "content": "string"
      },
      "finish_reason": "string"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}

目录