Skip to main content
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. Direct model access is the path LangChain and Deep Agents use by default. For other clients, use it when you want a provider’s native request and response behavior. To call models across providers in one API format, use the standard endpoint instead.

Choose a provider path

Append a provider path to your regional gateway base URL, for example https://eu.gateway.smith.langchain.com/anthropic for direct Anthropic access in GCP EU: Each path uses the provider key stored in the caller’s workspace. For secret names, see Provider authentication. Gateway Credits models use the standard endpoint rather than a provider-specific path. These hosted 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 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, reach these provider paths through the LANGSMITH_GATEWAY environment variable:
Deep Agents Code also requires LANGSMITH_GATEWAY_API_KEY. Set it to the same key:
LANGSMITH_GATEWAY support requires these minimum Python package versions: langchain-anthropic>=1.5.1, langchain-baseten>=0.2.3, langchain-fireworks>=1.5.1, langchain-google-genai>=4.3.2, and langchain-openai>=1.4.1.
Each supported integration appends its own provider path, so ChatAnthropic calls https://gateway.smith.langchain.com/anthropic and ChatOpenAI calls https://gateway.smith.langchain.com/openai/v1. To route requests through the standard endpoint instead, see Send your first LLM Gateway request.

See also