EN ▾
Get API key

SillyTavern API: connect an OpenAI-compatible model

To use SillyTavern with an OpenAI-compatible API, you need a URL, a key, and a model name. Here are the steps, context settings, and errors to know.

Everything about Uncensored AI: Usage, Integration, and Limits

Updated

Key points
  • Base URL to enter: https://api.apiiasanscensure.com/v1, uncensored model.
  • Max context of 100,000 tokens, but a shorter context reduces the cost per message.
  • A message with 16,000 tokens of context and 400 of response costs about $0.0026.
  • 401, 404, and 429 errors almost always have a simple cause to fix.
Theater scene with masks and glowing bubbles connected by a cable to a server, symbolizing roleplay via API

What you need on hand

The search for sillytavern api often leads to tutorials for local backends. Here, you connect to a hosted API that speaks the OpenAI format. SillyTavern can connect to it, as it offers a chat completion mode with a custom OpenAI source. Three pieces of information are enough:

  • the base URL: https://api.apiiasanscensure.com/v1
  • an API key, created on the get API key page
  • the model name: uncensored

The model is a text model configured to respond without content refusal for legal adult use, which suits fiction and roleplay well. It does not generate images: if you want avatars or backgrounds, you will need another tool. And the rule does not change, any sexual content involving minors is excluded.

Connection steps

The labels in the SillyTavern interface change from version to version. Here is the general logic, to be compared with your version and the official tool documentation if a label differs.

  1. Open the API connection panel (the plug icon at the top).
  2. Choose the "Chat Completion" API type.
  3. In the source, select the custom, OpenAI-compatible option.
  4. Paste the base URL, without adding anything after /v1. The tool adds /chat/completions itself.
  5. Paste the API key into the designated field.
  6. Enter the model identifier, uncensored, manually if it does not appear in the list.
  7. Use the connect or test button, then verify that the status turns green.

Before diving into SillyTavern, you can validate the key and URL with a simple call, to rule out an input problem right away:

curl https://api.apiiasanscensure.com/v1/models   -H "Authorization: Bearer VOTRE_CLE"

If this command returns the list of models, the key and address are correct. A full generation test is done with /v1/chat/completions, described in the documentation.

Context, response length, and cost per message

The model accepts up to 100,000 tokens per request, including prompt and response. This is not a reason to max it out. SillyTavern returns the character sheet, instructions, and recent history with every message, and all of this is billed as input each time.

Let's take a context filled to 16,000 tokens and a response of 400 tokens, at a rate of $0.15 per million for input and $0.50 per million for output:

  • Input: 16,000 × 0.15 / 1,000,000 = $0.0024
  • Output: 400 × 0.50 / 1,000,000 = $0.0002
  • Total: $0.0026 per message, or $0.26 for 100 messages

With an 8,000-token context, you get $0.0012 + $0.0002 = $0.0014 per message. The $0.50 free trial credit then allows about 357 messages, compared to about 192 with a 16,000-token context. Choose between long context and low cost.

Reasonable starting settings: context between 8,000 and 16,000 tokens, response length of 300 to 500 tokens, temperature around 0.9 for lively storytelling. Repetition penalties are passed to the API, and the seed parameter as well if you want to reproduce a response. The max_tokens field remains optional on the API side, but setting a limit avoids endless responses.

Streaming and concurrency

Enable streaming in SillyTavern to see the text appear in real time. The server sends tokens via SSE and reports usage at the end of the stream. One detail matters: a streaming request holds its concurrency slot until the stream closes.

A free trial credit allows 2 concurrent requests and 60 per minute. A full key allows 8 concurrent and 300 per minute. In a group chat, SillyTavern can trigger multiple character responses in sequence, or even in parallel depending on your settings. If you see refusals, that is the first thing to check.

Common errors and fixes

SymptomProbable causeCorrection
401, invalid API keyKey copied incorrectly, extra space, key deletedPaste the key again, regenerate if needed
404 or page not foundURL missing /v1, or with an extra pathUse the exact base URL provided
Model not foundModel name differs from uncensoredEnter the ID manually
429 rate_limitedToo many requests per minuteSpace out messages, switch to a standard key
429 concurrencyToo many simultaneous requestsDisable parallel group requests
429 with Retry-After: 5Temporary overloadWait 5 seconds and retry
Insufficient balanceCredit exhausted or trial expiredTop up from the pricing page

To track spending during a long session, the X-Balance-USD header and the GET /v1/balance endpoint show the live balance. Failed or rejected requests are not charged.

Keep a lightweight context without losing the thread

The cost of a long session comes almost entirely from the input. A few habits lighten it without harming the story:

  • Compact character sheet. A well-written 400-token description is better than a 2,000-token one full of repetitions. It is sent with every message.
  • Regular summaries. When the history exceeds the desired size, summarize the first 30 exchanges into a paragraph and remove them from the active context.
  • Few dialogue examples. Two or three are enough to set the style.
  • Keyword-triggered lore entries rather than always present, if your tool version supports this feature.

Let's calculate the effect: if these measures reduce the average context from 16,000 to 6,000 tokens, the input drops to 6,000 × 0.15 / 1,000,000 = $0.0009 and the full message to $0.0009 + $0.0002 = $0.0011. Over 1,000 messages, you go from $2.60 to $1.10. The difference remains modest at small scale, but becomes real for an application with many users.

One last framing point: the model does not refuse dark scenarios by principle, so the tone depends mostly on your sheet and instructions. If you share your characters or open a service to others, it is up to you to limit access to adults. The site also offers a guide on uncensored AI to understand what the service allows.

Pay and keep control of the budget

The service works on a pay as you go basis, with no subscription. New users can claim $0.50 of trial credit with one click, valid for 7 days, without a payment method. After that, top up is done in full amounts from $20 to $500, in crypto (USDT on TRC20 or USDC on Base), with a 5% bonus from $50, 10% from $100 and 15% from $200. The credit never expires. Details are on the pricing page.

With $20 and a message costing $0.0026, you have about 7,692 messages ($20 / $0.0026). A reasonable context and measured response lengths therefore make a small budget last a long time. The prompts are not used to train the model.

Other guides

Frequently asked questions

What URL to enter in SillyTavern?

https://api.apiiasanscensure.com/v1, without an extra path. The tool adds the chat completion route itself.

What model name to use?

uncensored. If the dropdown does not offer it, type it manually.

Can I generate images from SillyTavern with this API?

No. The API handles text only, no image, audio or video.

Why do I get 429 errors in group chat?

Multiple responses launched simultaneously exceed the concurrent requests limit. A trial key allows 2, a full key 8.

Your key is one step away

Create an account, copy the key, modify the base URL. That's it.

Get API keyRead documentation