← Apps, keys and settings

SillyTavern API connection failed? Fix it step by step

Updated

When SillyTavern will not connect to a hosted API, the cause is nearly always one of five: the wrong API type or source, a URL with the wrong ending, a key saved under another source, a model it cannot find, or its server unable to reach the internet. For an OpenAI-compatible provider such as UnsavedAI, pick Chat Completion, Custom (OpenAI-compatible), and a base URL ending in /v1.

Try it now, free, no account neededStart a story with The NarratorAny story you want, you choose

How SillyTavern connects

SillyTavern has two halves: the page you see in your browser, and a small server running on your machine, usually the terminal window that opened when you started it. When you click Connect, that server calls the provider, asks for its model list and reports back to the page.

Two things follow. The terminal window often prints a clearer error than the status line on the page, so look there first. And problems that only affect browsers, such as a provider refusing browser calls, do not apply to SillyTavern, because the call comes from its server.

Causes, most common first

  • Wrong API or source: Text Completion selected instead of Chat Completion, or a named source such as OpenAI chosen with another provider's key, so SillyTavern calls the wrong company.
  • URL ending: the base URL must stop at /v1. Pasting the full address ending in /chat/completions doubles the path; leaving off /v1 misses it.
  • Key slot: the key was saved under a different source, or never saved after pasting.
  • Model: the connection works but the model name does not exist, so the first message fails.
  • Network: a firewall, VPN, work or school network, or a proxy set in SillyTavern's config file blocks the server's outgoing call.
  • An old SillyTavern version that lacks the custom source. Labels can change between versions.

Fixing it, step by step

  • Open API Connections (the plug icon). Set API to Chat Completion and Chat Completion Source to Custom (OpenAI-compatible).
  • Paste the provider's base URL into Custom Endpoint (Base URL). It should end in /v1 with nothing after it.
  • Paste the key into Custom API Key under that same source, then click Connect.
  • Pick a model from Available Models, or type its exact ID into Enter a Model ID.
  • Send one short message to a simple character before loading a long chat.
  • Still nothing? Read the terminal window and match the error below.

Reading the error

  • 401 or "unauthorized": the key. See 401 Unauthorized errors.
  • 404 or "Not found": the URL ending, or a model name; the model not found page separates the two.
  • ENOTFOUND: the domain in the URL is misspelled.
  • ECONNREFUSED or ETIMEDOUT: the network is blocking the call, or the provider is down.
  • Connects, model list fills, but messages fail: the connection is fine and the problem is in the request, such as context or samplers.

Connecting SillyTavern to UnsavedAI

Use Chat Completion, Custom (OpenAI-compatible), our base URL ending in /v1 from the Setup page, a key made just for SillyTavern, and gemma-4-12b (gemma-4-31b on Priority). The click-by-click version is the SillyTavern guide.

The quickest route is the SillyTavern preset on Setup. Import it under AI Response Configuration and it fills in the source, URL and model, plus Context Size 56,000 and Max Response Length 700 (800 for gemma-4-31b). It never contains a key, so paste yours afterwards.

Our messages are specific: "Not found" means the URL ending, "A valid API key is required." means the key, and "Unknown model. Available models: …" lists the right names. If you are unsure whether the key or SillyTavern is at fault, run the key tester on Setup first.

Questions people ask

Do I have to click Connect every time I open SillyTavern?

SillyTavern can reconnect to the last API on start-up; look for an auto-connect option in its settings. The wording can change between versions.

SillyTavern on my phone through Termux will not connect. Same fixes?

Yes. The server runs on the phone, so the phone needs internet access, and the Termux window shows the error.

It connects, but replies are slow or fail later. Is that the connection?

No. Once Connect succeeds, the connection is fine. Look at 429 errors or slow first replies instead.

Characters for this story