How to Use DeepSeek API with SillyTavern

OpenAI-compatible endpoint setup — plug in and chat.

Third-Party Gateway

SillyTavern supports any OpenAI-compatible API endpoint. If you have a DeepSeek-compatible gateway key, here is how to connect it — step by step.

1. Open API Connections

In SillyTavern

  1. Click the plug icon (API Connections) in the top bar.
  2. Select Chat Completion from the API dropdown.
  3. Choose OpenAI as the API type (or "Custom" / "OpenAI-compatible" depending on your version).

2. Configure the Endpoint

Fill in these fields

SettingValue
API Base URLhttps://modelrelayapis.cc/v1
API Keysk-gateway-xxxxxxxx... (provided by admin)
Modeldeepseek-v4-flash
StreamingEnabled ✓

Important: The base URL must end with /v1. SillyTavern appends /chat/completions automatically. If you forget /v1, requests will go to the wrong path and you will get 404 Not Found.

3. Model Name

Use exactly: deepseek-v4-flash

Do not add prefixes like openai/ or text-. Just the bare model ID.

Available models on this gateway:

4. Test the Connection

Click Connect or send a test message in your chat. If everything is configured correctly, you should get a response within 2-5 seconds.

5. Common Errors and Fixes

401 Unauthorized

Problem: Invalid or missing API key.

Fix: Check that your sk-gateway-... key is copied correctly — no extra spaces, no missing characters. Contact your admin if the key is new and still failing.

404 Not Found

Problem: The path does not exist.

Fix: Make sure your Base URL ends with /v1. SillyTavern will call /v1/chat/completions. If your URL is just http://IP without /v1, it will call the wrong path.

402 Payment Required / Token Quota Exceeded

Problem: Your key has used all allocated tokens.

Fix: Contact your admin to add more tokens. This is a per-key quota — each key has a set number of tokens and stops when exhausted.

429 Too Many Requests

Problem: You exceeded the rate limit (default: 30 requests per minute).

Fix: Wait 60 seconds and try again. Reduce auto-retry frequency in SillyTavern settings.

5xx Server Error

Problem: The gateway or upstream DeepSeek service is temporarily unavailable.

Fix: Wait 1-2 minutes and retry. If it persists for more than 5 minutes, contact your admin.

6. About Streaming

Streaming (SSE) is supported. Characters in SillyTavern will appear token-by-token as they are generated. If streaming seems broken, check that the Streaming toggle is enabled in your API connection settings and that your character card does not have excessive prefill length.

Reasoning Content

This gateway filters reasoning_content by default. You only receive the final content field — exactly what SillyTavern expects. No stray thinking tokens in your character replies.

Need an API Key?

Buy a package and get your API key instantly after PayPal payment.
选择套餐并通过 PayPal 付款后,系统会自动生成你的 API Key。

This is a third-party API gateway. Not affiliated with DeepSeek. OpenAI-compatible endpoint.

View Plans & Buy
Get Your API Key — From $1

Plans start at $1 for 2M tokens. Instant delivery after PayPal payment.