---
title: "SillyTavern"
description: "Use plaingateway, the free OpenRouter alternative, in SillyTavern: five connection fields, the provider's list price for tokens and nothing on top."
---

# SillyTavern

SillyTavern is a chat and roleplay app that you run on your own machine. Its **Custom (OpenAI-compatible)** source talks to any OpenAI-compatible API, so plaingateway needs five connection fields and one key. Model ids are OpenRouter's, for example `deepseek/deepseek-v4.1-flash`.

## Paste this

Open **API Connections** (the plug icon in the top bar) and set these fields. Copy each value from the block:

```text
API: Chat Completion
Chat Completion Source: Custom (OpenAI-compatible)
Custom Endpoint: https://api.plaingateway.com/api/v1
Custom API Key: sk-pg-v1-...
Model ID: deepseek/deepseek-v4.1-flash
```

Press **Connect**. SillyTavern reads the model list from the endpoint; you can pick the model there or type it into the model id field. Press **Test Message** to send one short request.

## Where the setting lives

SillyTavern saves the connection in its own settings on the machine it runs on. Save a connection profile if you switch between plaingateway and another source.

## Get a key

1. Sign up at [plaingateway.com/signup](https://plaingateway.com/signup) and click the link in the confirmation email.
2. Open [Keys](https://plaingateway.com/settings/keys), press **New key** and copy it. It starts with `sk-pg-v1-` and is shown once.
3. Add credits by card on [Credits](https://plaingateway.com/settings/credits). Requests are paid from it.

## Check it works

**Test Message** is the check inside SillyTavern. From a terminal, the same request to the same endpoint with the same model:

```sh
export PLAINGATEWAY_API_KEY="sk-pg-v1-..."
curl -i https://api.plaingateway.com/api/v1/chat/completions \
  -H "Authorization: Bearer $PLAINGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-v4.1-flash",
    "max_tokens": 32,
    "messages": [
      {"role": "user", "content": "Say hello in five words."}
    ]
  }'
```

A 200 means the key and the endpoint work. Three things in the answer tell you what happened: the `X-PG-Host` header names the provider that served it, `X-PG-Cost-USD` is the charge, and `usage.cost` in the body is the same charge. The request also shows on the [Activity](https://plaingateway.com/activity) page.

## What it costs

You pay the provider's official list price for tokens, and plaingateway adds nothing on top: 0% platform fee, no markup, no subscription, free with your own provider keys. You can earn up to 20% bonus credit, added to your balance when you add money and never taken off the token price: each person you invite gives you 1% bonus credit once they have paid $20 in total, up to 20%, so $100 paid gets up to $120 of credit. The person you invite gets 5% bonus credit on their first top-up, and you earn 10% of what they pay ([How referral works](../referral/how-it-works.md)). Each model's price is on [Models](https://plaingateway.com/models).

## Limits today

- **Only `openai/` and `deepseek/` models answer today.** The list SillyTavern reads from the endpoint holds more models than answer today. Pick an `openai/` or `deepseek/` id; any other id returns an error. Ones that answer include `deepseek/deepseek-v4-pro`, `openai/gpt-5.6-luna` and `openai/gpt-6.1-sol`.
- **Credit is prepaid.** Requests are paid from a balance you add by card. With no balance the gateway answers 402. Each request first holds its largest possible cost, the prompt plus the **Max Response Length**; on a low balance it holds an eighth of what is left and shortens the answer to fit, so a long chat can get shorter answers, then 402, before the balance is spent. A lower **Max Response Length** holds less.

## Gotchas

**Pick Custom, not OpenRouter.** SillyTavern's OpenRouter source sends to OpenRouter's own address.

**The endpoint ends in `/api/v1`.** SillyTavern adds `/chat/completions` itself. Do not add it to the field.

**No `:free` ids.** Ids that end in `:free` on OpenRouter are not plaingateway models. Drop the suffix and use an id that answers.

**Context size.** SillyTavern sends as much chat history as its **Context Size** slider allows. `deepseek/deepseek-v4.1-flash` takes about one million tokens; each model page on [Models](https://plaingateway.com/models) lists its own. Every message resends the history, so a smaller context also costs less per message.

## Moving from OpenRouter

Keep your model ids. Switch the source to **Custom (OpenAI-compatible)**, set the endpoint to `https://api.plaingateway.com/api/v1` and paste a plaingateway key. The full guide: [Migrate from OpenRouter](../migrate/from-openrouter.md).

SillyTavern's own reference for this setting: [docs.sillytavern.app/usage/api-connections/openai](https://docs.sillytavern.app/usage/api-connections/openai/).
