EN ▾
Get API key

Best API Settings for Janitor AI (Proxy Setup)

Janitor AI can talk to any OpenAI-compatible endpoint through its proxy option. This page lists the values to enter and the generation settings that work well for long roleplay chats.

Updated

Isometric illustration of a chat window linked to an API server with settings sliders

Key points

  • Use the proxy option in Janitor AI and enter the API URL, the key and the model name uncensored.
  • Start with temperature 0.8 to 0.9 and a context size well under the 100,000-token window.
  • Long chats cost more per message because the whole history is sent each time; at these prices a turn is a fraction of a cent.
  • Errors 401, 404 and 429 each have a short fix, listed below.

The short answer: what to enter

If you are looking for the best api setting janitor ai users can copy, it comes down to four fields and two sliders. Janitor AI has an option for a custom OpenAI-style connection, usually called a proxy. You give it three values and then tune how the model writes.

FieldValue
API URLhttps://api.openainsfw.top/v1 (if the field rejects it, add /chat/completions at the end)
API keyThe key from your account page, sent as a Bearer token
Model nameuncensored
Temperature0.8 to 0.9 for roleplay, 0.6 for stricter answers
Max new tokens300 to 600 per reply
Context size8,000 to 16,000 tokens to begin with

The menu names inside Janitor AI change from time to time, so look for the section that lets you add a proxy or a custom API rather than the built-in model list. Everything below explains why these values are good defaults and what to change when something feels off.

Get a key first

You need an account before you can paste anything into Janitor AI. Sign-up works with Google or with an email and password. After that, the API key page has a one-click button for the trial credit: $0.50, valid for 7 days, no payment needed, one per person. See how to get an API key for the exact steps.

The trial key is limited to 2 concurrent requests and 60 requests per minute. For a single chat window that is plenty, since you send one message at a time and wait for the answer. A full key raises the limits to 8 concurrent requests and 300 per minute, which matters only if you run several chats or a bot at once.

Keep the key private. Janitor AI stores it in your browser or account settings so it can call the API on your behalf, and anyone who has the string can spend your credit. If you think it leaked, create a new one and replace it in the proxy settings.

Test the endpoint before touching Janitor AI

A bad URL or key is the most common reason a chat fails, and the Janitor AI error messages are short. Check the connection from a terminal first so you know the key and model name work. This also tells you the real error text if something is wrong.

curl https://api.openainsfw.top/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Say hello in one sentence."}],
    "max_tokens": 50
  }'

You can also list the available model with GET /v1/models. The list contains the one ID you need, uncensored. If curl returns a normal JSON reply, any failure in Janitor AI is a typing or formatting issue in the proxy form, not the account.

curl https://api.openainsfw.top/v1/models \
  -H "Authorization: Bearer YOUR_KEY"

Generation settings that suit roleplay

Temperature and top_p

Temperature controls how adventurous the word choice is. Around 0.8 to 0.9 gives varied, lively replies without drifting off topic. Go down to 0.6 or 0.7 if the character keeps inventing facts or breaks the scene. Go up toward 1.0 when replies feel flat and repetitive. Change one slider at a time and give each setting at least five or six messages, because a single reply tells you very little.

The API passes through top_p as well. A common habit is to move either temperature or top_p, not both, because they both widen or narrow the pool of likely words. If you already raised temperature, leave top_p at 1.0 or close to it.

Max new tokens

This caps the length of one reply. A cap of 300 gives short, snappy turns, and 600 allows a longer scene paragraph. The API does not require max_tokens, so a missing value lets the answer use whatever room is left in the context window. In a chat app you usually want a cap anyway, otherwise one reply can run on for pages. You pay for output tokens, so a lower cap also keeps costs down.

Repetition penalties

The frequency and presence penalties are passed through to the model. Small values such as 0.2 to 0.5 can reduce the loops where a character repeats the same phrase every turn. Large values make the writing strange, so raise them slowly. Temperature is usually the first thing to try, and the penalties come second.

Context size and what long chats cost

The model has a 100,000-token context window, counting the prompt and the reply together. That is far more than a chat needs, and filling it is slow and expensive. Janitor AI sends the character description, your persona, the scenario and as much recent history as fits your context size, on every single message.

That is why a long chat costs more per turn than a new one. Here is a worked example with the real prices of $0.15 per 1M input tokens and $0.50 per 1M output tokens:

  • Input: 8,000 tokens. 8,000 / 1,000,000 x $0.15 = $0.0012.
  • Output: 400 tokens. 400 / 1,000,000 x $0.50 = $0.0002.
  • Total for one turn: $0.0014.
  • One thousand turns like this: $1.40.

Now raise the context size to 32,000 tokens with the same 400-token reply. Input is 32,000 / 1,000,000 x $0.15 = $0.0048, output is still $0.0002, so a turn costs $0.0050 and a thousand turns cost $5.00. The reply is the same length, but the bill is more than three times higher. Start with 8,000 to 16,000 tokens and only raise it if the character forgets things you care about.

The full price table is on the pricing page. Credit is prepaid, there is no subscription, it never expires, and failed or refused requests are not charged.

Fixing common errors

SymptomLikely causeFix
401 or an authentication messageWrong or truncated key, extra spaceCopy the key again and paste it without spaces or quotes
404 or "model not found"Model name typed differentlyUse exactly uncensored, lowercase
404 on the URL itselfMissing or doubled pathTry the base URL, then the base URL plus /chat/completions, never both parts twice
429 with rate_limitedMore than the allowed requests per minuteWait a few seconds; avoid hitting regenerate repeatedly
429 with concurrencyToo many requests running at onceClose extra chat tabs; a trial key allows 2 at a time
429 with a short waitTemporary overloadRetry after about 5 seconds
Empty or cut-off replyMax new tokens too lowRaise the cap to 500 or more

A streamed reply holds its concurrency slot until the stream ends. If you close a tab in the middle of a reply, the slot may stay busy for a moment, so a quick retry can show a concurrency error. Waiting a few seconds clears it. The documentation lists the response headers, including the remaining balance, which you can read if you test with curl.

Character setup tips that help the model

Settings only go so far. Much of what makes a chat good is the text you give the model. A few habits make a difference with any open-weight model.

  • Write the character description in plain sentences, in the same person and tense you want in the replies.
  • Put the important rules first: tone, length, and what the character must never do. Models weight the start of the prompt heavily.
  • Give two or three short example lines of dialogue instead of a long list of adjectives.
  • Keep the scenario field short. A tight 300-word setup beats a 3,000-word one, and it saves input tokens on every turn.

The model is tuned to answer without content refusals for lawful adult use, so you do not have to write elaborate workarounds into the prompt. One rule stays fixed: no sexual content involving minors, and the service does not allow it. Characters must be adults, and the model will not write otherwise.

Janitor AI users often ask whether the endpoint keeps their chats. Prompts sent to this API are not used for training. Janitor AI itself has its own storage and privacy rules, so read those separately.

Questions and answers

What model name do I enter in Janitor AI?

Enter uncensored, in lowercase. It is the only model ID on this API, and GET /v1/models returns it.

Which temperature is best for roleplay?

Start at 0.8 to 0.9. Lower it to about 0.6 if the character invents facts or loses the scene, and raise it slightly if the replies feel repetitive.

How much does a Janitor AI chat cost on this API?

A turn with 8,000 input tokens and a 400-token reply costs $0.0014, so 1,000 turns cost about $1.40. Larger context sizes raise the cost because the history is sent every time.

Can I try it without paying?

Yes. After sign-up you can claim $0.50 of trial credit with one click on the API key page. It is valid for 7 days and needs no payment.

Why do I get a 429 error in the middle of a chat?

You went over the request or concurrency limit, or the service was briefly overloaded. Wait about 5 seconds and send again.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key