Skip to main content
Coding tools that let you set a custom base URL and key can run on your workspace models through the Model Gateway. Requests count toward your spend limit and show up in your usage, and your workspace admin sees them per key.

Before you start

When you create a Model Gateway key, Use it in your tools shows these steps with your key and the model you pick already filled in. Langdock shows the key only once, so finish the setup before you close the dialog, or keep the key in a password manager.
Save your key dialog with the new key, a model picker set to Sonnet 5.5, a tool picker set to REST API and a curl request to gateway.langdock.com
Replace YOUR_API_KEY with your key and your-model-id with a model ID in the examples below. The gateway converts between formats, so every enabled model works in every tool, including Claude models in Codex and GPT models in Claude Code.

Let your coding agent set it up

For Claude Code, Codex and OpenCode, switch Setup method to Agent setup. Langdock gives you a command that puts the key into a LANGDOCK_API_KEY environment variable in your terminal, and a prompt for the tool. Start the tool in that terminal and paste the prompt. The agent lists your models, sends a test request, backs up and updates the tool’s config file and tells you what it changed. The prompt never contains the key itself.

Set up a tool

Claude Code uses the Anthropic Messages format.
1

Check your models

2

Add your settings

Add this to ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json) and create the file if it does not exist. Make sure ANTHROPIC_API_KEY is not set in your shell, because it takes precedence over the token:
The base URL has no /v1, because Claude Code adds /v1/messages itself.
3

Start Claude Code

Run /status to check that Anthropic base URL shows https://gateway.langdock.com. If you are signed in with a claude.ai account, run /logout first.

On the classic endpoint

If your workspace does not have the Model Gateway yet, use your personal API key with the classic endpoint on api.langdock.com. Replace the gateway URLs like this: Use us instead of eu for models hosted in the US. On dedicated deployments, replace https://api.langdock.com with https://<your-domain>/api/public. The classic endpoint does not convert formats, so:
  • Claude Code, Claude Desktop and OpenCode work with Anthropic models only, Cursor and GitHub Copilot with OpenAI compatible models only.
  • Cursor Agent does not work there, and Claude and Gemini models cannot be added to Cursor there.
  • The classic Responses endpoint accepts only function tools, so Codex’s built in tools are rejected there. Use Codex through the Model Gateway.

Troubleshooting

More in Errors and troubleshooting.