This page is for developers. It assumes an admin has already configured a provider and at least one model — if Available Models is empty for you, ask your admin to work through the Quickstart Guide first.
What You Need
Every tool below needs the same three values, all of which live in Settings → My Models in the Barndoor portal:
1
Create an API key
Open Settings → My Models → My API Keys and click Create Key. Give it a descriptive name (for example 
Cursor on laptop) and click Create.The dialog shows a bd-… token — copy it now. Barndoor only stores a one-way hash of the key, so the raw value cannot be shown again.
2
Copy a model route name
Under Available Models, the portal lists every model your admin has enabled and that your access policies allow. Use the name exactly as shown:
- Model routes (
gpt-4o-mini,claude-sonnet-5, …) — use the plain name in themodelfield of your request. - Standalone models — use the
provider/modelform (for exampleopenai/gpt-4o-mini).
3
Copy your gateway endpoint
The LLM Gateway Endpoint card shows your base URL — it looks like 
https://app.barndoor.ai/api/llm-gateway/v1.
OpenAI-style clients take the
/v1 form. Anthropic-style clients (the Anthropic SDK, Claude Code) append /v1 themselves — give those the bare https://app.barndoor.ai/api/llm-gateway form.4
Confirm all three work
Before configuring a tool, try all three from a shell. This separates auth problems from model-name problems, which look alike once an editor is in the middle:A
401 means the key or URL is wrong; a 404 means the model route name is wrong. More request shapes — streaming, embeddings, Anthropic Messages — are in Sending Requests.Self-hosted and private-cloud deployments: if Barndoor is running on your own infrastructure, swap
app.barndoor.ai for your organization’s portal hostname everywhere on this page. The path (/api/llm-gateway/v1) is the same.Connect Your Tools
OpenAI Python SDK
OpenAI Python SDK
OpenAI Node SDK
OpenAI Node SDK
Anthropic SDK
Anthropic SDK
The Anthropic SDK appends
/v1/messages to base_url itself, so the base URL should not include /v1.Claude Code
Claude Code
Claude Code talks to the gateway via
ANTHROPIC_BASE_URL. The exact env-var setup depends on which kind of Anthropic provider your admin configured — a shared API key provider (everyone bills against one Anthropic key) or an OAuth passthrough provider (each developer bills against their personal Claude subscription). See Step 1 → Anthropic OAuth passthrough for the admin side.Claude Code appends
/v1/messages to ANTHROPIC_BASE_URL itself, so the base URL must not include /v1. If you copied the URL from Settings → My Models, strip the trailing /v1.- OAuth passthrough provider
`jq: Could not open file ~/.claude/.credentials.json`
`jq: Could not open file ~/.claude/.credentials.json`
Recent Claude Code versions don’t expose a plaintext credentials file. If you have a shell snippet that pipes
jq over that path to extract an OAuth token, remove it — Claude Code handles the OAuth token internally and your only job is to set the env vars in the tabs above.Cursor IDE
Cursor IDE
Cursor lets you add custom OpenAI-compatible providers under Settings → Models → OpenAI API Key → Override OpenAI Base URL:
- Toggle Custom OpenAI API Key.
- Set the base URL to
https://app.barndoor.ai/api/llm-gateway/v1. - Paste your
bd-…key as the API key. - Add the model names (for example
gpt-4o-mini,claude-sonnet-5) that you want Cursor to be able to select.

Codex CLI / Desktop
Codex CLI / Desktop
Codex uses the OpenAI Responses API (
wire_api = "responses"), not Chat Completions. Point a custom provider at the gateway and keep /v1 on the base URL — Codex appends /responses itself.env_key is the environment variable name; the export is the secret value. A missing /v1 produces 401 invalid JWT header: InvalidToken.Full steps for CLI and Desktop, plus troubleshooting: Use Codex with the LLM Gateway.LangChain
LangChain
ChatAnthropic, OpenAIEmbeddings, and the rest of the OpenAI-style integrations behave the same way — set base_url/anthropic_api_url and api_key.cURL / scripts
cURL / scripts
Use any of the examples in Sending Requests. For CI and shell scripts, export the URL and key once:
Related
- Using the LLM Gateway — overview, architecture, and prerequisites
- Quickstart Guide — admin setup, request reference, and troubleshooting
- Use Codex with the LLM Gateway — the full Codex CLI and Desktop walkthrough
- Get the most out of your Claude subscription — run Claude Code on your own Claude seat and fail over when you hit the cap