# Gemini base URL

> Set GOOGLE_GEMINI_BASE_URL to https://api.outrun.to/v1/gemini-cli for Gemini CLI. Why /v1beta returns 403, and the full setup.

To point Gemini CLI or a Gemini SDK at Outrun, set GOOGLE_GEMINI_BASE_URL (or your SDK's base URL) to https://api.outrun.to/v1/gemini-cli and use your Outrun key as GEMINI_API_KEY. Requests sent to https://api.outrun.to/v1beta/... are blocked and return a 403 "Just a moment..." page, so keep the /v1/gemini-cli part.

## What causes it?

- The base URL is https://api.outrun.to or https://api.outrun.to/v1beta, which the firewall blocks for Gemini requests.
- Gemini CLI still asks you to sign in with Google because the auth type is not set to an API key.

## How do I fix it?

In this order. [The Gemini CLI setup guide](https://outrun.to/docs/setup/gemini) has the full setup.

- Set GOOGLE_GEMINI_BASE_URL to https://api.outrun.to/v1/gemini-cli.
- Set GEMINI_API_KEY to your Outrun key.
- In ~/.gemini/settings.json set "security": {"auth": {"selectedType": "gemini-api-key"}}, or choose "Use Gemini API Key".
- Open a new terminal and run gemini.

**Terminal**

```
export GOOGLE_GEMINI_BASE_URL="https://api.outrun.to/v1/gemini-cli"
export GEMINI_API_KEY="KEY"
gemini
```

## Questions

### Can I use the OpenAI-compatible base URL for Gemini models instead?

Yes. OpenAI-compatible apps call Gemini models at https://api.outrun.to/v1 with the Gemini model ID. GOOGLE_GEMINI_BASE_URL is only for the Gemini-native API.

### Why do I get a "Just a moment..." page?

The request went to /v1beta/... on the bare host. Use https://api.outrun.to/v1/gemini-cli as the base URL.

### Does Outrun keep my prompts or outputs?

Outrun does not store your prompts, images or outputs unless you choose to save them.

## Related pages

- [Model not found (404)](https://outrun.to/fix/model-not-found-404)
- [401 Invalid API key in an OpenAI-compatible app](https://outrun.to/fix/openai-compatible-401-invalid-api-key)
- [Gemini CLI setup guide](https://outrun.to/docs/setup/gemini)
- [All error fixes](https://outrun.to/fix)
- [Get your API key](https://outrun.to/overview)

[Get your API key](https://outrun.to/key) [See all models and prices](https://outrun.to/pricing)
