Skip to main content
The LLM Gateway is in beta.
This page walks an admin through preparing the LLM Gateway for their organization: connecting providers, granting access, issuing API keys, and setting policies. Complete the following sections in order. Each one links to the page that covers its topic in full.
This page is for admins preparing the gateway for other users. To try the gateway yourself first, go to Send your first LLM Gateway request. The Simulator prompts for a missing provider key as you go.

Enable the gateway on self-hosted LangSmith

On self-hosted LangSmith, enable the gateway in the Helm chart before the other steps. Skip this section on other deployments.

Add provider keys

Adding a provider key requires permission to manage secrets in that workspace. The gateway calls each provider with a key stored as a secret in the workspace that the caller’s API key belongs to. Add a key for each provider you route requests to, in each workspace whose API keys send those requests. The gateway does not fall back to organization secrets for these calls. Skip this section if you route requests only to Gateway Credits models, which need no provider key. For the steps and the secret name each provider uses, see Add a provider key.

Decide who can call the gateway

An API key needs the gateway:invoke and workspaces:read permissions to call the gateway. On plans without workspace roles, every user has both, so skip this section. On the Enterprise plan, as an Organization Admin, give each user who calls the gateway a role that includes both permissions. For which built-in roles include them and how to create a custom role, see Grant permission to call the gateway.

Decide how developers get API keys

Each request authenticates with a workspace-scoped LangSmith API key. Developers can create their own personal access token (PAT), which carries their role, or the Simulator creates one for them. For shared agents or a company-wide rollout through mobile device management (MDM), you can create service keys instead. The key type also determines how the Usage tab can attribute spend. Requests made with a personal access token count toward a user, while requests made with a service key count only toward the key. If you plan to charge back LLM costs, see Attribute spend for chargebacks before you issue keys. For key types and scoping, see Choose a key type. For coding agent rollouts, see Set up coding agents.

Optional: Set policies

Creating policies requires the organization:gateway:manage permission, which Organization Admins and Organization Operators have by default. On self-hosted LangSmith earlier than application version 0.18.9 (Helm chart versions before 0.18.0-rc.22), it requires organization:manage instead. Available policies include:
  • Spend limits: Hard caps at the organization, user group, workspace, API key, or user level. Your organization may already have a default limit on the Policies tab.
  • Rate limits: Request or token limits in a time window.
  • Model access: Which models users can call.
  • Header-based policies: Spend caps, rate limits, and model access scoped by a custom request header, such as a customer, tenant, or cost center identifier.
  • Data policies: Detect and redact PII and secrets before they reach the model, and control whether request and response bodies are traced.
On the Enterprise plan, creating, updating, and deleting policies is recorded in audit logs.

Send a test request

To confirm the setup, follow Send your first LLM Gateway request. It sends a request from the Simulator and from code, and shows its trace. Share the same page with developers as their starting guide.