API compatibility - 5 documented limits
Google Gemini API API compatibility
Google Gemini API documents an OpenAI-compatible API at https://generativelanguage.googleapis.com/v1beta/openai/ (chat/completions, embeddings, images/generations, videos, batches and models). Its docs do not mention an Anthropic-compatible endpoint. The docs list 5 limitations: 5 for the OpenAI-compatible layer.
Verified against Google Gemini API's own documentation. Not documented means the docs read that day do not say; it never means No.
Compare every provider in the API compatibility matrix.
OpenAI-compatible API
Supportedhttps://generativelanguage.googleapis.com/v1beta/openai/- Endpoints
- chat/completions
- embeddings
- images/generations
- videos
- batches
- models
- Auth
- Authorization: Bearer $GEMINI_API_KEY
- Notes
- Docs say the OpenAI library support is still in beta. reasoning_effort maps to Gemini thinking_level/thinking_budget; Gemini-only features go through extra_body (cached_content, thinking_config, etc.). service_tier supports flex and priority. Docs recommend calling the Gemini API directly if you are not already on the OpenAI libraries.
From the docs
Gemini models are accessible using the OpenAI libraries (Python and TypeScript / Javascript) along with the REST API, by updating three lines of code and using your Gemini API key.
Anthropic-compatible API
Not documented- Notes
- The Gemini API docs read today document an OpenAI compatibility layer only; they do not mention an Anthropic-compatible endpoint.
Checked: ai.google.dev/gemini-api/docs/openai
Documented limitations
Parameters, content types and features Google Gemini API's docs say its compatibility layers ignore, reject or change, each with the line it comes from. A layer with nothing listed may still differ in ways the docs do not spell out.
OpenAI-compatible layer5
OpenAI library support is in beta
Support for the OpenAI libraries is still in beta while we extend feature support.
ai.google.dev/gemini-api/docs/openai reasoning cannot be turned off for Gemini 2.5 Pro or Gemini 3 models
If you want to disable thinking, you can set
reasoning_effortto"none"for 2.5 models. Reasoning cannot be turned off for Gemini 2.5 Pro or 3 models.ai.google.dev/gemini-api/docs/openai reasoning_effort and thinking_level/thinking_budget cannot be combined
Note that
reasoning_effortandthinking_level/thinking_budgetoverlap functionality, so they can't be used at the same time.ai.google.dev/gemini-api/docs/openai images: unlisted parameters silently ignored
Supported parameters include
prompt,model,n,size, andresponse_format. Any other parameters not listed here or in theextra_bodysection will be silently ignored by the compatibility layer.ai.google.dev/gemini-api/docs/openai batch: file upload/download not supported through OpenAI compat
Compatibility for upload and download is currently not supported.
ai.google.dev/gemini-api/docs/openai
Example from Google Gemini API's docs
Copied verbatim from the provider's documentation, placeholders included.
from openai import OpenAI
client = OpenAI(
api_key="GEMINI_API_KEY",
base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
)
response = client.chat.completions.create(
model="gemini-3.8-flash",
messages=[
{ "role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain to me how AI works"
}
]
)More on Google Gemini API
Newsletter
Know when a provider changes its API
One email per week. New models, new endpoints and the compatibility changes that break a base URL, and what they mean for your stack.