1. Gemini
OmniRouters-API Docs
  • Platform API
    • List models(OpenAI)
      GET
    • List models(Gemini)
      GET
  • Chat
    • OpenAI
      • ChatCompletions
      • Responses
    • Gemini
      • Gemini
        POST
      • Gemini Vision
        POST
    • Claude
      • Claude Messages
  • Videos
    • Omni-Create video
      • Parameter Description
      • Kling
        • Parameter Description
        • Kling-Template
        • Kling-3.0-shot-type
        • Kling-3.0-element-list
      • Vidu-Template
      • Hailuo-Template
      • Seedance-Template
      • JV(Jimeng)-Template
      • GV(Veo)-Template
      • OS(Sora)-Template
      • Hunyuan(Mingmou)-Template
      • Get Task
    • Wan2.6
      • Create Task
      • Get Task
    • Seedance
      • 1.5-Pro-Create Task
      • 2.0(2.0-fast)Create Task
      • volc/2.0(2.0-fast)Create Task
      • Get Task
    • Agent-VOD
      • Parameter Description
      • Create Task-general
      • Create Task-ecommerce
      • Create Task-mv
      • Create Task-replicate
      • Get Task
  • Images
    • Omni-Create image
      • Parameter Description
      • Create image
    • Nano-Banana
      • Gemini
      • OpenAI Chat
    • Nano-Banana-Pro
      • Gemini
      • OpenAI Chat
    • Nano-Banana2
      • Gemini
    • Seedream
      • Create image
    • Midjouney
      • Submit Imagine task (text-to-image, image-to-image)
      • Submit Blend task (image-to-image)
      • Execute actions (all associated button actions such as UPSCALE, VARIATION, REROLL, ZOOM, etc.)
      • Create Describe task (image-to-text)
      • Submit Modal (submit local redraw, ZOOM)
      • Create Shorten task (prompt analysis)
      • Create an "edits" task (image editing)
      • Create the swap_face task (face swap)
      • Create Video task (text-to-video, text-to-image-to-video)
      • Retrieve tasks by specified ID
  • Music
    • Suno
      • Create music
      • Create lyrics
      • Get Task
  • Embeddings
    • OpenAI
      POST
  • Audio
    • Seed-TTS
      • 豆包语音合成模型1.0音色ID
      • 豆包语音合成模型2.0音色ID
      • Seed-TTS
    • Gemini-TTS
      • Gemini-TTS
    • MiniMax-TTS
      • MiniMax-TTS
    • Vidu-TTS
      • Vidu-TTS
    • OpenAI-TTS
  • Moderations
  • Rerank
    • Create rerank
  • Realtime
    • OpenAI
  1. Gemini

Gemini Vision

Developing
POST
https://omnirouters.com/v1beta/models/{model}:generateContent
Gemini image, PDF, audio, and video recognition requests
⚠️Note: Only supports uploading images, PDFs, audios, and videos via inlineData in base64 format, and does not support fileData.fileUri or the File API.

Request

Path Params

Header Params

Body Params application/jsonRequired

Example
{
    "model": "gemini-2.0-flash",
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "string",
                    "inlineData": {
                        "mimeType": "string",
                        "data": "string"
                    },
                    "fileData": {
                        "mimeType": "string",
                        "fileUri": "string"
                    }
                }
            ]
        }
    ],
    "generationConfig": {
        "temperature": 1,
        "topP": 0.95,
        "topK": 40,
        "maxOutputTokens": 8192,
        "responseMimeType": "text/plain",
        "responseSchema": {}
    },
    "systemInstruction": {
        "parts": [
            {
                "text": "string"
            }
        ]
    },
    "safetySettings": [
        {
            "category": "HARM_CATEGORY_HARASSMENT",
            "threshold": "BLOCK_NONE"
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://omnirouters.com/v1beta/models/:generateContent' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-2.0-flash",
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "string",
                    "inlineData": {
                        "mimeType": "string",
                        "data": "string"
                    },
                    "fileData": {
                        "mimeType": "string",
                        "fileUri": "string"
                    }
                }
            ]
        }
    ],
    "generationConfig": {
        "temperature": 1,
        "topP": 0.95,
        "topK": 40,
        "maxOutputTokens": 8192,
        "responseMimeType": "text/plain",
        "responseSchema": {}
    },
    "systemInstruction": {
        "parts": [
            {
                "text": "string"
            }
        ]
    },
    "safetySettings": [
        {
            "category": "HARM_CATEGORY_HARASSMENT",
            "threshold": "BLOCK_NONE"
        }
    ]
}'

Responses

🟢200成功
application/json
Body

Example
{}
Modified at 2026-03-11 12:55:11
Previous
Gemini
Next
Claude Messages
Built with