docs.emix.ai
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Market
File Upload API
Market
File Upload API
  1. Gemini
  • Getting Started with Emix API (Important)
  • Market
  • Image Models
    • Seedream
      • Seedream4.5 - Text to Image
      • Seedream4.5 - Edit
      • Seedream5.0 Lite - Text to Image
      • Seedream5.0 Lite - Image to Image
      • Seedream5.0 Pro - Text to Image
      • Seedream5.0 Pro - Image to Image
    • Google
      • Google - Nano Banana
      • Google - Nano Banana Pro
      • Google - Nano Banana 2
      • Google - Nano Banana 2 Lite
    • Grok Imagine
      • Grok Imagine - Text to Image
      • Grok Imagine - image to image
    • GPT Image
      • GPT Image-1.5 - Text to Image
      • GPT Image-1.5 - Image to Image
      • GPT Image-2 - Text to Image
      • GPT Image 2 - Image To Image
    • Wan
      • Wan 2.7 Image
      • Wan 2.7 Image Pro
  • Video Models
    • Grok Imagine
      • Grok Imagine Text to Video
      • Grok Imagine Image to Video
      • Grok Imagine - Video Upscale
      • Grok Imagine - Video Extend
      • Grok Imagine Video 1.5 Preview
    • Kling
      • Kling 2.6 Text to Video
      • Kling 2.6 Image to Video
      • Kling AI Avatar Standard
      • Kling AI Avatar Pro
      • Kling V2.1 Master Image to Video
      • Kling V2.1 Master Text to Video
      • Kling V2.1 Pro
      • Kling V2.1 Standard
      • Kling 2.6 motion-control
      • Kling-3.0 motion-control
      • Kling 3.0
    • Bytedance
      • Bytedance Seedance 2.0
      • Bytedance Seedance 2.0 Fast
      • Bytedance Seedance 2.0 Mini
    • Veo3.1 API
      • VEO 3.1 Text to video
      • VEO 3.1 Image to video
      • VEO 3.1 Reference to vidoe
    • Wan
      • Wan 2.6 - Image to Video
      • Wan 2.6 - Text to Video
      • Wan 2.6 - Video to Video
      • Wan 2.7 - Text to Video
      • Wan 2.7 - Image to Video
      • Wan 2.7 - Video Edit
      • Wan 2.7 - Reference to Video
    • HappyHorse
      • HappyHorse-1-1 image-to-video
      • HappyHorse-1-1 text-to-video
      • HappyHorse-1-1 reference-to-video
    • Gemini Omni
      • Gemini Omni Video
      • Gemini Omni Audio
      • Gemini Omni Character
  • Chat Models
    • Claude
      • Claude Code + emix.ai Integration Guide
      • Claude Sonnet 5
    • Gemini
      • Gemini 3.5 Flash (openai)
        POST
    • Grok
      • Grok 4.5
      • Grok 4.3
  • Get Task Details
    GET
  1. Gemini

Gemini 3.5 Flash (openai)

POST
/gemini-3-5-flash-openai/v1/chat/completions

Streaming Support#

When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application.
Streaming Response Format:
Content-Type: text/event-stream
Each event line starts with data: followed by JSON
Events contain incremental message deltas
Final event indicates completion with finish_reason
Multimodal
Supports text and image inputs
Real-time Search
Google Search grounding enabled
Streaming
Server-sent events support
Flexible Roles
Multiple message roles supported
⚠️Important: Unified Media Structure
To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure:
  • The type field is fixed as "image_url"
  • The image_url key name remains unchanged for all file types
  • Only the url value points to your specific media file
// Example for Video/Audio/PDF/Image:

{ "type": "image_url", "image_url": { "url": "https://..." } }

Tools Parameter#

The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array.
Function Calling

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Request successful.
Bodyapplication/json

🟠400
🟠401
🟠429
🔴500Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.emix.ai/gemini-3-5-flash-openai/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "What is in this image?"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1759055072437dqlsclj2.png"
                    }
                }
            ]
        }
    ],
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "googleSearch"
            }
        }
    ],
    "stream": true,
    "include_thoughts": true,
    "reasoning_effort": "high"
}'
Response Response Example
200 - 成功示例
{
    "candidates": [
        {
            "content": {
                "role": "model",
                "parts": [
                    {
                        "functionCall": {
                            "args": {
                                "location": "Beijing"
                            },
                            "name": "get_weather_forecast",
                            "id": "gp737npz"
                        },
                        "thoughtSignature": "Es8CCswCAb4example"
                    }
                ]
            },
            "finishReason": "STOP"
        }
    ],
    "modelVersion": "gemini-3-5-flash",
    "usageMetadata": {
        "candidatesTokenCount": 18,
        "thoughtsTokenCount": 55,
        "totalTokenCount": 325,
        "promptTokenCount": 252
    },
    "credits_consumed": 0.01,
    "responseId": "xRS0aZC5BNHVz7IPuaO42Qk"
}
Previous
Claude Sonnet 5
Next
Grok 4.5
Built with