mirror of
https://github.com/fosrl/docs-v2.git
synced 2026-10-19 11:09:07 +02:00
73 lines
5.5 KiB
Plaintext
73 lines
5.5 KiB
Plaintext
---
|
|
title: "AI Gateway Overview"
|
|
description: "Route coding agents and AI clients through Pangolin with centralized providers and keys"
|
|
---
|
|
|
|
An AI Gateway resource is a normal Pangolin resource that proxies requests to one or more upstream AI providers (OpenAI, Anthropic, Google Gemini, Bedrock, Vertex AI, or a custom endpoint). Point a client at the resource's URL instead of the provider's, and Pangolin handles auth, access control, and logging in front of it.
|
|
|
|
## How It Fits Together
|
|
|
|
- **[Providers](/manage/ai/providers/overview)** are configured once per organization - the upstream URL, API key, and capabilities for OpenAI, Anthropic, etc.
|
|
- **Resources** (type `AI Gateway`) attach one or more of those providers and get a normal Pangolin domain.
|
|
- **[Virtual API Keys](/manage/ai/virtual-api-keys)** are what clients send to a **public** AI Gateway resource. Private resources are reached through the Pangolin network, so the gateway does not check a key.
|
|
- The **[Model Catalog](/manage/ai/model-catalog)** is the known-model list and token pricing used by [model routing](/manage/ai/providers/model-routing) and budgets.
|
|
|
|
A resource only understands the API format(s) its attached providers support. An Anthropic provider makes the resource speak the Anthropic Messages API; an OpenAI provider makes it speak Chat Completions/Responses; a Gemini provider makes it speak Gemini's `generateContent` API. Attach whichever providers match the clients you plan to connect. See [AI Providers](/manage/ai/providers/overview) for per-type setup and [Provider Configuration](/manage/ai/providers/configuration) for capabilities, auth, and model lists.
|
|
|
|
## 1. Add a Provider
|
|
|
|
Create an org-level provider so the gateway has an upstream to call. Sidebar → **AI Gateway** → **Providers** → **Create**, or follow the [AI Providers](/manage/ai/providers/overview) guide. Pick a type, paste in its API key, and save. You can add as many as you need.
|
|
|
|
## 2. Create a Resource
|
|
|
|
Resources → **Create** → set **Type** to **AI Gateway**, pick a domain, and attach the provider(s) from step 1. You can also attach providers to an existing resource later from its **AI Gateway** settings tab.
|
|
|
|
## 3. Get a Key
|
|
|
|
How a client authenticates depends on whether the resource is public or private. See [Virtual API Keys](/manage/ai/virtual-api-keys) for identity vs manual keys, always-on auth, and where to copy a key.
|
|
|
|
### Public Resources
|
|
|
|
Reachable from anywhere, so the gateway checks a virtual API key. Copy yours from the resource URL after login, the Resource Launcher more-info panel, or `https://app.pangolin.net/<org-id>/keys` (use your self-hosted dashboard URL in place of `app.pangolin.net` if you self-host).
|
|
|
|
### Private Resources
|
|
|
|
Only reachable from devices connected to your Pangolin network, so the gateway does not check a key. Instead, the machine running the client needs the [Pangolin client](/manage/clients/install-client) installed and connected.
|
|
|
|
You still have to put *something* in the client's key field. Most AI clients refuse to start with a missing key, so use the literal string `none`. Deleting the field usually breaks things. Claude Code, for instance, silently falls back to your regular Anthropic account if `apiKeyHelper` is missing, and OpenCode errors out with `OpenAI API key is missing`.
|
|
|
|
## 4. Connect a Client
|
|
|
|
Every resource's Keys page has ready-to-copy setup for common clients, and `pangolin configure <client>` can write the config for you. Full instructions per client:
|
|
|
|
| Client | Needs a provider that speaks | Guide |
|
|
|---|---|---|
|
|
| Claude Code | Anthropic Messages | [Setup guide](/manage/ai/configure-ai-clients/claude) |
|
|
| Codex | OpenAI Chat/Responses | [Setup guide](/manage/ai/configure-ai-clients/codex) |
|
|
| OpenCode | Anthropic Messages and/or OpenAI Chat | [Setup guide](/manage/ai/configure-ai-clients/opencode) |
|
|
| Gemini CLI | Gemini `generateContent` | [Setup guide](/manage/ai/configure-ai-clients/gemini) |
|
|
|
|
There are also guides for pointing other tools at a Pangolin AI Gateway resource:
|
|
|
|
- [Open WebUI](/manage/ai/configure-ai-clients/open-webui)
|
|
- [Claude Desktop](/manage/ai/configure-ai-clients/claude-desktop)
|
|
- [OpenClaw](/manage/ai/configure-ai-clients/openclaw)
|
|
|
|
## Supported Providers
|
|
|
|
Each type has its own configuration guide. Capabilities (which API formats a provider speaks) are explained in [Provider Configuration](/manage/ai/providers/configuration#capabilities).
|
|
|
|
| Provider | Default capabilities | Guide |
|
|
|---|---|---|
|
|
| OpenAI | Chat Completions, Responses | [Configure](/manage/ai/providers/openai) |
|
|
| Anthropic | Messages | [Configure](/manage/ai/providers/anthropic) |
|
|
| Google Gemini | `generateContent` | [Configure](/manage/ai/providers/google-gemini) |
|
|
| Vertex AI | Google `generateContent`/`rawPredict` | [Configure](/manage/ai/providers/vertex-ai) |
|
|
| Amazon Bedrock | Converse | [Configure](/manage/ai/providers/bedrock) |
|
|
| Microsoft Foundry | Chat Completions, Responses, Messages | [Configure](/manage/ai/providers/microsoft-foundry) |
|
|
| OpenRouter | Chat Completions | [Configure](/manage/ai/providers/open-router) |
|
|
| Vercel AI Gateway | Chat Completions, Responses | [Configure](/manage/ai/providers/vercel-ai-gateway) |
|
|
| Custom | Whatever you select | [Configure](/manage/ai/providers/custom) |
|
|
|
|
Use [Custom](/manage/ai/providers/custom) for any upstream that isn't in the typed list. Assign whichever capabilities it speaks - OpenAI, Anthropic, Gemini, Vertex, Bedrock, or a mix. A Moonshot AI (Kimi) endpoint is one example: select Anthropic Messages and point at its Anthropic-compatible URL.
|