API DocsAI Model APIsImagesGemini

OpenAI Chat Format

Gemini Image Generation

OpenAI Chat Format

Gemini Image Generation

Base URL

  • https://autorouter.top — Production

Authentication

BearerAuth: http (bearer) Authenticate using a Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Endpoints

POST /v1/chat/completions

OpenAI Chat Format

Gemini Image Generation

Request Body

Content-Type: application/json

Properties:

NameTypeRequiredDescription
modelstringYes-
streambooleanYes-
messagesarrayYes-
extra_bodyobjectNo-
contentsarrayYes-

Responses

200: Success

Content-Type: application/json

Request Example

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": "Generate an image of an astronaut floating in space"
    }
  ],
  "modalities": [
    "text",
    "image"
  ]
}'

Response Examples

{
  "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
  }
}

On this page