The LLM Gateway is in beta.
Choose a provider path
Append a provider path to your regional gateway base URL, for examplehttps://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:Create embeddings
The gateway routes embeddings requests to OpenAI, Azure Foundry, and Gemini Enterprise Agent Platform through their direct paths. Use these paths to generate vectors with the same workspace credentials, policies, and tracing as other gateway requests. The standard endpoint does not accept embeddings requests. Configure the provider’s workspace credentials before sending a request. Authenticate to the gateway with your LangSmith API key, not a provider key. The examples use the US Cloud hostname. To use another region, replace it with your regional gateway hostname.Call OpenAI or Azure Foundry
For OpenAI, setmodel to the embedding model ID without an openai/ prefix. For Azure Foundry, use the deployment name on your configured Foundry resource, not the underlying model ID.
data[].embedding.
Call Gemini Enterprise Agent Platform
Gemini Enterprise Agent Platform uses Google’s native request and response formats. The short paths in the table use the project and location from your Gemini Enterprise Agent Platform credentials and workspace secrets. You can also specify them in the path:/vertex/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:{action}. The gateway accepts the same path forms under v1beta and v1beta1.
<project-id> in the :predict example with your Google Cloud project ID. Choose a location where the model is available. The :predict route only accepts model IDs beginning with gemini-embedding-. Other models, including text-embedding-*, text-multilingual-embedding-*, and multimodalembedding@001, return 501.
Read vectors from embedding.values for embedContent, embeddings[].values for batchEmbedContents, and predictions[].embeddings.values for predict.
Use LangChain embeddings
Configure OpenAIEmbeddings explicitly with the direct gateway base URL and your LangSmith API key:LANGSMITH_GATEWAY setup for chat models in the next section is not a substitute for configuring an embeddings client’s base URL.
Track usage and apply policies
Embeddings requests pass through gateway policies and appear in gateway traces as LLM runs. Token usage comes from the provider response. Embeddings requests do not use fallback chains. If the model has no matching price entry, add a model price to track embedding costs.Configure LangChain and Deep Agents
LangChain chat models and Deep Agents, including Deep Agents Code, reach these provider paths through theLANGSMITH_GATEWAY environment variable:
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.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
- Send your first LLM Gateway request: use the standard API to call models across providers.
- Set up the LLM Gateway: configure provider secrets and access.
- View LLM Gateway traces: see where gateway traces appear and who can view them.
Connect these docs to your agent of choice via MCP for real-time answers.

