API Reference

This page summarizes the currently implemented JSON-RPC methods and transport-level HTTP endpoints.

1. binary HTTP

RouteBodySuccess responseNotes
POST /upload/{resource_id}/{file_id}Raw bytesResourceFilePayloadUpload one logical resource file
GET /download/{resource_id}/{file_id}NoneRaw bytesDownload one logical resource file

2. Configuration and Resource Families

FamilyMain methodsNotes
api.*create get list list_models update deleteReusable API connections
api_group.*create get list update deletePer-agent API binding bundles
preset.*create get list update deleteGeneration settings and modular prompts
preset_entry.*create update deleteSingle prompt entry management
preset_preview.*template runtimePrompt preview endpoints
schema.*create get list update deleteState schema resources
lorebook.*create get list update deleteLorebook resources
lorebook_entry.*create get list update deleteLorebook entry resources
player_profile.*create get list update deletePlayer setup resources
character.*create get list update deleteCharacter card resources

Notes:

  • api.delete returns conflict if an api_group still references the API
  • preset.delete returns conflict if a story draft or session still references the preset
  • schema.delete returns conflict if characters, resources, stories, or sessions still reference it
  • character covers and .chr archives are transferred through binary routes

3. Story Families

FamilyMain methodsNotes
story_resources.*create get list update deletePre-generation input bundle
story.*generate_plan create generate get update update_graph list delete start_sessionStory lifecycle
story_draft.*start get list update_graph continue finalize deleteChunked story generation

Highlights:

  • story.generate is the compatibility wrapper around the full draft flow
  • story_draft.start, story.generate, and story.generate_plan all accept optional api_group_id and preset_id
  • story.update_graph and story_draft.update_graph validate graph structure before saving

4. Session Families

FamilyMain methodsNotes
session.*get update list delete run_turn suggest_replies set_player_profile update_player_description get_runtime_snapshot get_variables update_variables get_config update_configCore runtime APIs
session_character.*get list update delete enter_scene leave_sceneSession-scoped temporary characters
session_message.*create get list update deleteTranscript message CRUD

Notes:

  • session.run_turn is the primary streaming method
  • session.suggest_replies returns 3 suggestions by default and accepts 2..=5
  • session.update_variables only accepts variable updates
  • session-scoped temporary characters do not modify the underlying story graph

5. Global and Aggregate APIs

MethodResultNotes
config.get_globalglobal_configGet the fallback api_group_id / preset_id pair
dashboard.getdashboardGet aggregated dashboard data

dashboard contains:

  • health
  • counts
  • global_config
  • recent_stories
  • recent_sessions

6. Data Package APIs

MethodResultNotes
data_package.export_preparedata_package_export_preparedBuild a temporary ZIP export slot
data_package.import_preparedata_package_import_preparedAllocate a temporary ZIP import slot
data_package.import_commitdata_package_import_committedValidate and atomically import the ZIP

Supported resource types:

  • preset
  • schema
  • lorebook
  • player_profile
  • character
  • story_resources
  • story

Import/export flow:

  1. call data_package.export_prepare, then download through GET /download/package_export:{export_id}/archive
  2. call data_package.import_prepare, then upload through POST /upload/package_import:{import_id}/archive
  3. call data_package.import_commit to validate and apply the package atomically