canonical: https://jentic.com/apis/aistoryhub.co/aistoryhub

# AIStoryHub API

The AIStoryHub API drafts, revises, and edits long-form fiction and manages the manuscript around it from outside the app. Its AI operations generate prose, revise text against an instruction, run a human-grit pass, return structured editorial notes on a chapter, and score a passage for AI tells. Alongside them it manages stories and their bible, chapters and scenes, world-building entries, Voiceprints that pin a story's voice, a Story Rules library, and durable named memories. Exact-span edits and deterministic find and replace let an agent change text precisely, and a skills listing can export a skill as a Claude Code SKILL.md file.

## For AI agents

Generate and revise long-form fiction and manage the manuscript behind it. Create stories, chapters, scenes, world-building, Voiceprints, Story Rules, and memories; make exact-span edits; and run AI generation, editorial, grit, and AI-tell self-check passes over text.

## Scope

Does not publish or host a public reading site, process payments, or manage audiobooks. Use for drafting, revising, and managing long-form fiction manuscripts only.

## Capabilities

- Generate prose and revise text against an instruction with the AI writing operations
- Run a human-grit pass and score a chapter or passage for AI tells from 0 to 100
- Create and update stories, chapters, and scenes, with exact-span edits and deterministic find and replace
- Maintain world-building entries and pin a story's Voiceprint to keep a consistent voice
- Keep a Story Rules library and durable named memories that persist across sessions
- Load a skill's prose instructions and export it as a Claude Code SKILL.md file

## Use cases

### Agent-Assisted Drafting and Self-Check

An agent writing a chapter can generate prose from the story's outline, revise it against an instruction, run a human-grit pass to roughen machine-smooth text, and then score the result for AI tells before saving. Because the self-check returns a 0 to 100 score, the agent can gate publishing on a threshold and revise again if the passage reads as machine-written. This turns raw generation into a reviewed draft without the agent leaving the manuscript.

Example prompt: Generate a scene from a story's outline, revise it for pacing, run the grit pass, then score it for AI tells and save the chapter only if the score clears a set threshold.

### Managing a Story Bible and World

A long manuscript stays consistent when its facts live in structured entries: the API manages a story's bible fields including the outline, world-building entries for people, places, and lore, and a Story Rules library the author can apply. Voiceprints pin the intended voice for a story so later generation matches it, and durable memories persist details across sessions. An agent uses these to keep continuity across many chapters.

Example prompt: Create a world-building entry for a new character, add a Story Rule about their speech, and pin a Voiceprint so later generated scenes match the voice.

### Precise, Deterministic Manuscript Edits

When an agent must change wording without disturbing the rest, it can apply an edit that replaces one exact, unique text span in a chapter, or run a deterministic find and replace across one chapter or the whole manuscript. Because the edits are exact and deterministic, the change is auditable and will not silently rewrite nearby text. This suits automated copy edits and consistent renames across a book.

Example prompt: Rename a character across the whole manuscript with a deterministic find and replace, then verify a specific chapter with an exact-span apply-edit.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/stories` | Create a story |
| POST | `/stories/{id}/chapters` | Create a chapter or scene |
| POST | `/stories/{id}/chapters/{chapterId}/apply-edit` | Replace one exact, unique text span in a chapter |
| POST | `/ai/generate` | Generate prose |
| POST | `/ai/revise` | Revise text against an instruction |
| POST | `/ai/self-check` | Score a chapter or passage for AI tells from 0 to 100 |
| POST | `/voiceprints` | Create a Voiceprint |
| GET | `/skills/{slug}/export` | Download a skill as a Claude Code SKILL.md file |

## Key resources

- **Stories** — Create, read, and update stories and their bible fields, including the outline
- **Chapters and Scenes** — List, create, update, and delete chapters and scenes, with exact-span edits and find and replace
- **AI Operations** — Generate prose, revise against an instruction, run the grit pass, get editorial notes, and score for AI tells
- **World, Voiceprints, and Rules** — World-building entries, pinned and library Voiceprints, and a Story Rules library
- **Skills and Memory** — A skills listing with SKILL.md export and durable named memories that persist across sessions

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 67 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 93 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 50 / 100
  - Agent Usability: 94 / 100
  - Security: 60 / 100
  - AI Discoverability: 70 / 100
- **View full report:** https://jentic.com/apis/aistoryhub.co/aistoryhub/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the AIStoryHub API by hand means creating a scoped bearer token under Settings, sending Authorization: Bearer ash_ on every call, and tracking which scope each operation needs since write access does not imply read access. Through Jentic you install once, import it from the API Directory, store the token once, and your agent calls the story, chapter, and AI operations.
- **Permission scoping:** AIStoryHub puts the story id in the URL path (`/stories/{id}`), so a rule can pin your agent to one story and the operations you pick: it can read and append chapters to that story and nothing else. The token itself is scoped so write access does not imply read access, and you choose the operations the agent may call, so destructive ones like chapter or Story Rule deletion are not included unless you add them.
- **Credential handling:** Your AIStoryHub scoped token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate a scene from the outline' or 'score a chapter for AI tells', and Jentic returns the matching AIStoryHub operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenAI** — Raw large-language-model text generation rather than a fiction workspace with a story bible and AI-tell scoring
- **Cohere** — General text generation and reasoning models without manuscript structure or editorial passes
- **Storyblok** — A headless CMS to publish finished chapters that AIStoryHub drafts and edits

## FAQ

### What authentication does the AIStoryHub API use?

Per its OpenAPI spec the AIStoryHub API uses an HTTP bearer scheme: you create a scoped token under Settings, Developer API and send it as Authorization: Bearer ash_... on every request. Each operation requires one scope listed via the x-required-scope extension, and scopes are explicit, so a write scope does not grant read access.

### Can I generate and revise prose with the AIStoryHub API?

Yes. The AI operations generate prose from a story's context, revise text against an instruction, run a human-grit pass to roughen machine-smooth writing, return structured editorial notes on a chapter, and score a passage for AI tells from 0 to 100. You can chain them to produce a reviewed draft rather than raw output.

### What are the rate limits for the AIStoryHub API?

The OpenAPI spec does not publish numeric rate limits for the AIStoryHub API. For current limits and the full per-operation scope list, check the developer documentation at https://aistoryhub.co/developers.

### How do I draft a chapter with the AIStoryHub API through Jentic?

Import the AIStoryHub API from the Jentic API Directory, then have your agent search by intent such as 'generate a scene from the outline' and Jentic returns the generate operation with its input schema. The agent generates the prose, revises it, scores it for AI tells, and saves the chapter. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the AIStoryHub API?

Yes. AIStoryHub carries the story id in the URL path, so write a rule that allows only one story and the read and chapter-append operations, and your agent can draft into that story but cannot delete chapters, Story Rules, or Voiceprints. The token's own scopes reinforce this, since write access does not imply read access, and every call it makes is logged.

### Is there an AIStoryHub MCP server?

You don't need an MCP server to give your agent the AIStoryHub API. Jentic connects it directly from the API Directory: import it, store your scoped token once, and your agent calls the story, chapter, and AI operations on demand without loading another server's tool definitions into its context.

### How does the AIStoryHub API keep a story's voice consistent?

You create Voiceprints in a library and pin one to a story, so later generation targets that voice, and you can clear or change the pinned Voiceprint at any time. Combined with the Story Rules library and durable memories, this keeps characters, lore, and tone consistent across many chapters.
