Docs / Integrations
Use Cent AI with SillyTavern
Connect SillyTavern to Cent AI as a custom OpenAI-compatible Chat Completion source with a base URL, an API key and a model.
Last updated
Your setup
Fills in YOUR_API_KEY in the code on this page. The key stays in this tab: it is never sent and never saved.
SillyTavern's Custom (OpenAI-compatible) source speaks the OpenAI Chat Completions format, so it connects to Cent AI at https://api.cent-ai.dev/v1 and adds /chat/completions itself. This page covers the connection only.
Prerequisites
- A Cent AI account with balance. See Quickstart.
- An API key from Keys. It looks like
cai_<secret>and is shown once. - SillyTavern installed and running. The version we tested is at the end of this page.
Configure SillyTavern
Open the API Connections panel (the plug icon) and fill in:
| Setting | Value |
|---|---|
| API | Chat Completion |
| Chat Completion Source | Custom (OpenAI-compatible) |
| Endpoint URL | https://api.cent-ai.dev/v1, without /chat/completions |
| API key | Your key, cai_<secret> |
| Model | Pick from the list loaded from GET /v1/models, or type a name exactly as listed there, for example glm-5.3 |
Click Connect. SillyTavern runs as a local server and sends requests from the machine it runs on. If your key has an IP allowlist, add the address of that machine.
Test it
Check the key and the model name with one request. Replace YOUR_API_KEY with your key.
export CENT_AI_KEY="YOUR_API_KEY"
curl https://api.cent-ai.dev/v1/chat/completions \
-H "Authorization: Bearer $CENT_AI_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.3","messages":[{"role":"user","content":"Hello"}]}'
The response has usage.cost, the amount charged for this request in USD. Then click Test Message in the API Connections panel, or send a message in a chat. The test message is a real request and is charged too. Each request appears on the Requests page of the dashboard with its tokens per rate and its cost. See Request cost.
Cache continuity
SillyTavern resends the character card, the chat history and other prompt parts on every message, so much of the input of a long chat can be read from the model's cache. Cent AI sends the next turns of a conversation to the route that served the previous turn. It uses the session signal a tool sends when there is one; without it, it uses the stable start of the prompt. You do not add anything to the connection for this.
- Keep a chat on one model. Another model starts a new cache.
- Prompt parts near the start that change on every message, such as random macros or lore entries that come and go, change everything after them.
Cent AI does not promise a cache hit rate. Cache tokens are charged only when the model reports them. See Prompt caching.
Troubleshooting
To look up a failed request, find the x-request-id of the response on the Requests page. All codes are in 4xx errors and 5xx errors.
401 invalid_api_key
The API key in the connection is wrong, cut off, revoked, or a management key (cai_mgmt_…). With a wrong key, the model list stays empty. Paste the key again, or create a new one in Keys.
402 insufficient_balance
The balance available for this model is empty, or the model is not in your budget pack. Top up or buy a pack. See Balance.
403 ip_not_allowed or model_not_allowed
The key has an IP allowlist without the address of the machine that runs SillyTavern, or a model allowlist without the chosen model. Add the address or the model to the key.
404 model_not_found
The model name is not one Cent AI serves. Copy the exact name from Models or GET /v1/models; names from other providers, such as gpt-4o-mini, are not aliases. A :free name works only for today's event model (see Free tokens daily); on any other model, including a previous day's event model, it returns 404.
429 rate_limited, key_limit_exceeded or project_budget_exceeded
rate_limited: more than 600 requests per minute on this key. Wait forRetry-After. See Rate limits.rate_limitedon a:freename: today's free pool is used up, or the event is off.Retry-Afterruns to 00:00 UTC; the model's own name stays available at its normal price.key_limit_exceeded: the daily or monthly limit you set on the key was reached.project_budget_exceeded: the budget of the key's project was reached.
501 not_available_yet
The endpoint is not open yet. Speech, transcription and embeddings return 501 for now. Do not point those SillyTavern extensions at Cent AI. The image endpoints are open; see Images.
Stream timeout
If a reply stops with upstream_timeout or upstream_unavailable in the stream, see Stream timeout.