Universal · about 3 minutes

Universal setup for any client

Any client that lets you set a custom API address connects the same way: address, key, model name. The hard part was never those three fields — it's that every client calls them something different and hides them somewhere different. This page lines the wording up.

Three values and you're connected

FieldValueCommon trap
API addresshttps://api.9coding.comNo trailing slash, no /v1 — the client appends the path
API keyFrom the console, starts with sk-9c-Copy-paste often drags a trailing newline or space along
Model nameCopy it from the /v1/models listHand-typed ids fail on case and hyphens — one character is enough

What each client calls these fields

Same thing, different wording. If you see any of these in the settings, that's the field.

What you're looking forMay appear as
API addressBase URL · API Host · Endpoint · Custom endpoint · API Proxy
API keyAPI Key · Token · Access Key · Secret
Protocol typeOpenAI Compatible · Custom · Custom provider
Which protocol? Almost every client wants OpenAI Compatible. Only native Anthropic clients like Claude Code speak the Anthropic protocol — that one has its own page.

Command-line tools

CLI tools generally read environment variables. For OpenAI-compatible ones:

~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://api.9coding.com/v1"
export OPENAI_API_KEY="sk-9c-your-key"
Note the /v1 here. OpenAI-style SDKs and CLIs expect OPENAI_BASE_URL to point at the /v1 level, while Anthropic's ANTHROPIC_BASE_URL stops at the domain. This is the easiest one to get backwards — the usual symptom is a 404, sometimes a 401.

Then open a new terminal or run source ~/.zshrc. Most CLI tools read the environment once, at startup.

Editor extensions

Cline, Roo Code and Continue configure inside their own settings panel rather than reading global environment variables. Same three fields:

  1. Set Provider to OpenAI Compatible (not the official OpenAI entry — that one usually locks the address)
  2. Base URL: https://api.9coding.com/v1
  3. API Key: your sk-9c- key
  4. Pick the model from the dropdown. If the dropdown is empty, the address or key isn't working — run the curl check below first

Desktop and web clients

Cherry Studio, ChatBox, NextChat, LobeChat and Open WebUI all add a custom provider under Settings → Model providers:

  1. Add a provider, type OpenAI Compatible
  2. API address: https://api.9coding.commost of these append /v1 themselves; if it won't connect, try the version with /v1
  3. Paste the key, then hit "fetch models" or enter the model id manually
  4. Back in the chat view, select the provider you just added
Added it but the model isn't selectable? Most clients require you to tick which models are enabled after fetching the list — until you do, they won't appear in the picker.

Your own code

The full OpenAI SDK version is on the one-line migration page. For the Anthropic SDK:

Python
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.9coding.com",
    auth_token="sk-9c-your-key",
)

The Anthropic SDK takes auth_token (which sends Authorization: Bearer) rather than api_key (which sends x-api-key). Mixing these two up is the most common cause of a 401.

Verify: one command tells you if it's connected

terminal
curl -s -w '\n%{http_code}\n' https://api.9coding.com/v1/models \
  -H "Authorization: Bearer sk-9c-your-key"
  • 200 and a model list → address and key are fine; the problem is in the client's settings. Check the protocol type first.
  • 401 → a credential problem, see 401 troubleshooting.
  • No status code at all → a network problem, see connection errors.

Run this before touching client settings. It separates "their problem" from "my configuration" in one step — which saves more time than anything else on this page.

Still stuck

  • Getting an error → match your error text; eight common errors each have their own page
  • Connected but want to see the cost → usage and balance
  • When reporting it, include the request id from the error response (it looks like (request id: 2026...)) plus the timestamp and model name — that's enough to trace the exact call