· By The Cloakray team
Roleplay and character chat on one API
Build character chat, interactive fiction and game NPCs with Claude, Kimi, DeepSeek, Grok and more: long memory, cheap repeated personas, and streaming.
Character chat is one of the most demanding things you can ask of a model. It has to stay in voice for hundreds of turns, remember what happened fifty messages ago, and still answer fast enough to feel like a conversation. Different models are good at different characters, so the apps that do this well rarely stick to one. Cloakray puts them all behind one API.
Pick the voice, not the vendor
Writing style varies more between models than benchmarks suggest. A few worth trying:
- Claude Opus 5.5 and Claude Sonnet 5.5 for rich prose and characters that stay consistent over long stories.
- Kimi K3 for lively dialogue and a distinct voice.
- DeepSeek V4.1 Flash and GLM-5.3 for high-volume chat at a low price per message.
- Grok 4.7 for a sharper, more playful tone.
- Gemini 3.5 Flash for very long context at speed.
Because the request shape is the same for every model, switching a character to another model is a one-word change. Let users choose, or run an A/B test on which one keeps people talking.
Long memory without the long bill
A roleplay request resends the same thing every turn: the character sheet, the world lore, the story so far. Prompt caching lets the model reuse the part that did not change, and you pay a fraction of the input price for it. Keep the stable parts (persona, rules, lore) at the start of the prompt and the new message at the end, and most of each request is served from cache.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.cloakray.com/v1",
apiKey: process.env.CLOAKRAY_API_KEY,
});
const stream = await client.chat.completions.create({
model: "claude-sonnet-5-5",
stream: true,
messages: [
{ role: "system", content: characterSheet + worldLore },
...storySoFar,
{ role: "user", content: nextMessage },
],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
Streaming shows the reply as it is written, so the character starts talking right away.
Beyond chat
- Interactive fiction. Let a model narrate while structured outputs track inventory, stats and quest state as JSON your game can read.
- Game NPCs. Give each character its own system prompt and tools to look up the world, so what they say matches the game.
- Character art. Generate portraits and scenes for your characters with the image models on the same key.
Ground rules
Each model is subject to its own provider's usage policy, and those differ. Test your characters against the model you plan to use, and pick the model whose policy fits your app. For mature storylines that a stock model refuses, use an abliterated or uncensored model, and see adult and NSFW apps for the rules that still apply.
Get started
- Create an account and top up with crypto. There is no subscription and no minimum.
- Point your OpenAI SDK, SillyTavern-style frontend or chat app at
https://api.cloakray.com/v1. - Try the same character on two or three models and keep the one that sounds right.