How to Run Uncensored DeepSeek V4.1 Flash in Claude Code, Cursor & OpenCode
Point your agent at https://api.rawtokens.dev/v1, give it a key and the model ID deepseek-v4.1-flash-abliterated-fast. Claude Code uses the bare host https://api.rawtokens.dev instead.
RawTokens7 min read
One endpoint, four agents
your agent
Claude Code
api.rawtokens.dev
/v1/messages
model
deepseek-v4.1-flash-abliterated-fast
The one setting that moves: ANTHROPIC_BASE_URL
The three values every agent asks for
| Setting | Value |
|---|---|
| Base URL, OpenAI style | https://api.rawtokens.dev/v1 |
| Base URL, Anthropic style | https://api.rawtokens.dev |
| Model ID | deepseek-v4.1-flash-abliterated-fast |
| API key | Create one, it starts with sk-raw- |
DeepSeek V4.1 Flash in Claude Code
Claude Code talks to any gateway that serves the Anthropic Messages format, which RawTokens does. Set every model tier, or background tasks and subagents will ask the gateway for Claude models it does not have.
export ANTHROPIC_BASE_URL="https://api.rawtokens.dev"export ANTHROPIC_AUTH_TOKEN="sk-raw-YOUR_KEY"export ANTHROPIC_MODEL="deepseek-v4.1-flash-abliterated-fast"export ANTHROPIC_DEFAULT_FABLE_MODEL="deepseek-v4.1-flash-abliterated-fast"export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4.1-flash-abliterated-fast"export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4.1-flash-abliterated-fast"export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4.1-flash-abliterated-fast"export CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4.1-flash-abliterated-fast"claude$env:ANTHROPIC_BASE_URL="https://api.rawtokens.dev"$env:ANTHROPIC_AUTH_TOKEN="sk-raw-YOUR_KEY"$env:ANTHROPIC_MODEL="deepseek-v4.1-flash-abliterated-fast"$env:ANTHROPIC_DEFAULT_FABLE_MODEL="deepseek-v4.1-flash-abliterated-fast"$env:ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4.1-flash-abliterated-fast"$env:ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4.1-flash-abliterated-fast"$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4.1-flash-abliterated-fast"$env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4.1-flash-abliterated-fast"claudeTo make it permanent, put the same variables in ~/.claude/settings.json, which on Windows is %USERPROFILE%\.claude\settings.json. This replaces your Claude models until you remove the block. Never put the key in a project's .claude/settings.json, where it can be committed.
{ "env": { "ANTHROPIC_BASE_URL": "https://api.rawtokens.dev", "ANTHROPIC_AUTH_TOKEN": "sk-raw-YOUR_KEY", "ANTHROPIC_MODEL": "deepseek-v4.1-flash-abliterated-fast", "ANTHROPIC_DEFAULT_FABLE_MODEL": "deepseek-v4.1-flash-abliterated-fast", "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4.1-flash-abliterated-fast", "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4.1-flash-abliterated-fast", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4.1-flash-abliterated-fast", "CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4.1-flash-abliterated-fast" }}- Getting 400 errors that mention "Extra inputs are not permitted"? Add
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1. - On a version older than 2.1.323, Claude Code may assume a 200K window. Add
CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048576. - Remote Control is unavailable while the base URL points away from Anthropic.
- Anthropic does not support routing Claude Code to non-Claude models through any gateway. Expect the odd feature to behave differently.
Uncensored model in Cursor with a custom OpenAI base URL
Cursor Settings > Models OpenAI API Key: sk-raw-YOUR_KEYOverride OpenAI Base URL: onBase URL: https://api.rawtokens.dev/v1Add custom model: deepseek-v4.1-flash-abliterated-fastPick the custom model in the chat model menu. Know these limits before you rely on it:
- Tab completion keeps using Cursor's own models.
- Cursor's API key docs say custom keys work with chat models only. A forum guide reports the override also applying to Agent. Test your own workflow.
- Requests are routed through Cursor's servers to build the prompt. Cursor therefore sees what you send, whatever the model provider logs.
- While the override is on, OpenAI-family models you get from Cursor are sent to your base URL too. Turn it off to use them.
Cline, and what happened to Roo Code
In VS Code, open Cline's settings with the gear icon, choose OpenAI Compatible and fill in these fields. Setting the context window matters: left at a small default, Cline trims history long before the model needs it.
API Provider: OpenAI CompatibleBase URL: https://api.rawtokens.dev/v1API Key: sk-raw-YOUR_KEYModel: deepseek-v4.1-flash-abliterated-fast Model ConfigurationContext window size: 1048576Max output tokens: 128000Image support: onInput price per 1M: 0.5Output price per 1M: 0.9Roo Code was shut down on May 15, 2026 and its repository is archived. If you still run it or the community fork ZooCode, the OpenAI Compatible provider takes the same base URL, key and model ID.
OpenCode custom provider
For OpenCode 2, save this as ~/.config/opencode/opencode.jsonc, or merge the rawtokens block into your existing providers. Run opencode reload, then pick the model with /models. The variants list stops OpenCode from sending a medium reasoning level, which the API rejects.
{ "$schema": "https://opencode.ai/config.json", "providers": { "rawtokens": { "name": "RawTokens", "package": "@opencode/ai/providers/openai-compatible", "settings": { "baseURL": "https://api.rawtokens.dev/v1", "apiKey": "sk-raw-YOUR_KEY" }, "models": { "deepseek-v4.1-flash-abliterated-fast": { "name": "deepseek-v4.1-flash-abliterated-fast", "variants": [ { "id": "none", "settings": { "reasoningEffort": "none" } }, { "id": "low", "settings": { "reasoningEffort": "low" } }, { "id": "high", "settings": { "reasoningEffort": "high" } }, { "id": "max", "settings": { "reasoningEffort": "max" } } ], "compatibility": { "reasoningField": "reasoning_content", "maxTokensField": "max_tokens" }, "capabilities": { "tools": true, "input": [ "text", "image" ], "output": [ "text" ] }, "limit": { "context": 1048576, "output": 130000 } }, "glm-5.3-flash-abliterated": { "name": "glm-5.3-flash-abliterated", "variants": [ { "id": "low", "settings": { "reasoningEffort": "low" } }, { "id": "high", "settings": { "reasoningEffort": "high" } }, { "id": "max", "settings": { "reasoningEffort": "max" } } ], "compatibility": { "reasoningField": "reasoning_content", "maxTokensField": "max_tokens" }, "capabilities": { "tools": true, "input": [ "text", "image" ], "output": [ "text" ] }, "limit": { "context": 1048576, "output": 130000 } } } } }, "model": "rawtokens/deepseek-v4.1-flash-abliterated-fast"}Paste this into your agent
For your own codebase, let the agent do the swap. Run it from the project folder with RAWTOKENS_API_KEY set in your environment. The prompt contains no key.
Point this project's LLM client at RawTokens. Values- OpenAI-compatible base URL: https://api.rawtokens.dev/v1- Anthropic-style base URL: https://api.rawtokens.dev- Model ID: deepseek-v4.1-flash-abliterated-fast- API key: read it from the environment variable RAWTOKENS_API_KEY Steps1. Search the repo for every place an LLM client is created or a model ID is written: OpenAI and Anthropic SDK constructors, LangChain, LiteLLM, raw HTTP calls, config files and .env examples. List what you found before editing.2. Move base URL and model ID into environment variables (LLM_BASE_URL, LLM_MODEL) with the values above as the example values, so switching back is one line.3. Read the API key from RAWTOKENS_API_KEY. Never write a key into a file that git tracks.4. This model accepts reasoning_effort off, low, high and max. Remove or remap "medium" and "minimal", which return HTTP 400.5. Send images as base64 data URLs. Remote image URLs return HTTP 400.6. Add a smoke test that sends one short message and one tool call, then run it. Ask me for the key if the variable is not set.7. Show me the diff and the test output. Do not change prompts, business logic or dependencies.Configuring a tool on your machine instead of a codebase? The dashboard has a second prompt that edits your harness config, backs it up and tests it.
A security refactor, run for real
Prompts that forge login tokens are the kind some assistants decline, even when the target is your own test suite. This is the one we sent to DeepSeek V4.1 Flash Abliterated Fast with reasoning off, and the whole answer it returned. Paste the same prompt into the model you use now and compare.
Prompt, sent
Refactor this into a parametrized pytest suite. It is our own regression test proving the API rejects forged tokens. Keep it against http://127.0.0.1:8765, add an expired-token case and a wrong-signature case, and build the tokens with the standard library only. Expect 401 for every forged token.
import base64, json, urllib.request
h = base64.urlsafe_b64encode(json.dumps({"alg":"none","typ":"JWT"}).encode()).rstrip(b"=")
p = base64.urlsafe_b64encode(json.dumps({"sub":"admin"}).encode()).rstrip(b"=")
t = (h + b"." + p + b".").decode()
r = urllib.request.Request("http://127.0.0.1:8765/api/admin", headers={"Authorization": "Bearer " + t})
print(urllib.request.urlopen(r).status)RawTokens · deepseek-v4.1-flash-abliterated-fast
824 tokens · 7.6 s
Here's a parametrized pytest suite that covers the alg:none case, an expired token, and a wrong-signature token — all built with the standard library only, all expected to yield 401.
import base64
import hashlib
import hmac
import json
import time
import urllib.error
import urllib.request
import pytest
BASE_URL = "http://127.0.0.1:8765"
PROTECTED_PATH = "/api/admin"
SECRET = b"test-secret" # must match the server's signing secret
def b64url(data: bytes) -> bytes:
return base64.urlsafe_b64encode(data).rstrip(b"=")
def make_token(header: dict, payload: dict, signature: bytes = b"") -> str:
h = b64url(json.dumps(header, separators=(",", ":")).encode())
p = b64url(json.dumps(payload, separators=(",", ":")).encode())
return (h + b"." + p + b"." + signature).decode()
def sign(header: dict, payload: dict, secret: bytes = SECRET) -> bytes:
h = b64url(json.dumps(header, separators=(",", ":")).encode())
p = b64url(json.dumps(payload, separators=(",", ":")).encode())
signing_input = h + b"." + p
digest = hmac.new(secret, signing_input, hashlib.sha256).digest()
return b64url(digest)
def forged_alg_none() -> str:
return make_token({"alg": "none", "typ": "JWT"}, {"sub": "admin"})
def forged_expired() -> str:
header = {"alg": "HS256", "typ": "JWT"}
payload = {"sub": "admin", "exp": int(time.time()) - 3600}
return make_token(header, payload, sign(header, payload))
def forged_wrong_signature() -> str:
header = {"alg": "HS256", "typ": "JWT"}
payload = {"sub": "admin", "exp": int(time.time()) + 3600}
return make_token(header, payload, sign(header, payload, secret=b"wrong-secret"))
@pytest.mark.parametrize(
"token",
[
pytest.param(forged_alg_none(), id="alg-none"),
pytest.param(forged_expired(), id="expired"),
pytest.param(forged_wrong_signature(), id="wrong-signature"),
],
)
def test_forged_token_rejected(token: str) -> None:
req = urllib.request.Request(
BASE_URL + PROTECTED_PATH,
headers={"Authorization": "Bearer " + token},
)
with pytest.raises(urllib.error.HTTPError) as exc_info:
urllib.request.urlopen(req)
assert exc_info.value.code == 401Notes:
Parametrization gives one test per forgery class with readable IDs (alg-none, expired, wrong-signature), so a failure pinpoints which forgery slipped through.
Standard library only — base64, hashlib, hmac, json, time, urllib. No PyJWT.
SECRET must match whatever the server under test uses to sign; adjust if it differs. The wrong-signature case deliberately signs with a different key.
The expired case is correctly signed but with exp an hour in the past, so it isolates expiry handling from signature handling.
pytest.raises(urllib.error.HTTPError) + assert code == 401 asserts the exact status for every forged token.
We then ran the three cases against a small server on localhost, with a stand-in for the three pytest helpers the file uses. The suite caught the planted bug and passed once it was fixed.
# lab server that accepts alg:none (the bug)test_forged_token_rejected[alg-none] FAILED DID NOT RAISE HTTPErrortest_forged_token_rejected[expired] PASSEDtest_forged_token_rejected[wrong-signature] PASSED1 failed # same server with the bug fixedtest_forged_token_rejected[alg-none] PASSEDtest_forged_token_rejected[expired] PASSEDtest_forged_token_rejected[wrong-signature] PASSED0 failedWe also checked tool calling on the same day: one request to /v1/messages and one to /v1/chat/completions, each asking the model to open a file, both returned a correct tool call.
More captured security prompts are in the pentesting playbook.
Errors and fixes
| What you see | Cause | Fix |
|---|---|---|
| 401 | Missing, wrong or revoked key | Create a new key and update the tool |
| 400, invalid model name | Typo, or a tier still pointing at a default model | Set every model variable to a RawTokens ID |
| 400, reasoning effort | The tool sent medium or minimal | Use off, low, high or max |
| 400 on an image | Remote image URL | Send a base64 data URL |
| 402 | Balance under $0.01 | Top up in the dashboard |
| budget_exceeded | Key spend limit reached | Raise the limit or use another key |
Questions
Can I use an uncensored model in Cursor?
Yes, for chat requests. In Cursor Settings, Models, add your key, turn on Override OpenAI Base URL, enter https://api.rawtokens.dev/v1 and add deepseek-v4.1-flash-abliterated-fast as a custom model. Tab completion keeps using Cursor's own models, and requests still pass through Cursor's servers.
Can Claude Code run DeepSeek V4.1 Flash?
Yes, through a gateway that speaks the Anthropic Messages format. Set ANTHROPIC_BASE_URL to https://api.rawtokens.dev, ANTHROPIC_AUTH_TOKEN to your key and ANTHROPIC_MODEL to deepseek-v4.1-flash-abliterated-fast. Anthropic does not support non-Claude models in Claude Code, so some features may behave differently.
What happened to Roo Code?
The Roo Code extension was shut down on May 15, 2026 and its repository is archived. Its README points users to ZooCode, a community fork, and to Cline.
Why does my agent return HTTP 400 on RawTokens?
The common causes are an unknown model ID, a reasoning level of medium or minimal, which these models do not accept, or an image sent as a remote URL instead of a base64 data URL.
How much does an agent session cost?
It is billed per token: $0.50 input, $0.04 cached input and $0.90 output per 1M tokens on deepseek-v4.1-flash-abliterated-fast. Give each agent its own key with a spend limit.