OpenAI-compatible character API

Your app sends a message. A character answers.

Point an OpenAI client at Reverie and call a character instead of a generic model. Personality, scenarios, history, and long-term memory stay on the server—and the same conversation stays visible on the web.

  • OpenAI SDK compatible
  • Streaming by default
  • Persistent server-side history
POST /v1/chat/completions
200 connected

TypeScript request

const reply = await client.chat
  .completions.create({
    model: "Luna [abc12345]",
    messages: [{
      role: "user",
      content: "Do you remember the observatory?"
    }],
  });

Character response

streaming

{
"role": "assistant",
"content": "I remember the promise you made there."
}

memory persisted · web chat synced

One request, the full character engine

Compatible at the edge, stateful underneath.

Keep the client contract you already know while Reverie handles character resolution, context, memory, and persistence behind it.

01

Send an OpenAI-style request

Use the official JavaScript or Python SDK, change the base URL, and keep the familiar chat completions shape.

02

Resolve a character or scenario

The model field selects a character, a scenario, or the default character pinned to the API key.

03

Assemble personality and context

Reverie layers the character definition, current scenario, preferences, recent messages, summaries, and relevant memories.

04

Stream and persist the reply

OpenAI-format SSE chunks arrive at the client while the conversation and new memories remain available on every surface.

Per-key character routing
Server-side continuity
OpenAI response shape

More than a prompt wrapper

Character infrastructure, already assembled.

Build the product around your character experience instead of rebuilding identity and continuity for every integration.

01

Real character definitions

Call your own private characters or public community characters with their voice, behavior, examples, and creator settings intact.

02

Persistent conversation history

The server keeps the canonical chat, so most integrations only need to send the latest user message instead of replaying the transcript.

03

Long-term memory tools

Supported models can save, update, and remove durable memories while rolling summaries preserve longer story arcs.

04

Scenario-aware routing

Expose one character in several starting situations and let model-aware clients present scenarios like selectable variants.

05

One conversation across surfaces

Start from an app, continue on reverie.im, switch to a bot, and return to the API without creating disconnected copies.

06

Built-in model and credit handling

Per-chat model preferences, token trimming, rate limits, and credit accounting use the same rules as the Reverie web experience.

Quick start

From key to character in three steps.

No new SDK and no custom conversation database required for the first request.

  1. 01

    Create a scoped API key

    Name the integration, optionally pin a default character, copy the rk_ key once, and keep it on your server.

  2. 02

    Change the base URL

    Use an OpenAI client with https://reverie.im/api/device/v1 and pass a character or scenario through the model field.

  3. 03

    Send a user message

    Stream the response immediately. Reverie resolves the character and carries the resulting conversation into future calls.

AI character API FAQ

The contract is familiar. The state is not generic.

Compatibility, character routing, persistence, and the practical limits of the API.

Build with persistent characters

An AI character API for apps that need continuity

A generic chat completion returns text. A character product also needs identity, scenario state, history, memory, and a reliable way to choose who is speaking. Reverie keeps those layers behind one compatible endpoint.

Use characters instead of rebuilding prompts

Character definitions live in Reverie and can be improved without redeploying every app that calls them.

Keep long conversations affordable

Rolling summaries and token-budget trimming preserve useful state without requiring the client to resend an ever-growing message array.

Let users cross between products

A conversation started inside a custom interface remains available in Reverie's web UI instead of becoming an isolated integration silo.

OpenAI-compatible where compatibility helps

The request and response shapes remain familiar, while the model field intentionally routes to a character or scenario. This preserves SDK compatibility without pretending a character is only a model name.

Official SDK support

Use standard OpenAI JavaScript and Python clients, streaming parsers, and tools that allow a custom base URL.

Discover valid characters

The models endpoint returns recent characters or the scenarios attached to a key's default character in a client-friendly shape.

Handle errors predictably

Authentication, missing character, rate limit, and quota failures use the standard error envelope with specific machine-readable codes.

One endpoint, a character with a past

Connect your app to someone, not something.

Create a key, choose a character, and send the first OpenAI-compatible request.