AI Chat Games

How it works

A look inside the platform.

01

From prompt to game

AI Chat Games is a platform for vibe-coding and sharing turn-based games. You tell the platform's coding agent what game you want, and the platform builds and runs it for you.

The coding agent on a phone: a prompt asking for a character to chat with, whose portrait changes with their mood; the agent’s plan; a “Built your game” card; and a Play button for “The Margin — Chat with Juniper”.
Coding agent
The finished game on a phone: a generated portrait of Juniper Vale, a mood badge reading Curious, and a short chat in which her mood changes from Content to Curious.
Generated game
02

What a game is made of

Game architecture, revealed step by stepA game has state. Every play session keeps a state: what is true right now, as any JSON value the game code chooses. This game stores the character’s mood and the id of their current portrait image.SHARED SESSION DATAPERSISTED BY THE PLATFORMStatemood: "calm"portrait: "m_4c19a7"secondsWaiting: 12Game historyThe sequence of events.YOUR BROWSERFrontend · ReactMood: calmCHATWho are you?Just a traveller, resting my feet.Nobody stops here.Mind if I sit?Not at all. Company at last!Type a message…PLATFORM SERVERBackend · Sandboxedasync onEvent()Process one input at a time.onTick()Update on the game clock.IOAgents · Images · Notify · RandomSchedulerinvokes onTickrender staterender eventsinput eventawait IOupdateemit outputupdateemit input
01 / 15

A game has state.

Every play session keeps a state: what is true right now, as any JSON value the game code chooses. This game stores the character’s mood and the id of their current portrait image.

SESSION DATAStateSTORED BY THE PLATFORM · NOT GAME CODE
{  "mood": "calm",  "portrait": "m_4c19a7"}
03

Chat and history

A session’s history is a chain of turns, each one an input event and everything it caused. The built-in Chat shows the chain, and any turn on it can be rewound to or edited.

A branching session timelineA timeline runs from left to right. An arrow rewinds from its old endpoint to an earlier point, where a new path branches off and continues into the future.rewind

↶ Rewind

Back to any turn.

Rewinding restores the game to an earlier turn. Game state, the agents’ memories and the game clock all go back together, and play continues from there.

✎ Edit

Fix what a character said.

If an agent’s reply was wrong, open that turn and edit the reply, or have it regenerated. The turn runs again with your version and play continues from there.

The Juniper game on a phone with a turn’s menu open and the rest of the screen dimmed: the turn’s number, time and cost, then Edit block, Rewind to end of block and Open raw data.
A turn’s menu
The turn editor on a phone: the input event as JSON, the message Juniper was sent, her JSON reply with its text, mood and expression, a Recalculate button, and the turn as it appears in the chat.
Editing a turn
04

Agents

An agent is a named conversation with a model, declared in the backend with its own system prompt, model, tools, memory and compaction settings. Game code decides when it speaks and what it is told.

Send and add

agent.send posts new messages and asks for a reply, keeping both. agent.addMessages appends to the conversation without calling the model. A send with no messages makes the agent respond to what it already has, which is how a scene with several characters takes turns. A send can carry a responseFormat schema, and the reply comes back as validated data instead of text.

Tools

A tool is a description, a schema and an execute function. An agent lists the tools it may call, and execute writes game state itself, so a character offering a quest is code changing the world.

Compaction and memory

Compaction is on by default: when an agent’s history outgrows its token budget, the older part is summarised in a separate call. Memory gives an agent notes it opens, closes and deletes itself. Open notes sit at the head of its context; closed ones appear as one-line descriptions.

Transient sends

A transient send keeps nothing, neither what it posted nor the reply. The reply is itself a message, tool calls and memory work included, and addMessages accepts it as is. So a game can pass a one-off instruction, or draft a reply and check it, then keep only what should stand.

05

Image generation

A game can generate images while it is played. It calls generateImage with a prompt and gets back a media id at once; the picture is drawn in the background and appears the moment it is ready, so the turn never waits on it.

Juniper, a bookbinder in round brass glasses and an indigo cardigan, smiling gently over a mug of tea in her rain-lit workshop
Reference
The same portrait of Juniper, now grinning with one hand open in delight
Excited
The same portrait of Juniper, now with a furrowed brow and one palm turned up in worry
Concerned

Fast and cheap

A 1024×1024 image with no references is back in as little as three seconds on a warm server, and typically within six. It costs one credit, which is between 0.4¢ and 1¢ depending on the plan. Asking for the same image again returns it at no charge.

Consistent characters

A prompt can carry up to ten reference images from the game. They fix a character’s face, outfit and style, so the prompt states only the change: here The Margin draws Juniper’s new mood from her one reference portrait each time it shifts. Several references compose into one frame, so two characters can share a scene.

06

Time

A game reads the date and time from state.now, and runs in one of two modes. In wall time the clock is the player’s real one. In game time it is the fiction’s own clock, which opens at a moment the game chooses and advances only while the game runs.

Wall timeGame time
Follows the player’s real clock–
Pauses while the game is suspended–
Rewinds with a rewound turn–
Supports fast-forward–
Use it forCompanions, pets, care loopsRPGs, board games, suspendable stories
07

Across devices, and while you’re away

Each playthrough is a session that runs on our servers. Your screens are windows into it, so it carries on when you switch devices, or close them all.

One session, across your devices

Open the same session on your phone, laptop or another browser tab, and each screen receives the same game state and history as they change. Start on one device and continue on another, or keep several screens open together.

Your game sessionRuns on our servers
Your phone
Your laptop
Another tab
Different screens. The same session.

Keep playing while you’re away

Because the session runs on our servers, a game that supports background play can keep going after you close every screen: a pet growing hungry, a garden growing, or characters carrying on a conversation. With your permission, it can run for up to 48 hours after you leave, within your spending limit.

You control whether it runs while you’re away. See background play and spending controls.

Know when something happens

A game can reach out when it needs your attention: your garden needs water, something is ready, or a character has news. Notifications appear in your inbox across games, and you can enable push notifications on your device to hear from the game while you’re away.

The Margin’s settings panel on a phone: Background play and Notifications toggles under Permissions; under Spending, the account balance, a per-game spend limit of 50 credits with 9.6 used, which pauses the game at the limit; and Add to Home Screen, needed for notifications on iPhone.
A game’s settings
08

The coding agent

Ask for a change whenever you like, and the coding agent makes it. It reads and writes the game’s source, and it can look inside the game you’re playing: the state, what each character said, and recent turns with their logs.

Ask→Read the docs→Change the code→Typecheck→Build→Your game updates

It sees what you saw

Say “Juniper forgot my name” and the agent can open the turn where it happened, read the messages and logs, and fix the cause. You describe what went wrong in your own words; it finds out why.

It reads the manual

The agent sees an index of the platform’s guides and reads the ones it needs as it works, so it follows proven patterns and avoids known pitfalls. They’re the same guides you can read in the docs.

Every change is checked

After a change the platform typechecks, feeds any errors back to the agent to repair, builds, and saves a revision.

Your game updates in place

A revision that keeps the state’s shape hot-swaps into the running session with its state intact. One that changes it leaves the session on the old revision and offers a restart. Updating your copy and publishing an update for others are separate actions.

Bring your own agent

Build with the AI you already use

Connect Claude, or any agent that speaks MCP, and sign in. It gets the same tools as the built-in agent, and a few more: it can start a session and play the game itself, so it tries out its own changes before you do.

https://aichatgames.io/mcp
09

Playing and remixing

Playing a published game gives you your own copy of it, crediting the original. The coding agent sits beside it, ready when you want to change a rule, a character, or the whole premise.

Find a game→Play your copy→Make it your own→Publish it for others

Mix games together

Name any published games and say what you like about each. The agent copies the code that already works, with the comments that record its pitfalls, instead of rediscovering them from scratch. Every game it draws on is credited under “Inspired by”. It sees their published source only: never anyone’s conversations, sessions or drafts.

Murder on the NightlineA mystery proven consistent before you board
The MarginA portrait that changes with her mood

You ask

“A murder mystery like Murder on the Nightline, where each suspect’s portrait shows how they’re feeling, like Juniper’s in The Margin.”

Inspired by Murder on the Nightline · The Margin

10

Publishing

Publishing puts your game on Explore and your profile, where others can find it, play their own copy, and build on it.

  • Your game

    The MarginJuniper, a bookbinder in a rainy seaside workshop
    • The Lighthouse KeeperA new companion, the same mood portraits
      • Two KeepersA second keeper, and they talk to each other
    • La MargenJuniper in Spanish, for learners
    • Faces on the NightlineSuspects whose portraits show how they feelAlso inspired by Murder on the Nightline
Every game built on yours lists it under “Inspired by”, and your game’s page lists the games it inspired, so players can follow the family both ways.

A snapshot, not a live link

Publishing pins the version you chose. Keep changing your game in private, and choose Update post when you want players to have your latest. Anyone who already has a copy keeps the one they started with.

Your process stays private

Others can play your game and build on its source. Your chats with the coding agent, your sessions and your unpublished changes stay yours.

Sharing costs you nothing

Each player plays their own copy on their own balance, so a popular game never runs up your bill.

Before it goes up, a game needs a title and a category, and it passes a content check.

Coming later: comments, likes & recommendations