Text generation
Choose a platform model with thegemini 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
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
UsePOST /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.