Uncensored AI API: calling one with the OpenAI or Anthropic format
An uncensored model behind an API you already know how to call. What “OpenAI-compatible” and “Anthropic-compatible” mean, working requests in both formats, system prompts, streaming, and what to expect from the answers.
What you need
An uncensored model is called like any other chat model: an HTTPS request with a key, a model id and a list of messages. On Unaligned, the uncensored and abliterated models sit in the same API as the mainstream ones, so the only thing that changes in your code is the model id. You need an account, some credit and an API key; the quick start covers those three steps. The examples below read the key from an environment variable, UNALIGNED_KEY.
What “OpenAI-compatible” and “Anthropic-compatible” mean
Most AI tooling speaks one of two request formats. OpenAI’s Chat Completions sends a messages array where each message has a role (system, user, assistant, tool) and reads the answer from choices. Anthropic’s Messages API also sends messages, but puts the system prompt in a separate top-level system field, requires max_tokens, and returns the answer as a list of content blocks.
A service is “compatible” with one of them when it accepts the same requests and returns the same responses at another address. In practice, an official SDK, an IDE plugin or an agent framework built for that format works unchanged once you give it a different base URL and key. Unaligned answers in both formats, plus a simpler native one, and every model is available in each. Which format to pick depends only on the code you already have: the OpenAI and Anthropic pages of the docs list the base URLs and the supported fields.
A first request, OpenAI format
The example uses DeepSeek V4.1 Flash 1017 Abliterated, one of the models in the table below; any id from that table works the same way. With curl, then with the official Python SDK pointed at our base URL:
curl https://api.unaligned.pw/openai/v1/chat/completions \
-H "Authorization: Bearer $UNALIGNED_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-abliterated",
"messages": [
{"role": "system", "content": "You are a terse security reviewer."},
{"role": "user", "content": "Explain how a heap spray works."}
]
}'The same request, Anthropic format
Two differences: the system prompt moves out of messages into system, and max_tokens is required. Anthropic clients add /v1 to the base URL themselves, so give them the address as it is.
curl https://api.unaligned.pw/anthropic/v1/messages \
-H "x-api-key: $UNALIGNED_KEY" \
-H "content-type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-abliterated",
"max_tokens": 2048,
"system": "You are a terse security reviewer.",
"messages": [{"role": "user", "content": "Explain how a heap spray works."}]
}'Today our model list marks all of them as reasoning models, so set max_tokens with room for the reasoning: the reasoning is generated and billed as output, as Billing explains.
System prompts with an uncensored model
A system prompt matters more with these models, not less. A mainstream model brings its own idea of tone and limits; a model with fewer refusals tends to follow yours more literally. Say who the model is talking to, what it should and should not do, and in what form it should answer. If you want it to stay inside a topic, refuse something, or add a warning for your audience, write that in the system prompt: the model no longer does it on its own initiative. How to write a system prompt for an uncensored model has worked examples.
Your system prompt applies on every model in the table. GLM-5.3 Uncensored and GLM-5.3 Flash Uncensored add instructions of their own before it, to refuse less, counted as input as Billing explains; today the abliterated models add nothing to it.
Streaming
Both formats stream the same way at the transport level: add "stream": true and the answer arrives as server-sent events, piece by piece, instead of one JSON document at the end. In the OpenAI format each event carries a delta of the message; add stream_options.include_usage to get the token counts in the last event. In the Anthropic format you receive the standard event sequence, from message_start to message_stop. With curl, -N turns off buffering so you see the events as they come:
curl -N https://api.unaligned.pw/openai/v1/chat/completions \
-H "Authorization: Bearer $UNALIGNED_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash-1017-abliterated", "stream": true, "stream_options": {"include_usage": true},
"messages": [{"role": "user", "content": "Write a limerick about lockpicking."}]}'The SDKs handle the events for you: stream=True on the OpenAI client, client.messages.stream(…) on the Anthropic one. For a chat interface or an agent with many steps, streaming makes the wait feel shorter even when the total time is the same.
Images, tools and the rest
- Images. Only some models accept them: the
visionfield ofGET /v1/modelssays which, and so does each model page. Send images inline (data URLs in the OpenAI format,base64sources in the Anthropic one); addresses are not fetched. - Tools.
toolsandtool_choicework in both formats, on models that support them, so an uncensored model can sit inside an existing agent loop; Uncensored models for coding and agents covers that use. - State. The API does not hold the conversation for you: send the whole history with each request, as with Chat Completions anywhere.
- The Responses API (
/responses) also works with every model, statelessly, for tools such as Codex that use it.
What to expect from the answers
Fewer refusals, not none. Expect the model to take on requests a mainstream assistant would decline, and to skip most of the disclaimers. It can still decline now and then; a clearer request, or context stated in the system prompt, can get further than repeating the same one.
No new knowledge either. Removing refusals does not teach a model anything, and published measurements find that abliteration can cost a little capability, by an amount that depends on the tool and on the model. Check facts and code as you would with any model. What is an abliterated model? explains why, and Uncensored vs abliterated vs jailbreak why this is sturdier than prompting a mainstream model around its rules.
And the use is yours. The model answers the question asked; what you build with it, and what you do with its output, remains your responsibility. To pick between the models in the table, see Which uncensored model should you use?; for live prices, Pricing.
Models in this guide
USD per 1M tokens.
| Model | Context | Input | Output | Cached | Output speed |
|---|---|---|---|---|---|
| GLM-5.3 Uncensored Uncensored glm-5.3-uncensored | 1M | $0.15 | $0.24 | $0.017 | 103 tokens/s |
| GLM-5.3 Flash Uncensored Uncensored glm-5.3-flash-uncensored | 1M | $0.088 | $0.14 | $0.005 | 67 tokens/s |
| GLM-5.3 Abliterated Uncensored glm-5.3-abliterated | 1M | $2.00 | $3.20 | $0.413 | 200 tokens/s |
| DeepSeek V4.1 Flash 1017 Abliterated Uncensored deepseek-v4.1-flash-1017-abliterated | 1M | $0.375 | $0.60 | $0.083 | 125 tokens/s |
| DeepSeek V4.1 Flash 1017 Abliterated Fast Uncensored deepseek-v4.1-flash-1017-abliterated-fast | 1M | $1.25 | $2.00 | $0.264 | 280 tokens/s |
Questions
Is there an uncensored model with an OpenAI-compatible API?
Yes. On Unaligned, every uncensored and abliterated model answers in the OpenAI Chat Completions and Responses formats as well as the Anthropic Messages format. Point the OpenAI SDK at our base URL, use your Unaligned key, and set the model id.
Can I use an uncensored model with the Anthropic SDK or Claude Code?
Yes. Give the Anthropic client our Anthropic base URL as it is (it adds /v1 itself) and an uncensored model id. Tools built on the Anthropic format work the same way.
Does an uncensored API model follow my system prompt?
Yes, and it tends to follow it more literally than a mainstream model, since it has fewer refusals of its own. Two of ours, the GLM-5.3 Uncensored models, also add instructions of their own before yours, to refuse less.
Does an uncensored model support streaming?
Yes. Add "stream": true in either format and the answer arrives as server-sent events, as with OpenAI or Anthropic directly.
Other guides
- What is an abliterated model?→
- Uncensored vs abliterated vs jailbreak: what is the difference?→
- Which uncensored model should you use?→
- Private AI API: no e-mail, no KYC, paid in crypto→
- Why mainstream AI models refuse, and what “unaligned” means→
- Uncensored AI for roleplay and fiction writing→
- Uncensored models for coding and agents→
- Abliterated vs fine-tuned uncensored models→
- Run an abliterated model locally, or use an API?→
- How to pay for an AI API with crypto→
- GLM-5.3 Abliterated vs DeepSeek V4.1 Flash Abliterated→
- How to write a system prompt for an uncensored model→
- All guides→
- All models→