First pass on connections for different clients and new features

This commit is contained in:
Owen
2026-08-20 14:26:26 -04:00
parent 45baf08dc4
commit 62b0d81ebb
12 changed files with 693 additions and 3 deletions
+35
View File
@@ -0,0 +1,35 @@
---
title: "Claude Desktop"
description: "Connect Claude Desktop's third-party inference to a Pangolin AI Gateway resource"
---
Claude Desktop can route its requests through a third-party inference gateway instead of Anthropic directly. Point it at an AI Gateway resource that has an Anthropic-compatible provider attached — Anthropic itself, Bedrock, Vertex AI, or a custom Anthropic-compatible endpoint. See [AI Gateway Overview](/manage/ai/overview) if you haven't set that up yet.
import AiGatewayKey from "/snippets/ai-gateway-key.mdx";
You'll need the resource's URL (its `<endpoint>`) and its API key (`<key>`). Both are on the resource's Keys page.
<AiGatewayKey />
## Steps
1. Open Claude Desktop, go to the menu in the top left and select **Help > Troubleshooting**, and turn on **Developer Mode**.
2. From the menu bar, open **Developer**, then **Configure Third-Party Inference…**.
3. Select **Gateway**
4. Select **Credential kind** > **Static API Key**.
3. Fill in:
- **Gateway base URL:** `<endpoint>`
- **Gateway API Key:** `<key>`
4. Restart Claude Desktop.
{/*
Screenshot: `/images/ai/claude-desktop-inference-dialog.png`
The "Configure Third-Party Inference" dialog with the Gateway URL and API Key fields filled in.
<Frame>
<img src="/images/ai/claude-desktop-inference-dialog.png" alt="Claude Desktop third-party inference settings" />
</Frame>
*/}
Send a message to confirm it's working — check the resource's activity in Pangolin's logs if you want to verify traffic is actually flowing through the gateway rather than straight to Anthropic.
For a private resource, put `none` in the API Key field rather than leaving it blank, and make sure the Pangolin client is installed and connected on the same machine as Claude Desktop.
+133
View File
@@ -0,0 +1,133 @@
---
title: "Claude Code"
description: "Connect Claude Code to a Pangolin AI Gateway resource"
---
Claude Code talks the Anthropic Messages API, so the resource you point it at needs an Anthropic-compatible provider attached - Anthropic itself, Bedrock, Vertex AI, or a custom Anthropic-compatible endpoint like Kimi K2. See [AI Gateway Overview](/manage/ai/overview) if you haven't set that up yet.
import AiGatewayKey from "/snippets/ai-gateway-key.mdx";
You'll need the resource's URL (its `<endpoint>`) and its API key (`<key>`). Both are on the resource's Keys page.
<AiGatewayKey />
## Fastest: Pangolin CLI
[Install the Pangolin CLI](/manage/clients/install-client#quick-install-recommended) if you don't have it, then log in:
```bash
pangolin login
```
Configure Claude Code against a resource:
```bash
pangolin configure claude
```
This prompts you to pick an organization and resource if you have more than one, fetches a key for you if the resource needs one, and writes `~/.claude/settings.json`. To skip the prompts:
```bash
pangolin configure claude --resource <resource-niceid-or-domain>
```
To undo it:
```bash
pangolin configure claude --reset
```
{/*
Screenshot: `/images/ai/claude-cli-tab.png`
The Claude Code card on a resource's Keys page, expanded, with the CLI tab selected showing the `pangolin configure claude` command.
<Frame>
<img src="/images/ai/claude-cli-tab.png" alt="Claude Code CLI setup" />
</Frame>
*/}
## Manual setup
Pick the preset that matches your provider.
### Default (Anthropic)
Write `~/.claude/settings.json`:
```json
{
"apiKeyHelper": "echo '<key>'",
"env": {
"ANTHROPIC_BASE_URL": "<endpoint>"
}
}
```
Or, for a one-off shell session instead of a permanent settings file:
```bash
export ANTHROPIC_BASE_URL=<endpoint>
export ANTHROPIC_API_KEY=<key>
claude
```
For a private resource, keep `apiKeyHelper`/`ANTHROPIC_API_KEY` in place and set the key to `none`. Claude Code only calls `apiKeyHelper` if it's present, and falls back to whatever account you're already signed into if it isn't - so removing it sends your traffic to Anthropic instead of through the gateway.
### Amazon Bedrock
Use this when the resource has a Bedrock provider attached. Write `~/.claude/settings.json`:
```json
{
"env": {
"ANTHROPIC_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_BEDROCK_BASE_URL": "<endpoint>/bedrock",
"CLAUDE_CODE_USE_BEDROCK": "1",
"CLAUDE_CODE_SKIP_BEDROCK_AUTH": "1"
}
}
```
### Google Vertex AI
Use this when the resource has a Vertex AI provider attached. Write `~/.claude/settings.json`:
```json
{
"env": {
"CLOUD_ML_REGION": "global",
"ANTHROPIC_VERTEX_PROJECT_ID": "<your-gcp-project-id>",
"CLAUDE_CODE_USE_VERTEX": "1",
"CLAUDE_CODE_SKIP_VERTEX_AUTH": "1",
"ANTHROPIC_VERTEX_BASE_URL": "<endpoint>/v1"
}
}
```
Replace `<your-gcp-project-id>` with your actual GCP project ID.
### Kimi K2 (Moonshot AI)
Use this when the resource has a custom provider pointed at Moonshot AI's Anthropic-compatible endpoint. Write `~/.claude/settings.json`:
```json
{
"apiKeyHelper": "echo '<key>'",
"env": {
"ANTHROPIC_BASE_URL": "<endpoint>/anthropic",
"ANTHROPIC_MODEL": "kimi-k2",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "kimi-k2",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "kimi-k2",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "kimi-k2",
"CLAUDE_CODE_SUBAGENT_MODEL": "kimi-k2",
"ENABLE_TOOL_SEARCH": "false"
}
}
```
{/*
Screenshot: `/images/ai/claude-manual-tab.png`
The same card with the Manual tab selected and the preset dropdown open, showing Default/Bedrock/Vertex/Kimi options.
<Frame>
<img src="/images/ai/claude-manual-tab.png" alt="Claude Code manual setup presets" />
</Frame>
*/}
+76
View File
@@ -0,0 +1,76 @@
---
title: "Codex"
description: "Connect Codex to a Pangolin AI Gateway resource"
---
Codex talks the OpenAI API, so the resource you point it at needs an OpenAI-compatible provider attached — OpenAI, OpenRouter, Vercel AI Gateway, Microsoft Foundry, or a custom OpenAI-compatible endpoint. See [AI Gateway Overview](/manage/ai/overview) if you haven't set that up yet.
import AiGatewayKey from "/snippets/ai-gateway-key.mdx";
You'll need the resource's URL (its `<endpoint>`) and its API key (`<key>`). Both are on the resource's Keys page.
<AiGatewayKey />
## Fastest: Pangolin CLI
[Install the Pangolin CLI](/manage/clients/install-client#quick-install-recommended) if you don't have it, then log in:
```bash
pangolin login
```
Configure Codex against a resource:
```bash
pangolin configure codex
```
This prompts you to pick an organization and resource if you have more than one, fetches a key for you if the resource needs one, and merges a `pangolin` provider into `~/.codex/config.toml` without touching anything else in that file. To skip the prompts:
```bash
pangolin configure codex --resource <resource-niceid-or-domain>
```
To undo it:
```bash
pangolin configure codex --reset
```
{/*
Screenshot: `/images/ai/codex-cli-tab.png`
The Codex card on a resource's Keys page, expanded, with the CLI tab selected showing the `pangolin configure codex` command.
<Frame>
<img src="/images/ai/codex-cli-tab.png" alt="Codex CLI setup" />
</Frame>
*/}
## Manual setup
Merge this into `~/.codex/config.toml` (honors `$CODEX_HOME` if you've set it):
```toml
model_provider = "pangolin"
[model_providers.pangolin]
name = "Pangolin AI Gateway"
base_url = "<endpoint>/v1"
wire_api = "responses"
env_key = "PANGOLIN_API_KEY"
```
Codex reads the key from the environment variable named in `env_key`, not from the file. Before running Codex, export it in your shell:
```bash
export PANGOLIN_API_KEY=<key>
```
Codex is the one client here that also tolerates no key at all: for a private resource you can drop the `env_key` line and skip the export entirely. Exporting `PANGOLIN_API_KEY=none` works too, so use whichever you find clearer.
{/*
Screenshot: `/images/ai/codex-manual-tab.png`
The same card with the Manual tab selected, showing the config.toml snippet.
<Frame>
<img src="/images/ai/codex-manual-tab.png" alt="Codex manual setup" />
</Frame>
*/}
+75
View File
@@ -0,0 +1,75 @@
---
title: "Gemini CLI"
description: "Connect Gemini CLI to a Pangolin AI Gateway resource"
---
Gemini CLI talks Google's native `generateContent` API, so the resource you point it at needs a Google Gemini (or Vertex AI) provider attached. See [AI Gateway Overview](/manage/ai/overview) if you haven't set that up yet.
import AiGatewayKey from "/snippets/ai-gateway-key.mdx";
You'll need the resource's URL (its `<endpoint>`) and its API key (`<key>`). Both are on the resource's Keys page.
<AiGatewayKey />
## Fastest: Pangolin CLI
[Install the Pangolin CLI](/manage/clients/install-client#quick-install-recommended) if you don't have it, then log in:
```bash
pangolin login
```
Configure Gemini CLI against a resource:
```bash
pangolin configure gemini
```
This prompts you to pick an organization and resource if you have more than one, fetches a key for you if the resource needs one, and writes `~/.gemini/.env` - the file Gemini CLI loads automatically on every run, regardless of which directory you start it from. To skip the prompts:
```bash
pangolin configure gemini --resource <resource-niceid-or-domain>
```
To undo it:
```bash
pangolin configure gemini --reset
```
{/*
Screenshot: `/images/ai/gemini-cli-tab.png`
The Gemini CLI card on a resource's Keys page, expanded, with the CLI tab selected showing the `pangolin configure gemini` command.
<Frame>
<img src="/images/ai/gemini-cli-tab.png" alt="Gemini CLI setup" />
</Frame>
*/}
## Manual setup
Write `~/.gemini/.env`:
```bash
GOOGLE_GEMINI_BASE_URL=<endpoint>
GEMINI_API_KEY=<key>
```
Gemini CLI also checks a project-local `.env` first (in the current directory or a parent, up to `.git` or your home directory) before falling back to `~/.gemini/.env`, so a project-level file with the same two lines overrides this for just that project.
Or, for a one-off shell session instead of a permanent file:
```bash
export GOOGLE_GEMINI_BASE_URL=<endpoint>
export GEMINI_API_KEY=<key>
gemini
```
{/*
Screenshot: `/images/ai/gemini-manual-tab.png`
The same card with the Manual tab selected, showing the .env file and shell snippets.
<Frame>
<img src="/images/ai/gemini-manual-tab.png" alt="Gemini CLI manual setup" />
</Frame>
*/}
For a private resource, keep `GEMINI_API_KEY` in place and set it to `none`. Gemini CLI won't start without it set to something.
+55
View File
@@ -0,0 +1,55 @@
---
title: "Open WebUI"
description: "Connect Open WebUI to a Pangolin AI Gateway resource"
---
Open WebUI is a self-hosted chat interface. It talks the OpenAI API, so point it at an AI Gateway resource that has an OpenAI-compatible provider attached (OpenAI, OpenRouter, Vercel AI Gateway, Microsoft Foundry, or custom). See [AI Gateway Overview](/manage/ai/overview) if you haven't set that up yet.
import AiGatewayKey from "/snippets/ai-gateway-key.mdx";
You'll need the resource's URL (its `<endpoint>`) and its API key (`<key>`). Both are on the resource's Keys page.
<AiGatewayKey />
## If you're running Open WebUI for the first time
```bash
docker run -d -p 3000:8080 \
-e OPENAI_API_BASE_URL=<endpoint>/v1 \
-e OPENAI_API_KEY=<key> \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
```
Open `http://localhost:3000`, finish the first-run account setup, and your Pangolin gateway is already the active connection.
## If Open WebUI is already running
Go to **Settings → Connections** and add a connection:
- **URL:** `<endpoint>/v1`
- **Key:** `<key>`
{/*
Screenshot: `/images/ai/openwebui-connections.png`
Open WebUI's Settings → Connections page with the Pangolin gateway URL and key filled in.
<Frame>
<img src="/images/ai/openwebui-connections.png" alt="Open WebUI connection settings" />
</Frame>
*/}
Save, then open a new chat - the models exposed by your resource's attached provider(s) show up in the model picker.
{/*
Screenshot: `/images/ai/openwebui-model-picker.png`
The Open WebUI model picker showing models served through the Pangolin gateway.
<Frame>
<img src="/images/ai/openwebui-model-picker.png" alt="Open WebUI model picker" />
</Frame>
*/}
For a private resource, set the key to `none` rather than leaving it blank. Open WebUI treats a blank key as "no connection configured" and won't list the models.
Note that Open WebUI runs as a server, not on your laptop - so it's the Open WebUI host that needs the Pangolin client installed and connected to reach a private resource, not the browser you're viewing it from.
+97
View File
@@ -0,0 +1,97 @@
---
title: "OpenClaw"
description: "Connect OpenClaw to a Pangolin AI Gateway resource"
---
[OpenClaw](https://openclaw.ai) is an open-source agent gateway that can run against any OpenAI- or Anthropic-compatible endpoint. Point it at an AI Gateway resource with a matching provider attached - OpenAI-compatible (OpenAI, OpenRouter, Vercel AI Gateway, Microsoft Foundry, custom) or Anthropic-compatible (Anthropic, Bedrock, Vertex AI, custom). See [AI Gateway Overview](/manage/ai/overview) if you haven't set that up yet.
import AiGatewayKey from "/snippets/ai-gateway-key.mdx";
You'll need the resource's URL (its `<endpoint>`) and its API key (`<key>`), both on the resource's Keys page, plus the name of a model your attached provider actually serves (e.g. `gpt-4o`, `claude-sonnet-4-6`) - that's `<model-id>` below.
<AiGatewayKey />
## Install
```bash
# macOS/Linux
curl -fsSL https://openclaw.ai/install.sh | bash
# Windows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex
```
## Connect it to your resource
```bash
openclaw onboard --non-interactive --accept-risk \
--auth-choice custom-api-key \
--custom-base-url "<endpoint>/v1" \
--custom-model-id "<model-id>" \
--custom-api-key "<key>" \
--custom-compatibility openai \
--install-daemon --skip-channels --skip-skills
```
Set `--custom-compatibility anthropic` instead of `openai` if the resource's provider is Anthropic/Bedrock/Vertex rather than OpenAI-compatible, and drop `--custom-base-url`'s trailing `/v1` in that case (Anthropic-style resources are addressed at the endpoint root).
Prefer the interactive wizard instead:
```bash
openclaw onboard --install-daemon
```
When prompted, choose **QuickStart or Manual mode**, select the custom/OpenAI-compatible provider option, and enter the base URL and key.
{/*
Screenshot: `/images/ai/openclaw-onboard.png`
The `openclaw onboard` interactive wizard at the provider selection step.
<Frame>
<img src="/images/ai/openclaw-onboard.png" alt="OpenClaw onboarding wizard" />
</Frame>
*/}
## Manual setup
Onboarding writes `~/.openclaw/openclaw.json`. You can edit it directly instead - changes reload automatically:
```json
{
"models": {
"providers": {
"pangolin": {
"baseUrl": "<endpoint>/v1",
"apiKey": "<key>",
"api": "openai-completions",
"models": [
{
"id": "<model-id>",
"name": "<model-id> via Pangolin"
}
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "pangolin/<model-id>" }
}
}
}
```
To switch models later without re-editing the file:
```bash
openclaw models set pangolin/<model-id>
```
## Verify
```bash
openclaw health
openclaw models status
openclaw agent --agent main -m "Hello, what model are you?"
```
For a private resource, keep `--custom-api-key`/`apiKey` and set it to `none`, and make sure the Pangolin client is connected on whichever machine runs the OpenClaw daemon.
+97
View File
@@ -0,0 +1,97 @@
---
title: "OpenCode"
description: "Connect OpenCode to a Pangolin AI Gateway resource"
---
OpenCode configures each model provider separately, so it can talk to whichever API formats your resource supports — Anthropic Messages, OpenAI Chat/Responses, or both, depending on which providers are attached. See [AI Gateway Overview](/manage/ai/overview) if you haven't set that up yet.
import AiGatewayKey from "/snippets/ai-gateway-key.mdx";
You'll need the resource's URL (its `<endpoint>`) and its API key (`<key>`). Both are on the resource's Keys page.
<AiGatewayKey />
## Fastest: Pangolin CLI
[Install the Pangolin CLI](/manage/clients/install-client#quick-install-recommended) if you don't have it, then log in:
```bash
pangolin login
```
Configure OpenCode against a resource:
```bash
pangolin configure opencode
```
This prompts you to pick an organization and resource (if you have more than one), then asks which OpenCode provider ID(s) should point at this gateway — defaults to `anthropic,openai`, but you can enter any comma-separated list OpenCode recognizes (e.g. `openrouter,google`). It fetches a key for you if needed and writes `opencode.json` and `auth.json`. To skip the org/resource prompts:
```bash
pangolin configure opencode --resource <resource-niceid-or-domain>
```
To undo it:
```bash
pangolin configure opencode --reset
```
{/*
Screenshot: `/images/ai/opencode-cli-tab.png`
The OpenCode card on a resource's Keys page, expanded, with the CLI tab selected showing the `pangolin configure opencode` command.
<Frame>
<img src="/images/ai/opencode-cli-tab.png" alt="OpenCode CLI setup" />
</Frame>
*/}
## Manual setup
Merge this into your global `opencode.json` (`~/.config/opencode/opencode.json`, or `$XDG_CONFIG_HOME/opencode/opencode.json` if set):
```json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"anthropic": {
"options": {
"baseURL": "<endpoint>/v1"
}
},
"openai": {
"options": {
"baseURL": "<endpoint>/v1"
}
}
}
}
```
Then merge your key into `auth.json` (`~/.local/share/opencode/auth.json`, or `$XDG_DATA_HOME/opencode/auth.json` if set):
```json
{
"anthropic": {
"type": "api",
"key": "<key>"
},
"openai": {
"type": "api",
"key": "<key>"
}
}
```
<Warning>
`auth.json` is required even for a private resource. OpenCode refuses to start a provider with no key at all and fails with `OpenAI API key is missing. Pass it using the 'apiKey' parameter or the OPENAI_API_KEY environment variable.` Set the key to `none` rather than leaving the entry out.
</Warning>
Only add entries for the providers your resource actually supports. To point a different OpenCode provider (`openrouter`, `google`, `groq`, etc.) at this gateway, add a matching block under `provider` in `opencode.json` and a matching key in `auth.json`.
{/*
Screenshot: `/images/ai/opencode-manual-tab.png`
The same card with the Manual tab selected, showing the opencode.json/auth.json snippets.
<Frame>
<img src="/images/ai/opencode-manual-tab.png" alt="OpenCode manual setup" />
</Frame>
*/}
+98
View File
@@ -0,0 +1,98 @@
---
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** are configured once per organization - the upstream URL and API key for OpenAI, Anthropic, etc.
- **Resources** (type `AI Gateway`) attach one or more of those providers and get a normal Pangolin domain.
- **Keys** are what clients authenticate to the resource with. Public resources check them; private resources don't, since only devices on the Pangolin network can reach them at all.
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.
## 1. Add a provider
Sidebar → **AI Gateway** → **Providers** → **Create**. Pick a provider type, paste in its API key, and save. You can add as many as you need.
{/*
Screenshot: `/images/ai/create-provider.png`
The AI Gateway → Providers → Create form, showing the provider type dropdown and API key field filled in for OpenAI or Anthropic.
<Frame>
<img src="/images/ai/create-provider.png" alt="Creating an AI provider" />
</Frame>
*/}
## 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.
{/*
Screenshot: `/images/ai/create-resource.png`
The new resource dialog with Type set to "AI Gateway" and a provider selected in the AI Providers section.
<Frame>
<img src="/images/ai/create-resource.png" alt="Creating an AI Gateway resource" />
</Frame>
*/}
## 3. Get a key
How a client authenticates depends on whether the resource is public or private.
### Public resources
Reachable from anywhere, so the gateway checks an API key. Find yours in either place:
- Your org's **Your API Keys** page (top-level nav)
- The resource's **API Keys** panel in the Resource Launcher
Both show your personal **Identity Key** and any other keys attributed to you.
### Private resources
Only reachable from devices connected to your Pangolin network, so no key is checked. 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 no key set at all, 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`.
{/*
Screenshot: `/images/ai/api-keys-panel.png`
The resource launcher's API Keys panel, showing the Identity Key section and the "Configure Coding Agents" cards below it.
<Frame>
<img src="/images/ai/api-keys-panel.png" alt="Resource API Keys panel" />
</Frame>
*/}
## 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/claude) |
| Codex | OpenAI Chat/Responses | [Setup guide](/manage/ai/codex) |
| OpenCode | Anthropic Messages and/or OpenAI Chat | [Setup guide](/manage/ai/opencode) |
| Gemini CLI | Gemini `generateContent` | [Setup guide](/manage/ai/gemini) |
There are also guides for pointing other tools at a Pangolin AI Gateway resource:
- [Open WebUI](/manage/ai/open-webui)
- [Claude Desktop](/manage/ai/claude-desktop)
- [OpenClaw](/manage/ai/openclaw)
## Supported providers
| Provider | Speaks |
|---|---|
| OpenAI | Chat Completions, Responses |
| Anthropic | Messages |
| Google Gemini | `generateContent` |
| Vertex AI | Google `generateContent`/`rawPredict` |
| Bedrock | Converse |
| Microsoft Foundry | Chat Completions, Responses, Messages |
| OpenRouter | Chat Completions |
| Vercel AI Gateway | Chat Completions, Responses |
| Custom | Whatever you configure |
Use **Custom** for any OpenAI- or Anthropic-compatible endpoint that isn't in the list above - for example a Moonshot AI (Kimi) endpoint, which is Anthropic-compatible.