AIStoryHub AI API

AI generation and revision. Runs on your own BYOK provider key.

Operations 5

POST /ai/generate Generate prose (Generate Pro) #
POST /ai/revise Revise text against an instruction #
POST /ai/grit-pass Run the Human Grit Pass over text #
POST /ai/editorial-pass Get structured editorial notes on a chapter #
POST /ai/self-check Score a chapter or passage for AI tells (0-100) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/aistoryhub-co:aistoryhub-co-ai-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

aistoryhub-co-ai-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AIStoryHub AI API
  version: 1.0.0
  description: A REST API for reading and creating stories and chapters on AIStoryHub outside the app. Authenticate with a scoped bearer token created under Settings, Developer API. Scopes are explicit, so write access does not imply read access.
  contact:
    url: https://aistoryhub.co/developers
  termsOfService: https://aistoryhub.co/terms
servers:
- url: https://aistoryhub.co/api/v1
security:
- bearerAuth: []
tags:
- name: AI
  description: AI generation and revision. Runs on your own BYOK provider key.
paths:
  /ai/generate:
    post:
      operationId: aiGenerate
      tags:
      - AI
      summary: Generate prose (Generate Pro)
      description: Runs on the token owner's own AI provider key (BYOK).
      x-required-scope: ai:generate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - story_id
              - instruction
              properties:
                story_id:
                  type: string
                  format: uuid
                instruction:
                  type: string
                chapter_id:
                  type: string
                  format: uuid
                file_type:
                  type: string
                  default: chapter
                file_name:
                  type: string
                special_instructions:
                  type: string
                references:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
      responses:
        '200':
          description: The generated prose.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiText'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /ai/revise:
    post:
      operationId: aiRevise
      tags:
      - AI
      summary: Revise text against an instruction
      description: Runs on the token owner's own AI provider key (BYOK).
      x-required-scope: ai:revise
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - story_id
              - text
              - instruction
              properties:
                story_id:
                  type: string
                  format: uuid
                text:
                  type: string
                instruction:
                  type: string
      responses:
        '200':
          description: The revised text.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiText'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /ai/grit-pass:
    post:
      operationId: aiGritPass
      tags:
      - AI
      summary: Run the Human Grit Pass over text
      description: Runs on the token owner's own AI provider key (BYOK).
      x-required-scope: ai:revise
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - story_id
              - text
              properties:
                story_id:
                  type: string
                  format: uuid
                text:
                  type: string
      responses:
        '200':
          description: The grit-passed rewrite.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiText'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /ai/editorial-pass:
    post:
      operationId: aiEditorialPass
      tags:
      - AI
      summary: Get structured editorial notes on a chapter
      description: Runs on the token owner's own AI provider key (BYOK). Notes are grounded in the story bible and the author's voice style.
      x-required-scope: ai:editorial
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - story_id
              - paragraphs
              properties:
                story_id:
                  type: string
                  format: uuid
                paragraphs:
                  type: array
                  items:
                    type: string
                  description: The chapter split into text blocks; note anchors reference these by index.
                file_name:
                  type: string
      responses:
        '200':
          description: Editorial notes, fence list, and scope limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditorialResult'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /ai/self-check:
    post:
      operationId: aiSelfCheck
      tags:
      - AI
      summary: Score a chapter or passage for AI tells (0-100)
      description: Pure analysis against the platform's AI-cliche corpus and structural detectors -- no AI model call, so it doesn't require a BYOK key.
      x-required-scope: stories:read
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - story_id
              properties:
                story_id:
                  type: string
                  format: uuid
                chapter_id:
                  type: string
                  format: uuid
                  description: Score this chapter's current content.
                text:
                  type: string
                  description: Or score this pasted passage instead.
      responses:
        '200':
          description: A 0-100 score (lower is cleaner) with the worst offenders listed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  score:
                    type: integer
                  findings:
                    type: array
                    items:
                      type: object
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    EditorialResult:
      type: object
      properties:
        notes:
          type: array
          items:
            $ref: '#/components/schemas/EditorialNote'
        fence_list:
          type: array
          items:
            type: string
        scope_limits: {}
    EditorialNote:
      type: object
      description: A single editorial note anchored to the chapter text by verbatim quote.
      properties:
        category:
          type: string
        scope:
          type: string
          enum:
          - line
          - structural
        confidence:
          type: string
          enum:
          - high
          - medium
          - low
        note:
          type: string
        suggestedInstruction:
          type: string
        anchorStart:
          type: string
        anchorEnd:
          type: string
        paragraphIndex:
          type: integer
        paragraphIndexEnd:
          type: integer
      additionalProperties: true
    AiText:
      type: object
      properties:
        text:
          type: string
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
              - unauthorized
              - forbidden
              - invalid_request
              - not_found
              - rate_limited
              - internal_error
            message:
              type: string
  responses:
    InvalidRequest:
      description: The request body or parameters are invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The token lacks the scope this endpoint requires.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, malformed, invalid, revoked, or expired token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests. Retry after the delay in the `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource does not exist or you do not own it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ash_...
      description: 'Create a token under Settings, Developer API and send it as `Authorization: Bearer ash_...`. Each endpoint requires one scope, listed per-operation via the `x-required-scope` extension; see https://aistoryhub.co/developers for the full scope list.'