> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routerbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Gemini API

> Gemini 2.5 / 3.x via RouterBase — OpenAI-compatible chat completions with per-user prompt caching.

## Overview

Google's **Gemini** models on RouterBase, served through the standard
OpenAI-compatible chat completions endpoint (streaming, tool calling,
vision, per-user prompt caching).

|              |                                             |
| ------------ | ------------------------------------------- |
| **Provider** | Google                                      |
| **Family**   | `gemini`                                    |
| **Modality** | Chat                                        |
| **Caching**  | Per-user prompt cache (automatic, isolated) |

## Models

* `google/gemini-2.5-pro`
* `google/gemini-2.5-flash`
* `google/gemini-2.5-flash-lite`
* `google/gemini-3-flash-preview`
* `google/gemini-3.1-pro-preview`
* `google/gemini-3.1-flash-lite`

Pricing is deliberately not reproduced here. Rates are set per model in the
RouterBase catalogue and can be overridden per account, so any figure copied
into this page is a snapshot that goes stale the next time a rate changes.
Fetch the current rate for any model from the [Models API](/api-reference/models):

```http theme={null}
GET /api/models/{model}/pricing
```

URL-encode the slash in the model id — e.g. `google%2Fgemini-2.5-pro`.

## Endpoint

```http theme={null}
POST https://routerbase.com/v1/chat/completions
```

Drop-in compatible with the OpenAI client — point it at
`https://routerbase.com/v1`. See the full
[Chat Completions reference](/api-reference/chat-completions) for every
parameter, streaming, and prompt-caching details.

## Quickstart

```bash theme={null}
curl https://routerbase.com/v1/chat/completions \
  -H "Authorization: Bearer $ROUTERBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-2.5-pro",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'
```

Live catalogue + current rates: the [Models API](/api-reference/models).
