Skip to main content

Text generation

Choose a platform model with the gemini protocol. Use the gateway root, x-goog-api-key, and the Gemini contents format. Do not prepend the OpenAI SDK’s /v1 Base URL to a /v1beta path.
cURL
Replace MODEL_ID with the platform ID. URL-encode it as a path segment if it contains special characters. Responses use the native Gemini candidate format.

Streaming and counting

Use POST /v1beta/models/MODEL_ID:streamGenerateContent?alt=sse for streams, with a streaming-compatible route. POST /v1beta/models/MODEL_ID:countTokens requires channel support and has no generation charge. The gateway also accepts /v1/models/MODEL_ID:ACTION. GET /v1beta/models returns a Gemini-style catalog; GET /v1/models keeps the OpenAI format.

Capability boundaries

Multimodal input, reasoning, tools, and other configuration depend on the model and upstream implementation. A generation endpoint does not imply support for every provider media service. Do not automatically retry requests whose execution is uncertain.