> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fabricgateway.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fabricgateway.ai/_mcp/server.

# Connect Google Gemini

> Target URL, credentials, supported endpoints, and model names for a Google Gemini AI Studio connection.

The Google Gemini AI Studio connection sends requests to the Gemini API with a Gemini API key. Clients call the route with the OpenAI API format, which Gemini also accepts, and the gateway forwards each request unchanged, apart from the credentials. This topic lists what's specific to Gemini. For the setup steps, see [Connect an LLM provider](/configure/connections/llm-providers). For Gemini models on Google Cloud, see [Other providers](/configure/providers/other-providers).

## Target URL

Use the base URL of Gemini's OpenAI-compatible API, `https://generativelanguage.googleapis.com/v1beta/openai`.

## Credentials

Enter a Gemini API key from Google AI Studio when you set up credentials. The gateway sends it to Google in the header that the provider catalog names, and replaces the same header if the client sent it. Callers authenticate to the gateway with their gateway key in `fg-api-key`.

## Supported endpoints

| Method | Path                | Notes               |
| ------ | ------------------- | ------------------- |
| `POST` | `/chat/completions` | Supports streaming. |
| `POST` | `/embeddings`       |                     |
| `GET`  | `/models`           |                     |

A request to a path that isn't on this list gets `404`.

## Model names

Use Gemini model names, for example `gemini-2.5-flash`. The gateway sends the `model` field exactly as the client wrote it. If you restrict models on the connection, list the same names.

## Example

```bash
curl "BASE_URL/chat/completions" \
  -H "fg-api-key: GATEWAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash",
    "messages": [{ "role": "user", "content": "Hello" }]
  }'
```

Replace `BASE_URL` with the route's base URL and `GATEWAY_KEY` with your gateway key. For how to find both, see [Authenticate and send a request](/use/authenticate).

## Next steps

* [Call a route with the OpenAI-compatible API](/use/llm/openai-compatible)
* [Fail over across providers](/configure/routing/failover)
* [Restrict model and tool access](/configure/access-and-limits/model-access)