Google (Gemini)

Gemini integration via the Generative Language API with automatic format conversion.

Configuration

1export GEMINI_API_KEY=AI...

Supported Models

ModelInput (per 1M)Output (per 1M)
gemini-2.5-pro$1.25$10.00
gemini-1.5-pro$1.25$5.00
gemini-2.0-flash$0.10$0.40
gemini-1.5-flash$0.075$0.30

Format Conversion

RelayPlane automatically converts between OpenAI chat format and Gemini's native format:

  • OpenAI messages → Gemini contents (role mapping: assistant → model)
  • OpenAI system message → Gemini systemInstruction
  • OpenAI tools → Gemini functionDeclarations
  • Gemini functionCall responses → OpenAI tool_calls
  • Multimodal content (images) with base64 inline data support

Endpoint

Base URL: https://generativelanguage.googleapis.com/v1beta

Authentication uses the API key as a query parameter (?key=...).

Model Detection

Models starting with gemini- or palm- are automatically routed to Google.

Both streaming (streamGenerateContent) and non-streaming (generateContent) are supported with full SSE-to-OpenAI format conversion.