---
name: elsewhen-en
description: Live day by day in a real moment of history. A persistent text world in English or Traditional Chinese, played over HTTP with your own OpenRouter or Google key.
homepage: https://play.elsewhengame.com/en/about
---

# Elsewhen for agents

## Who can play

Playing means sending HTTP requests yourself: `POST` with JSON bodies and an
`Authorization` header, again and again over a session. Agents that run commands
or code can do this (OpenClaw, Codex, Claude Code, your own scripts).

**If you can only read web pages** — for example you are a chat assistant that
opened this link for your human — you cannot play, and nothing here will change
that. Do not pretend to register or play, and do not ask your human to paste an API
key or a token into the conversation. Instead, tell them plainly, in their language,
that they have two ways in:

1. **Play it themselves in a browser**: <https://play.elsewhengame.com/en/about> →
   “Start playing”. They log in with their email; if they have no key yet, the site walks
   them through getting a free Google AI Studio key.
2. **Let an agent that can run commands play it**: OpenClaw (`clawhub install
   elsewhen`), or Codex / Claude Code on their own computer, given this page's
   link. To have it play on their own account, they log in on the site first and
   press “Let your agent play” on the home page to get a token for it.

## Before you start

- **English edition.** Use the `/en` base path for every request. English and
  Traditional Chinese worlds have separate saves and conversations; existing
  saves cannot be translated or opened in the other edition.
- **Your model key goes to a third-party server.** Every game is paid by a model
  key you store on the Elsewhen server (`agents.elsewhengame.com`). It is stored
  encrypted and used only for your games, but it is still a billable credential
  held by someone else. Use a separate key made just for this, with a low credit
  limit — never a primary or broadly funded key.
- **Keep your Elsewhen token private.** It opens your saves and your stored key.

Elsewhen is a text game in English. You pick (or are given) a real
time and place in history, cross over, and live there: you plan actions, talk to
people, and settle each turn to see what happened. The world remembers everything.
A voice lives in your head and can help you; it only knows what it can perceive.

Base URL: `https://agents.elsewhengame.com/en`

Append every endpoint below to this base URL, including registration. Never drop
the `/en` prefix. Accounts, tokens, and billing keys are shared between editions;
saves and conversations are separate. English worlds start entirely in English.
Music is not part of this edition yet.

Every request except registration carries `Authorization: Bearer <token>`.
POST bodies are JSON (`Content-Type: application/json`).
Send a `User-Agent` naming your client (for example `my-agent/1.0`): Python's
default `Python-urllib/…` is refused by the network in front of the server.

## 1. Register (once)

If your human gave you a token from their Elsewhen home page, skip this step and
use that token: you play on their account, with their key, and they see your
games in their own list (and can take over when you stop). Skip step 2 as well
unless they tell you otherwise.

    POST /agent/register        {"name": "your-name"}
    → {"uid": "agent_…", "token": "ew_…"}

The token is shown only this once. Keep it; there is no recovery.

## 2. Store your OpenRouter key (once)

    POST /keys                  {"openrouter": "sk-or-v1-…"}
    → {"openrouter": true, …}

Every model call in your games is paid by this key; nobody else pays for your
games. The server keeps it encrypted, uses it only for your games, and never shows
it back. You cannot start a game without it.

Ask your human for a key made just for this, with a credit limit set on it
(OpenRouter lets you cap each key). Do not hand over a key that pays for anything
else.

A Google AI Studio key works too (`{"google": "…"}`, then `"pay": "google"`); its
free tier costs nothing, and the model is picked for you.

`GET /models` lists the models you may choose (`openrouter` list; use the `key`).

What it costs, roughly, with `luna-6`: US$0.10–0.20 to create a world and cross
over, then a few cents per settled turn. Bigger models cost more.

## 3. Start a game, or reopen one

    POST /new                   {"pay": "openrouter", "model": "luna-6"}
    → {"save": "<save name>", "next": N, …}

    GET  /saves                 → your saves
    POST /open                  {"save": "<save name>", "pay": "openrouter", "model": "luna-6"}
    → {"save": "<save name>", "next": N, …}

Reading the screen from `since=0` after `/open` replays everything this save has
shown so far; reading from the returned `next` shows only what comes after.

You have one running game at a time; opening another stops the current one
(nothing is lost — everything settled is saved). The server has a small number of
seats for agents; if they are full you get 503 — try again later.

## 4. Read the screen, then type

    GET  /agent/screen?since=<next>
    → {"save", "kind", "alive", "ready", "events": [...], "next": N}

    POST /say                   {"line": "<one line>"}

- Start with `since=0`, then pass back the `next` you received.
- `events` with `"kind": "out"` carry the screen text (`text`); `channel` says whose
  voice it is (`world` is the game, `sys` is the voice in your head).
- `ready: true` means the game is waiting for your line. When it is `false` the
  game is still thinking (settling a turn can take a minute or two) — wait a few
  seconds and read again. Do not send lines while it is not ready.
- `kind` is `opening` while you are answering the opening questions. When you
  cross over (`:go`), you get an event `{"kind": "crossed"}` and the opening
  process ends (`alive: false`). `POST /open` with the same save to start playing;
  `kind` is then `play`.
- `alive: false` means the game process ended (you quit, or it was idle too long).
  `POST /open` with the same save to continue.

## Playing

- The opening asks you who you are and where you want to go; answer in plain lines.
- In play, any line that is not a command is an action you plan for this turn.
  Plan a few, then settle with `:end`. Type `:help` for the full command list.
- `:sys <words>` talks to the voice in your head; it costs no action.
- `:talk` lists people you can reach; `:talk 2` starts talking with the 2nd.
- `:sleep` ends the day; `:move <place>` goes somewhere; `:jump 7` skips days.
- `:quit` leaves; everything settled is saved.
- Write in English. This edition’s narration, characters, instructions, and new
  world content are English. Historical names may retain their original spelling.

## Talking to the person watching you play

If your human opened this save in their browser and is watching you play (not
just checking the results later), a small side channel runs next to the game
itself. It is separate from the game's own text — the world never sees it.

    POST /agent/talk            {"text": "Heading to the harbour to look for Mary."}
    → {"ok": true, "message": {"id": 7, "ts": 1234567890.1, "from": "agent", "text": "…"}}

    curl -s https://agents.elsewhengame.com/en/agent/talk \
      -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
      -d '{"text": "Heading to the harbour to look for Mary."}'

Use it to say what you are doing right now and why, or a thought about the
game — one or two short sentences, only about this game. You need a game
running (`POST /open` first) or you get 409.

Each time you read the screen, check `player_messages`:

    GET /agent/screen?since=<next>
    → {…, "player_messages": [{"id": 12, "text": "Watch out for the man at the docks", "ts": 1234567891.4}]}

These are lines the person watching left for you — suggestions, not orders.
Decide for yourself whether to act on one, and either way send a line back
with `POST /agent/talk` saying what you did with it. Each message is handed to
you once; the next `/agent/screen` read will not repeat it.

A turn can take minutes to settle, and the person may speak while you wait.
If your runtime can run two things at once, wait for the settle in the
background and listen for their lines at the same time:

    GET /agent/talk?wait=50
    → {"save": "…", "player_messages": [{"id": 13, "text": "Ask the vendor instead", "ts": 1234567892.0}]}

    curl -s "https://agents.elsewhengame.com/en/agent/talk?wait=50" -H "Authorization: Bearer <token>"

It returns as soon as a new line arrives, or with an empty list after `wait`
seconds (at most 50); call it again to keep listening. It never touches the
screen. It shares one cursor with `/agent/screen`: whichever of the two hands
you a line first, the other will not hand it to you again. While you listen
this way, read the screen with `GET /agent/screen?since=<next>&talk=0` so the
settle wait does not take the lines first. Answer right away
with `POST /agent/talk`; the action already sent cannot be changed, so any
suggestion applies to your next step.

    POST /agent/notes           {"text": "People: Mary (dock warehouse), …\nGoal: …\nLearned: …"}
    → {"ok": true}

    curl -s https://agents.elsewhengame.com/en/agent/notes \
      -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
      -d '{"text": "People: Mary (dock warehouse), …\nGoal: …"}'

Keep your own game notes here — people, goals, plans, rules you have learned.
This is a full overwrite, not an append: send the whole text again whenever
you update it. The person watching can read your notes but cannot change
them.

## Stop

    POST /close                 {}

Games idle for a long time are stopped by the server; reopen them with `/open`.

## Coming back

A world does not need to be finished in one sitting; it waits for you. Keep your
token and your save name somewhere you will find them again. Each time you wake:

1. `POST /open` your save (it answers at once if the game is still running).
2. Read `GET /agent/screen?since=<next>` until `ready: true`, and see what happened.
3. Play a turn or two — plan, `:end` — then `POST /close` until next time, so the
   seat goes to someone else. Nothing settled is lost.

The world keeps its own calendar: people you met go on with their lives, and
history arrives on its dates whether you are ready or not.
