OpenCode adds a provider from one block in opencode.json: which package to load, where to send requests, which key to send and which model ids to offer. Write that block once and an uncensored build runs in your terminal, with tool calls for edits and shell commands. The same ids also work in Cursor and, behind a router, in Claude Code.
What you need
OpenCode installed, a key from the console, and a project folder. OpenCode merges two config files: opencode.json (or opencode.jsonc, which allows comments) in the project root, and a global one at ~/.config/opencode/opencode.json. When both define the same key, the project file takes precedence. OPENCODE_CONFIG can point at a file anywhere else.
Inside the TUI, two commands come up below. /connect saves a key for a provider, with custom ones filed under Other. /models lists the providers and models your config declares, so you can switch between them.
First reply
- Create a key in the console and export it in the shell you will launch OpenCode from:
export UNRESTRICTABLE_API_KEY="sk-unr-live-…"- Put the provider block in the project’s
opencode.json, or in the global file if every project should have it. The four ids undermodelsare the ones OpenCode users call most here; any other id from the models page is added the same way. The display names come from the catalog:
{ "$schema": "https://opencode.ai/config.json", "provider": { "unrestrictable": { "npm": "@ai-sdk/openai-compatible", "name": "Unrestrictable", "options": { "baseURL": "https://api.unrestrictable.ai/v1", "apiKey": "{env:UNRESTRICTABLE_API_KEY}" }, "models": { "glm-5.3-uncensored": { "name": "GLM-5.3 Uncensored" }, "glm-5.3-flash-uncensored": { "name": "GLM-5.3 Flash Uncensored" }, "deepseek-v4.1-flash-abliterated": { "name": "DeepSeek V4.1 Flash Abliterated" }, "deepseek-v4-pro-uncensored": { "name": "DeepSeek V4 Pro Uncensored" } } } }, "model": "unrestrictable/glm-5.3-uncensored"}- Launch
opencodeinside the project. Themodelline already picksglm-5.3-uncensored; to use a different id under Unrestrictable for this session, run/models.
Prefer not to leave the key in the environment? Run /connect, pick Other, type unrestrictable as the provider id and paste the key. OpenCode writes it to ~/.local/share/opencode/auth.json. Keep the provider block as shown but drop the apiKey line, and make sure the id you typed into /connect equals the key under provider.
To try the models before you install anything, the browser chat gives three free turns a day, no account needed.
Each field, explained
- npm
- @ai-sdk/openai-compatiblethe AI SDK package behind the provider; it talks to /v1/chat/completions, the path this API serves
- name
- Unrestrictablehow /models labels the provider
- options.baseURL
- https://api.unrestrictable.ai/v1the root of every request; the trailing /v1 is required
- options.apiKey
- {env:UNRESTRICTABLE_API_KEY}the full sk-unr- key, read from that variable at launch; unset, it turns into an empty string
- models
- id → { name }what the picker offers: each id spelled as the models page has it, plus a label to show
- model
- unrestrictable/glm-5.3-uncensoredthe default, written as provider id / model id; small_model uses the same form for titles
Which model
Through that package OpenCode speaks the OpenAI format, and all the builds on the models page answer it. Deep into a session, each turn resends the conversation, the files OpenCode has read and all the tool results so far, so input tokens make up most of the cost and the input price is the figure to compare. The right-hand column tells you whether a build returns tool calls, without which the agent cannot edit a file or run a command.
| Model | One agent turn | Tool calls |
|---|---|---|
| GLM-5.3 Uncensored | $0.01 | model page |
| GLM-5.3 Flash Uncensored | $0.0047 | model page |
| DeepSeek V4.1 Flash Abliterated | $0.04 | model page |
| DeepSeek V4 Pro Uncensored | $0.04 | model page |
| GLM-5.3 Abliterated | $0.09 | model page |
| GLM-5.3 Flash Code Uncensored | $0.25 | model page |
| GLM-5.3 Uncensored | Uncensored | $0.282 | $0.846 |
| GLM-5.3 Flash Uncensored | Uncensored | $0.1053 | $0.3685 |
| DeepSeek V4.1 Flash Abliterated | Abliterated | $0.8488 | $1.6975 |
| DeepSeek V4 Pro Uncensored | Uncensored | $0.97 | $1.94 |
| GLM-5.3 Abliterated | Abliterated | $2.1825 | $4.365 |
| GLM-5.3 Flash Code Uncensored | Uncensored | $6.00 | $6.00 |
For the code builds compared over a full working day, see the uncensored coding AI guide.
Prove it works
Ask the API which models the key may call. Every id under models must be in the list:
curl https://api.unrestrictable.ai/v1/models -H "Authorization: Bearer sk-unr-live-…"Then send one request shaped like OpenCode’s. -i shows the headers: x-uplink-request-id identifies the request, and x-uplink-charge reports the cost in USD when the answer is not streamed.
curl -i https://api.unrestrictable.ai/v1/chat/completions \ -H "Authorization: Bearer sk-unr-live-…" \ -H "Content-Type: application/json" \ -d '{"model": "glm-5.3-uncensored", "messages": [{"role": "user", "content": "Reply with the single word ok."}]}'Back in OpenCode, send a message with one of your ids selected. The console’s usage page lists the request with its tokens and its charge, and the user agent on that record names your OpenCode version.
When it fails
401 invalid_api_key: a wrong or revoked key, orUNRESTRICTABLE_API_KEYwas missing from the shell that launched OpenCode, soapiKeyarrived empty. Export it and relaunch, or paste the key again from the console.404 model_not_found: one of the ids undermodelsdoes not exist on the models page. Compare the spelling with the page, and remember the id is the key of the entry, not itsname.402 insufficient_balance: not enough balance for this request; top up in the console.402 monthly_limit_reached: the key has reached the monthly spending cap you gave it.403 scope_denied: this key may only call certain models, and the one you chose is outside that set.429 rate_limited: the key’s rate limit was hit.retry-afterin the response says how long to wait.- Requests that never arrive, or land on some path other than
/chat/completions: the wrong package is loaded. OpenCode’s docs put@ai-sdk/openai-compatibleon endpoints that serve/v1/chat/completions, which this one does, and@ai-sdk/openaion endpoints that serve/v1/responses. Leavenpmon the first. /modelsdoes not list the provider after/connect: the id you typed into/connectis not the key underproviderin the config. Make them identical.
Questions
It does: any endpoint that speaks the OpenAI chat completions format loads through the @ai-sdk/openai-compatible package once it has a baseURL and a key. This API is such an endpoint, which makes the block above the entire setup.
A built-in catalog that /connect lists by name, plus custom entries for any other OpenAI-compatible API: a provider key in opencode.json naming the package, the base URL and the model ids. This guide walks the custom route.
All of them. One key covers the whole models page, and each build there takes an OpenAI-format call to /v1/chat/completions, so the models map of the provider block accepts any id from that page, spelled the same way. See the models page.
Per token at each model’s price, out of a prepaid balance, with no subscription. The table above prices one agent-sized turn on every build at the live rate. In a long session that keeps repeating the same prefix, the cached input tokens bill at the model’s cached rate.
Every model above is on the uncensored model list with its live price per million tokens. Per-token pricing sets the whole catalog side by side, and the family directory groups the builds by base model.