Skip to main content
Beta: The LLM Gateway is in beta.
Direct model access exposes each provider API through a provider-specific gateway path. The gateway still handles authentication, provider secrets, policies, and tracing, but it does not translate the request and response into another provider’s API format. Prefer standard model access for model calls across providers. Use direct model access when you want to access a provider’s API directly, preserve its native request and response behavior, and avoid the gateway’s standardization layer.

Choose a provider path

Append a provider path to your regional gateway base URL: LangChain also offers managed models through the /langchain path. These models require no provider secret of your own.

Configure provider SDKs

Set each provider SDK’s base URL to its direct gateway path and use your LangSmith API key as the provider API key:
The gateway resolves the actual provider key from your workspace’s Provider Secrets, so the provider key does not need to be stored locally.
Direct paths use the provider’s native model name without a provider prefix.

Configure LangChain and Deep Agents

LangChain chat models and Deep Agents, including Deep Agents Code, support direct gateway paths through two convenience environment variables:
This routes supported chat models through their provider-specific paths at https://gateway.smith.langchain.com. To use a regional gateway, set its URL instead of true:
  • Supported in Python only.
  • Supported chat models:
  • Provider-specific base URLs take precedence over the gateway setting. For example, OPENAI_API_BASE sends OpenAI to that URL while every other supported provider continues to use the gateway.

Use a regional gateway

If your LangSmith account is on a regional instance, use the corresponding regional gateway and append the provider path. For example, use https://eu.gateway.smith.langchain.com/anthropic for direct Anthropic access in GCP EU.

See also