Skip to main content
POST
Native Gemini path. Streaming uses POST /v1beta/models/{model}:streamGenerateContent.
string
required
Gemini model ID, for example gemini-3-flash-preview.
array
required
Conversation turns.
object
Optional sampling controls.

Endpoint

This free route accepts Gemini native requests and routes only to Gemini platforms. To keep the Gemini format while calling OpenAI or Anthropic models, use the Gemini Format Converter.

Install SDK

Code Examples

Request Format

Response Format

array
Generated candidates.
object
promptTokenCount, candidatesTokenCount, totalTokenCount.

Errors

Same envelope as Errors. Use x-goog-api-key. Native Gemini routes return 400 when the body is not Gemini format.
Missing contents, unknown model ID, or a protocol mismatch.
Missing or invalid x-goog-api-key.
See Rate Limits.

Routing & Protocols

Native-route constraints and converter routes

Gemini Overview

Headers, models, and route family overview

Gemini Format Converter

Keep Gemini format while calling other providers