Claude Code and the Codex CLI are built for their makers' models, but both can run another model. This is how to run an uncensored one in each, with OpenUncensored as the backend: one key, 61 uncensored models, OpenAI compatible. There is also a third option for Claude Code: keep Claude as the agent and give it uncensored models as a tool.
Buy a prepaid key at openuncensored.com/credits: no account, no sign up, just a card and a
key (ou-...). Or hand your agent openuncensored.com/agents.md and let it get one for you.
Codex CLI (direct)
Codex speaks the OpenAI Responses API, which OpenUncensored serves at https://api.openuncensored.com/v1/responses. Add a provider to
~/.codex/config.toml:
[model_providers.openuncensored]
name = "OpenUncensored"
base_url = "https://api.openuncensored.com/v1"
env_key = "OU_API_KEY"
wire_api = "responses"
[profiles.uncensored]
model_provider = "openuncensored"
model = "glm-5.3-flash-apex-abliterated"
Then export OU_API_KEY=ou-... and run codex --profile uncensored. File edits, shell commands and multi-step
tasks work as usual.
For harder tasks, add a profile with a reasoning model and an effort level:
[profiles.uncensored-thinking]
model_provider = "openuncensored"
model = "deepseek-v4.1-flash-1017-uncensored-thinking"
model_reasoning_effort = "high"
Claude Code (through a local proxy)
Claude Code talks the Anthropic Messages API, and OpenUncensored is OpenAI compatible, so put a translator in between. LiteLLM's proxy does this and is the gateway Claude Code's own docs describe:
# litellm.yaml
model_list:
- model_name: uncensored
litellm_params:
model: openai/glm-5.3-flash-apex-abliterated
api_base: https://api.openuncensored.com/v1
api_key: os.environ/OU_API_KEY
- model_name: uncensored-alt
litellm_params:
model: openai/glm-5.3-flash-uncensored
api_base: https://api.openuncensored.com/v1
api_key: os.environ/OU_API_KEY
pip install 'litellm[proxy]'
export OU_API_KEY=ou-...
litellm --config litellm.yaml --port 4000
# in another terminal
export ANTHROPIC_BASE_URL=http://localhost:4000
export ANTHROPIC_AUTH_TOKEN=anything
claude --model uncensored
Switch models inside a session with /model uncensored-alt. The proxy only listens on your machine; the key stays
in its environment.
Claude Code with uncensored models as a tool
If you want Claude to stay the agent and only hand some requests to an uncensored model, add our MCP server instead:
claude mcp add --transport http open-uncensored https://openuncensored.com/mcp \
--header "Authorization: Bearer ou-..."
Claude then has tools to list models, read the rankings, look up a model, check your balance and send a prompt to any
uncensored model, billed to your key. The agent skill teaches Claude Code, Codex, Cursor and other agents to pick a
model, get a key and call the API: npx skills add DhruvAtreja/open-uncensored-skills.
Which model to use in an agent
Coding agents need a model that finishes multi-step tool tasks without looping, not just one that answers. These are the current best uncensored models on our agent tests:
| Model | id | Agent tasks | Loops | $ per 1M in + out |
|---|---|---|---|---|
| Apex Flash 1 Abliterated | glm-5.3-flash-apex-abliterated |
3/5 | 0% | $0.650 |
| GLM 5.3 Flash Uncensored | glm-5.3-flash-uncensored |
3/5 | 40% | $0.620 |
| Gemma 4 31B Gembrain Uncensored Heretic | gemma-4-31b-gembrain-uncensored-heretic |
3/5 | 40% | $0.612 |
| DeepSeek V4.1 Flash 1017 Uncensored | deepseek-v4.1-flash-1017-uncensored |
2/5 | 0% | $1.65 |
| MiMo V2.6 Flash Uncensored | mimo-v2.6-flash-uncensored |
2/5 | 0% | $1.96 |
| DeepSeek V4.1 Flash 0910 Uncensored | deepseek-v4.1-flash-0910-uncensored |
2/5 | 20% | $1.65 |
The five tasks:
- File search & edit (3 tools, up to 30 turns): Find a config value across a fake repo and patch it.
- Web research (2 tools, up to 26 turns): Search, open pages, reconcile two conflicting sources.
- Multi step math (1 tools, up to 30 turns): Chain eight calculator calls without losing state.
- Code debugging (3 tools, up to 28 turns): Run tests, read a traceback, fix, rerun until green.
- Data pipeline (5 tools, up to 24 turns): Load, filter, join and export a CSV through five tools.
What it costs
Coding agents resend the whole conversation at every step, so most of their tokens are cached input. The cached price on
each model page decides the bill more than the headline price. A prepaid key also caps spending: when
the credit runs out, requests stop with 402 insufficient_quota instead of running up a bill.
Troubleshooting
| Status | Code | What it means | What to do |
|---|---|---|---|
| 401 | invalid_api_key |
Missing or wrong key | Send Authorization: Bearer ou-... |
| 402 | insufficient_quota |
The key's credit is used up | Top up the same key at /credits |
| 404 | model_not_found |
No model with that id | Copy the id from /models or GET https://api.openuncensored.com/v1/models |
| 400 | invalid_routing_options |
only/ignore exclude every provider, or an unknown strategy |
Loosen the routing block |
| 4xx | upstream_rejected_request |
The provider rejected the request itself | Read the message: usually a parameter that model does not support |
| 429 | rate_limit_exceeded |
Every provider for the model is rate limited | Retry after the Retry-After header |
| 502 | all_providers_failed |
Every provider was tried and failed | Retry, or pick another model |
- The agent loops or repeats a tool call. Pick a model with a low loop rate from the table above.
- Tool calls arrive as plain text. The model is not following the tool format. Try another model; agent scores show which ones handle tools.
- Claude Code says the model does not exist. The name after
--modelmust match amodel_nameinlitellm.yaml, not our model id.
Setup for Cursor, Cline, Kilo, Roo and OpenCode is in this guide.