← Apps, keys and settings

Choosing an OpenAI-compatible API for roleplay

Updated

An OpenAI-compatible API speaks the same request format as OpenAI's Chat Completions, so apps like SillyTavern, JanitorAI, Open WebUI and LibreChat can use it by swapping in a URL, a key and a model name. For roleplay, check the context size, reply cap, how many replies run at once, what is stored and which models you get. UnsavedAI offers gemma-4-12b free and gemma-4-31b on Priority.

Try it now, free, no account neededStart a story with The NarratorAny story you want, you choose

What compatible actually means

Years ago many apps were built around OpenAI's Chat Completions format: a list of messages with roles, a model name and a few settings like temperature and max_tokens. Other providers adopted the same shape so those apps could talk to them unchanged. "Compatible" means that shape, not the same models or the same company.

For you, it means one set of three values connects almost any roleplay app: a URL, an API key, and the exact model name.

Base URL or full URL

Apps differ on which URL they want. SillyTavern, Open WebUI, LibreChat and most code libraries want the base URL ending in /v1 and add /chat/completions themselves. JanitorAI wants the full address ending in /v1/chat/completions. Mixing them up is the most common setup failure, and it usually shows as "Not found" or a network error.

What to check before you choose

  • Context: how much of the story fits. Compare the real limit, and remember it includes the reply.
  • Reply cap: the longest single reply allowed.
  • Concurrency: how many replies can be written at once, which matters for swipes and multiple chats.
  • Samplers: whether your temperature, min P and penalties are passed through or silently replaced.
  • Storage: whether prompts and replies are logged, and who can read them.
  • Models: whether they suit character writing, and which plan includes which.

How UnsavedAI answers those

Both Gemma 4 models allow 61,440 tokens including the reply, with up to 8,192 tokens per reply. Free writes one reply at a time and Priority two. Sampler settings are passed to the model within published ranges, and unknown fields are ignored so presets do not break. API traffic is never stored, and nobody reads or screens it. There is no daily token cap.

The API is text chat only: images get "This model accepts text messages only." and tool calling is off for these models. Current status of each model is on Models, and prices are on Pricing.

Connecting your app

Get a key on the Setup page, then follow the guide for your app: JanitorAI, SillyTavern, Open WebUI, LibreChat, or the Chat Completions guide if you are building your own.

Questions people ask

Can I use the official OpenAI libraries?

Yes. Point the client's base URL at ours, ending in /v1, and pass your key and a model name. Keep the key on a server, never in a public web page or app.

Do I need to install anything?

Not for the API itself. You only need an app with a custom or OpenAI-compatible provider option, plus a key from your account.

Does compatible mean every OpenAI feature works?

No. It means chat requests work. Images, tools, embeddings and other extras depend on the provider and model; ours are text chat only.

Characters for this story