Connect in five steps
This is the fast path for glm api sillytavern setups. It assumes you already run SillyTavern and have created a key on the API key page.
- Open the plug icon (API Connections) at the top of SillyTavern.
- Set the API type to Chat Completion.
- Set the Chat Completion Source to Custom (OpenAI-compatible).
- Paste
https://api.glmapikey.com/v1into the custom endpoint field and your key into the custom API key field. - Enter
uncensoredas the model ID and press Connect.
A green status light and a model name below the button mean the connection works. Send a message to a character and a reply should stream in. Menu names shift a little between SillyTavern releases, so if a label differs, look for the field that takes an endpoint URL; the values stay the same.
One honest note on the name. This endpoint is not the official GLM API from any vendor, and it does not route to other vendors' models. It is a single open-weight model run by an independent provider, tuned to answer without content refusals for lawful adult use. What it shares with the model families people look for under the GLM name is the interface: a standard OpenAI-style chat completions API that roleplay front ends already know how to talk to.
What you are connecting to
The facts that matter for roleplay, in one place:
| Property | Value |
|---|---|
| Endpoint | POST /v1/chat/completions |
| Model ID | uncensored |
| Context window | 100,000 tokens, prompt plus reply |
| Streaming | Yes, server-sent events |
| Passed-through samplers | temperature, top_p, stop, seed, presence and frequency penalties |
| Price | $0.15 per 1M input, $0.50 per 1M output |
| Limits, full key | 8 concurrent, 300 per minute |
| Limits, trial key | 2 concurrent, 60 per minute |
The model is meant for fiction, roleplay and companion apps used by adults. It will stay in character and will not break a scene to lecture you about it. One rule has no exceptions: the service refuses any sexual content involving minors, and character cards that try to set up such a scenario will not work. Keep your cards and prompts on the right side of that line.
Prompts are not used for training, so your characters and chat logs are not fed back into a model. They do pass through the provider to generate a reply, as with any hosted API.
Settings worth changing after you connect
Open the AI Response Configuration panel (the sliders icon). You do not need to touch much, but a few values decide how the chat feels and what it costs.
Context size
This is how many tokens SillyTavern sends with each request: character card, lore, system prompt and as much recent chat as fits. The API allows up to 100,000 tokens, but you do not have to use all of it. A setting of 16,000 to 32,000 keeps replies on topic and keeps the bill small. Raise it when a long story needs the model to recall details from far back. The calculation further down shows why this matters.
Max response length
Set a ceiling that suits your style. 300 to 500 tokens suits short exchanges, and 800 or more suits scene-writing. A lower value also shortens the wait before each reply ends.
Streaming
Leave it on. Replies appear word by word, and you can stop one that has gone the wrong way and not pay for the rest of it. Keep in mind that a streaming request holds a concurrency slot until the stream ends.
Temperature and penalties
Start with temperature around 0.8 and top_p around 0.9. If replies repeat phrases, add a small frequency penalty such as 0.3. If the model wanders off the card, lower the temperature to 0.6. These are starting points to adjust by feel, not magic numbers, and the seed parameter is passed through if you want repeatable output while you tune.
Instruct and prompt format
With the Chat Completion source, SillyTavern builds the message list itself, so you do not need to pick an instruct template. Use the prompt manager to order the system prompt, character description, scenario and chat history, and keep your own style instructions short and direct.
What a roleplay session costs
Roleplay is input-heavy. Each turn resends the card, the lore and the recent chat, and the model answers with a few hundred tokens. Take a context of 30,000 tokens and a 300-token reply:
- Input: 30,000 / 1,000,000 x $0.15 = $0.0045
- Output: 300 / 1,000,000 x $0.50 = $0.00015
- Total: $0.00465 per turn, so 100 turns cost $0.465
Now compare a context of 8,000 tokens with the same reply: input is $0.0012, output is $0.00015, so $0.00135 per turn and $0.135 for 100 turns. The smaller context is about a third of the price. The trade is that the model sees less history, so it may forget a detail from an hour ago. Lorebook entries and a short running summary let you keep the facts you care about in a small context.
Even the larger figure is modest. A trial credit of $0.50 covers roughly 107 turns at 30,000 tokens of context ($0.50 / $0.00465), which is enough to judge whether the model suits your characters. After that you top up with any whole amount from $20 to $500, and credit never expires. Bonuses apply from $50 (+5%), $100 (+10%) and $200 (+15%). Full numbers are on the pricing page.
Group chats and the concurrency limit
SillyTavern group chats send one request for each character that speaks. Features such as swipes, regenerate and background summaries can also start requests in quick succession. If several of them overlap, you may see a 429 error with the code concurrency. It means too many requests were running at once, not that anything is wrong with your key.
A trial key allows 2 concurrent requests and 60 per minute. A funded key allows 8 and 300. To stay inside the lower limit:
- Wait for a reply to finish before you regenerate.
- In groups, keep character reply order manual or sequential instead of letting several characters answer together.
- Turn off extensions that fire requests on every message, such as auto-summaries, until you have a funded key.
The API also returns 429 with a Retry-After: 5 header when it is briefly overloaded. In that case, wait five seconds and press generate again. Failed and refused requests are not charged, so there is no cost to trying again.
Troubleshooting
If the Connect button fails, test the key outside SillyTavern so you know which side has the problem:
curl https://api.glmapikey.com/v1/models \
-H "Authorization: Bearer $API_KEY"
A JSON list that includes uncensored means the key and URL are right, and the fault is in the SillyTavern fields.
- Status stays red or you see a 404. The endpoint probably has a trailing path or is missing
/v1. Use exactlyhttps://api.glmapikey.com/v1. - 401 error. The key was pasted with a space or line break. Paste it again.
- Replies cut off mid-sentence. Your max response length is too low. Raise it.
- Replies ignore the character. The card is probably being trimmed because the context size is too small for it. Raise the context or shorten the card.
- The key stops working after a while. The trial credit lasts 7 days, so top up to continue.
- SillyTavern on a phone or another device cannot connect. Check that the device has internet access and that the URL was typed exactly, then run the curl test from that device.
For more on request fields and headers, see the documentation. If you want to understand how to get a key in the first place, the GLM key explainer walks through it.
