Developer API · v1
Your stories, from your own code.
A REST API and an MCP server over the same account. Scoped bearer tokens, predictable JSON, no SDK required.
Example: create a story
POST /api/v1/stories · stories:write
curl -X POST https://aistoryhub.co/api/v1/stories \
-H "Authorization: Bearer ash_your_token_here" \
-H "Content-Type: application/json" \
-d '{"title":"The Lighthouse","genre":"mystery"}'{
"id": "b1f2...",
"title": "The Lighthouse",
"genre": "mystery",
"status": "draft",
"word_count": 0,
"created_at": "2026-07-16T12:00:00.000Z",
"updated_at": "2026-07-16T12:00:00.000Z"
}One token. First call in a minute.
Create a token in Settings, Developer API, then call the API with it. Everything is JSON over HTTPS. The base URL is https://aistoryhub.co.
curl https://aistoryhub.co/api/v1/me \
-H "Authorization: Bearer ash_your_token_here"Scoped, and shown once.
Every request is authenticated with an API token sent as a bearer token. Tokens are shown once at creation, so store them securely and never expose them in client-side code. Revoke a token any time from your settings.
A token only grants the scopes you select. Scopes are explicit, so write access does not imply read access. Request the minimum a given integration needs.
Authorization: Bearer ash_your_token_hereScopes
account:readRead basic account info (id, email, plan).stories:readList and read your stories and their chapters.stories:writeCreate and update stories.world:readRead world-building entries (characters, locations, lore, factions, items, species, timeline).world:writeCreate, update, and delete world-building entries.voice:readRead your Voiceprint library (Style Lab profiles) and see which one is pinned to a story.voice:writeCreate, update, and delete Voiceprints, and pin one to a story.ai:generateRun AI prose generation. Uses your own connected AI provider key.ai:reviseRun AI revision passes (improve text, Human Grit Pass). Uses your own connected AI provider key.ai:editorialRun the Editorial Pass to get structured line and structural notes on a chapter. Uses your own connected AI provider key.skills:readBrowse the skills catalog and load the prose body of any skill this connection has installed.memory:readRead durable memories saved about the account or a story.memory:writeSave, update, and delete durable memories about the account or a story.rules:readRead your saved Story Rules library.rules:writeCreate, update, and delete Story Rules. Does not publish to the community gallery.
Every endpoint, and its tool.
Each row pairs a REST endpoint with its matching MCP tool and the scope it needs. The ai:* endpoints run on your own connected AI provider key, the same BYOK key the app uses, so your provider bills the usage, not AIStoryHub. They accept a JSON body; generate, revise and grit-pass return { text }, while editorial-pass returns structured notes.
Account
- GET
/api/v1/meThe token owner's account.
get_meaccount:read
Stories
- GET
/api/v1/storiesList your stories (paginated).
list_storiesstories:read - POST
/api/v1/storiesCreate a story.
create_storystories:write - GET
/api/v1/stories/{id}Fetch a single story.
get_storystories:read - PATCH
/api/v1/stories/{id}Update a story's bible fields, including the outline (logline/arc/theme/ending/notes).
update_storystories:write - GET
/api/v1/stories/{id}/chaptersList a story's chapters.
list_chaptersstories:read - GET
/api/v1/stories/{id}/chapters/{chapterId}Fetch one chapter with its content and beats.
get_chapterstories:read - POST
/api/v1/stories/{id}/chaptersCreate a chapter or scene, ready to draft into.
create_chapterstories:write - PATCH
/api/v1/stories/{id}/chapters/{chapterId}Update a chapter/scene's title, content, or beats.
update_chapterstories:write - POST
/api/v1/stories/{id}/chapters/{chapterId}/apply-editLiteral patch: replace one exact, unique text span. No AI rewrite.
apply_editstories:write - GET
/api/v1/stories/{id}/chapters/{chapterId}/draft-status?draft_id=Where a saving generate_prose draft stands: drafting, saved, failed, or lost.
draft_statusstories:read - POST
/api/v1/stories/{id}/manuscript/find-replaceDeterministic find/replace, one chapter or the whole manuscript.
find_replacestories:write - DELETE
/api/v1/stories/{id}/chapters/{chapterId}Delete a chapter or scene, with confirmation.
delete_chapterstories:write
World
- GET
/api/v1/stories/{id}/worldList world entries (optional ?type=, paginated).
list_world_entriesworld:read - POST
/api/v1/stories/{id}/worldCreate a world entry.
create_world_entryworld:write - GET
/api/v1/stories/{id}/world/{nodeId}Fetch one world entry.
get_world_entryworld:read - PATCH
/api/v1/stories/{id}/world/{nodeId}Update a world entry.
update_world_entryworld:write - DELETE
/api/v1/stories/{id}/world/{nodeId}Delete a world entry.
delete_world_entryworld:write
Voice
- GET
/api/v1/voiceprintsList your Voiceprint library (paginated).
list_voiceprintsvoice:read - POST
/api/v1/voiceprintsCreate a Voiceprint (33 style dials).
create_voiceprintvoice:write - GET
/api/v1/voiceprints/{id}Fetch a single Voiceprint.
get_voiceprintvoice:read - PATCH
/api/v1/voiceprints/{id}Update a Voiceprint's fields.
update_voiceprintvoice:write - DELETE
/api/v1/voiceprints/{id}Delete a Voiceprint, with confirmation.
delete_voiceprintvoice:write - GET
/api/v1/stories/{id}/voiceFetch the story's pinned Voiceprint, if any.
get_story_voicevoice:read - PATCH
/api/v1/stories/{id}/voicePin or clear the story's Voiceprint.
set_story_voicevoice:write
AI
- POST
/api/v1/ai/generateGenerate prose (Draft). With save and chapter_id, writes it into the chapter (replace, or append to continue from the end); target_words sets a firm length.
generate_proseai:generate - POST
/api/v1/ai/reviseRevise text against an instruction.
revise_textai:revise - POST
/api/v1/ai/grit-passRun the Human Grit Pass over text.
grit_passai:revise - POST
/api/v1/ai/editorial-passGet structured editorial notes on a chapter. focus: "continuity" returns contradictions only.
editorial_passai:editorial - POST
/api/v1/ai/self-checkScore a chapter or pasted passage for AI tells, 0-100. No AI model call.
self_checkstories:read
Skills
- GET
/api/v1/skillsList the first-party skills catalog.
list_catalog_skillsskills:read - GET
/api/v1/skills/{slug}Load the prose body of a skill this connection has installed.
load_skillskills:read - GET
/api/v1/skills/{slug}/exportDownload an installed skill as a Claude Code SKILL.md file.
–skills:read
Memory
- GET
/api/v1/memoryList durable memories (optional ?story_id=).
list_memoriesmemory:read - POST
/api/v1/memorySave or update a memory by name.
remembermemory:write - DELETE
/api/v1/memory/{name}Delete a memory (optional ?story_id=).
forget_memorymemory:write
Story Rules
- GET
/api/v1/rulesList your Story Rules library (paginated).
list_rulesrules:read - POST
/api/v1/rulesCreate or update a rule by name.
create_rulerules:write - GET
/api/v1/rules/{id}Fetch a single rule.
get_rulerules:read - PATCH
/api/v1/rules/{id}Update a rule's fields.
update_rulerules:write - DELETE
/api/v1/rules/{id}Delete a rule, with confirmation.
delete_rulerules:write
The same API, for agents.
Every endpoint above is also exposed as an MCP tool, so an MCP-aware client (Claude Code, Claude Desktop, Cursor, ChatGPT, or your own agent) can call your AIStoryHub account directly. The server speaks Streamable HTTP and is authenticated the same way as the REST API: your ash_ token, sent as a bearer token.
https://aistoryhub.co/mcp/mcpNew to MCP or just want the one-click path? See the step-by-step Claude Desktop install guide with screenshots. Otherwise, add it to Claude Code with a custom header:
claude mcp add --transport http aistoryhub https://aistoryhub.co/mcp/mcp \
--header "Authorization: Bearer ash_your_token_here"Claude Desktop and Cursor both accept the same url + headers shape for a remote HTTP server:
{
"mcpServers": {
"aistoryhub": {
"url": "https://aistoryhub.co/mcp/mcp",
"headers": {
"Authorization": "Bearer ash_your_token_here"
}
}
}
}Both snippets work with any client that lets you set a static header on a remote server. Create a token in Settings, Developer API and both appear there with your real token already filled in.
claude.ai Connectors and Claude Desktop's one-click "Add connector" also work directly against https://aistoryhub.co/mcp/mcp, with no manual token step. AIStoryHub runs a real OAuth 2.1 authorization server (RFC 8414 metadata, PKCE-only, dynamic client registration): connecting prompts you to sign in and approve the requested permissions, and the connection shows up in Settings, Developer API right alongside manually created tokens, revocable the same way.
ChatGPT supports the same shape of connector under Settings, Apps, Advanced settings, Developer mode (Pro, Plus, Business, Enterprise and Education accounts): add a custom connector pointed at the endpoint above and OpenAI drives the same OAuth 2.1 flow.
Skills as SKILL.md files
Skills you install onto a connection (in Settings, Skills) can also be pulled down as real SKILL.md files, usable in any local project's .claude/skills/ directory, independent of the live MCP session:
curl https://aistoryhub.co/api/v1/skills/editor-in-chief/export \
-H "Authorization: Bearer ash_your_token_here" \
-o SKILL.mdThe export is a snapshot of the revision installed at download time. A skill's prose can change later (a first-party skill gets revised, or you edit your own), so re-download to pick up the current version.
When it fails, it says why.
Errors return a matching HTTP status and a consistent body.
{ "error": { "code": "forbidden", "message": "This token is missing the required scope stories:write." } }401 unauthorizedMissing, malformed, invalid, revoked, or expired token.403 forbiddenThe token lacks the scope the endpoint requires.400 invalid_requestThe request body or parameters are invalid.404 not_foundThe resource does not exist or you do not own it.409 confirmation_requiredThe action is destructive (delete_world_entry) or the resource changed since you last read it (update_world_entry with expected_updated_at). Not a failure. Retry the same request with confirm: true.429 rate_limitedToo many requests. Retry after the given delay.
Rate limits
Requests are rate limited per token by your plan tier. Exceeding the limit returns 429 with a Retry-After header telling you how long to wait. Build in a short backoff and you will rarely see it.
Versioning
The API is versioned in the URL. You are reading the docs for /api/v1. Backwards-compatible changes, such as new endpoints, new optional fields or new scopes, ship within v1 without notice. Breaking changes, such as removing a field or changing a response shape, ship under a new version path (/api/v2) rather than altering v1 in place, so existing integrations keep working.