Skip to main content
OpenPAI supports both the OpenAI-compatible protocol and the Gemini-native protocol (/v1beta/models/{model}:generateContent), covering Google’s latest Gemini 3 preview and the stable 2.5 series.

Gemini 3 series (current mainline)

The next-generation flagship, suited to agents, complex reasoning, realtime voice and more — currently Google’s primary series.
Model IDTypePositioning
gemini-3.1-pro-previewChat / AgentMost intelligent — top-tier reasoning and agent capability for complex multi-step tasks
gemini-3.5-flashChatFrontier-class performance rivaling larger models
gemini-3-flashChatFrontier capability + lower cost
gemini-3.1-flash-liteChatHigh performance + ultra-low cost, for high-volume lightweight tasks
gemini-3.1-flash-live-previewRealtime audioVoice-first apps, bidirectional low-latency streaming (Live API)
gemini-3.1-flash-tts-previewSpeech synthesisLow-latency, natural TTS
Preview models may change their interface and pricing at any time; for production, also configure a stable fallback model. The available IDs shown in Console → Models are authoritative.

Gemini 2.5 series (stable)

Model IDContextPositioning
gemini-2.5-pro1MStrongest general reasoning and code
gemini-2.5-flash1MBest value for reasoning tasks
gemini-2.5-flash-lite1MFastest, cheapest multimodal option
gemini-2.5-flash-native-audio-preview1MSub-second native audio streaming

Thinking and reasoning effort

The Gemini 2.5 / 3 series supports an explicit thinking budget. Both ways work:

Via parameter

resp = client.models.generate_content(
    model="gemini-2.5-pro",
    contents="Prove Goldbach's conjecture",
    config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(thinking_budget=8000),
    ),
)

Via model ID suffix

OpenPAI passes through the following model ID aliases, mapping them internally to the corresponding thinking config:
Model IDBehavior
gemini-2.5-pro-thinkingDefault medium thinking budget
gemini-2.5-pro-thinking-128Force a 128-token thinking budget
gemini-2.5-flash-thinkingFlash + thinking on
gemini-2.5-flash-nothinkingFlash + thinking off (cheaper)
gemini-2.5-pro-low/medium/highProgressively higher reasoning effort
gemini-3.1-pro-preview-highGemini 3 Pro, maximum reasoning budget

Multimodal generation

Model IDUse case
nano-banana-proTop-tier visual creation / 4K professional design
nano-banana-2Efficient image generation / editing
gemini-2.5-flash-imageNative image generation / editing
imagen-4Ultra-fast text-to-image (2K)
veo-3.1Video generation (with native audio); availability subject to the console
Example:
curl "https://openp.ai/v1beta/models/gemini-2.5-flash-image:generateContent" \
  -H "x-goog-api-key: $OPENPAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role":"user","parts":[{"text":"A red panda surfing, cartoon style"}]}],
    "generationConfig": {"responseModalities": ["IMAGE"]}
  }'

Embedding models

Model IDDimensionsPositioning
gemini-embedding-23072 (reducible)Latest multimodal embedding, first choice for semantic retrieval
gemini-embedding-0013072 (reducible)Text embedding, RAG / classification
text-embedding-004768Older, for compatibility

Examples

OpenAI-compatible protocol

from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="https://openp.ai/v1")

resp = client.chat.completions.create(
    model="gemini-3.1-pro-preview",
    messages=[{"role": "user", "content": "Explain the Fourier transform"}],
)
print(resp.choices[0].message.content)

Gemini native protocol

curl "https://openp.ai/v1beta/models/gemini-3.1-pro-preview:generateContent" \
  -H "x-goog-api-key: $OPENPAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role":"user","parts":[{"text":"hello"}]}],
    "generationConfig": { "temperature": 0.7, "maxOutputTokens": 2048 }
  }'

google-genai SDK

from google import genai

client = genai.Client(
    api_key="sk-XXXXXXXXXXXXXXXX",
    http_options={"base_url": "https://openp.ai"},
)

resp = client.models.generate_content(
    model="gemini-3.1-pro-preview",
    contents="Give me 3 travel vlog titles",
)
print(resp.text)

Vision and multimodal input

Gemini natively supports image, PDF, audio and video input:
{
  "contents": [{
    "role": "user",
    "parts": [
      {"text": "Summarize this image"},
      {"inline_data": {"mime_type": "image/png", "data": "<base64>"}}
    ]
  }]
}

Function calling

Full support for Gemini function_declarations and function_call; when accessed via the OpenAI-compatible endpoint, these are automatically converted to tools / tool_calls structures. See Function calling.

API docs