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
| Field | Value | Common trap |
|---|---|---|
| API address | https://api.9coding.com | No trailing slash, no /v1 — the client appends the path |
| API key | From the console, starts with sk-9c- | Copy-paste often drags a trailing newline or space along |
| Model name | Copy it from the /v1/models list | Hand-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 for | May appear as |
|---|---|
| API address | Base URL · API Host · Endpoint · Custom endpoint · API Proxy |
| API key | API Key · Token · Access Key · Secret |
| Protocol type | OpenAI Compatible · Custom · Custom provider |
Command-line tools
CLI tools generally read environment variables. For OpenAI-compatible ones:
export OPENAI_BASE_URL="https://api.9coding.com/v1"
export OPENAI_API_KEY="sk-9c-your-key"
/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:
- Set Provider to OpenAI Compatible (not the official OpenAI entry — that one usually locks the address)
- Base URL:
https://api.9coding.com/v1 - API Key: your
sk-9c-key - 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:
- Add a provider, type OpenAI Compatible
- API address:
https://api.9coding.com— most of these append/v1themselves; if it won't connect, try the version with/v1 - Paste the key, then hit "fetch models" or enter the model id manually
- Back in the chat view, select the provider you just added
Your own code
The full OpenAI SDK version is on the one-line migration page. For the Anthropic SDK:
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
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 idfrom the error response (it looks like(request id: 2026...)) plus the timestamp and model name — that's enough to trace the exact call