# How do I add an uncensored model provider to OpenCode?

_Updated November 18, 2026. https://openuncensored.com/opencode-uncensored-provider_

**Short answer:** Add OpenUncensored as an OpenAI compatible provider in `opencode.json` (in the project, or `~/.config/opencode/opencode.json` for every project): base URL `https://api.openuncensored.com/v1`, your key in `OPENUNCENSORED_API_KEY`, and the model ids you want. Then run `opencode run -m openuncensored/deepseek-v4.1-flash-1017-uncensored`. One key reaches 62 uncensored, abliterated and heretic models.

## Add the provider

Buy a prepaid key on the [credits page](https://openuncensored.com/credits) with no account (the key is the account), or point your agent at [agents.md](https://openuncensored.com/agents.md) and let it buy one.

OpenCode 2:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "openuncensored": {
      "name": "OpenUncensored",
      "env": ["OPENUNCENSORED_API_KEY"],
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": { "baseURL": "https://api.openuncensored.com/v1" },
      "models": {
        "deepseek-v4.1-flash-1017-uncensored": { "name": "DeepSeek V4.1 Flash 1017 Uncensored" },
        "glm-5.3-flash-uncensored": { "name": "GLM 5.3 Flash Uncensored" },
        "qwen3.8-27b-uncensored-fast": { "name": "Qwen 3.8 27B Uncensored Fast by Heabsy" }
      }
    }
  }
}
```

OpenCode 1.x:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openuncensored": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "OpenUncensored",
      "options": {
        "baseURL": "https://api.openuncensored.com/v1",
        "apiKey": "{env:OPENUNCENSORED_API_KEY}"
      },
      "models": {
        "deepseek-v4.1-flash-1017-uncensored": { "name": "DeepSeek V4.1 Flash 1017 Uncensored" },
        "glm-5.3-flash-uncensored": { "name": "GLM 5.3 Flash Uncensored" },
        "qwen3.8-27b-uncensored-fast": { "name": "Qwen 3.8 27B Uncensored Fast by Heabsy" }
      }
    }
  }
}
```

```bash
export OPENUNCENSORED_API_KEY=ou-...
opencode run -m openuncensored/deepseek-v4.1-flash-1017-uncensored "Explain this repository"
```

Add any id from the [models page](https://openuncensored.com/models) to the `models` block the same way, or list them all with `curl -s https://api.openuncensored.com/v1/models | jq -r '.data[].id'`.

## Test the key first

```bash
curl https://api.openuncensored.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENUNCENSORED_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "deepseek-v4.1-flash-1017-uncensored", "messages": [{"role": "user", "content": "Hello"}]}'
```

If this works and OpenCode does not, the problem is the config or the environment OpenCode runs in.

## Things that trip people up

- **The background daemon does not see your shell.** `opencode serve` started as a service does not read variables you export later. Put the key where the daemon reads it, or test with `opencode run --standalone`.
- **Model names are prefixed** with the provider key: `openuncensored/<model id>`.
- **Older versions** use the `provider` block with `@ai-sdk/openai-compatible` (the OpenCode 1.x tab). Base URL and ids are the same.

## Models that finish agent tasks

| Model | Model id | Agent tasks | Speed | $ / 1M in · out |
|---|---|---|---|---|
| [GLM 5.3 Flash Uncensored](https://openuncensored.com/models/glm-5.3-flash-uncensored) | `glm-5.3-flash-uncensored` | 3/5 | 178 tok/s | $0.12 · $0.50 |
| [DeepSeek V4.1 Flash 1017 Uncensored](https://openuncensored.com/models/deepseek-v4.1-flash-1017-uncensored) | `deepseek-v4.1-flash-1017-uncensored` | 2/5 | 239 tok/s | $0.33 · $1.32 |
| [MiMo V2.6 Flash Uncensored](https://openuncensored.com/models/mimo-v2.6-flash-uncensored) | `mimo-v2.6-flash-uncensored` | 2/5 | 118 tok/s | $0.46 · $1.50 |
| [DeepSeek V4.1 Flash 0910 Uncensored](https://openuncensored.com/models/deepseek-v4.1-flash-0910-uncensored) | `deepseek-v4.1-flash-0910-uncensored` | 2/5 | 209 tok/s | $0.33 · $1.32 |
| [GLM 5.3 Uncensored](https://openuncensored.com/models/glm-5.3-uncensored) | `glm-5.3-uncensored` | 2/5 | 117 tok/s | $0.39 · $1.32 |

_OpenCode resends the conversation each step, so most input is billed at the cached rate. A model that loops burns tokens without progress: prefer more agent tasks finished._

## FAQ

### How do I add an uncensored model provider to OpenCode?

Add OpenUncensored as an OpenAI compatible provider in `opencode.json` (in the project, or `~/.config/opencode/opencode.json` for every project): base URL `https://api.openuncensored.com/v1`, your key in `OPENUNCENSORED_API_KEY`, and the model ids you want. Then run `opencode run -m openuncensored/deepseek-v4.1-flash-1017-uncensored`. One key reaches 62 uncensored, abliterated and heretic models.

### Which uncensored model is best in OpenCode?

GLM 5.3 Flash Uncensored: the most agent tasks finished among ranked models fast enough for agent loops.

### Does OpenCode's tool calling work with uncensored models?

Yes, through the standard OpenAI tools format. How reliably a model uses tools differs; the agent tasks column on this page measures it.

### Do I need an account?

No. Buy a prepaid key on the [credits page](https://openuncensored.com/credits) and use it as the API key. The key is the account, and it cannot spend more than you loaded.

More: [best uncensored LLM API](https://openuncensored.com/best-uncensored-llm-api), [cheapest](https://openuncensored.com/cheapest-uncensored-llm-api), [leaderboard](https://openuncensored.com/uncensored-llm-leaderboard).
