SillyTavern API setup: base URL, API key, and model list
Updated 2026-07-15
In SillyTavern, pick Chat Completion, set the source to Custom (OpenAI-compatible), paste a base URL that ends at /v1, and add your API key. The model dropdown then fills itself from the provider's /v1/models endpoint.
Quick answer: the five settings that matter
Open the API Connections panel (the plug icon) and set exactly this: API = Chat Completion. Chat Completion Source = Custom (OpenAI-compatible). Custom Endpoint (Base URL) = https://api.apisrouter.com/v1. Custom API Key = your sk-... key. Click Connect, wait for the green light, and pick a model from the dropdown, for example deepseek-v4-flash. The single most common failure is pasting the full path. SillyTavern appends /chat/completions to whatever you enter, so the URL must stop at /v1. If you paste https://api.apisrouter.com/v1/chat/completions, SillyTavern requests /v1/chat/completions/chat/completions and the connection fails with a 404. This is the opposite of JanitorAI, which wants the full completions URL in its proxy config. Same provider, different field conventions.
Why the SillyTavern API URL ends at /v1
Every OpenAI-compatible API is a base URL plus a set of fixed routes. GET /v1/models returns the list of model IDs your key can use. POST /v1/chat/completions runs the actual chat request. SillyTavern knows these routes and builds them itself, so it only asks you for the base. When you click Connect, it calls /v1/models with your key and uses the response to populate the model dropdown. An empty dropdown almost always means that call failed. You also need to pick the right API mode. Chat Completion sends structured messages with system, user, and assistant roles, which is what every hosted OpenAI-compatible provider expects. Text Completion sends one raw prompt string and exists mainly for local backends like KoboldCpp and text-generation-webui. For any hosted API key, use Chat Completion. If you select Text Completion against a hosted chat endpoint you will get errors or garbage formatting, and several samplers shown in that mode do not apply anyway.
Step-by-step setup
If the dropdown stays empty after Connect, recheck three things in order: the URL ends at /v1 with no trailing path and no trailing spaces, the key is pasted without quotes or whitespace, and the source is Custom (OpenAI-compatible) rather than plain OpenAI. The plain OpenAI source ignores your custom URL on some versions and talks to api.openai.com, where your key is invalid.
- Get a key. On APIsRouter there is no account form: pay at /topup and the key is emailed to you. Any OpenAI-compatible key works the same way in these steps.
- In SillyTavern, click the plug icon to open API Connections.
- Set API to Chat Completion.
- Set Chat Completion Source to Custom (OpenAI-compatible).
- In Custom Endpoint (Base URL), enter https://api.apisrouter.com/v1 with nothing after /v1.
- Paste your key into the Custom API Key field.
- Click Connect. The status dot turns green and the Available Models dropdown fills from /v1/models.
- Select a model, open a character card, and send a short test message.
Verify the connection outside SillyTavern
When something fails, test the endpoint directly before blaming SillyTavern. This curl call is exactly what the Connect button does. If it returns a JSON array of model IDs, your key and URL are fine and the problem is in the SillyTavern fields. If the model list works but chats fail, run one real completion from Python with the same base URL. A successful reply here proves the whole chain, and any error message you get back is the provider's real error rather than SillyTavern's generic one.
curl https://api.apisrouter.com/v1/models \
-H "Authorization: Bearer sk-your-key"Sampler and preset basics
Chat Completion sources expose a small sampler set: temperature, top P, frequency penalty, and presence penalty, plus response length and context size. Fancier samplers you may have read about (min P, mirostat, dynamic temperature) belong to Text Completion backends and are simply not sent to hosted chat APIs, so do not hunt for them here. Presets in SillyTavern bundle two things: sampler values and the prompt structure that the Prompt Manager assembles from your character card, persona, and lorebook. The built-in Default preset is a sane starting point. Change one value at a time and regenerate the same scene to see what it actually does. Context size deserves attention: SillyTavern fills the context window with chat history, so a larger context means more prompt tokens sent on every turn, which improves memory and raises per-message cost at the same time.
| Setting | Starting point | What it does in roleplay |
|---|---|---|
| Temperature | 0.8 | Higher (up to 1.1) gives varied prose; lower (0.6) if the character drifts off-card |
| Top P | 0.95 | Leave alone unless replies turn incoherent, then lower slightly |
| Frequency penalty | 0.1 | Fights repeated sentence rhythms in long chats |
| Presence penalty | 0.05 | Small values discourage topic looping |
| Max response tokens | 350 | 300 to 500 fits paragraph-style replies without rambling |
| Context size | Model limit or 16k | More history per turn; also more input tokens billed per message |
Recommended models for SillyTavern
Model choice matters more than sampler tuning. Community consensus, as far as approximate reports go, puts the DeepSeek V4 family first for the price: deepseek-v4-flash is the default recommendation for long chats and deepseek-v4-pro holds complex cards and group chats together better. GLM-5, Kimi K2.6, and MiMo are solid value picks with distinct prose voices, worth rotating when a chat starts feeling samey. Grok is notable because xAI's published policy explicitly permits mature themes in fictional settings, which matters for darker storylines. Claude writes the best prose of anything on this list but Anthropic's policy prohibits explicit content, so treat Claude as the pick for SFW creative writing and literary-style scenes. Two practical notes. First, SillyTavern is software aimed at adults, and every model here enforces its own provider's content policy regardless of your frontend, so keep cards and scenes within those rules. Second, because the dropdown is populated live from /v1/models, you can switch models mid-chat and compare replies to the same message, which is the fastest way to find your own favorite.
| Model ID | Strength in SillyTavern | Content policy notes |
|---|---|---|
| deepseek-v4-flash | Community favorite for long chats; best value per message | Flexible policy for fiction; follows character cards well |
| deepseek-v4-pro | Stronger instruction-following for complex cards and group chats | Same family as Flash with better coherence |
| glm-5 | Distinct prose voice; good pacing in slow scenes | Value pick for narrative-heavy chats |
| kimi-k2.6 | Long-context recall for big lorebooks | Value pick; handles large cards without forgetting |
| grok-4.5 | Strong improvisation and banter | xAI policy permits mature themes in fictional settings |
| claude-sonnet-4-6 | Highest prose quality for the money | SFW creative writing only; Anthropic prohibits explicit content |
| claude-opus-4-7 | Best long-form literary writing | Same SFW-only policy as Sonnet |
| gemini-3.5-flash | Fast replies, long context | Standard Google policy; good for adventure-style RP |
What SillyTavern chats actually cost
Hosted models bill per token, and roleplay is input-heavy: every turn resends the character card plus recent history. A turn that sends 8,000 prompt tokens and gets a 350-token reply costs about a tenth of a cent on deepseek-v4-flash, so a few dollars covers months of casual chatting. The same turn on claude-opus-4-7 costs roughly 25 times more, which is why most people run a cheap daily driver and save premium models for scenes they care about. One gateway key covers this whole table. APIsRouter is an OpenAI-compatible gateway with pay-as-you-go billing and no subscription: you pay at /topup without creating an account, the key arrives by email, your first top-up adds a matching +100% to your balance, global models are priced 20% below official rates, and Chinese models sit under their official prices.
| Model | Input / 1M tokens | Output / 1M tokens |
|---|---|---|
| deepseek-v4-flash | $0.126 | $0.252 |
| deepseek-v4-pro | $0.3915 | $0.783 |
| glm-5 | $0.514 | $2.314 |
| gemini-3.5-flash | $1.20 | $7.20 |
| claude-sonnet-4-6 | $2.40 | $12.00 |
| claude-opus-4-7 | $4.00 | $20.00 |
| gpt-5.5 | $4.00 | $24.00 |
| grok-4.5 | $1.60 | $4.80 |
FAQ
What API URL do I put in SillyTavern?
The base URL only, ending at /v1. For APIsRouter that is https://api.apisrouter.com/v1. SillyTavern appends /chat/completions itself, so entering the full completions path breaks the connection with a 404.
Is there a free API for SillyTavern?
SillyTavern itself is free open-source software. Hosted model access bills per token, though some providers offer free tiers with tight rate limits and queues. Running a local model through KoboldCpp is free if your hardware can handle it. In practice, budget hosted models like deepseek-v4-flash cost a fraction of a cent per message, which is close enough to free for casual use without the rate-limit pain.
Why is my SillyTavern model list empty?
The Connect call to /v1/models failed. Check that the URL ends at /v1 with no extra path or spaces, the key is pasted clean, and the source is Custom (OpenAI-compatible) rather than plain OpenAI. Test with curl against /v1/models to see the provider's real error.
Should I use Chat Completion or Text Completion in SillyTavern?
Chat Completion for any hosted OpenAI-compatible API. Text Completion is for local backends like KoboldCpp and text-generation-webui that take a raw prompt string. Picking Text Completion against a hosted chat endpoint causes errors or broken formatting.
Which model is best for roleplay in SillyTavern?
Start with deepseek-v4-flash, the common community default for long chats at low cost. Move to deepseek-v4-pro for complex cards, try GLM-5 or Kimi K2.6 for a different prose voice, and use Claude for the highest-quality SFW creative writing. Grok suits mature fictional themes under xAI's published policy.
Is my API key safe in SillyTavern?
Keys are stored locally in SillyTavern's secrets.json on your machine and are only sent to the API host you configured. Do not share screenshots of the connection panel or exported settings files, and rotate the key if you suspect it leaked.