Skip to main content
Beta: The LLM Gateway is in beta.
Configure coding agents to use the standard LLM Gateway endpoint for centralized cost controls, observability, and audit trails. The gateway authenticates each caller, routes by model ID, enforces policies, and traces each call. Claude Code can use the standard Anthropic Messages format, while Codex and Deep Agents Code can use the standard OpenAI-compatible formats. Gemini CLI uses Google’s native API and requires direct model access.

Prerequisites

Set your LangSmith API key before configuring a client:

Claude Code CLI

Point Claude Code at the standard Messages endpoint and use a provider-prefixed model ID:
Claude Code appends /v1/messages to ANTHROPIC_BASE_URL. The gateway uses the anthropic/ prefix to resolve the workspace’s Anthropic provider secret.
Claude Desktop plugins break when the gateway is configured. Claude users on a paid plan (Plus, Max) are not yet supported.

Codex CLI

Codex uses the Responses API. Add the following to ~/.codex/config.toml to call the hosted Kimi K3 model with Gateway Credits through the standard endpoint:
Then run:
To use a bring-your-own-key model instead, replace model with its provider-prefixed ID, such as openai/gpt-5.4-mini.
Codex Desktop plugins break when the gateway is configured. The TOML configuration forces authentication through the gateway, so OpenAI no longer handles plugin authentication directly.

Gemini CLI

Gemini CLI sends Google’s native Generate Content requests, which the standard endpoint does not expose. Follow Direct model access to configure the /gemini route, then run:

Deep Agents Code

Use the OpenAI-compatible client with the standard endpoint, then pass the hosted model slug through the openai integration:
To use a bring-your-own-key model, keep the standard base URL and pass a provider-prefixed model after openai:, for example, openai:anthropic/claude-opus-5. For provider-native integrations and model IDs, see Direct model access.

Company-wide deployment

For organizations rolling the gateway out to all developers, distribute the configuration through mobile device management or a shared shell profile. Distribute:
  1. The standard gateway base URL for each client.
  2. A workspace-scoped LangSmith API key per user or team, depending on your policy granularity.
  3. The model IDs approved for each coding agent.
  4. The Codex config.toml if your organization uses Codex.
Provider API keys stay centralized in LangSmith workspace secrets. Gateway Credits models do not require provider API keys.

Verify the setup

After configuring a coding agent, make a test call and confirm that:
  1. The call succeeds and the agent receives a response.
  2. A trace appears in the gateway or gateway-<short_api_key>-<api_key_id> tracing project in your LangSmith workspace.
If the call fails with a 403, check that your API key’s role includes gateway:invoke and workspaces:read. If a bring-your-own-key call fails with a 400 mentioning a missing provider key, ask your organization admin to add the provider’s key to workspace secrets.

Next steps