OpenUncensored
58개의 검열되지 않고 아블리터레이션된 오픈 웨이트 LLM과 대화하고, 모델 순위를 비교하고, 모든 MCP 클라이언트에서 잔액을 확인하세요. OAuth 로그인을 지원하는 원격 서버입니다.
호스팅형 MCP 서버
npx add-mcp 'https://openuncensored.com/mcp/connect'Claude Code, Codex, Cursor 등에 설치됩니다
문서
One API for every uncensored model.
OpenUncensored speaks the OpenAI chat completions protocol. Point any OpenAI SDK at our base URL, pick a model id from the catalogue, and the router picks the provider.
Base URLhttps://api.openuncensored.com/v1Live
Cheapest & fastest DeepSeek V4.1 Flash ($0.28 / $0.007 cached / $1.12)
Call deepseek-v4.1-flash-1017-uncensored (or shorthand alias deepseek) at $0.28 in / $0.007 cached / $1.12 out per 1M tokens — 270+ tok/s live on our own GPUs, 1M context, native tool calling and image input, plus a -thinking variant for reasoning.Read benchmarks & pricing →
Start here
Up and running in a minute.
- 01
Get a key
Buy credits and copy the
ou-key. No account. Agents can buy one themselves through the checkout API. - 02 Pick a model Browse models and copy its id. Check its refusal fingerprint and loop rate first.
- 03
Send a request
Set the base URL to
https://api.openuncensored.com/v1; any OpenAI SDK works. Add aroutingobject when you care which provider serves it.
curl https://api.openuncensored.com/v1/chat/completions \
-H "Authorization: Bearer $OU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-uncensored",
"messages": [{"role": "user", "content": "Explain how SQL injection works."}],
"routing": {"strategy": "quality"}
}'
Older base URL
https://openuncensored.com/api/v1 still works, but it goes through the website, which ends a request that has sent nothing for 120 seconds. Streams are fine there; a long non-streamed answer or a slow image is not. On https://api.openuncensored.com/v1 an image request may take up to 4 minutes.
Security
Keys and auth.
Send your key as a bearer token: Authorization: Bearer <key>. A missing or wrong key returns 401 with code invalid_api_key.
Hosted keys start with ou- and come from the credits page. Each key carries a prepaid USD balance. It is shown once, and we store only its SHA-256 hash. Buy more credits for the same key by ticking “Add to a key I already have”.
Optionally name your app with an X-Title header (or HTTP-Referer), the OpenRouter convention. Cline, Roo, Kilo Code and others already send it. It only labels your traffic in our stats.
On a self hosted router, OU_API_KEY holds the accepted keys (comma separated for several). Keys are compared in constant time. If OU_API_KEY is unset the router runs open, which is only safe on localhost: anyone who can reach the port can spend your provider keys.
Browser use
The router only accepts browser requests from origins listed in OU_CORS_ORIGINS (default: pages served from localhost). Never ship a server key inside client side code.
POST /v1/chat/completions
Chat completions.
Fully OpenAI compatible, streaming and non streaming. Samplers outside the OpenAI spec such as top_k, min_p and repetition_penalty are forwarded to the provider untouched, because those matter for the models this router serves.
| Field | Type | Description |
|---|---|---|
| model | string | A model id from GET /v1/models. Required. |
| messages | array | Chat messages, at least one. Tool calls and tool results pass through. |
| stream | boolean | Server sent events when true. Default false. |
| temperature, top_p, max_tokens | number | Standard sampling controls. |
| tools, tool_choice | array, object | OpenAI tool calling. Providers flagged as tool capable are tried first. |
| response_format, seed, stop | various | Forwarded as is. |
| routing | object | Router extension. See routing. |
Response
The upstream body, plus usage when the provider left it out (marked usage_estimated) and an ou object describing how the request was served. model, ou.model and every stream chunk always name the model you requested. The same facts arrive as headers: X-Request-ID, X-OU-Model, X-OU-Provider, X-OU-Strategy, X-OU-Attempts and X-OU-Latency-Ms.
{
"id": "chatcmpl-8f2c",
"object": "chat.completion",
"model": "deepseek-v4.1-flash-1017-uncensored",
"choices": [
{"index": 0, "message": {"role": "assistant", "content": "SQL injection happens when…"}, "finish_reason": "stop"}
],
"usage": {"prompt_tokens": 18, "completion_tokens": 412, "total_tokens": 430},
"ou": {
"request_id": "req_4f1c09a2b7d34e81c0aa",
"provider": "openuncensored",
"model": "deepseek-v4.1-flash-1017-uncensored",
"strategy": "quality",
"latency_ms": 1240.6,
"usage_estimated": false,
"attempts": [
{"provider": "openuncensored", "outcome": "ok", "status_code": 200, "latency_ms": 1240.6}
]
}
}
POST /v1/responses
Responses API.
The OpenAI Responses API, for clients that only speak it, such as the Codex CLI and the OpenAI Agents SDK. Every model works here: the router translates the request to chat completions, routes, bills and falls back exactly as above, and translates the answer back, streaming included.
| Field | Type | Description |
|---|---|---|
| model | string | A model id from GET /v1/models. Required. |
| input | string or array | A prompt, or message, function_call and function_call_output items. |
| instructions | string | System prompt. |
| stream | boolean | Responses events: response.created, output item and text deltas, response.completed. |
| tools, tool_choice | array, object | Function and custom (free form) tools. Hosted tools such as web search are not available and are ignored. |
| max_output_tokens, temperature, top_p | number | Standard sampling controls. |
| routing | object | Router extension, same as for chat. See routing. |
Stateless
Nothing is stored. Send the whole conversation in input each turn; previous_response_id and store are not supported. Model reasoning comes back as reasoning output items.
curl https://api.openuncensored.com/v1/responses \
-H "Authorization: Bearer $OU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-uncensored",
"instructions": "You are a terse assistant.",
"input": "Explain how SQL injection works."
}'
POST /v1/messages
Anthropic Messages API.
The Anthropic Messages API, for Claude Code, the Anthropic SDKs and other clients that speak it. Every model works here too: the request is translated to chat completions, routed, billed and falls back as above, and the answer comes back in Anthropic's format, streaming included. The base URL for Anthropic clients is https://api.openuncensored.com (they add /v1/messages themselves). Send the key as x-api-key or Authorization: Bearer.
| Field | Type | Description |
|---|---|---|
| model | string | A model id from GET /v1/models. Required. Claude model names are not served. |
| messages, system | array, string or blocks | Text, image and tool_result blocks. Pictures returned by tools reach vision models. |
| max_tokens | integer | Output limit, as in Anthropic's API. |
| stream | boolean | Anthropic events: message_start, content block deltas, message_delta with usage, message_stop. |
| tools, tool_choice | array, object | Client tools with input_schema. Server tools that Anthropic runs, such as web search, are ignored. |
| thinking | object | When enabled, the model's reasoning comes back as thinking blocks. The model's own default reasoning applies either way. |
| temperature, top_p, stop_sequences | number, array | Standard sampling controls. |
| routing | object | Router extension, same as for chat. See routing. |
Prompt caching is automatic
No cache_control markers needed (they are accepted and ignored). Providers cache the shared start of your prompts on their own, and the cached part comes back as cache_read_input_tokens, billed at the provider's cached price. POST /v1/messages/count_tokens returns an estimate (about 4 characters per token) and is free.
curl https://api.openuncensored.com/v1/messages \
-H "x-api-key: $OU_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017-uncensored",
"max_tokens": 1024,
"system": "You are a terse assistant.",
"messages": [{"role": "user", "content": "Explain how SQL injection works."}]
}'
POST /v1/images/generations
Uncensored images.
OpenAI compatible image generation, so client.images.generate works unchanged. Anything involving minors, real people without consent or non consensual imagery is strictly prohibited, and providers refuse it. Each model is routed to its cheapest provider with automatic fallback, and billed per image from the same credits as text.
| Field | Type | Description |
|---|---|---|
| model | string | An id from the table below or GET /v1/images/models. Required. |
| prompt | string | What to draw. Up to 8000 characters; some image models (such as Z-Image, Chroma, Qwen Image) take up to 1500. |
| n | integer | Images to make, 1 to 4. Default 1. Each is billed. |
| size | string | 1024x1024 (default), 1024x1536, 1536x1024, 1024x1792, 1792x1024, 512x512 or auto. |
| response_format | string | b64_json (default) or url, which returns a data: URL. Nothing is stored on our side. |
| Model | Per image | What it is |
|---|---|---|
| z-image-turbo | $0.01 | Fast photorealistic model from Alibaba Tongyi (Apache 2.0). Good default. |
| chroma | $0.01 | Uncensored FLUX.1-schnell derivative (Apache 2.0), strong at prompt following. |
| qwen-image | $0.03 | Alibaba's Qwen-Image (Apache 2.0). Best text rendering inside images. |
| qwen-image-3-uncensored | $0.04 | Uncensored Qwen Image 3, high detail at 1K and 2K. |
| hidream-o1-dev | $0.02 | HiDream's fast 2K model. |
The response is the OpenAI shape, data[].b64_json, plus an ou object with the provider used. Prices are for the cheapest route; a fallback provider can cost a little more.
curl https://api.openuncensored.com/v1/images/generations \
-H "Authorization: Bearer $OU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "z-image-turbo", "prompt": "a red fox in fresh snow, photo", "size": "1024x1024"}' \
| jq -r '.data[0].b64_json' | base64 --decode > fox.png
POST /v1/images/edits
Edit images, keep your characters.
Send one or more reference images plus an instruction, and the model draws a new image that keeps them: the same character, face and outfit in a new scene, pose or style. It is OpenAI's edit endpoint, so client.images.edit works unchanged, and it bills per image from the same credits. qwen-image-3-edit gives the best edits and is the one we recommend; qwen-edit-uncensored is the fallback for edits it refuses. The same rules as image generation apply.
| Field | Type | Description |
|---|---|---|
| model | string | An editing model below. |
| prompt | string | What to make from the references. Name what must stay the same. |
| image / image[] | file | Multipart uploads like OpenAI: PNG, JPEG, WebP or GIF, up to 20 MB each. |
| images | string[] | In a JSON body instead: data URLs, base64 strings or public https links. |
| n, size, response_format | As for image generation. |
| Editing model | Per image | References and what it is |
|---|---|---|
| qwen-edit-uncensored | $0.04 | up to 3 · Uncensored Qwen Image Edit. Keeps a character from up to 3 reference images in new scenes. |
| seedream-v5-5-edit | $0.0255 + $0.0102 each | up to 10 · ByteDance Seedream 5.5 editing. Strongest at keeping one character consistent across up to 10 reference images. |
| qwen-image-3-edit | $0.04 + $0.00345 each | up to 3 · Qwen Image 3 editing at 1K and 2K, high detail; up to 3 reference images. |
curl https://api.openuncensored.com/v1/images/edits \
-H "Authorization: Bearer $OU_API_KEY" \
-F model=qwen-image-3-edit \
-F "image[]=@knight.png" \
-F prompt="The same knight, same face and armour, now riding a horse across a snowy battlefield" \
| jq -r '.data[0].b64_json' | base64 --decode > knight-horse.png
POST /v1/videos
Images into video.
Image to video: send one image, which becomes the first frame, and a prompt saying what happens, and the model animates it into a short clip. The endpoints follow OpenAI's Videos API, so client.videos.create, retrieve and download_content in the OpenAI Python SDK work unchanged. Jobs are asynchronous: create one, poll it until it completes, then download the MP4. Credit is checked when the job is created, and the clip is charged only when it completes; a failed clip costs nothing. Finished clips are kept for 7 days.
| Field | Type | Description |
|---|---|---|
| model | string | An id from the table below or GET /v1/videos/models. Required. |
| prompt | string | What happens in the clip. Up to 4000 characters. Required. |
| image | string | The first frame: a data URL, a base64 string or a public https link. Required. input_reference and image_url are accepted as aliases. |
| input_reference | file | In a multipart/form-data body instead: the image as a file upload, up to 20 MB. The other fields keep the same names. |
| seconds | integer or string | Clip length, one of the model's seconds, such as 5 or "5". Default: the model's default_seconds. |
| resolution | string | One of the model's resolutions, such as 720p. A size such as 1280x720 is accepted too and matched by its shorter side. Default: the model's default_resolution. |
| Video model | Per clip | Length, audio and what it is |
|---|---|---|
| minimax-h3-chili-image-to-video | $0.17 | 4 to 15 s · with audio · Animates an image into a 4 to 15 second clip at 768p with sound. The fastest and best at following the prompt. |
| wan-2.2-enhanced-image-to-video | $0.40 | 5 or 8 s · no audio · Animates an image into a 5 or 8 second clip at up to 720p, without sound. An uncensored version of Alibaba's Wan 2.2. |
| ovi-image-to-video | $0.22 | 5 s · with audio · Animates an image into a 5 second clip with sound. Character.AI's open audio and video model, based on Wan. |
The price is for the model's default length and resolution. GET /v1/videos/models lists every model's seconds, resolutions, audio, the price of each length and resolution in prices, and typical_wait_s, the usual time from create to completed (35 to 70 s for MiniMax H3 Chili, 50 to 70 s for Wan 2.2 Enhanced, 2 to 4 min for Ovi).
| Endpoint | Key | Returns |
|---|---|---|
| POST /v1/videos | yes | A Video object with status queued. |
| GET /v1/videos/{id} | yes | The Video object. Poll every 5 to 10 seconds until status is completed or failed. |
| GET /v1/videos/{id}/content | yes | The MP4 (video/mp4). 409 video_not_ready before it completes, 410 video_expired after 7 days. |
| GET /v1/videos | yes | Your videos, newest first. ?limit=20. |
| GET /v1/videos/models | no | Video models with their lengths, resolutions, audio and prices. |
A Video object has id, model, status (queued, in_progress, completed or failed), progress from 0 to 100, seconds, size once it completes, error when it fails, and created_at, completed_at and expires_at in Unix seconds. Its ou object carries price_usd, audio and, once the clip completes, download_url: a direct link to the MP4, valid for one hour. Only the account that created a video can read it.
# 1. Create the job: the image is the first frame
curl https://api.openuncensored.com/v1/videos \
-H "Authorization: Bearer $OU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "minimax-h3-chili-image-to-video", "prompt": "She turns and smiles as the rain falls; the camera pushes in.",
"image": "https://example.com/street.jpg", "seconds": 5}'
# -> {"id": "video_...", "object": "video", "status": "queued", ...}
# 2. Poll every 5 to 10 seconds until "status" is "completed" or "failed"
curl https://api.openuncensored.com/v1/videos/video_abc -H "Authorization: Bearer $OU_API_KEY"
# 3. Download the MP4
curl -o clip.mp4 https://api.openuncensored.com/v1/videos/video_abc/content -H "Authorization: Bearer $OU_API_KEY"
GET /v1/models
The catalogue.
| Endpoint | Query | Returns |
|---|---|---|
| GET /v1/models | ?available=true | Every model with its providers and eval scores. The flag hides models no healthy, configured provider can serve right now. |
| GET /v1/models/{id} | none | One model with per provider live metrics, pricing, rate limits and circuit breaker state. |
| GET /v1/stats/latency | ?days=7 | Live speed on real traffic per model and provider: p50 and p90 latency, time to first token, tokens per second, success rate. Only pairs with at least 5 successful requests. No key needed. |
| GET /api/rankings.json | none | The OpenUncensored Score for every model, with its parts (intelligence, agentic, non-refusal, drift) and weights. Served from the site (https://openuncensored.com/api/rankings.json), not the API base URL. No key needed. |
| GET /metrics | none | TTFT, tokens per second, latency percentiles and error rate over the rolling window, plus lifetime tokens and cost. |
| GET /health | ?deep=true | Liveness and provider status (ok, degraded, unavailable). Deep probes every configured upstream and needs a key. |
GET https://api.openuncensored.com/v1/models/deepseek-v4.1-flash-1017-uncensored
{
"id": "deepseek-v4.1-flash-1017-uncensored",
"object": "model",
"owned_by": "deepseek",
"base_model": "deepseek-ai/DeepSeek-V4.1-Flash-1017",
"abliteration_method": "finetune",
"modality": "text",
"context_length": 1048576,
"pricing": {"prompt": "0.00000028", "completion": "0.00000112"},
"available": true,
"providers": [
{"name": "openuncensored", "status": "online", "configured": true,
"pricing": {"input_per_mtok": 0.28, "output_per_mtok": 1.12, "cache_read_per_mtok": 0.007}}
]
}
GET /v1/credits
Credits and balance.
The prepaid balance of the key you send. Usage is charged at exactly the provider's per token price, with no markup, and settles every 30 seconds, so a request in flight can take the balance slightly below zero. At zero the API answers 402 with code insufficient_quota and a link to top up.
curl https://api.openuncensored.com/v1/credits -H "Authorization: Bearer $OU_API_KEY"
{"object": "credits", "data": {"remaining_usd": 4.18, "balance_usd": 4.2,
"pending_usage_usd": 0.02, "currency": "usd",
"top_up_url": "https://openuncensored.com/credits"}}
A key runs at most 32 requests at once, and each running request reserves its likely cost until it finishes, so parallel calls cannot spend more than the balance. Past the limit the API answers 429 with code concurrency_limit; retry after a second.
POST /api/agent/checkout
Buy credits by API.
For agents buying on their human's behalf: the agent gets a Stripe payment link to hand over, then polls for the key. The key goes only to whoever holds the claim token, never to the payment page. These endpoints live on the site (https://openuncensored.com/api/...), not under the API base URL.
| Endpoint | Body or header | Returns |
|---|---|---|
| POST /api/agent/checkout | {"credits": 1000, "key"?: "ou-..."} | credits is in US cents (500 to 100000). Send key to top up an existing key. Returns payment_url, session_id, claim_token and next_steps. |
| GET /api/agent/checkout/{session_id} | Authorization: Bearer <claim_token> | status is pending, expired or paid. When paid, api_key holds the new key exactly once, with balance_cents and base_url. Poll every 5 seconds. |
curl -X POST https://openuncensored.com/api/agent/checkout \
-H "Content-Type: application/json" -d '{"credits": 1000}'
# give payment_url to your human, then poll:
curl https://openuncensored.com/api/agent/checkout/$SESSION_ID \
-H "Authorization: Bearer $CLAIM_TOKEN"
POST /api/feedback
Tell us what to fix.
Feedback from people or their agents: bugs, missing models, pricing, docs. No key needed, and a human reads every submission. Send JSON, or plain text as the whole body. A few submissions a minute per address at most.
| Field | Type | Description |
|---|---|---|
| message | string | What should we improve? Required, up to 5000 characters. |
| category | string | One of bug, model_request, pricing, docs, agent_experience, feature, other. |
| contact | string | Email or handle if you want a reply. |
| model, agent | string | The model it is about, and the agent or tool sending it. |
| api_key | string | Optional ou- key (or Authorization: Bearer) to link it to your account. |
curl -X POST https://openuncensored.com/api/feedback \
-H "Content-Type: application/json" \
-d '{"message": "Add Kimi K3 uncensored", "category": "model_request", "agent": "claude-code"}'
{"ok": true, "id": "fb_...", "thanks": "Thanks. A human reads every submission."}
MCP and markdown
Built for agents.
An agent can use the whole site without a browser. Give it openuncensored.com/agents.md: how to buy a key, call the API and recover from errors, in one page.
| Resource | Type | What it is |
|---|---|---|
| /mcp | MCP, streamable HTTP | An MCP server with tools list_models, get_rankings, get_model, buy_credits, check_purchase, check_balance, chat, generate_image, create_video, get_video, send_feedback and get_guide. |
| /mcp/connect | MCP, OAuth sign in | The connector for Claude, ChatGPT, Cursor and other MCP apps: add the URL, sign in by pasting your key once, and the app gets list_models, get_rankings, get_model, chat, generate_image, create_video, get_video, check_balance and send_feedback. |
| /agents.md | markdown | The agent guide: fastest path from nothing to a working call. |
| /llms.txt, /llms-full.txt | text | Index of the site for language models, and the full docs in one file. |
| /<page>.md | markdown | Any page as markdown, for example /docs.md, /uncensored-llm-leaderboard.md, /models/<id>.md. |
Claude: Settings > Connectors > Add custom connector
ChatGPT: Settings > Apps > Advanced settings > Developer mode > Create app
URL: https://openuncensored.com/mcp/connect
Then sign in with your API key when asked.
SDKs and coding agents
Plug it in anywhere.
Anything that speaks the OpenAI API works: set the base URL to https://api.openuncensored.com/v1 and use your key. The snippets below use OPENUNCENSORED_API_KEY for the key. Chat completions carry tools, streaming, JSON schema output and reasoning_effort; clients that only speak the Responses API, such as Codex, use /v1/responses, and Anthropic clients such as Claude Code use /v1/messages.
// npm i ai @ai-sdk/openai-compatible zod
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText, streamText, tool, stepCountIs } from "ai";
import { z } from "zod";
const openUncensored = createOpenAICompatible({
name: "openuncensored",
apiKey: process.env.OPENUNCENSORED_API_KEY,
baseURL: "https://api.openuncensored.com/v1",
includeUsage: true, // usage at the end of streams
supportsStructuredOutputs: true, // Output.object sends a JSON schema
});
const { text } = await generateText({
model: openUncensored("deepseek-v4.1-flash-1017-uncensored"),
prompt: "Explain how a lock pick works in one sentence.",
});
// Streaming
const result = streamText({
model: openUncensored("deepseek-v4.1-flash-1017-uncensored"),
prompt: "Count from 1 to 5.",
});
for await (const part of result.textStream) process.stdout.write(part);
// Tools, several steps
const { text: answer } = await generateText({
model: openUncensored("deepseek-v4.1-flash-1017-uncensored"),
tools: {
weather: tool({
description: "Get the weather in a city",
inputSchema: z.object({ city: z.string() }),
execute: async ({ city }) => ({ city, temperatureC: 18 }),
}),
},
stopWhen: stepCountIs(3),
prompt: "What is the weather in Paris?",
});
// Reasoning effort, for models that reason
await generateText({
model: openUncensored("deepseek-v4.1-flash-1017-uncensored-thinking"),
prompt: "Is 91 prime?",
providerOptions: { openuncensored: { reasoningEffort: "high" } },
});
Claude Code, Codex and OpenCode in one go: curl -fsSL https://openuncensored.com/setup.sh | sh. It asks before each change, keeps backups, and adds claude-uncensored, codex-uncensored and opencode-uncensored instead of changing your defaults (read the script).
Step-by-step guides: Claude Code and Codex, OpenCode, Cline, Roo Code, Kilo Code and Cursor, SillyTavern and RisuAI.
Router extension
Routing strategies.
Each model is served by one or more providers, each with its own price and speed. The router ranks them with a strategy, tries them in order and falls back to the next one when a provider fails before the first streamed byte. Hosts that run the model themselves always go before resellers; the strategy orders providers within each group. Pick the strategy, in order of precedence, with the routing body field, the X-OU-Strategy header, OpenRouter's provider.sort (price, throughput or latency), or a default for your key on the credits page. Without any of these the strategy is default.
Three choices cover most uses. auto (the default) takes the cheapest provider among those producing at least 100 tokens per second. cheapest always takes the cheapest provider for the request, even a slow one. fastest takes the provider producing the most tokens per second, whatever it costs. For example, send "routing": {"strategy": "cheapest"} in the body or the header X-OU-Strategy: fastest, or set a default once for your key on the credits page so every request uses it without any code change.
| Strategy | Ranks by | Notes |
|---|---|---|
| default | price above 100 tok/s | Aliases auto, quality. Providers averaging at least 100 output tokens per second (or not measured yet) go first, cheapest first; slower ones follow, best eval score first. |
| speed | live latency | Alias latency. Lowest average time to first token for streams, total latency otherwise. |
| throughput | live tokens/s | Alias fastest. Highest average output tokens per second. For long answers and batch jobs. |
| cost | price | Aliases cheapest, price. Cheapest for this prompt plus max_tokens (512 assumed when unset), counting the share of prompt tokens the model usually gets as cache hits. |
| random | nothing | Shuffled. Useful for spreading load or A/B tests. |
| Field | Type | Description |
|---|---|---|
| routing.strategy | string | default, speed, throughput, cost or random (aliases auto, quality, fastest, latency, cheapest, price). |
| routing.only | string[] | Only try these providers. |
| routing.ignore | string[] | Never try these providers. This is how you exclude a host today. |
| routing.allow_fallbacks | boolean | False: never answer with another model. The model's other providers are still tried when one fails. Default true. |
{
"model": "deepseek-v4.1-flash-1017-uncensored",
"messages": [{"role": "user", "content": "…"}],
"routing": {
"strategy": "cost",
"only": ["venice", "nanogpt"],
"ignore": ["openrouter"],
"allow_fallbacks": true
}
}
What you are billed. The price of the provider that answered, with no markup. The response names it in ou.provider and the X-OU-Provider header, and X-OU-Strategy echoes the strategy used. Things to know:
- Cached input (prompt tokens a provider has seen recently) is priced very differently from host to host. Each model's
providerslist in/v1/models/{id}has every provider'sinput_per_mtok,output_per_mtokandcache_read_per_mtok(nullwhen the provider doesn't publish one), plus livetokens_per_secondandtime_to_first_token_ms. - The top level
pricingof a model is the cheapest provider's list price, not a promise for every request. - Speeds are rolling averages over recent requests and move through the day.
- Changing provider partway through a conversation loses that provider's prompt cache, so the next few requests can be fully priced.
- A fallback is billed at the fallback provider's price. List the providers you accept in
onlyto get the error instead. - When a provider reports its own charge, that is what you pay; otherwise we compute it from its listed prices.
Providers that fail three times in a row go offline for 60 seconds (OU_BREAKER_THRESHOLD, OU_BREAKER_COOLDOWN). An upstream 429 cools that provider down for its Retry-After, or 30 seconds when none is given. Requests the upstream rejects as invalid (400, 413, 422) are relayed and never retried.
Coming next
Route by what it refuses.
Planned
The same model can behave differently on different hosts: a platform system prompt, a moderation classifier or an aggressive quantisation all change what comes back. These filters will route only to model and provider pairs whose measured behaviour meets your bar.
| Field | Type | Description |
|---|---|---|
| routing.require_openPlanned | string[] | Categories that must stay open. One of cyber bio chem weapons drugs violence hate selfharm privacy fraud political. |
| routing.max_refusalPlanned | number | Highest refusal rate allowed in each required category, 0 to 1. |
| routing.max_loop_ratePlanned | number | Skip pairs whose agentic doom loop rate is above this, 0 to 1. |
| routing.no_loggingPlanned | boolean | Only providers that state they keep no prompt or completion logs. |
{
"model": "deepseek-v4.1-flash-1017-uncensored",
"messages": [{"role": "user", "content": "…"}],
"routing": {
"strategy": "quality",
"ignore": ["openrouter"],
"require_open": ["cyber", "bio"],
"max_refusal": 0.05,
"max_loop_rate": 0.2,
"no_logging": true
}
}
Today
Exclusion by provider already works with routing.ignore and routing.only. Per category numbers live on each model page.
stream: true
Streaming responses.
Streams are server sent events in the OpenAI chunk format, ending with data: [DONE]. Fallback to another provider only happens before the first byte reaches you. After that, an upstream failure arrives in band as an OpenAI style error event so your client can surface it. The router tolerates up to 60 seconds of silence mid stream (OU_STREAM_TIMEOUT).
data: {"id":"chatcmpl-8f2c","choices":[{"index":0,"delta":{"content":"SQL"}}]}
data: {"id":"chatcmpl-8f2c","choices":[{"index":0,"delta":{"content":" injection"}}]}
data: {"error": {"message": "upstream closed the connection", "type": "upstream_error", "param": null, "code": null}}
data: [DONE]
OpenAI error format
When things go wrong.
Every error uses OpenAI's shape: {"error": {"message", "type", "param", "code", "metadata"}}. metadata carries per provider details, such as why each one was skipped.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body failed validation. |
| 400 | invalid_routing_options | Unknown strategy or provider, or only/ignore exclude every provider. |
| 401 | invalid_api_key | Missing or wrong bearer token. |
| 404 | model_not_found | No model with that id. |
| 400 | invalid_size | Image size not in the supported list. |
| 400 | invalid_image | An edit reference image is missing, not a PNG, JPEG, WebP or GIF, over 20 MB, or not a data URL, base64 string or https link. On /v1/videos: the input image could not be read. |
| 400 | too_many_images | More reference images than the model takes (max_input_images in GET /v1/images/models). |
| 400 | model_cannot_edit | The model does not edit images. The message lists the editing models. |
| 400 | edit_only_model | An editing model sent to /v1/images/generations. Send reference images to /v1/images/edits. |
| 400 | missing_image | A video request without an image. Every video model needs one, the first frame. |
| 400 | image_too_large | The video input image is over 20 MB. |
| 400 | invalid_seconds | seconds is not one of the model's lengths (seconds in GET /v1/videos/models). |
| 400 | invalid_resolution | resolution or size does not match one of the model's resolutions. |
| 400 | prompt_too_long | A video prompt over 4000 characters. |
| 402 | insufficient_credit | Not enough credit for the clip. Top up and create the job again. |
| 404 | video_not_found | No video with that id on this account. |
| 409 | video_not_ready | The clip has not completed yet. Poll GET /v1/videos/{id} first. |
| 410 | video_expired | The clip was deleted after 7 days. |
| 502 | upstream_error | The video provider would not queue the job. Nothing is charged. |
| 4xx | upstream_rejected_request | The provider rejected the request itself. Relayed as is, never retried. |
| 429 | rate_limit_exceeded | Every provider for the model is rate limited. Honour Retry-After. |
| 502 | all_providers_failed | Each provider was tried and failed. |
| 503 | no_provider_available | Every provider is unconfigured or offline. |
| 503 | not_ready | The router is still starting up. |
| 500 | internal_error | A router bug. Check the router logs. |
MIT licensed
Run it yourself.
The router is a FastAPI app. Bring your own provider keys, they are read from the environment variables named by api_key_env in configs/providers.yaml.
git clone https://github.com/DhruvAtreja/open-uncensored
cd open-uncensored
pip install -e .
# provider keys, named by api_key_env in configs/providers.yaml
export FEATHERLESS_API_KEY=…
export VENICE_API_KEY=…
export OPENROUTER_API_KEY=…
# require a bearer token before exposing the port
export OU_API_KEY=$(openssl rand -hex 24)
export OU_CORS_ORIGINS=https://openuncensored.com
ou-router --host 0.0.0.0 --port 8080
| Variable | Default | Purpose |
|---|---|---|
| OU_API_KEY | unset | Accepted bearer tokens, comma separated. Unset means open, local use only. |
| OU_HOST, OU_PORT | 127.0.0.1:8080 | Bind address. Also --host and --port. |
| OU_ROUTING_STRATEGY | quality | Server default strategy: quality, speed, throughput, cost or random. |
| OU_CORS_ORIGINS | localhost | Origins allowed to call the API from a browser, or *. |
| OU_REQUEST_TIMEOUT | 300 | Non streaming upstream timeout, seconds. |
| OU_STREAM_TIMEOUT | 60 | Longest silence tolerated while streaming, seconds. |
| OU_CONNECT_TIMEOUT | 10 | Upstream connect timeout, seconds. |
| OU_METRICS_WINDOW | 100 | Requests per rolling metrics window. |
| OU_BREAKER_THRESHOLD | 3 | Consecutive failures that take a provider offline. |
| OU_BREAKER_COOLDOWN | 60 | Seconds a provider stays offline. |
| OU_HEALTH_INTERVAL | 0 | Seconds between active health checks. 0 is off. |
| OU_LOG_LEVEL | INFO | Also --log-level. --reload restarts on code changes. |
| OU_PROVIDERS_CONFIG, OU_MODELS_CONFIG | configs/ | Alternative YAML files. |
In models.yaml each model can carry upstream_ids (the name a provider expects), pricing, eval_scores and provider_eval_scores for hosts whose quantisation changes quality.
ou-eval
Run the evals yourself.
Every number on this site comes from the same harness you can run locally. Five benchmarks: capability, agentic, tool_call, refusal and divergence. Results land in results/{model}/{provider}/{timestamp}.json. Responses to harmful probes are scored and discarded, never written to disk.
# run every benchmark against one model on one provider
ou-eval --model venice-uncensored --provider openrouter \
--api-model cognitivecomputations/dolphin-mistral-24b-venice-edition \
--benchmarks all --trials 2
# compare against a live base model run
ou-eval --model huihui-qwen3.5-27b-abliterated --provider featherless \
--base-model Qwen/Qwen3.5-27B --base-provider featherless
# fold every results/ file into leaderboard.json
cd src && python -m eval.report --output ../leaderboard/leaderboard.json
| Flag | Default | Purpose |
|---|---|---|
| --model / --provider | required | Model id and provider name from configs/. |
| --benchmarks | all | Comma separated subset. |
| --api-model | --model | Model name the provider expects, when it differs. |
| --base-url, --api-key-env | config | Point at an ad hoc endpoint. |
| --base-model, --base-provider | models.yaml | Run the base model live for retention and divergence. |
| --base-accuracy | none | Known base capability accuracy, skips the live base run. |
| --trials | 2 | Agentic runs per scenario, 1 to 20. |
| --tool-mode | auto | text (JSON in prompt), native (tools parameter) or auto. |
| --limit | all | Only the first N items per benchmark. |
| --concurrency, --rpm | 4, provider | Parallel requests and requests per minute. |
| --timeout, --retries | 180, 3 | Per request timeout and retries with backoff. |
| --temperature, --max-tokens | per bench | Override sampling. Raise max tokens for reasoning models. |
| --results-dir, --no-save | ./results | Where results go, or skip writing them. |
How each score is computed is on the methodology page.