Skip to content

Gemini Chat ​

Google Gemini models support both OpenAI-compatible format and Gemini native format.

Endpoint ​

POST $URL/v1/chat/completions

Supported Models ​

ModelPositioning
gemini-3.5-flashLatest high-speed version
gemini-3.1-pro3.1 flagship
gemini-3.1-flash-lite3.1 lightweight version
gemini-3-pro-preview3.0 Pro preview
gemini-3-flash-preview3.0 lightweight preview
gemini-2.5-pro / gemini-2.5-flash2.5 stable versions
gemini-2.5-pro-preview-ttsSupports voice output

More versions (gemini-pro-latest / gemini-flash-latest aliases, etc.) are available in the "Model Hub" section of the console.

Request Example ​

bash
curl $URL/v1/chat/completions \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-pro",
    "messages": [
      {"role": "user", "content": "Explain why GPS satellites need clock calibration using relativity"}
    ]
  }'
python
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="$URL/v1")
resp = client.chat.completions.create(
    model="gemini-2.5-pro",
    messages=[{"role": "user", "content": "Explain why GPS satellites need clock calibration using relativity"}],
)
print(resp.choices[0].message.content)
ts
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: process.env.YOUR_API_KEY,
  baseURL: '$URL/v1',
})
const resp = await client.chat.completions.create({
  model: 'gemini-2.5-pro',
  messages: [{ role: 'user', content: 'Explain why GPS satellites need clock calibration using relativity' }],
})
console.log(resp.choices[0].message.content)

Method 2: Gemini Native Format ​

If you need the Gemini SDK or native endpoint, call:

POST $URL/v1/models/{model}:generateContent

Request Body (Gemini Native) ​

json
{
  "contents": [
    {
      "role": "user",
      "parts": [{ "text": "Explain the theory of relativity in simple terms." }]
    }
  ],
  "systemInstruction": {
    "parts": [{ "text": "You are a helpful physics tutor." }]
  },
  "generationConfig": {
    "temperature": 0.7,
    "maxOutputTokens": 1024
  }
}

cURL Example ​

bash
curl $URL/v1/models/gemini-2.5-pro:generateContent \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [{"text": "Explain the theory of relativity in simple terms."}]
      }
    ]
  }'

Recommendation ​

ScenarioRecommended Method
Existing OpenAI SDK codeMethod 1, just change the model
Need Gemini-specific features (grounding, native function calling syntax)Method 2
Multi-model unified managementMethod 1

© 2026 Euno AI. All rights reserved.