API reference
The UncensoredAI API
An OpenAI-compatible HTTP API. If your code already speaks to OpenAI, point it at https://uncensoredai.dev/v1 and swap the key.
Quickstart
Every request targets POST /v1/chat/completions with a JSON body. Set stream: true to receive server-sent events instead of a single JSON document.
const response = await fetch("https://uncensoredai.dev/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.UNCENSOREDAI_KEY}`,
},
body: JSON.stringify({
model: "gpt-6-sol",
messages: [
{ role: "system", content: "You are a concise assistant." },
{ role: "user", content: "Summarise SSE in one sentence." },
],
temperature: 0.7,
}),
});
const data = await response.json();
console.log(data.choices[0].message.content);Authentication
Your 16-digit access key is the credential. Send it as a Bearer token on every request, formatted as sk-ua-4821-9053-7712-6634. We store only a hash; rotating it from the dashboard invalidates the old value immediately.
Authorization: Bearer sk-ua-4821-9053-7712-6634Chat completions
POST /v1/chat/completions accepts the standard OpenAI fields. The model value must be one of the 35 catalog ids.
| Field | Type | Notes |
|---|---|---|
| model | string | Required. A catalog model id. |
| messages | array | Required. OpenAI message objects. |
| stream | boolean | Optional. Enable SSE streaming. |
| temperature | number | Optional, 0–2. Forwarded upstream. |
| max_tokens | integer | Optional. Caps completion length. |
| tools | array | Optional. Function/tool definitions. |
Streaming
With stream: true the response is a text/event-stream. Each data: line carries a delta frame; the stream ends with data: [DONE]. The final content frame may include a usage object.
curl https://uncensoredai.dev/v1/chat/completions \
-H "Authorization: Bearer sk-ua-4821-9053-7712-6634" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro-uncensored",
"messages": [{ "role": "user", "content": "Count to five." }],
"stream": true
}'List models
GET /v1/models returns the catalog in OpenAI format. It requires the same Bearer authentication.
curl https://uncensoredai.dev/v1/models \
-H "Authorization: Bearer sk-ua-4821-9053-7712-6634"{
"object": "list",
"data": [
{ "id": "gpt-6-astra", "object": "model", "owned_by": "uncensoredai" },
{ "id": "glm-5-3-abliterated", "object": "model", "owned_by": "Z.ai" }
]
}Usage & billing
Every billed request records prompt, cached and completion tokens. The cost is computed from the per-model rates on the pricing page and deducted from your balance. When the balance reaches zero, requests fail with a 402 until you top up.
Errors
Failures use the OpenAI error envelope: { "error": { message, type, code } }.
| Code | Status | Meaning |
|---|---|---|
| invalid_api_key | 401 | The Bearer key is missing, malformed or revoked. |
| model_not_found | 404 | The requested model id is not in the catalog. |
| insufficient_quota | 402 | Balance has run out. Top up and retry. |
| upstream_unreachable | 502 | The upstream provider could not be reached. |
| upstream_not_configured | 503 | Upstream credentials are not set on the server. |
| invalid_request_error | 400 | The request body is malformed or missing fields. |
