Experience API overview
Welcome to the Hidden Door Experience API.
Hidden Door is a story engine. It runs stories in worlds that keep evolving: characters form relationships, choices change places and objects, and every story leaves its mark on the world for the next. Our web game is one client of that engine. This API, our MCP server and host integration are three ways for you to build on the same architecture.
Key concepts
Section titled “Key concepts”Every experience begins with a world seed, which defines a setting and its rules, lore and story possibilities. Creating a world instance from that seed gives you an evolving version of the world, with its own characters, items, locations and history. For example, two instances of the Land of Oz might start from the same seed and develop very differently as stories unfold in each.
Within an instance, you can create characters and bring them into stories, advancing the action one turn at a time. Characters form relationships, events change the world, and the instance carries that history into later stories. Storylines connect stories through chapters, and each chapter’s beats are marked open, hit or skipped as stories fulfil them. A conversation lets a player talk with a character or the narrator inside a story.
World seeds are created with the MCP or in Atlas, not through this API. This API lists the seeds you can use and creates instances from them.
Three ways to build
Section titled “Three ways to build”Hosted. With the Experience API, Hidden Door runs the story loop and your client presents it. You choose a world, bring characters into a story and submit their actions; Hidden Door returns the narrative, the changes to the world and anything it needs from the player next. Your interface can be a game, a chat app, a companion screen or something we haven’t thought of.
Embedded. Your game runs its own loop, with its own characters, renderer and verbs, and asks Hidden Door for story at the moments you choose. See Integrate with your own game.
With agents. The Hidden Door MCP server lets agents create and edit world seeds, alongside Atlas, our web editor for worlds, either by importing existing creative works or by developing a new concept from scratch.
Guides
Section titled “Guides”Read the guides in order for a walkthrough, or go directly to the task you need. They follow one Land of Oz instance from its creation to a finished story.
- Start a world instance: choose the Oz seed and create an evolving world.
- Create characters in a world instance: generate and save an original character.
- Read the evolving world: inspect entities, story history and setting rules.
- Add locations and items: populate the world and refine its descriptive detail.
- Choose a storyline and start a story: assemble a cast, generate options and select an opening.
- Advance a story and supply requested input: submit actions, consume events and answer input requests.
- Have a conversation with a character: exchange dialogue with a character or narrator and apply its effects.
- Finish a story and continue the world: apply outcomes, retain new entities and start the next episode.
The recipes use the same operations to build different kinds of experience:
- A companion character: a character the player keeps coming back to talk with.
- A story that plays itself: your server chooses the actions and Hidden Door tells the story.
- A living world companion: a second screen that shows the world, its cast and its storylines as they change.
Use the endpoint reference to look up request fields, constraints and responses. Each guide links to the operations it uses.
Work with an evolving world
Section titled “Work with an evolving world”Hidden Door holds the authoritative state of each instance. Read current game state to see its entities, stories and storyline progress. Send actions and identifiers to change that world; do not send an edited snapshot back.
Generate story options with a lead, supporting cast and modifiers, then start a story using one of the three returned options. New options replace the previous set. Stories and their history persist independently of those temporary previews.
Story-changing operations return updated gameState, the new public events and any outstanding inputRequests. If a story asks for an entity, text, a choice or a next scene, answer that request using its event identifier. The request remains part of the story until it is answered or superseded.
Use conversations to exchange dialogue with a present character or the narrator. Their transcripts remain available until the returned expiry time. Ending a conversation, or submitting the next story action, applies its effects to the world; letting it expire discards its pending effects.
World seed endpoints return only seeds you have permission to create instances from.
Integrate with your own game
Section titled “Integrate with your own game”With host integration, your game stays in charge of play, and Hidden Door supplies the story around it:
- You choose the entry points. Your game asks for story at the moments that matter to it: the player starts talking to a character, a character approaches the player, or something happens in the world. Hidden Door answers with the next piece of narrative for that moment.
- Your verbs stay yours. Your game reports what players actually did in its own terms, such as entering an area or picking something up. Hidden Door folds those events into the story and the world’s history, the same way it treats actions in a hosted story.
- Story comes back in terms your game can use. Stories carry objectives, and storylines mark each beat as
open,hitorskipped. In an integration, those beats and objectives refer to your characters, places and assets, so your game can light up a quest marker or trigger a cutscene when the story reaches them. - The world remembers. As with a hosted experience, each world instance keeps its characters, relationships and history, so the next story builds on the last.
Go further with the MCP
Section titled “Go further with the MCP”Use the MCP tools to imagine stories and create story media:
- Imagined stories play out a what-if story in a world instance from a premise, without a live player, and save it to the instance’s history as if it had been played.
- Story media turns a finished story into a postcard, a comic page or a short screenplay, built around a moment you choose.
To try them, get in touch.
Connect your application
Section titled “Connect your application”The API base URL is https://api.hiddendoor.co/experience/v1.
The API authenticates requests with an API key in the Authorization: Bearer <api-key> header. Access is limited to Hidden Door staff, who can generate keys in Account Settings → API Keys. To request access, get in touch. The examples use $HD_API_KEY for that key. Keep it on a server you control, not in browser code or a distributed game client.
Keys belong to your Hidden Door account and share that account’s world access and instances. Separate keys do not isolate applications or environments, and key scopes do not restrict access. Browser session tokens are not accepted. Your application manages its own end-player identities; do not give players your API key.
Read with your tools
Section titled “Read with your tools”The docs are available as web pages and machine-readable text:
- Documentation index lists the guides, recipes and API contract for agents and other tools.
- Guide Markdown provides the walkthrough as plain text.
- OpenAPI document defines the endpoint inputs, outputs and schemas used by the reference.