Google

Google Gemini-compatible API

The Gemini API's native paths and request shapes, for models that declare support for the Google protocol. Point your Google GenAI SDK's base_url at the address below and change nothing else.

Base URL

Loading…

Get started

Loading…

Available models

  • The model name in the path is a platform model name (such as gemini-2.5-flash); see list models. Only models that declare Google protocol support can be called here; other models return 404.
  • For image output, include IMAGE in generationConfig.responseModalities; the request is served by the platform's image models.
  • Forcing a tool (toolConfig mode ANY) on a thinking model is passed through to the model just like the native Gemini API: the model decides, and a rejection comes back as a Google-formatted 400 error.

Endpoints

MethodPathDescriptionSupport
POST/v1beta/models/{modelsId}:generateContentGenerate content● Supported
POST/v1beta/models/{modelsId}:streamGenerateContentStream generated content● Supported
POST/v1beta/models/{modelsId}:countTokensCount tokens◐ Partial
POST/v1beta/models/{modelsId}:embedContentGenerate an embedding● Supported
POST/v1beta/models/{modelsId}:batchEmbedContentsGenerate batch embeddings● Supported
GET/v1beta/modelsList models● Supported
GET/v1beta/models/{modelsId}Get a model● Supported

Differences from Gemini API

  • Generate content:Forced tool use in toolConfig (functionCallingConfig mode ANY, including allowedFunctionNames) is forwarded unchanged on thinking models too — the same as the native Gemini API, so whether it is accepted is up to the upstream model; if the upstream answers 400, the error keeps the Google format and carries the upstream code and status.
  • Count tokens:Returns a model-family-calibrated estimate, including Chinese text and tool definitions, with the response header x-praxis-token-count: estimated. Do not use it as an exact usage or billing count.
  • Generate an embedding:Only text parts are accepted; images and other multimodal parts are rejected. taskType, title and retrieval settings such as autoTruncate / documentOcr / audioTrackExtraction have no equivalent on the platform: a request that carries them gets 400 (INVALID_ARGUMENT) instead of being silently ignored, because different taskType values produce vectors that behave differently and dropping one would quietly change retrieval quality. outputDimensionality maps to the dimension of the returned vector.
  • Generate batch embeddings:Each entry in requests follows the same rules as embedContent (text parts only, same rejections); every entry in a batch must use the same outputDimensionality. The current official JS and Python SDKs actually call this batch endpoint for embedContent.
  • List models:Embedding models are listed with embedContent as their only supported method. While the model catalog is temporarily unavailable, generateContent keeps working: requests that explicitly ask for image output (responseModalities includes IMAGE) still go to the image route, and older image requests that do not say so are handled as text chat for that window — every response during the fallback carries the X-Praxis-Route-Degraded: model-catalog-unavailable header so you can tell.

For authoritative parameter definitions, see the official Gemini API documentation.

Errors follow the Gemini API format, see errors; quotas and response headers are covered in rate limits.

Export

On this page