AICOMBO
EN
  • CN
  • EN
EN
  • CN
  • EN
EN
  • CN
  • EN
  1. Gemini Format
  • User Guide
  • Audio
    • Text to Speech
      POST
    • Gemini Native
      POST
  • Chat
    • Native OpenAI Format
      • ChatCompletions Format
      • Responses Format
      • Responses Async Task Retrieval
      • Responses Async Task Deletion
      • Responses Async Task Retrieval (Streaming)
    • Native Gemini Format
      • Gemini Chat
    • Native Vertex AI Format
      • Gemini Chat
    • Native Anthropic Format
      • Native Claude Format
      • Native Claude Format - Token Count
  • Completions
    • Native OpenAI Format
      POST
  • Images
    • Gemini Format
      • Responses Format
        POST
      • OpenAI Compatible
        POST
  • Models
    • List Models
      • Native OpenAI Format
      • Native Gemini Format
  1. Gemini Format

OpenAI Compatible

POST
https://api.aicombo.com/v1/chat/completions
Gemini image generation - OpenAI-compatible path

请求参数

Header 参数

Body 参数application/json必填

示例
{
  "model": "gemini-3.1-flash-image-preview",
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": "Generate an image of spring"
    }
  ],
  "extra_body": {
    "google": {
      "image_config": {
        "aspect_ratio": "16:9",
        "image_size": "1K"
      }
    }
  }
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location 'https://api.aicombo.com/v1/chat/completions' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
  "model": "gemini-3.1-flash-image-preview",
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": "Generate an image of spring"
    }
  ],
  "extra_body": {
    "google": {
      "image_config": {
        "aspect_ratio": "16:9",
        "image_size": "1K"
      }
    }
  }
}'

返回响应

🟢200Success
application/json
Bodyapplication/json

示例
{
    "id": "chatcmpl-20260529055406466461200ifkqP6H2",
    "model": "gemini-3.1-flash-image-preview",
    "object": "chat.completion",
    "created": 1780034063,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "![image](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...(truncated))"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 5,
        "completion_tokens": 1120,
        "total_tokens": 1125,
        "prompt_tokens_details": {
            "cached_tokens": 0,
            "text_tokens": 5,
            "audio_tokens": 0,
            "image_tokens": 0
        },
        "completion_tokens_details": {
            "text_tokens": 0,
            "audio_tokens": 0,
            "reasoning_tokens": 0
        },
        "input_tokens": 0,
        "output_tokens": 0,
        "input_tokens_details": null,
        "claude_cache_creation_5_m_tokens": 0,
        "claude_cache_creation_1_h_tokens": 0
    }
}
上一页
Responses Format
下一页
Native OpenAI Format
Built with