> ## Documentation Index
> Fetch the complete documentation index at: https://game-narrative.docs.kitefrost.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Run the dev-time consistency check (advisory)

> On-demand, project-scoped, advisory consistency check over the project's current authored quests and NPCs. Returns a flat, located ConsistencyReport (errors / warnings / info). Read-only - never writes, never blocks generation or export. Free (0 SU): a budget-exhausted tenant still receives the report (never 402).



## OpenAPI

````yaml /openapi.json post /v1/projects/{project_id}/game-narrative/continuity/check
openapi: 3.1.0
info:
  title: KiteFrost
  description: >
    ## KiteFrost API


    Persistent memory and queryable context for AI-powered products. Create

    projects, track entities and relationships, record events, and query context
    -

    stateful AI you can audit, with durable state across sessions, agents, and

    tools.


    ### What you get


    - **Persistent projects** - entities, relationships, and events live across
    sessions

    - **Context queries** - ask "what does this entity know right now?" and get
    a consistent answer

    - **Event sourcing** - every state transition is recorded and replayable

    - **BYOK** - bring your own LLM provider key per project


    ### Authentication


    All routes (except `/health` and `/ready`) require an `Authorization: Bearer
    <key>` header.

    Use publishable keys (`pk_...`) for read-only client calls and secret keys
    (`sk_...`) for

    write / generation / admin operations.


    ### Async generation pattern


    1. Call a `POST .../generate` endpoint → receive `{"session_id": "...",
    "status": "accepted"}`

    2. Poll `GET /v1/sessions/{session_id}/status` until `status` is `completed`
    or `error`

    3. If `status == "awaiting_human"`, submit a response via `POST
    /v1/sessions/{session_id}/respond`
  version: 1.0.0
servers:
  - url: https://api.kitefrost.ai
    description: Production
security: []
tags:
  - name: projects
    description: >-
      Project, entity, and event management: create projects, upsert entities,
      record events, query context, and generate content with project context.
  - name: npcs
    description: >-
      NPC (non-player character) CRUD, dialogue generation, and export. Supports
      the brainstorm → draft lifecycle.
  - name: sessions
    description: >-
      Poll generation session status, submit HITL responses, and create manual
      state snapshots for rollback/replay.
  - name: events
    description: >-
      Lightweight player-event ingestion path. Accepts player choices, quest
      triggers, and custom events without spinning up a full session.
  - name: players
    description: >-
      Player data management: GDPR erasure (right to be forgotten), data export
      (right of access), player context, facts, quests, and preferences.
  - name: keys
    description: >-
      API key lifecycle management: create publishable / secret keys, list,
      revoke, and rotate keys with scoped permissions.
  - name: byok
    description: >-
      Bring Your Own Key (BYOK) management. Store, revoke, and check the status
      of a tenant-supplied LLM provider API key per project.
  - name: ttrpg
    description: >-
      TTRPG GM pack endpoints: encounter CRUD and generation, session CRUD and
      async generation.
  - name: chapters
    description: >-
      Book Author pack endpoints: chapter CRUD, async generation, and markdown
      export.
  - name: ideas
    description: >-
      Idea Generation Engine: generate novel story ideas, list, fetch, mutate,
      blend, assign, and archive ideas.
  - name: seeds
    description: >-
      Story-seed discovery operations: list, detail, on-demand generate, promote
      (canonical assign per R127-C6), lifecycle transition, and soft-delete.
  - name: feedback
    description: >-
      Collect explicit feedback signals (thumbs, rating, A/B choice) and
      retrieve aggregated insights for model improvement.
  - name: webhooks
    description: >-
      Webhook subscription management: register HTTPS endpoints for async event
      delivery, list, delete, and test HMAC signatures.
  - name: audio
    description: >-
      Audio Story pack endpoints: async audio-story generation, list, fetch, and
      export (SSML / manifest / audio).
  - name: billing
    description: >-
      Billing integration: checkout, portal, subscription management, tier info,
      and usage stats.
  - name: demo
    description: >-
      Public demo endpoint - try the KiteFrost from the landing page without
      signing up. Limited to 5 messages per session and 20 requests per IP per
      hour. No authentication required.
  - name: health
    description: >-
      Health and readiness probes for load-balancer and orchestrator liveness
      checks.
  - name: score
    description: >-
      Content scoring: run craft-layer quality metrics (C10-C15) and humanness
      scoring (H2) on arbitrary text to get a per-dimension quality breakdown.
  - name: resilience
    description: >-
      Resilience Score: aggregate compliance, training, and education pack
      results into an overall project resilience score (0-100) with
      per-dimension breakdown and trend.
  - name: compliance-exercises
    description: >-
      Compliance Tabletop pack endpoints: create exercises, generate scenarios,
      evaluate participant responses, and produce after-action reviews.
  - name: training
    description: >-
      Training Simulation pack endpoints: create scenarios, generate branching
      scenario trees, and assess learner competency.
  - name: support
    description: >-
      Support Orchestration pack endpoints: create ticket contexts, generate
      response drafts, and escalate tickets.
  - name: story_bible
    description: >-
      Story Bible: assemble the Knowledge Graph into a structured canonical
      reference of characters, locations, events, factions, and items with their
      relationships. Supports point-in-time snapshots via at_seq.
  - name: gamification
    description: >-
      Gamification endpoints: player points, earned achievements, leaderboards
      with configurable visibility and weekly reset, and activity streaks.
  - name: conversations
    description: >-
      Multi-player conversation lifecycle: create, join, submit input, stream
      events (SSE), leave, and get conversation state.
  - name: images
    description: >-
      Image generation: create AI-generated images from text prompts with
      pack-configurable presets, safety controls, and audit logging.
paths:
  /v1/projects/{project_id}/game-narrative/continuity/check:
    post:
      tags:
        - continuity
      summary: Run the dev-time consistency check (advisory)
      description: >-
        On-demand, project-scoped, advisory consistency check over the project's
        current authored quests and NPCs. Returns a flat, located
        ConsistencyReport (errors / warnings / info). Read-only - never writes,
        never blocks generation or export. Free (0 SU): a budget-exhausted
        tenant still receives the report (never 402).
      operationId: >-
        check_continuity_v1_projects__project_id__game_narrative_continuity_check_post
      responses:
        '200':
          description: Consistency report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsistencyReport'
        '401':
          description: Unauthorized - no valid API key supplied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: Unauthorized
                code: unauthorized
                request_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                message: No valid API key was supplied.
                doc_url: https://docs.kitefrost.ai/errors/unauthorized
        '403':
          description: Forbidden - API key lacks the required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: Forbidden
                code: forbidden
                request_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                message: Your API key does not have the required scope.
                doc_url: https://docs.kitefrost.ai/errors/forbidden
        '404':
          description: Project not found
        '429':
          description: >-
            Too Many Requests - rate limit exceeded. Retry after the
            'Retry-After' header interval.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: Rate limit exceeded
                code: rate_limited
                request_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                message: You have exceeded the rate limit for your plan.
                doc_url: https://docs.kitefrost.ai/errors/rate_limited
        '500':
          description: >-
            Internal Server Error - unexpected server-side failure. Retry with
            exponential back-off.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                error: Internal server error
                code: internal_error
                request_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                message: An unexpected error occurred.
                doc_url: https://docs.kitefrost.ai/errors/internal_error
components:
  schemas:
    ConsistencyReport:
      properties:
        report_version:
          type: string
          const: '1'
          title: Report Version
          default: '1'
        project_ref:
          type: string
          title: Project Ref
        generated_at:
          type: string
          title: Generated At
        summary_counts:
          $ref: '#/components/schemas/SummaryCounts'
        findings:
          items:
            $ref: '#/components/schemas/ReportFinding'
          type: array
          title: Findings
      type: object
      required:
        - project_ref
        - generated_at
        - summary_counts
      title: ConsistencyReport
      description: The flat, advisory, located dev-time consistency report (INV-GNRPT3).
    APIError:
      properties:
        error:
          type: string
          title: Error
        code:
          type: string
          title: Code
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
        detail:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Detail
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        doc_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Doc Url
        feedback_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Feedback Id
      type: object
      required:
        - error
        - code
      title: APIError
      example:
        code: not_found
        doc_url: https://docs.kitefrost.ai/errors/not_found
        error: Not found
        message: >-
          The requested resource does not exist or you do not have permission to
          access it. Verify the resource ID and your API key scopes.
        request_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
    SummaryCounts:
      properties:
        error:
          type: integer
          minimum: 0
          title: Error
          default: 0
        warning:
          type: integer
          minimum: 0
          title: Warning
          default: 0
        info:
          type: integer
          minimum: 0
          title: Info
          default: 0
      type: object
      title: SummaryCounts
      description: Per-severity finding tallies.
    ReportFinding:
      properties:
        id:
          type: string
          title: Id
        severity:
          type: string
          enum:
            - error
            - warning
            - info
          title: Severity
        kind:
          type: string
          enum:
            - world_state_contradiction
            - npc_status_conflict
            - quest_status_conflict
            - quest_prerequisite_conflict
            - relationship_conflict
          title: Kind
        entities:
          items:
            type: string
          type: array
          title: Entities
        arc_refs:
          items:
            type: string
          type: array
          title: Arc Refs
        message:
          type: string
          title: Message
        why:
          items:
            type: string
          type: array
          title: Why
        source_locus:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Locus
        entity_links:
          items:
            $ref: '#/components/schemas/EntityLink'
          type: array
          title: Entity Links
      type: object
      required:
        - id
        - severity
        - kind
        - message
      title: ReportFinding
      description: |-
        One customer-facing, disclosure-safe consistency finding.

        Attributes
        ----------
        id:
            Stable per-report finding identifier (``finding-{n}``).
        severity:
            ``error`` / ``warning`` / ``info`` - projected from the substrate band.
        kind:
            Closed-enum fact-family classification.
        entities:
            Referenceable entity/node atoms this finding is about (≥1 - INV-GNRPT2).
        arc_refs:
            Arc/scene references that localise the finding (may be empty in v1).
        message:
            Human-readable, customer-facing explanation (no internal names).
        why:
            The conflicting fact reference(s) backing the finding.
        source_locus:
            Optional source coordinate (e.g. ``"story.yarn:42"``) recovered from an
            imported snapshot's pack-local locus side-channel (GN-IMP-1 R2/INV-IR2).
            ``None`` on the native (non-import) path - the side-channel is import-only.
        entity_links:
            Server-side enriched click-through links (GN-CDASH-2 / INV-CDF2).
            Populated by the dashboard REST route; empty on the CLI/import paths.
            Each entry maps a cited entity fact-key to its dashboard detail route.
    EntityLink:
      properties:
        entity_type:
          type: string
          title: Entity Type
        entity_id:
          type: string
          title: Entity Id
        slug:
          type: string
          title: Slug
        route:
          type: string
          title: Route
      type: object
      required:
        - entity_type
        - entity_id
        - slug
        - route
      title: EntityLink
      description: >-
        Server-side enriched click-through link for a cited entity (GN-CDASH-2).


        Populated by the dashboard REST route so the UI can render

        ``<NuxtLink>`` to the entity's dashboard detail page without

        re-implementing ``parse_fact_key`` in TypeScript.

        ``None`` / absent when no dashboard route is known (import-path
        entities).

````