Janitor AI API setup: the exact proxy config, field by field
Updated 2026-07-15
In JanitorAI's API settings, choose Proxy and fill five fields: a config name, an exact model ID such as deepseek-v4-flash, the full endpoint https://api.apisrouter.com/v1/chat/completions, your API key, and an optional custom prompt. The most common failure is pasting a base URL that stops at /v1, because JanitorAI never appends the path for you.
Quick answer: the five values JanitorAI asks for
JanitorAI's proxy setup has exactly five fields, and four of them are copy-paste. Open any chat, go to API Settings, pick Proxy as the API type, then create a new configuration with these values:
Configuration name: APIsRouter-deepseek (any label, only you see it)
Model name: deepseek-v4-flash (exact model ID, no spaces)
Proxy URL: https://api.apisrouter.com/v1/chat/completions
API key: sk-... (paste with no leading/trailing spaces)
Custom prompt: (optional, leave blank to use the character card as written)What each field actually does
Keep the custom prompt short and mechanical. Good uses: capping response length, enforcing third person, banning actions written for your character. Bad uses: pasting a second character sheet or a thousand-word style guide, which inflates every request and pushes older chat history out of context sooner. After saving, use the check proxy button if your build shows one, then send a short test message. If nothing comes back, work through the error table below before changing models.
- Configuration name: a local label. It is never sent to the API. Name it after the model, like APIsRouter-deepseek or APIsRouter-glm, so you can keep one saved config per model and switch in two taps.
- Model name: sent as the model parameter on every request. It must be the exact ID, lowercase with dashes: deepseek-v4-flash works, "DeepSeek V4 Flash" does not.
- Proxy URL: the full chat completions endpoint. JanitorAI sends requests to exactly the URL you type. SillyTavern takes a base URL ending at /v1 and appends the path itself, and it auto-populates the model list from /v1/models. JanitorAI does neither, which is why a URL that stops at /v1 returns a 404 here even though it works fine in SillyTavern.
- API key: sent as an Authorization: Bearer header to the proxy URL only. Never paste it into a chat message or screenshot.
- Custom prompt: an optional system-level instruction added alongside the character card, not a replacement for it. It is resent with every message, so every word costs input tokens for the whole life of the chat.
Which model name to enter, and why
The proxy URL and API key stay identical across configs. The only value that changes per model is the model name, so the practical move is one saved configuration per model you actually use. For roleplay, the DeepSeek V4 family is the approximate community favorite on JanitorAI boards: strong character-card adherence at the lowest token prices in this table. GLM-5, Kimi K2.6, and MiMo are solid value picks with policies that accommodate fictional content. Grok 4.5 is a common pick for darker or mature fictional themes because xAI's published policy explicitly allows them in fiction. Claude Sonnet 4.6 and Opus 4.7 write the best prose of anything here, but Anthropic's usage policy prohibits explicit content, so treat Claude as a strictly SFW creative-writing option. Two ground rules regardless of model. JanitorAI is an 18+ platform and its ToS still applies in proxy mode, and so does the content policy of whichever model provider you route to. Picking a model with a flexible fiction policy does not suspend either one.
| Model name (paste exactly) | Strengths on JanitorAI | Content policy notes |
|---|---|---|
| deepseek-v4-flash | Community favorite; best value for long chats | Flexible policy for fictional content |
| deepseek-v4-pro | Better long-chat consistency and recall | Same family, higher rate |
| glm-5 | Natural dialogue on a budget | Accommodates fiction |
| kimi-k2.6 | Long context; value pick | Accommodates fiction |
| grok-4.5 | Distinct voice; 500K context window | xAI policy permits mature fictional themes |
| claude-sonnet-4-6 | Best prose quality per dollar | SFW creative writing only per Anthropic policy |
| claude-opus-4-7 | Deepest characterization | SFW creative writing only |
| gemini-3.5-flash | Fast mid-tier all-rounder | Standard Google policy applies |
Test the key outside JanitorAI first
When a config fails, you have three suspects: the URL, the key, and the model name. JanitorAI's error surface is thin, so test all three at once with curl before touching the app again:
curl https://api.apisrouter.com/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [{"role": "user", "content": "Say ready."}],
"max_tokens": 20
}'Fixing 401, 404, and model not found
If the curl test returns a JSON completion, your URL, key, and model name are all valid, and the remaining problem lives inside JanitorAI: usually an unsaved config, a stale selected configuration, or a browser extension blocking the request. If curl fails, the status code tells you which field to fix.
| Error | Usual cause | Fix |
|---|---|---|
| 401 Unauthorized | Key pasted with a trailing space or line break, a revoked key, or the field silently cleared after an app update | Re-paste the key with no whitespace, confirm it starts with sk-, save the config again |
| 404 Not Found | Proxy URL stops at /v1 or has a typo in the path | Use the full endpoint ending in /chat/completions |
| Model not found / invalid model | Display name instead of ID, wrong casing, or a deprecated ID | Paste the exact lowercase ID, e.g. deepseek-v4-flash; verify against the /v1/models output above |
| Network error / no response | Config not saved, wrong config selected, or an ad blocker interfering | Re-save, hard-refresh, confirm the active config, try a clean browser profile |
| Response cuts off mid-sentence | Max new tokens set too low in JanitorAI generation settings | Raise max new tokens to 300 or more and regenerate |
What a month of chatting actually costs
JanitorAI resends the character card plus recent chat history with every message, so input tokens dominate the bill. A typical setup with a detailed card runs roughly 4,000 to 6,000 input tokens and 200 to 400 output tokens per message. The table assumes 5,000 in and 300 out across 1,000 messages, which is a heavy month for most users. Treat these as estimates: your card size and history depth move the numbers. These are APIsRouter catalog rates. APIsRouter is an OpenAI-compatible gateway with pay-as-you-go billing and no subscription; global models are listed at 20% off official pricing and Chinese models below official rates. There is no signup form: pay at the top-up page, the key arrives by email, and your first top-up adds a 100% balance bonus. That makes a $5 test of DeepSeek or GLM a months-long experiment rather than a monthly commitment.
| Model | Price per 1M tokens (in / out) | Est. cost per 1,000 messages |
|---|---|---|
| deepseek-v4-flash | $0.126 / $0.252 | ~$0.71 |
| deepseek-v4-pro | $0.3915 / $0.783 | ~$2.19 |
| glm-5 | $0.514 / $2.314 | ~$3.26 |
| gemini-3.5-flash | $1.20 / $7.20 | ~$8.16 |
| grok-4.5 | $1.60 / $4.80 | ~$9.44 |
| claude-sonnet-4-6 | $2.40 / $12.00 | ~$15.60 |
| claude-opus-4-7 | $4.00 / $20.00 | ~$26.00 |
| gpt-5.5 | $4.00 / $24.00 | ~$27.20 |
FAQ
What API does Janitor AI use?
By default JanitorAI runs on its built-in model. Proxy mode lets you connect any OpenAI-compatible chat completions API instead: you supply the full endpoint URL, an exact model ID, and an API key, and JanitorAI sends your chats there.
How do I get an API key for Janitor AI?
From any OpenAI-compatible provider. Keys typically look like sk- followed by a long string. The key goes in the API key field and is only ever sent to the proxy URL you configured. Some gateways skip account creation entirely: you pay first and the key arrives by email.
Why do I keep getting a 401 error on Janitor AI?
Almost always the key itself: a trailing space or line break from copy-paste, a revoked or exhausted key, or a config that silently lost the field. Re-paste with no whitespace and re-save. If a curl request with the same key succeeds, the key is fine and the saved config is stale.
What is the best model for Janitor AI roleplay?
Community consensus favors the DeepSeek V4 family: Flash for value, Pro for long-chat consistency. GLM-5 and Kimi K2.6 are strong budget picks. Claude writes the best prose but Anthropic policy prohibits explicit content, so it suits SFW creative chats only.
Does the custom prompt replace my character card?
No. It is an extra system-level instruction sent alongside the card on every message. Because it is resent constantly, keep it under a few sentences: formatting rules, response length, perspective. Long custom prompts inflate input costs and crowd out chat history.
Is using the Janitor AI API free?
The built-in model is free with queues at peak times. External APIs bill per token, but entry-level models cost a fraction of a cent per message, and some providers offer heavily rate-limited free tiers. For steady chatting, cheap pay-as-you-go models beat free tiers on reliability.