Updated
DeepSeek API Key in SillyTavern: Connect Our API
SillyTavern can talk to any OpenAI-compatible endpoint through its Custom source. This guide shows the fields to fill, sensible context settings for long roleplay, and what each chat costs.

Quick setup
For a deepseek api key sillytavern setup, one clarification first. A key issued by DeepSeek's own platform is for DeepSeek's endpoint. The key you get on this site belongs to a separate service: an independent, OpenAI-compatible API running one open-weight model, tuned to answer without content refusals for lawful adult use. It is not DeepSeek's official API, so use this site's key only with this site's base URL.
The values to enter in SillyTavern are:
- Source: Chat Completion, then Custom (OpenAI-compatible)
- Custom endpoint (base URL):
https://api.deepseekapikey.com/v1 - API key: the key from your account
- Model ID:
uncensored
SillyTavern updates often and menu labels can shift slightly between releases, so match by meaning if a name differs. The rest of this page walks through each step and the settings that matter for long character chats.
Step by step in the interface
- Get a key. Sign up on the API key page with Google or with email and password. New users can claim $0.50 of trial credit with one click, valid for 7 days, one per person, without a card.
- Open the API connection panel. In SillyTavern, click the plug icon at the top to open API Connections.
- Select the API type. Pick Chat Completion from the API dropdown. The text completion modes are meant for backends that take raw prompts; this API uses chat messages.
- Select the source. In the Chat Completion Source list, choose Custom (OpenAI-compatible).
- Enter the endpoint. Paste
https://api.deepseekapikey.com/v1into the custom endpoint field. SillyTavern adds the chat completions path on its own, so leave it off. If you get a 404 later, try the full path as a second attempt. - Enter the key. Paste the key into the custom API key field.
- Enter the model. Type
uncensoredinto the model ID field. If a model dropdown loads from theGET /v1/modelsendpoint, you can choose it from there. - Connect. Press Connect. A green status and the model name mean the call succeeded. Send a message to a character to confirm.
If Connect fails, test outside SillyTavern in a terminal. This isolates the problem:
curl https://api.deepseekapikey.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "uncensored", "messages": [{"role": "user", "content": "Reply with the word ready."}], "max_tokens": 10}'
A normal JSON reply means the key and URL are valid and the problem is in the SillyTavern fields. The quickstart lists more examples.
Context size and response length
This is where roleplay setups either work well or waste money. The model has a 100,000-token context window, counting the prompt and the reply together. SillyTavern has its own Context Size slider in the sampling settings, which controls how much of the history and character data it packs into each request.
You can set it as high as 100,000, but think about what that means. SillyTavern builds the full prompt every turn: system prompt, character card, lorebook entries, persona, then as much chat history as fits. A bigger setting means the model sees more of the past, and you pay for every one of those tokens again on each message.
A practical way to choose:
- 8,000 to 16,000 tokens: short scenes and quick chats. Cheap and fast.
- 30,000 to 50,000 tokens: a long story with a detailed character card and lorebook. Good for most users.
- Up to 100,000 tokens: large lorebooks or very long continuous stories. Leave a margin so that the prompt plus the reply stays under the window.
For response length, set Max Response Length to 300 to 600 tokens for a typical roleplay reply. The max tokens parameter is optional in the API, but SillyTavern sends a value, and a limit stops an overlong reply from running up the bill. Turn on the streaming option so that text appears as it is generated; the API supports server-sent events with stream: true.
Passing the penalties and sampling values works as the interface suggests. Temperature, Top P, frequency penalty and presence penalty are sent to the model, and stop sequences and a fixed seed are passed through as well. Start with temperature around 0.8 and adjust: lower if the character loses track of facts, higher if replies feel repetitive.
What roleplay costs
The price is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Input dominates because of the resent history. Worked examples, with a 400-token reply each time:
| Prompt size | Input cost | Output cost (400 tokens) | Per message | 100 messages |
|---|---|---|---|---|
| 8,000 tokens | $0.0012 | $0.0002 | $0.0014 | $0.14 |
| 20,000 tokens | $0.0030 | $0.0002 | $0.0032 | $0.32 |
| 50,000 tokens | $0.0075 | $0.0002 | $0.0077 | $0.77 |
| 100,000 tokens | $0.0150 | $0.0002 | $0.0152 | $1.52 |
Check one row: 20,000 / 1,000,000 x $0.15 = $0.003, and 400 / 1,000,000 x $0.50 = $0.0002, which gives $0.0032. At that size the $0.50 trial credit covers roughly 156 messages. Failed or refused requests are not charged, so retries after an error do not add to the bill. Swipes and regenerations do count, because each one is a new completed request.
Credit is prepaid, never expires, and there is no subscription. Top up any whole amount from $20 to $500, with +5% from $50, +10% from $100 and +15% from $200. For example, $100 credits $110. You can pay by crypto (USDT on TRC20, USDC on Base). The pricing page has the current list.
Group chats, swipes and rate limits
SillyTavern can send several requests close together: group chats where multiple characters reply in sequence, swipes, and extensions that summarize or generate side content. A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 concurrent and 60 per minute.
If you see an error with code concurrency, too many requests were running at once. Wait for the current stream to finish before swiping again, because a streamed request keeps its slot until the stream ends. An error with code rate_limited means too many per minute. A 429 that comes with a Retry-After: 5 header is temporary overload and clears quickly.
For long stories, consider the summarize extension or lorebook entries to carry facts forward, so you can keep the context size lower. A short summary of earlier events at the top of the prompt costs far less than keeping fifty thousand tokens of raw history.
Fixing common problems
Connect says unauthorized
The key is wrong, has a space at the end, or comes from another service. A key issued by DeepSeek's platform does not work with this base URL.
Connect says not found
Check the endpoint spelling. It should end in /v1 in the common setup. Some builds expect the full chat completions path, so if the short form fails, try https://api.deepseekapikey.com/v1/chat/completions.
Replies are short or cut off
Raise Max Response Length. If the cut-off happens only on long chats, your prompt may be near the window limit; lower the Context Size a little so there is room for the reply.
The character forgets earlier events
That is the context setting at work. Raise it, or move key facts into the character card, persona or a lorebook entry so they stay in every prompt.
The reply gets rejected
The model is tuned to avoid content refusals for lawful adult use, but one rule does not move: no sexual content involving minors. Characters and scenarios in that area are refused. The service is text only, so image generation in SillyTavern needs a different backend.
Prompts sent through the API are not used for training. Your chat files stay in SillyTavern's data folder on your machine unless you move them. If you want the background on how this service differs from DeepSeek's own, see DeepSeek API: myths vs. facts.
More guides
Questions and answers
Can I use a DeepSeek-issued key in SillyTavern with this setup?
No. Keys only work with the service that issued them. For a DeepSeek key, use DeepSeek's own endpoint; for this site's key, use https://api.deepseekapikey.com/v1.
Which source do I pick in SillyTavern?
Pick Chat Completion, then Custom (OpenAI-compatible). Enter the base URL, your key and the model ID uncensored.
How large can the context be?
The window is 100,000 tokens for prompt and reply together. A higher setting costs more per message, since the history is resent every turn.
Is streaming supported?
Yes. Streaming runs over server-sent events, and you can turn it on in SillyTavern. A streamed request holds its concurrency slot until it ends.
How can I test it for free?
New users can claim $0.50 of trial credit with one click on the API key page after sign-up. It lasts 7 days and needs no card.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.