Skip to main content

Endpoints

Generate Content

Stream Generate Content

List Models

Get Model Info

Count Tokens

The Gemini native protocol endpoint provides direct compatibility with Google AI SDKs and supports advanced features like thinking signatures, grounding, and tool calling.

Authentication

string
required
Bearer token authentication
Alternatively, use query parameter:
string
API key as query parameter

Path Parameters

string
required
Model name:
  • gemini-3-flash - Fast and efficient
  • gemini-3-pro-high - High quality reasoning
  • gemini-3-pro-low - Cost-efficient
  • gemini-3-pro-image - Image generation
  • claude-sonnet-4-6 - Mapped Claude model

Request Headers

string
required
Must be application/json

Request Body

array
required
Conversation content in Gemini format
object
Generation parameters
array
Available tools/functions
object
System-level instruction
string
Project ID (automatically injected by proxy)

Response Format

Non-Streaming Response

array
Generated candidates
object
Token usage statistics
string
Actual model version used

Example: Basic Generation

Example: Streaming

Example: With System Instruction

Example: Function Calling

Example: Google Search Grounding

Example: Multi-Modal (Image)

Example: Extended Thinking

Model Information

Get detailed model specs:
Response includes:
  • maxOutputTokens - Maximum output limit
  • supportsThinking - Extended thinking support
  • supportedGenerationMethods - Available methods
  • inputTokenLimit - Context window size

Token Counting

Response:

Features

  • Native Gemini Protocol: Full compatibility with Google AI SDK
  • Auto Project Injection: Automatically injects project ID from account pool
  • Dynamic Token Limits: Automatically caps maxOutputTokens to model limits
  • Thinking Signatures: Validates and preserves thinking signatures across turns
  • MCP Fuzzy Matching: Intelligent tool name matching for MCP servers
  • Grounding Support: Google Search integration for factual queries
  • Context Caching: Automatic caching for repeated contexts

Error Format

Common error codes:
  • 400 - Invalid request
  • 401 - Authentication failed
  • 429 - Quota exceeded (triggers auto-retry)
  • 500 - Internal error