AI Gateway

Reach an AI API over the Pangolin tunnel using the connected client's identity

A private AI Gateway resource exposes an AI API only to devices connected with the Pangolin client. Nothing is reachable from the public internet. Unlike public AI Gateway, the gateway does not check a virtual API key. Identity comes from the active client connection.

This page covers how the resource works: reachability, access, and what you attach. Providers, model routing, the catalog, and client setup live in AI Gateway.

Benefits

  • The gateway is never reachable from the public internet, only from connected clients with access.
  • There are no API keys to issue or leak. The client connection identifies the caller.
  • Provider API keys stay in Pangolin and never reach users' machines.
  • Calls are attributed to the connected user, so usage analytics and session logs show who made each one.
  • Self-hosted model servers on a site network can sit behind the same gateway as cloud providers.

Use Cases

  • Give employees Claude Code, Codex, or other coding agents through company provider accounts without handing out provider keys.
  • Keep AI access limited to managed devices that run the Pangolin client.
  • Serve a self-hosted model, such as one running on Ollama or vLLM, to your team without exposing it to the internet.
  • Give machine clients, such as CI jobs or internal agents, model access tied to their own identity.

How It Works

  1. You create a private resource with type AI Gateway on a Pangolin Site and attach one or more org-level providers.
  2. You grant users, roles, or machines access, the same as any other private resource.
  3. The user connects with the Pangolin client. The machine running the AI client must be on that tunnel.
  4. The agent calls the resource URL. Pangolin attributes the call to the connected user and proxies to the selected provider.

Clients still need a value in the API key field. Use the literal string none. Deleting the field usually breaks the client.

Providers, Not Destinations

Private AI Gateway resources attach providers on the resource's AI Gateway tab. They do not use a host or CIDR destination as the model backend. Cloud APIs are called from Pangolin. Custom providers can use Site Targets when the model server is on a site network.

Private resources, including this type, can only be created on Pangolin Sites.

Authentication and Access Rules

Access is the private resource model: grant users, roles, or machines explicitly. See Private Authentication.

When the connected client maps to a user, Pangolin forwards that identity upstream as Remote-* headers.

More Than One Resource

Give different users and roles their own providers with more than one AI Gateway resource. Distinct hostnames are the usual approach. Unlike other private resource types, they can also share a FQDN because they all route to the gateway inside Pangolin. See Multiple Gateway Resources.

Compared to Public AI Gateway

Private AI GatewayPublic AI Gateway
ReachabilityPangolin client tunnelPublic FQDN
AuthClient identity; use none as the key placeholderVirtual API key on every call
Who can call itUsers, roles, and machines granted on the resourceIdentity keys follow users and roles; manual keys grant access when created

For providers, model routing, and connecting Claude Code, Codex, and other clients, see AI Gateway.

Was this page helpful?