Ollama API SillyTavern Setup: Connect a Hosted Endpoint
SillyTavern can talk to any OpenAI-compatible endpoint through its Custom source. This page walks through the settings, the values to paste, and what to do when the connection fails.
Updated

Key points
- In SillyTavern choose Chat Completion, then the Custom (OpenAI-compatible) source.
- Set the base URL to https://api.ollamaapi.com/v1 and the model ID to uncensored.
- Test with curl first so you know whether a failure is the key or the app.
- Keep the context size in line with your budget; each reply re-sends the history as input.
What you need before you start
If you searched for ollama api sillytavern, you probably want SillyTavern to talk to a model through an OpenAI-style address instead of a local Ollama install. That works, because SillyTavern lets you add any OpenAI-compatible endpoint. This page connects it to a hosted one, which means no GPU on your side.
You need three things: a working SillyTavern install, an API key, and the endpoint values. The values are:
- Base URL:
https://api.ollamaapi.com/v1 - Model ID:
uncensored - Authorization: your key, sent as a bearer token (SillyTavern does this for you)
For the key, sign up with Google or with email and password and open the API key page. New users can claim $0.50 of trial credit with one click there. It is one per person, valid for 7 days, and needs no card. Trial keys are limited to 2 concurrent requests and 60 requests per minute, which is enough for a single chat.
Content rule: the model is tuned to answer without content refusals for lawful adult use, which suits fiction, roleplay and companion setups for adults. Nothing involving minors is allowed, and the endpoint has a hard limit on it.
Test the key with curl first
A five-second test saves a lot of guessing. If this command returns a reply, the key, the URL and the model ID are right, and any later problem is in the SillyTavern settings.
curl https://api.ollamaapi.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Say hello in one short sentence."}],
"max_tokens": 40
}'You can also list models with GET https://api.ollamaapi.com/v1/models using the same header. A 401 means the key is wrong or missing. A reply with text in choices[0].message.content means you are ready to configure the app.
Connect SillyTavern step by step
Menu names can shift a little between SillyTavern versions, but the path is stable. Open the plug icon at the top, which is the API Connections panel.
- Set API to Chat Completion. Do not use Text Completion for this endpoint, since it offers chat completions only.
- Set Chat Completion Source to Custom (OpenAI-compatible).
- In Custom Endpoint (Base URL), enter
https://api.ollamaapi.com/v1. Leave off any trailing path such as/chat/completions. - Paste your key into Custom API Key.
- In Model ID, type
uncensored. If the field offers a dropdown filled by the models route, pick the same entry. - Press Connect. A green status with the model name means the handshake worked.
Open any character card and send a short message. If text streams in, you are done with the connection. The remaining sections cover tuning, because the defaults are not always the best fit for a hosted model with a large window.
A reminder if you came from Ollama: SillyTavern's own Ollama connection uses a local address and the Text Completion path. That route points to your own computer. Here you use the Chat Completion route and a public HTTPS address instead, so the two setups do not mix.
Settings worth changing
Context size
The window is 100,000 tokens, prompt plus completion. SillyTavern lets you set a context size in the sampler panel, and the app drops the oldest messages when the chat grows beyond it. A bigger value remembers more of the story and also costs more, because the whole history is sent as input on every reply.
Here is a worked example. A chat turn that sends 8,000 tokens of history and receives a 300-token reply costs 8,000 x $0.15 per 1M = $0.0012 for input, plus 300 x $0.50 per 1M = $0.00015 for output. That is $0.00135 per turn, so 100 turns cost $0.135. Push the history to 60,000 tokens and the input part alone is $0.009 per turn, so 100 turns cost $0.90 plus $0.015 for output, or $0.915 in total. Most chats do not need that much, and a summary of old events usually works better than raw history.
Max response length
max_tokens is optional. Setting a response length of 300 to 500 tokens keeps replies tidy and caps output cost. Raise it if the character tends to get cut off mid-sentence.
Sampling
Temperature, top_p, stop sequences, seed and the frequency and presence penalties are passed through to the model. Start near the defaults of a chat preset, and change one value at a time. If replies repeat phrases, raise the penalties a little rather than the temperature.
Streaming
Leave streaming on. Text appears as it is generated, using SSE. Usage is reported at the end of the stream. Note that a streaming request holds a concurrency slot until it finishes, so pressing regenerate twice quickly on a trial key (2 concurrent) can produce an error.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 Unauthorized | Wrong or missing key | Paste the key again and check for spaces at either end |
| 404 Not found | Wrong path in the base URL | Use exactly https://api.ollamaapi.com/v1, nothing after it |
| Model not found | Wrong model ID | Type uncensored in lowercase |
429 with concurrency | Too many requests at once | Wait for the running reply to end; avoid group chats on a trial key |
429 with rate_limited | Over requests per minute | Slow down; a full key allows 300 per minute |
| 429 with Retry-After 5 | Temporary overload | Retry after five seconds |
| Browser CORS message | SillyTavern running on another device or proxy | Enable its server-side request path or run it on one machine |
Group chats deserve a note. SillyTavern can send several character replies in sequence or at the same time. If you see concurrency errors with groups, lower the number of active characters or upgrade from the trial key. A full key allows 8 concurrent requests.
When a reply is empty or cut short, look at the response length setting first, then at the stop sequences. A stop string that matches a common word ends the reply early with no error.
Adding credit and keeping costs predictable
The trial credit is enough to try the setup and judge the writing. At the per-turn cost from the example above, $0.50 pays for roughly 370 turns of an 8,000-token chat (0.50 divided by 0.00135). After that, top up from $20, in any whole amount up to $500. Card (Visa, Mastercard, Apple Pay, Google Pay) and crypto (USDT on TRC20, USDC on Base) are accepted. Larger top-ups carry a bonus: +5% from $50, +10% from $100 and +15% from $200. Credit never expires, nothing renews on its own, and failed or refused requests are not charged. See the pricing page for the full table.
The balance after each call appears in the X-Balance-USD response header, and you can check the dashboard too. The docs explain the request fields if you want to move from SillyTavern to your own scripts later. Prompts are not used for training.
More guides
Questions and answers
Which SillyTavern source should I choose?
Chat Completion with the Custom (OpenAI-compatible) source. Enter the base URL https://api.ollamaapi.com/v1, your key and the model ID uncensored.
Is this the same as connecting SillyTavern to a local Ollama server?
No. A local Ollama connection points to your own computer. This is a hosted endpoint reached over HTTPS, with no model running on your machine.
Why does regenerate sometimes return an error on the trial key?
A trial key allows 2 concurrent requests. A streaming reply keeps its slot until it ends, so a quick second regenerate can exceed the limit.
Can I use it for roleplay and character chats?
Yes, for lawful adult use such as fiction, roleplay and companion apps. Sexual content involving minors is not allowed.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.