# Google Gemini

Add Google's Gemini API as a provider, with a key from Google AI Studio, and call Gemini models through the LLM Gateway.

Connect Google's Gemini API using your API key to serve Gemini models such as `gemini-4-carbon`. For keyless Gemini access on Google Cloud, use [Google Vertex AI](/guides/llm-gateway/providers/google-vertex-ai) instead. Adding a provider requires Owner or LLM Gateway Admin on the organization, or on a project for a project-scoped provider.

## Add Google Gemini [#add-google-gemini]

1. Create an API key in [Google AI Studio](https://aistudio.google.com/apikey).
2. In your organization, click **LLM Gateway**, then **Providers**, then **Add a provider**, then **Google Gemini** under **Model providers**.
3. Paste the key into **API key**, select which projects can create models with this provider, click **Test** and click **Add provider**.

See [Add a provider](/guides/llm-gateway/add-a-provider) for adding a project provider, sharing and key rotation.

## What kosem uses [#what-kosem-uses]

- **API:** Gemini's `generateContent` endpoint at `https://generativelanguage.googleapis.com`. kosem translates Anthropic Messages, OpenAI Responses and OpenAI Chat Completions calls to it, so every Gemini call is translated.
- **Type, for the API:** `providerTypes/google`, with no settings.
- **Models to start with:** `gemini-4-carbon` and `gemini-3.8-flash`. The provider list omits audio, image, video, Live, computer use and Deep Research models.
- **Prices:** Google's list prices, for usage and spend limits.

Gemini buffers streamed responses until its thinking or tool call arguments finish, so on long prompts the first output tokens can take minutes. Through Anthropic's SDK, token counting returns `501` for Gemini models so SDKs fall back to local estimation.

When Google rejects the key (for example, if expired or revoked), the provider shows **Needs attention**: create a key in Google AI Studio and [replace it](/guides/llm-gateway/add-a-provider#replace-a-key).

## Related [#related]

- [Add a provider](/guides/llm-gateway/add-a-provider)
- [Google Vertex AI](/guides/llm-gateway/providers/google-vertex-ai)
- [Call models from your code](/guides/llm-gateway/call-models-from-code)
