mirror of
https://github.com/fosrl/docs-v2.git
synced 2026-10-01 10:19:23 +02:00
35 lines
2.2 KiB
Plaintext
35 lines
2.2 KiB
Plaintext
---
|
|
title: "Cloud APIs Through a Site"
|
|
description: "Send OpenAI or Anthropic traffic out through a Pangolin site so the vendor sees a fixed egress IP"
|
|
---
|
|
|
|
Typed [OpenAI](/manage/ai/providers/openai) and [Anthropic](/manage/ai/providers/anthropic) providers send requests from the Pangolin node's own egress. A [Custom](/manage/ai/providers/custom) provider with **Site Targets** sends the same APIs out through a chosen site, so OpenAI or Anthropic see that site's public IP.
|
|
|
|
Use this when the vendor allowlists IPs, or all inference must leave from one network. The site is only the egress path. Auth still lives on the provider: paste the real vendor key.
|
|
|
|
Those typed provider types use **Upstream URL** only. This walkthrough uses Custom plus targets.
|
|
|
|
See [Capabilities](/manage/ai/providers/configuration#capabilities) for the full capability list.
|
|
|
|
## Configure
|
|
|
|
1. Pick a [site](/manage/sites/understanding-sites) that can reach the public internet. That box's public IP is what the vendor will see.
|
|
2. Sidebar → **AI Gateway** → **Providers** → **Create**. Set **Provider Type** to **Custom**.
|
|
3. Select capabilities that match the cloud API:
|
|
- OpenAI: **OpenAI Chat Completions** and **OpenAI Responses**
|
|
- Anthropic: **Anthropic Messages** and **Anthropic Models**
|
|
4. Set **Routing Mode** to **Site Targets**.
|
|
5. Set **Auth Type** to **Bearer** for OpenAI, or **`x-api-key`** for Anthropic, and paste the vendor API key.
|
|
6. Allow the model ids you plan to call, then save.
|
|
7. On the **Network** tab, add a target on that site. Use the API hostname as the address so TLS Host and SNI match:
|
|
|
|
| Vendor | Address | Port | Method |
|
|
|---|---|---|---|
|
|
| OpenAI | `api.openai.com` | `443` | HTTPS |
|
|
| Anthropic | `api.anthropic.com` | `443` | HTTPS |
|
|
|
|
The target address is sent as the Host header.
|
|
8. Attach the provider to an [AI Gateway resource](/manage/ai/overview).
|
|
|
|
The site must resolve and reach that hostname. Clients still point at the resource URL, not at OpenAI or Anthropic directly: [Codex](/manage/ai/configure-ai-clients/codex), [Claude Code](/manage/ai/configure-ai-clients/claude), and the other [client guides](/manage/ai/overview#4-connect-a-client).
|