Check these first
Before digging through individual error codes, run through this 60-second checklist in SillyTavern's API Connections panel (the plug icon at the top). Fixing a small mismatch here resolves most connection problems right away:
- Chat Completion Source: Set API to
Chat Completionand Chat Completion Source toCustom (OpenAI-compatible). - Base URL: Set Custom Endpoint (Base URL) to
https://tavernapi.com/v1with no trailing slash and no/chat/completionsat the end.- Web apps (JanitorAI): Browser frontends that ask for the full Proxy URL are the exception—give them
https://tavernapi.com/v1/chat/completions. - SillyTavern native Reverse Proxy: If you connect through SillyTavern's native sources instead of Custom, set Proxy Server URL to
https://tavernapi.com/v1for the Claude source, orhttps://tavernapi.comfor the Google AI Studio source.
- Web apps (JanitorAI): Browser frontends that ask for the full Proxy URL are the exception—give them
- API Key: Paste your complete
sk-tav-...string into Custom API Key (or Proxy Password on native sources) with no spaces before or after it. - Connect and pick a model: Click Connect and select a model from the Available Models dropdown (
claude-opus-5-5,claude-sonnet-5-5,gemini-4-argon,gemini-3.8-flash, ordeepseek-v4-pro). - Account balance: Open the TavernAPI console and confirm your USD balance or
$0.30trial credit is above zero.
How TavernAPI errors look in SillyTavern
When a request cannot be completed, TavernAPI responds with standard JSON in this structure:
{"error": {"message": "...", "type": "...", "code": "..."}}SillyTavern shows the "message" text in a red pop-up. If the pop-up disappears too quickly, look at the window that runs the SillyTavern server (Command Prompt on Windows, Termux on Android), where the error is printed together with the HTTP status and the "code".
Error codes
Match the HTTP status and message below to see why the request failed and how to fix it.
Note: You are not charged when a request is rejected before generation starts (400, 401, 402, 403, 404, or a 429 / 5xx before any reply text). If the connection drops mid-reply, you pay only for the tokens that were actually generated.
401 Invalid API key
- What you see: Message
Invalid API key, codeinvalid_api_key. If no key was sent at all (an empty key field), the message starts withMissing API keyand the code ismissing_api_key. - Why it happens: The API key field is empty, the
sk-tav-...key was cut off while copying, has a leading or trailing space, was deleted in the console, or is a key from a different service (such as OpenRouter or OpenAI). - How to fix it: Copy and paste your full
sk-tav-...key again and check for accidental spaces. If you no longer have the full string, open the API keys tab in the console and create a new key (copy it immediately, because each key is shown only once). - Are you charged? No.
402 Insufficient balance
- What you see: Message
Insufficient balance, codeinsufficient_balance. - Why it happens: Your current balance (or trial credit) is smaller than the temporary hold required to start the request. Before forwarding each prompt, TavernAPI holds an estimate equal to the input tokens it can see plus your full Max Response Length (
max_tokens) calculated at the model's output price. As soon as the reply finishes, TavernAPI charges only the tokens actually used and releases the rest of the hold immediately. Because of this pre-authorization hold,402can appear while you still have some balance left—especially when Max Response Length is set very high or you are calling a higher-priced model likeclaude-opus-5-5. - How to fix it:
- Open AI Response Configuration (the sliders icon in SillyTavern) and lower Max Response Length to a realistic number (such as
1024or2048tokens) so the pre-request hold shrinks. - Switch to a lower-cost model in the dropdown, such as
gemini-3.8-flashordeepseek-v4-pro(see model rates). - Or top up your balance in the console.
- Open AI Response Configuration (the sliders icon in SillyTavern) and lower Max Response Length to a realistic number (such as
- Are you charged? No.
403 Trial or preset not unlocked
- What you see: One of three 403 messages and codes:
- Trial model restriction: Message
Model "<id>" is not available with trial credit. Add credit to unlock it., codetrial_restricted. - Locked preset pack: Message
"<preset pack name>" is not included in your account. See https://tavernapi.com/console/presets(orThis preset is currently unavailable), codepreset_locked. - Account status: Message
Account suspended, codeaccount_banned.
- Trial model restriction: Message
- Why it happens:
trial_restricted: The$0.30free trial credit works only withgemini-4-argonandgemini-3.8-flash. Requestingclaude-opus-5-5,claude-sonnet-5-5, ordeepseek-v4-proon a trial-only account triggers this error.preset_locked: Your active SillyTavern preset includes[[tav:...]]placeholders from a preset tier your account has not unlocked yet.account_banned: The account has been suspended (see the Acceptable Use Policy).
- How to fix it:
- For
trial_restricted: Pickgemini-4-argonorgemini-3.8-flashin SillyTavern's model dropdown, or add credit in the console to unlock every model. - For
preset_locked: Switch to your own local preset in SillyTavern, toggle off the locked[[tav:...]]entries in Prompt Manager, or unlock the preset in https://tavernapi.com/console/presets. The Standard preset unlocks with your first top-up; the Pro preset unlocks with a$4.99one-time purchase, an active$19or$39credit pack, or$25of total top-ups (see how TavernAPI presets work). - For
account_banned: Contact support with your account email.
- For
- Are you charged? No.
404 Model not available
- What you see: Message
Model "<id>" is not available, codemodel_not_found. - Why it happens: The model ID in your request contains a typo, is left over from another provider (for example,
anthropic/claude-...from OpenRouter, or an old-storysuffix), or the model is temporarily disabled. - How to fix it: Click Connect in SillyTavern to refresh the model dropdown and pick from the list. If you type the model ID by hand (such as in JanitorAI), enter one of the five exact IDs:
claude-opus-5-5claude-sonnet-5-5gemini-4-argongemini-3.8-flashdeepseek-v4-pro
- Are you charged? No.
404 Not found (wrong URL)
- What you see: Message
Not found, codenot_found. - Why it happens: The URL path is wrong. Most often
/v1is typed twice (https://tavernapi.com/v1/v1), or/chat/completionswas pasted into SillyTavern's Custom Endpoint field (which adds/chat/completionson its own). If/v1is missing entirely (https://tavernapi.com), the request lands on the website instead of the API, so you get a plain 404 page rather than this JSON error; the fix is the same. - How to fix it: Replace the endpoint with the exact URL for your frontend from Check these first:
| Frontend / Connection Mode | Field Name | Exact URL to Enter |
|---|---|---|
SillyTavern → Chat Completion → Custom (OpenAI-compatible) | Custom Endpoint (Base URL) | https://tavernapi.com/v1 |
SillyTavern → Chat Completion → Claude (Reverse Proxy) | Proxy Server URL | https://tavernapi.com/v1 |
SillyTavern → Chat Completion → Google AI Studio (Reverse Proxy) | Proxy Server URL | https://tavernapi.com |
| Web apps that ask for the full URL (e.g. JanitorAI) | Proxy URL | https://tavernapi.com/v1/chat/completions |
- Are you charged? No.
400 Bad request
- What you see: One of three 400 messages and codes:
model is required(codemodel_required)messages must be a non-empty array(codemessages_required)Unknown preset block [[tav:...]]. Download the latest preset from https://tavernapi.com/console/presets(codepreset_block_unknown)
- Why it happens:
model_required: No model was selected before sending the message.messages_required: The outgoing request had no messages in the array (for example, an empty prompt or a regex/extension script that stripped every message).preset_block_unknown: Your local preset file is older than the server's current preset definition, or a[[tav:...]]tag was edited by hand.
- How to fix it:
- For
model_required, press Connect in SillyTavern and choose a model from the dropdown. - For
messages_required, make sure your chat has at least one message and check any prompt-modifying extensions. - For
preset_block_unknown, download the latest preset JSON from https://tavernapi.com/console/presets and import it into SillyTavern again.
- For
- Are you charged? No.
429 Too many requests or upstream busy
- What you see: Message
Upstream error (429), typerate_limit_error, codeupstream_error. - Why it happens: Either you sent too many requests at once (for example, clicking regenerate repeatedly while a turn is still in flight), or the upstream model provider is busy right now. When an upstream route hits capacity, TavernAPI automatically tries other routes first before returning
429. - How to fix it: Wait a few seconds and swipe or regenerate the reply.
- Are you charged? No—you are not charged when no reply was produced.
5xx server errors
- What you see:
- HTTP 502: Message
Upstream error (502), codeupstream_error - HTTP 503: Message
No upstream route is configured for this model, codeno_route - HTTP 500: A
preset_...code (for examplepreset_block_error)
- HTTP 502: Message
- Why it happens:
Upstream error (502)(upstream_error): The upstream model provider failed or the network connection dropped during the request.No upstream route is configured for this model(503,no_route): The model is temporarily unavailable across all configured upstream routes.- 500
preset_...codes (such aspreset_block_error): A server-side error occurred while expanding a locked preset block.
- How to fix it:
- For
502(upstream_error): Wait a few seconds and swipe or regenerate. - For
503(no_route): Switch to another model in the dropdown while the route is restored. - For
500(preset_block_error): Try the same chat without the TavernAPI preset (or with the locked[[tav:...]]entries turned off) to confirm generation works, then contact support with the approximate time and model ID.
- For
- Are you charged? If the provider fails before any reply text is produced, the hold is returned in full. If it fails mid-reply after streaming has started, you pay only for the tokens that were generated.
Problems without an error code
Sometimes SillyTavern does not show an HTTP error banner, but something still looks wrong in the chat window.
Connect stays red or the model list is empty
If clicking Connect in SillyTavern leaves the status light red or the Available Models dropdown stays blank:
- Check the source, Base URL, and API key from Check these first.
- Make sure the URL starts with
https://(nothttp://) and has no spaces beforehttps://or after/v1. - If you are on SillyTavern's native Claude or Google AI Studio source, confirm you expanded the Reverse Proxy section and placed your
sk-tav-...key inside Proxy Password, not the direct provider key box above it. See the SillyTavern setup guide for every field.
Replies are empty or cut off
If the character's message stops in the middle of a sentence or comes back completely blank:
- Max Response Length is too low: A reply stops as soon as it reaches Max Response Length (
max_tokens) in SillyTavern's AI Response Configuration panel. In addition, models that think before answering spend part of that token budget on internal thinking before writing the visible reply. If Max Response Length is set very low (like250or400), the model can spend the whole budget on thinking and leave the visible reply empty. Raise Max Response Length (for example, to1024–2048tokens) and regenerate. - Upstream safety filters: The model provider's own safety filters can also end a reply early or return an empty message when a prompt triggers their classifier.
Replies ignore the preset or show [[tav:...]] text
Locked preset placeholders ([[tav:...]]) only expand when your request passes through TavernAPI's server. If your replies ignore the preset rules or you see raw [[tav:...]] strings:
- Open API Connections (the plug icon) and verify your active connection points to
https://tavernapi.com/v1—not to another provider where you might have left the TavernAPI preset enabled. - Open AI Response Configuration (the sliders icon) and check that the TavernAPI preset is selected in the Chat Completion Presets dropdown and the core prompt entries are toggled on.
- After preset updates, re-download the preset JSON from https://tavernapi.com/console/presets and import it again so your local file matches the server. See how TavernAPI presets work.
The bill is higher than expected
In roleplay, SillyTavern re-sends your chat history, character card, and preset on every turn. TavernAPI cuts that input cost automatically with server-side prompt caching, so a higher-than-usual bill almost always comes from prompt-cache misses or a very long chat:
- Sending the first message after a break: Upstream providers keep cached prefixes for only a few minutes of inactivity. The first turn after a long break has to build the cache again, so it costs noticeably more; the turns right after it drop back to the discounted cache-read rate.
- Editing early messages or shifting top-of-prompt entries: Editing or deleting an older message, switching presets mid-chat, or putting random macros (
{{random}},{{roll}}) near the top of the prompt changes the prefix and forces a fresh cache write. - Long unpruned context: A chat that has grown past 100k tokens costs more per turn than a 20k-token chat, even with caching active.
Read our prompt caching guide for tips on keeping your cache hit rate high, and check the Usage page in the console to see your exact input, cached, and output tokens per request.
Top-up and payment problems
Crypto top-ups on TavernAPI go through a NOWPayments checkout in whole-dollar amounts from $6 to $500 (see how to pay with crypto). In the console under Billing, each crypto order displays one of five statuses: Pending, Partially paid, Paid, Expired, or Failed.
Less arrived than the invoice
This usually happens when your exchange or wallet deducts its withdrawal fee from the amount you sent instead of adding the fee on top.
- The order status changes to
Partially paid, and we credit the part that actually arrived, in proportion, automatically. - To make up the remaining amount, start a new top-up order in the console.
- Do not send a second payment to the old deposit address unless support asks you to.
The order says Expired
Unpaid crypto orders close automatically after 1 hour and change to Expired. If your payment was already sent and arrives on-chain after the 1-hour window anyway, it is still credited to your balance automatically.
My top-up hasn't arrived
Blockchain network confirmations usually take a few minutes, though busy networks or slow exchange batching can take longer. Your console Billing status updates by itself as soon as the transaction confirms.
If nothing has changed after about 30 minutes, contact support with:
- The transaction hash (TXID)
- The coin and network you used
- The amount sent
- Your TavernAPI account email
I sent more than the invoice
When a payment exceeds the invoice total, only the invoiced order amount is credited automatically; the extra amount is not added on its own. Contact support with your transaction hash (TXID) and account email so we can verify the payment and add the extra to your balance.
I used the wrong network or coin
If you sent funds over the wrong blockchain network or sent a different coin than the one selected at checkout, contact support right away with the transaction hash (TXID), coin, network, and amount. Recovery is not guaranteed.
Still stuck?
If the steps above did not solve the problem, reach out to us through the contact page and include these details so we can check the logs right away:
- For API or preset errors: your TavernAPI account email, the model ID (
claude-opus-5-5,claude-sonnet-5-5,gemini-4-argon,gemini-3.8-flash, ordeepseek-v4-pro), roughly when it happened (with your time zone), the HTTP status and errorcode, and the preset pack name if you were using one. - For payment problems: your account email, the transaction hash (TXID), the coin and network, and the amount sent.
Note: Never send your full sk-tav-... API key in an email, Telegram message, or Discord DM. If we need to check a specific key, the last 4 characters shown in your console are enough.