EN ▾
Uncensored text API for media pipelineswannsfw.cc

Updated

SillyTavern: How to Use It With an OpenAI-Compatible API

SillyTavern how to use, in one paragraph: install it locally, open API Connections, pick Chat Completion with the Custom (OpenAI-compatible) source, paste a base URL and key, and set the model name. The rest of this page covers each step and the fixes for common errors.

Patch cable plugged into a glowing chat window, illustrating a SillyTavern connection to an API

Key points

  • SillyTavern runs on your machine and talks to any OpenAI-compatible endpoint.
  • Settings: Chat Completion, Custom source, base URL https://api.wannsfw.cc/v1, model uncensored.
  • Context size and reply length control cost more than any other setting.
  • For fiction and roleplay among lawful adults only; no content involving minors.

What SillyTavern is and what it needs

SillyTavern is a local web interface for chatting with language models, built around characters, personas and long-running stories. It does not contain a model. It sends your messages to a backend of your choice and shows the replies, which is why it needs an API.

This site provides one: a hosted, OpenAI-compatible text API. The model behind it is a single open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not an official API from any model vendor. The endpoints are POST /v1/chat/completions and GET /v1/models, and that is all SillyTavern needs. The docs cover the same endpoints for scripts.

You need three things: Node.js on your computer, a SillyTavern download, and an API key from the API key page. New users can claim $0.50 of trial credit there, valid for 7 days, without paying anything.

Install and start

Follow the project's own install instructions, because they change between releases. The usual path is: install a current LTS version of Node.js, download or clone the SillyTavern repository, then run the start script for your system. It launches a local server and prints an address. Open that address in your browser. The default is a localhost URL on port 8000 unless you changed it.

Keep SillyTavern bound to your own machine unless you know how to secure it. It stores your chats and your API key in plain files in its data folder, so treat that folder like a password store and include it in your backups.

Connect the API in six steps

  1. Click the plug icon at the top to open API Connections.
  2. Set API to Chat Completion.
  3. Set Chat Completion Source to Custom (OpenAI-compatible).
  4. In the endpoint field, enter https://api.wannsfw.cc/v1.
  5. Paste your key into the API key field and type uncensored as the model ID.
  6. Press Connect. When the status turns green, send a short test message.

The authentication header SillyTavern sends is Authorization: Bearer your-key, which is exactly what the API expects. If the connection fails, take SillyTavern out of the picture and test the same values with curl:

curl https://api.wannsfw.cc/v1/models \
  -H "Authorization: Bearer $API_KEY"

curl https://api.wannsfw.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"user","content":"Say ok."}],"max_tokens":10}'

If both calls succeed, the key and URL are fine and the problem is a typo in a SillyTavern field. If the first call returns an authorization error, the key is wrong or has stray whitespace.

Set up a character and a first chat

Characters in SillyTavern are files you create or import: a name, a description, a first message and optional example dialogue. Create one with the plus button in the character panel, or import a PNG or JSON file from a community site. Check any imported file before you chat. Descriptions are free text, and you are the one paying for every token in them.

Write the description in plain sentences about personality, speech style and setting. Add two or three example exchanges that show the voice you want. Skip long lists of rules; the model follows a clear voice better than a page of prohibitions. Then add a persona, which is who you are in the story, and start chatting.

Use this API for fiction, roleplay and companion-style chats among adults. The hard limit is that nothing sexual involving minors is allowed, and the model will not produce it. Keep every character an adult.

Settings that change quality and cost

Open the AI Response Configuration panel (the sliders icon). Four settings matter most.

  • Context size. The API supports up to 100,000 tokens of prompt plus completion. A setting of 16,000 to 32,000 tokens is a practical range for chats: long enough for memory, cheap enough to run all evening.
  • Max response length. 250 to 400 tokens gives paragraph-sized replies. The API does not require a limit, so set one yourself to keep pacing and cost predictable.
  • Temperature and top_p. Around 0.8 to 1.0 temperature with a top_p of 0.9 to 0.95 suits creative writing. These and the repetition penalties are passed through to the model.
  • Streaming. Turn it on. You see words as they arrive, and the API sends usage at the end of the stream.

Lorebooks (World Info) let you store facts about places and people and inject them only when keywords appear. They are the best way to keep a big world consistent without keeping all of it in every prompt.

Group chats, extensions and upkeep

Two features multiply your request count without you noticing. Group chats make several characters reply in turn, so one of your messages can trigger several calls. Swipes, the button that regenerates a reply, send a fresh request each time. Add extensions that summarise or caption in the background, and a quiet chat can produce a stream of requests.

That is fine on a full key, which allows 8 concurrent requests and 300 per minute. On a trial key, which allows 2 concurrent and 60 per minute, it explains most surprise 429 errors. Turn off background extensions while you test, and let each reply finish before you swipe.

Summarisation extensions are worth keeping once you are on a full key. They compress older messages into a short note, which keeps the prompt small. Smaller prompts mean lower cost, because input tokens are billed at $0.15 per 1M, and they also help the model stay on topic.

Back up, update and stay in control

Your characters, personas and chats live in SillyTavern's data folder. Copy it somewhere safe on a schedule, because a bad update or a disk failure takes your stories with it. Before you update the app, read its release notes, since settings sometimes move or get renamed. If a menu in this article does not match what you see, look for the same idea under a nearby label.

Rotate your API key if you ever paste it into a place you did not mean to, such as a screenshot or a shared config file. The balance shows up in the X-Balance-USD response header, and you can watch it from a script if you want an alert before credit runs out.

Fix common errors

SymptomLikely causeFix
401 or authorization errorWrong or truncated keyCopy the key again from the API key page and paste without spaces.
404 or model not foundWrong URL path or model nameUse the base URL ending in /v1 and the model name uncensored.
429 with code concurrencyToo many requests at onceWait for the current stream to finish before regenerating. A trial key allows 2 concurrent requests, a full key 8.
429 with code rate_limitedOver 60 (trial) or 300 (full) requests per minuteSlow down, or turn off extensions that call the API in the background.
429 with Retry-After: 5Temporary overloadRetry after five seconds.
Replies cut shortMax response length too lowRaise it to 400 or more.

A streamed request holds its concurrency slot until the stream ends, which is why rapid swipes on a trial key trigger the concurrency error.

What a session costs

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, billed from prepaid credit. Take a chat that sends 12,000 tokens of prompt per turn and receives 350 tokens back. Input costs 12,000 x $0.15 / 1,000,000 = $0.0018. Output costs 350 x $0.50 / 1,000,000 = $0.000175. One turn is about $0.002, so a 200-turn evening costs about $0.39 (200 x $0.001975 = $0.395).

That means the $0.50 trial credit covers roughly one such evening. After the trial you top up with any whole amount from $20 to $500, with +5% from $50, +10% from $100 and +15% from $200. This site takes crypto only: USDT on TRC20 or USDC on Base. Credit never expires and failed or refused requests are not charged. The pricing page has the full table. For a wider look at this kind of API, see the uncensored text generation overview. Prompts are not used for training.

Questions and answers

Do I need to pay to try SillyTavern with this API?

SillyTavern itself is free software you run yourself. The API has a one-time $0.50 trial credit, claimed with one click on the API key page, valid for 7 days. After that, top-ups start at $20.

Which source do I pick in the Chat Completion menu?

Pick the Custom (OpenAI-compatible) source, then enter the base URL, your API key and the model name uncensored. Menu labels can change between versions.

Why does it say the model is not found?

The model field must be exactly uncensored. A typo, or a leftover model name from another source, is the usual cause. You can list valid names with GET /v1/models.

Can I use text completion mode instead?

This API exposes chat completions and a model list. Use the Chat Completion API type in SillyTavern, not the older text completion modes.

Your key is one form away

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

Get API key