Connect any compatible provider.

These steps work with any OpenAI- or Anthropic-compatible API. Point the tool at the provider's base URL, paste a key, and let it discover models.

Three things every tool needs

  1. An API key from your provider's dashboard.
  2. A base URL that matches the protocol the tool expects.
  3. A model ID from the provider's model list.

Pick the right base URL

Use the OpenAI-compatible URL for most IDEs, CLIs, and agents. Use the Anthropic-compatible URL only when a tool explicitly asks for Anthropic Messages.

OpenAI-compatible
https://<provider-host>/v1

Most providers end in /v1. The client adds /chat/completions for you.

Anthropic-compatible
https://<provider-host>

Usually the root URL without /v1. Use the exact value from the provider's docs.

  • Do not include /chat/completions or /messages in the base URL.
  • If the provider publishes a separate compatibility URL, use that instead of guessing.
  • Keep keys in environment variables or the tool's secret store, never in a commit.

Find models automatically

Most tools fetch the model list once you enter the base URL and key. If yours does not, run this with your key:

Model discovery
curl "$BASE_URL/models" \ -H "Authorization: Bearer $API_KEY"

Use an id from the response. If the provider does not expose /models, copy an exact model ID from its model page.

Connect your tool

The setting names differ, but every tool below needs the same three values.

IDEs
  • Cursor: open Settings, go to Models, add an OpenAI API key, then set the OpenAI base URL override.
  • VS Code (Cline, Roo Code, Kilo Code, Continue): choose the OpenAI-compatible or Anthropic provider, paste the base URL and key, then fetch models.
  • Windsurf: add a custom OpenAI provider and set the base URL.
  • JetBrains AI and Zed: add a custom OpenAI provider or endpoint.
CLI & terminal
  • Claude Code (Anthropic): export ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN before launching.
  • Codex CLI (OpenAI): export OPENAI_BASE_URL and OPENAI_API_KEY before launching.
  • OpenCode, Aider, Goose: set the OpenAI-compatible base URL in the tool's provider config.
  • curl: POST to $BASE_URL/chat/completions with an Authorization: Bearer header.
AI agents
  • OpenAI SDKs: create the client with baseURL and apiKey.
  • Anthropic SDKs: create the client with baseURL and apiKey.
  • LangChain, LlamaIndex, CrewAI, AutoGen: use their OpenAI-compatible connector and override the base URL.
  • MCP hosts and custom agents: point the model provider at the base URL and use a discovered model ID.

Environment variables

These names are widely used. Some tools expect ANTHROPIC_API_KEY instead of ANTHROPIC_AUTH_TOKEN; either works when the provider accepts a bearer token.

OpenAI-compatible
OPENAI_BASE_URL=https://<provider-host>/v1 OPENAI_API_KEY=your-key
Anthropic-compatible
ANTHROPIC_BASE_URL=https://<provider-host> ANTHROPIC_AUTH_TOKEN=your-key

Give this to your AI

Paste this into the AI that is configuring your tool. Fill in the four bracketed values and it will make the changes for you.

AI setup instruction
Connect the API I use to the tool I am configuring. Tool: [IDE, CLI, or agent name] Protocol: [OpenAI-compatible or Anthropic-compatible] Base URL: [paste the provider's base URL] API key env var: [e.g. OPENAI_API_KEY or ANTHROPIC_AUTH_TOKEN] Do this: 1. Discover the available model IDs using the provider's models endpoint (usually GET [base URL]/models). 2. Configure the tool with the base URL that matches its protocol. 3. Choose a model ID returned by that call. 4. Read the key from an environment variable; never hardcode it. 5. Tell me which file or setting you changed, and ask before guessing any missing value.

What it works with

Most current coding tools speak one of these two protocols. If a tool accepts an OpenAI base URL, an OpenAI-compatible provider works. If it asks for an Anthropic base URL or Anthropic Messages, use an Anthropic-compatible provider.

When a tool lists models itself, enter the base URL and key first, then use its refresh or fetch action. When it does not, use the model discovery request above and paste a returned ID.