Docs
API referenceSign in

OpenCode setup

Connect OpenCode to UncensoredLabs with an OpenAI-compatible provider and an environment-based API key.

Configure the client

Set UNCENSOREDLABS_API_KEY in the environment that starts OpenCode. Merge the example for your installed major version into your configuration; do not combine the v1 and v2 provider formats.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "uncensoredlabs/deepseek-v4.1-flash-1017-abliterated",
  "provider": {
    "uncensoredlabs": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "UncensoredLabs",
      "options": {
        "baseURL": "https://uncensoredlabs.dev/v1",
        "apiKey": "{env:UNCENSOREDLABS_API_KEY}"
      },
      "models": {
        "deepseek-v4.1-flash-1017-abliterated": {
          "name": "DeepSeek Flash 1017 Abliterated"
        }
      }
    }
  }
}
OpenCode v2: opencode.jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "model": "uncensoredlabs/deepseek-v4.1-flash-1017-abliterated",
  "providers": {
    "uncensoredlabs": {
      "env": [
        "UNCENSOREDLABS_API_KEY"
      ],
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": {
        "baseURL": "https://uncensoredlabs.dev/v1",
        "apiKey": "{env:UNCENSOREDLABS_API_KEY}"
      },
      "models": {
        "deepseek-v4.1-flash-1017-abliterated": {
          "name": "DeepSeek Flash 1017 Abliterated"
        }
      }
    }
  }
}

Select the configured model in OpenCode. The compatible provider uses Chat Completions; choosing a Responses or Anthropic provider changes the protocol and will fail.

Verify the connection

Use an application API key from the dashboard, not your account sign-in key. Keep credentials outside committed configuration.

Start a new session and request a short response. Then ask the client to list files without changing them, and review its tool permissions before a longer task.

Configuration examples were checked against the linked official documentation on November 1, 2026. Client versions and features vary; these guides do not certify every client release.

Troubleshooting

Use text Chat Completions. Responses, Anthropic Messages and image input are not supported. Client web-search features may require a separate service.
StatusWhat to check
400 / 404Check the base URL, exact model ID and Chat Completions mode. Do not append the completions path to a base-URL field.
401 / 403Check the application API key, its model permissions and whether it has been revoked.
402Check available credit and existing reservations. A reservation can exceed the final charge; use a smaller output limit before retrying.
429Respect Retry-After and reduce concurrent tasks. Do not immediately retry the same request in a loop.