Short answer: set ANTHROPIC_BASE_URL to https://xfield.cloud.brutal.ai/api, ANTHROPIC_AUTH_TOKEN to your XField key and ANTHROPIC_MODEL to an abliterated model such as deepseek-v4.1-flash-1017-uncensored. Then start claude from the same shell. Nothing else in Claude Code changes.
Why Claude Code stops on security tasks
Claude Code is an agent. It reads files, runs commands and writes code across dozens of steps. When the model behind it refuses one step, the whole run stops: the fuzzer is half written, the exploit proof of concept for your own bug is missing, the malware sample's strings are not decoded. Most of these refusals hit ordinary defensive work.
A router or a different system prompt does not fix this, because the refusal sits in the model weights. An abliterated model has the direction that leads to refusals removed, so it does the task instead. Read more in Routing doesn't remove refusals.
Setup in three variables
You need Claude Code installed and an XField API key. No key yet? Request access.
export XFIELD_API_KEY="sk-xf-v1-..."
export ANTHROPIC_BASE_URL="https://xfield.cloud.brutal.ai/api"
export ANTHROPIC_AUTH_TOKEN="$XFIELD_API_KEY"
export ANTHROPIC_MODEL="deepseek-v4.1-flash-1017-uncensored"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-5.3-flash-uncensored"
claude
| Variable | What it does |
|---|---|
ANTHROPIC_BASE_URL | Sends every request to XField. Claude Code appends /v1/messages itself, so the URL ends in /api, not /api/v1. |
ANTHROPIC_AUTH_TOKEN | Your key, sent as a bearer token. ANTHROPIC_API_KEY also works, but Claude Code asks you to approve it once. |
ANTHROPIC_MODEL | The main model for the session. |
ANTHROPIC_DEFAULT_HAIKU_MODEL | The small model for background work such as titles and summaries. Older Claude Code versions read ANTHROPIC_SMALL_FAST_MODEL; set both if you share config across versions. |
To make it permanent, including for background agents, put the same values in the env block of ~/.claude/settings.json. The full reference is in the Claude Code docs page.
Which model for which job
| Job | Model |
|---|---|
| Most coding-agent runs, fastest answers | deepseek-v4.1-flash-1017-uncensored |
| Hard security research, long reports, large diffs | glm-5.3-uncensored |
| Long agentic runs and very long outputs | kimi-k3.1-pro-uncensored |
| Background work (titles, summaries, quick checks) | glm-5.3-flash-uncensored |
Every model answers on the Anthropic Messages format, so switching is one variable. See all models.
Check that it works
Before starting a long run, confirm the key and the base URL:
curl https://xfield.cloud.brutal.ai/api/v1/key \
-H "Authorization: Bearer $XFIELD_API_KEY"
Then start claude and give it a small task from your real work, for example writing a test fixture that contains an injection string.
Common errors
- 404 Not Found: the base URL ends in
/v1. For Claude Code it must behttps://xfield.cloud.brutal.ai/api. The OpenAI-style base with/v1is only for OpenAI SDKs and tools. - 401 Unauthorized: the key is missing, mistyped or deleted. Check that
ANTHROPIC_AUTH_TOKENis set in the shell you startclaudefrom, or insettings.json. - Claude Code still uses your subscription: the variables are not set in that shell. Values in
settings.jsonwin over shell exports. - Remote Control or voice dictation are gone: both need a claude.ai login and are off while Claude Code points at another API. Unset the variables to get them back.
Other coding agents
The same models work with OpenAI-compatible agents through the base URL https://xfield.cloud.brutal.ai/api/v1: see the setup pages for Codex, opencode and other tools.
What happens to your code
XField is hosted in the EU on Brutal AI's own servers. Prompts and completions are not stored and not used for training; each request leaves only a usage record with the model, token counts, timing and cost. Details: Data handling. Your own tools may still log requests, so check their settings.