OpenCode with an uncensored model

One provider block in opencode.json: the OpenAI-compatible package, the base URL, the key from an env var, uncensored ids with their names. Pick one with /models; the cost per agent turn and the errors.

Steps checked November 2, 2026 · prices as of November 9, 2026

OpenCode takes a custom provider in opencode.json: the OpenAI-compatible package, a base URL, a key and the model ids. One block, and an uncensored build answers in the terminal with tool calls for edits and commands. The same ids work in Cursor and, through a router, in Claude Code.

Where the settings are

OpenCode reads opencode.json (or opencode.jsonc, JSON with comments) from the project root, and a global one from ~/.config/opencode/opencode.json. Both load; where the two set the same key, the project file wins. OPENCODE_CONFIG points at a file somewhere else.

Two TUI commands matter here: /connect stores a key for a provider (under Other for a custom one), and /models lists the providers and models from your config to pick from.

Steps

  1. Create a key in the console and put it in an environment variable in the shell that starts OpenCode:
shell
1export UNCENSOREDLLM_API_KEY="sk-ullm-live-…"
  1. Add the provider to opencode.json in the project, or to the global file to have it in every project. The ids under models are the four OpenCode users call most here; any id on the models page goes in the same way, and the display names are from the catalog:
opencode.json
1{
2 "$schema": "https://opencode.ai/config.json",
3 "provider": {
4 "uncensoredllm": {
5 "npm": "@ai-sdk/openai-compatible",
6 "name": "UncensoredLLM",
7 "options": {
8 "baseURL": "https://api.uncensoredllm.ai/v1",
9 "apiKey": "{env:UNCENSOREDLLM_API_KEY}"
10 },
11 "models": {
12 "glm-5.3-uncensored": { "name": "GLM-5.3 Uncensored" },
13 "glm-5.3-flash-uncensored": { "name": "GLM-5.3 Flash Uncensored" },
14 "deepseek-v4.1-flash-abliterated": { "name": "DeepSeek V4.1 Flash Abliterated" },
15 "deepseek-v4-pro-uncensored": { "name": "DeepSeek V4 Pro Uncensored" }
16 }
17 }
18 },
19 "model": "uncensoredllm/glm-5.3-uncensored"
20}
  1. Start opencode in the project. The model line already selects glm-5.3-uncensored; /models switches to another id under UncensoredLLM for the session.

To keep the key out of the environment, run /connect, choose Other, enter uncensoredllm as the provider id and paste the key; OpenCode stores it in ~/.local/share/opencode/auth.json. The provider block stays as above without the apiKey line, and the id in /connect has to match the key in the config.

What each setting does

npm
@ai-sdk/openai-compatible
the AI SDK package OpenCode loads for the provider; this one speaks /v1/chat/completions, which is what the API serves
name
UncensoredLLM
the provider name in /models
options.baseURL
https://api.uncensoredllm.ai/v1
where the requests go; the /v1 at the end matters
options.apiKey
{env:UNCENSOREDLLM_API_KEY}
the whole sk-ullm- key, read from the variable at start; an unset variable becomes an empty string
models
id → { name }
the ids the picker offers, each exactly as the models page shows it, with the name to display
model
uncensoredllm/glm-5.3-uncensored
the default model, as provider id / model id; small_model takes the same form for title generation

Picking a model

OpenCode sends OpenAI-format requests through the package above, and every build on the models page answers in that format. An agent turn carries the conversation, the files OpenCode read and every tool result so far, so input tokens are most of the bill and a build with a low input price costs the least per turn. The last column says whether the build takes tool calls, which the agent loop needs for edits and shell commands.

ModelOne agent turnTool calls
GLM-5.3 Uncensored$0.01model page
GLM-5.3 Flash Uncensored$0.0047model page
DeepSeek V4.1 Flash Abliterated$0.04model page
DeepSeek V4 Pro Uncensored$0.04model page
GLM-5.3 Abliterated$0.09model page
GLM-5.3 Flash Code Uncensored$0.25model page

40,000 input and 1,200 output tokens at the catalog prices on 2026-11-09. Tool calls as the catalog publishes them; where it does not, the model page says.

Uncensored models and their prices per million tokens
GLM-5.3 Uncensoredglm-5.3-uncensoredUncensored$0.282$0.846
GLM-5.3 Flash Uncensoredglm-5.3-flash-uncensoredUncensored$0.1053$0.3685
DeepSeek V4.1 Flash Abliterateddeepseek-v4.1-flash-abliteratedAbliterated$0.8488$1.6975
DeepSeek V4 Pro Uncensoreddeepseek-v4-pro-uncensoredUncensored$0.97$1.94
GLM-5.3 Abliteratedglm-5.3-abliteratedAbliterated$2.1825$4.365
GLM-5.3 Flash Code Uncensoredglm-5.3-flash-code-uncensoredUncensored$6.00$6.00

Prices per million tokens, read from the live catalog on 2026-11-09.

For coding specifically, the uncensored coding AI guide compares the code builds and costs a full coding day on each.

Check it

List the models your key can call; every id you put under models should be in the answer:

shell
1curl https://api.uncensoredllm.ai/v1/models -H "Authorization: Bearer sk-ullm-live-…"

Then send one request the way OpenCode does. -i prints the headers: x-uplink-request-id names the request, and on a non-streamed answer x-uplink-charge is what it cost in USD.

shell
1curl -i https://api.uncensoredllm.ai/v1/chat/completions \
2 -H "Authorization: Bearer sk-ullm-live-…" \
3 -H "Content-Type: application/json" \
4 -d '{"model": "glm-5.3-uncensored", "messages": [{"role": "user", "content": "Reply with the single word ok."}]}'

In OpenCode, send a message with one of your ids selected. The request shows on the console’s usage page with its tokens and its charge, and the user agent on it names the OpenCode version.

Errors and fixes

  • 401 invalid_api_key: the key is wrong or revoked, or UNCENSOREDLLM_API_KEY was not set in the shell that started OpenCode, so apiKey came through empty. Export it and start OpenCode again, or copy the key again from the console.
  • 404 model_not_found: an id under models is not on the models page. Check the spelling against the page; the id is the key, not the name.
  • 402 insufficient_balance: the balance does not cover the request. Top up in the console. 402 monthly_limit_reached means the key hit the monthly spend limit you set on it.
  • 403 scope_denied: the key is limited to certain models and this is not one of them.
  • 429 rate_limited: the key hit its rate limit. The response carries retry-after.
  • Requests that never reach the API, or arrive at a path other than /chat/completions: the provider is on the wrong package. Per the OpenCode docs, @ai-sdk/openai-compatible is for endpoints that serve /v1/chat/completions, which this API does; @ai-sdk/openai is for endpoints that serve /v1/responses. Keep npm on the former.
  • The provider is missing from /models after /connect: the id entered in /connect differs from the key under provider in the config. Make the two the same.

Questions

Yes, and so is any endpoint that answers the OpenAI chat completions format. OpenCode loads it through the @ai-sdk/openai-compatible package with a baseURL and a key; this API is one such endpoint, so the block above is the whole setup.

OpenCode ships a catalog of providers that /connect lists by name, and a custom entry for any other OpenAI-compatible API, added in opencode.json under provider with the package, the base URL and the model ids. This guide is the custom path.

Every model on the models page: all of them answer /v1/chat/completions in the OpenAI format with the same key, so any id there goes into the models map of the provider block as it is spelled on the page. See the models page.

Per token at the model’s price, from your prepaid balance, with no subscription. The table above costs one agent-sized turn on each build at the live price; a long session that repeats the same prefix bills the cached input tokens 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.

Get a keyPrepaid from $10, no subscription.

New models and price changes, once a month.

New uncensored builds with their prices, price moves, and what the daily model check found.

Join on Telegram