EN ▾
Get API key
Get API key

SillyTavern API Not Working: Custom Endpoint Fixes

When the sillytavern api not working message appears after you add a custom endpoint, the cause is almost always one of five things: the URL, the key, the model ID, the wrong API type, or a rate limit. Work through them in order and test with curl first.

Updated:

A pipeline from chat window to server with one repaired connection, illustrating endpoint troubleshooting
Glowing dice, data streams and a light chest on a folding screen, representing roleplay API features

Key points

  • Test the endpoint and key with curl before touching SillyTavern settings.
  • Use the Chat Completion API type with the Custom (OpenAI-compatible) source, not Text Completion.
  • The base URL is https://api.roleplayapi.com/v1 and the model ID is uncensored.
  • A 429 means a limit: rate_limited, concurrency, or temporary overload with Retry-After 5.

Step 1: prove the endpoint works outside SillyTavern

Start here, because it splits the problem in half. If curl works, the endpoint and key are fine and the fault is in the SillyTavern configuration. If curl fails, no setting in the app will help.

curl -i https://api.roleplayapi.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 ok."}],"max_tokens":10}'

The -i flag prints response headers. Look at the status line first. A 200 with a JSON body means success, and you will also see headers such as X-Balance-USD, which shows your remaining credit. A 401 means the key is wrong or malformed. A 429 means a limit was hit. A connection error means the URL or your network is the problem.

You can also list models with GET /v1/models using the same Authorization header. If that returns a list, authentication works.

Step 2: choose the right API type in SillyTavern

SillyTavern has several connection modes, and a wrong choice here produces confusing errors. Open the plug icon in the top bar and set these:

  1. API: Chat Completion. Do not use Text Completion for this endpoint.
  2. Chat Completion Source: Custom (OpenAI-compatible).
  3. Custom Endpoint (Base URL): https://api.roleplayapi.com/v1
  4. Custom API Key: your key, with no quotes and no spaces.
  5. Model ID: uncensored

Press Connect and wait for the green status. SillyTavern's labels shift a little between releases, but the pattern holds: a chat completion source, a base URL, a key and a model field. If you pasted the key from a message or email, check for a trailing space or line break, which is a classic cause of a 401.

Two more things are worth checking. First, update SillyTavern: older versions have different custom endpoint fields, and a guide written for a new release will not match an old interface. Second, look at your prompt settings. Some presets add a long system prompt, a jailbreak field or a prefill that you no longer need with a model that does not refuse. Extra text costs tokens on every turn and can confuse the model, so start from a clean preset, confirm that plain chat works, and add pieces back one at a time. That way a failure points to the exact change that caused it.

If the connection is green but the first reply fails, send a very short message such as "hi" with a blank card. A short prompt rules out size and format problems, and if it succeeds, the cause lives in your card, world info or preset rather than in the connection.

Common errors and what they mean

SymptomLikely causeFix
Status stays red or "could not get models"Wrong base URLUse the base URL ending in /v1, with no extra path
401 UnauthorizedMissing, wrong or spaced keyPaste the key again and check for whitespace
404 Not FoundDuplicated or missing path segmentRemove /chat/completions from the base URL
Reply is emptyResponse length set to 0 or a stop string matchedCheck response length and custom stop strings
429 Too Many RequestsA limit was hitSee the section on 429 below
Works in curl, fails in appWrong API type or model IDRedo step 2 exactly

The most frequent URL mistake is entering the same path twice. SillyTavern adds /chat/completions itself, so a base URL that already ends with it becomes a 404. The reverse also happens: a URL without /v1 reaches a path that does not exist.

Context size and response length

SillyTavern builds each prompt from the character card, world info, chat history and your message. It keeps the total under the context size you set in the AI response configuration. This API supports 100,000 tokens of context, prompt plus completion, so you can raise the slider well above the default of a few thousand if you want long memory.

Raising it has costs. Each turn resends the history, so input tokens grow and the bill rises with them. With a 30,000-token prompt and a 500-token reply, one message costs 30,000 x $0.15 / 1,000,000 = $0.0045 for input plus 500 x $0.50 / 1,000,000 = $0.00025 for output, about $0.00475. That is fine for most people, but it is worth knowing before you set the slider to the maximum.

The response length setting maps to max_tokens, which is optional here. If replies cut off in the middle of a sentence, raise it. If they ramble, lower it.

Fixing 429 errors

The API returns HTTP 429 in three situations, and the error body tells you which:

  • rate_limited: too many requests per minute. A full key allows 300 per minute, a trial key 60.
  • concurrency: too many requests at once. A full key allows 8 at the same time, a trial key 2.
  • Temporary overload: a 429 with a Retry-After: 5 header. Wait five seconds and resend.

In SillyTavern the usual culprit is concurrency. A streamed reply keeps its slot until the stream ends, so if you press regenerate or swipe quickly while a reply is still arriving, the new request counts as a second one. Group chats with several characters replying at once can also stack requests. On a trial key, which allows only 2 at once, this happens fast. Wait for the stream to finish, or run fewer characters in parallel.

The rate-limit headers X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency in the curl output show your limits. The documentation describes them in full.

If you are out of credit or the key is new

Check your balance through the X-Balance-USD header on any response, or with GET /v1/balance. A new account can claim $0.50 of trial credit with one click on the API key page. It lasts 7 days and needs no card, so an expired trial is a possible reason for a key that used to work. Top-ups start at $20, and the pricing page lists the payment options.

When none of this explains the problem, open the browser console and the terminal where SillyTavern runs. The server log shows the actual upstream status code, which is more useful than the generic red banner. Send the status code and the request ID from the X-Request-Id header to support. The API for roleplay article covers more frontend setups if you want to compare configurations.

Questions and answers

Which base URL do I enter in SillyTavern?

Use https://api.roleplayapi.com/v1 with no trailing path. SillyTavern appends the chat completions path itself.

Why does SillyTavern say the model cannot be found?

Set the Model ID field to uncensored by hand. It is the only model this endpoint serves, so a name copied from another service will not match.

Can I use streaming?

Yes. Streaming over SSE is supported. Remember that a streamed request holds its concurrency slot until it ends.

Why does it work in curl but not in SillyTavern?

The API type is usually wrong. Switch to Chat Completion, choose the Custom OpenAI-compatible source, and re-enter the URL, key and model ID.

Your key is one form away

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