/api/openapi.jsonDB-native character library server. Clients do zero heavy lifting: querying, filtering, sorting, and windowing all happen server-side. All timestamps are unix milliseconds. Every collection GET says what it answers in its x-collection: a page ({items, total, limit, nextCursor}: 100 rows unless limit asks, at most 1000 unless the operation names its own numbers, a limit outside them refused by name; a reader that needs the whole set walks nextCursor with after, and count=false skips the total), the whole set as a plain array or document with what bounds it. info.version is the API's own version (apiVersion on /api/health): it moves only when a route is removed or a shape a client reads changes. From the first public release on, an operation marked deprecated here leaves in a later release, and a form a list still answers until a later API version is named in its x-collection deprecated, with that version in until. Multi-user mode (server.yaml multiUser: true) gates every user surface behind an HttpOnly SameSite=Strict session cookie from /api/auth/login; single-user mode needs no auth and everything resolves to the default user. A 401 that means "sign in" carries X-CL-Auth: required. A 401 without it is no request to sign in: a refused login or password change under /api/auth, or a site's refusal a provider route passes through (a wrong password at a site's login, an expired site token). While the app updates itself, from its merge to its restart, every write (a non-GET request outside /api/app/update, extension routes included) is answered 503 with words: try it again after the reload. A request may send X-UTC-Offset, the reader's clock in minutes east of UTC, and X-Time-Zone, its IANA zone (Europe/Paris): the time macros a prompt or a sent message holds ({{time}}, {{date}}) answer in the offset, and a stored date written without a zone (a message's createdAt, {{idle_duration}}) is read in the zone, else at the offset, else in the server's own.
Cards, avatars, import/export
| Parameter | In | Type | Description |
|---|---|---|---|
q |
query | string | search over the fields qIn names. name, nickname, creator, tags, listingName and tagline match q as one substring. The card-text fields (notes, description, firstMessage, altGreetings) match it word by word: every word must appear inside some word of those fields ("agon" finds "dragon"), capitals and accents ignored ("cafe" finds "café"), and a "quoted run" must appear as those whole words in that order. Punctuation separates words, so a q of punctuation alone matches no card text. The fields qIn names are ORed |
qIn |
query | string | fields q searches: name, nickname, creator, notes, tags, listingName, tagline, description, firstMessage, altGreetings (default: name,nickname,creator). The card-text fields answer from the full-text index, except a word found inside too many indexed words (most words of one or two letters), which reads the text of every card instead and is slower |
match |
query | string | full-text search in FTS5 query syntax over name/creator/nickname/creator_notes/description/personality/scenario/first_mes/mes_example/system_prompt/alternate_greetings/post_history_instructions/depth_prompt: words AND by default, OR/NOT, "phrases", prefix*, column filters like description:dragon. Composable with every other filter |
words |
query | string | plain text in place of match, over the same full-text columns: every word of two letters or more required, each matching as a prefix ("drag" finds "dragon"; a lone letter is passed over); a text with no such words matches no character. A filter takes it too |
ids |
query | string | restrict to these character uuids (bulk resolve/existence check) |
notIds |
query | string | leave out these character uuids (a selection over a filter that the reader deselected some of) |
creator |
query | string | exact creator (case-insensitive) |
tag |
query | string | must carry EVERY listed tag (AND, case-insensitive) |
anyTag |
query | string | must carry at least one listed tag (OR) |
excludeTag |
query | string | must carry none of the listed tags |
excludeTagAll |
query | string | rejected only when carrying EVERY listed tag (the exclude-all mode) |
provider |
query | string | linked to this provider id (chub, wyvern, ...) |
linked |
query | 1 | true | yes | 0 | false | no |
linked to any provider (true) / to none (false) |
hasUrl |
query | 1 | true | yes | 0 | false | no |
the card holds an http substring anywhere: a cheap SUPERSET of every card with remote media, in any field (the media-localization prefilter) |
fav |
query | 1 | true | yes | 0 | false | no |
favorites only / non-favorites only |
locked |
query | 1 | true | yes | 0 | false | no |
update-locked only / unlocked only |
mediaLocalized |
query | 1 | true | yes | 0 | false | no |
media localization completed (the bulk sweep skips these) / not yet |
loreDismissed |
query | 1 | true | yes | 0 | false | no |
the embedded-lorebook hint was dismissed for this character / not |
world |
query | string | exact primary lorebook name |
hasWorld |
query | 1 | true | yes | 0 | false | no |
has a primary lorebook REFERENCE (extensions.world) |
hasLorebook |
query | 1 | true | yes | 0 | false | no |
has an EMBEDDED character_book in the card |
hasSystemPrompt |
query | 1 | true | yes | 0 | false | no |
card carries a non-empty system_prompt |
altGreetingsMin |
query | integer | at least this many alternate greetings; also altGreetingsMax |
specVersion |
query | string | exact card spec version, for example '3.0' or '2.0' |
tokensMin |
query | integer | token estimate lower bound |
tokensMax |
query | integer | token estimate upper bound |
createdAfter |
query | integer | createdAt >= (ms); also createdBefore |
importedAfter |
query | integer | importedAt >= (ms); also importedBefore |
updatedAfter |
query | integer | updatedAt >= (ms); also updatedBefore |
sort |
query | name | created | imported | updated | tokens | relevance | random | string matching ^ext\.[a-z0-9][a-z0-9-]*\.[a-z][a-zA-Z0-9_]*$ |
an unknown value is refused 400 naming the set; default name; relevance (bm25, best first) requires match or words and ranks at most 10000 characters: a match the filter leaves broader is refused 400 (narrow it, or sort by another key); random = uniform sample (offset-only, no cursor). An extension the account has on adds its declared sort keys as ext.<id>.<key> (listed in its inventory row's serverQuery): the characters with a value first, in its order, then the rest by name ascending whichever the order; offset-only, no cursor |
order |
query | asc | desc |
default asc |
limit |
query | integer | page size: default 100 (an ids request: its id count), at most 1000, or 10000 with idsOnly; past it, walk nextCursor with after. A whole library is never one answer |
offset |
query | integer | page start (with limit); cost grows with depth - prefer after for scrolling |
after |
query | string | keyset cursor from a prior response nextCursor: O(page) at any depth. Not available with sort=relevance, sort=random or an extension's sort key |
count |
query | 1 | true | yes | 0 | false | no |
count=false skips the total (null in the envelope): the count leg dominates broad queries on huge libraries; scroll clients use nextCursor for has-more |
rules |
query | string | URL-encoded JSON array of structured filter rules [{field, op, value}] - the advanced-filter model evaluated server-side. Identity and library: name, nickname, creator, creatorNotes, version, listingName, tags, favorite, providerLink, playlist, playlistName, nameOverride, uid (the id of the character itself: contains or equals), tokens, cardSpec. Card text (unindexed: a rule reads the card of each character it tests, so it costs more the broader the set): description, personality, scenario, firstMessage, exampleDialogue, systemPromptText, postHistoryInstructions, depthPrompt. Presence: embeddedLorebook, systemPrompt, altGreetings, linkedLorebook. Dates: dateAdded, dateCreated, dateModified, lastChat. An extension the account has on adds its declared fields as ext.<id>.<key> (their ops are in its inventory row's serverQuery). Unknown field/op fails 400 naming the valid set |
idsOnly |
query | 1 | true | yes | 0 | false | no |
project only {id, fav} per item (no tags or links) - select-all-matching, whose toolbar star reads fav, and cheap id enumeration; fields= adds more of each character to it |
fields |
query | string | a projection the verb names: with idsOnly, the fields to carry beside id and fav (name, creator, characterVersion, mediaLocalized, links); on a list, creatorNotes to carry the notes whole and creatorNotesExcerpt their plain-text excerpt, neither of which a row carries unless named. An unknown name is 400 |
| 200 | CharacterEnvelope | OK |
| 400 | Error | invalid parameter, match and words both, or sort=relevance over more than 10000 matching characters |
| 200 | object | groups best first: by confidence, then by the best score in the group |
| Parameter | In | Type | Description |
|---|---|---|---|
name |
query | string | source filename hint, used for logging and the import summary. NOT an identity: two unrelated cards sharing a filename import as two characters. Identity heals through the embedded cl.uid / version_uid aliases and the provider link |
onExisting |
query | string | only 'copy' is accepted: force a new character that claims nothing. Absent runs the no-overwrite triage (new / identical-skip / diverged-skip); anything else is 400 |
source |
query | string | the provider namespace this import came through. One link per character: a card embedding several provider namespaces keeps only one link, the source's, else the first in the namespaces order GET /api/extensions answers |
image/pngapplication/octet-stream| 200 | object | {id, created, name, row}; created:false means it resolved onto an existing character; row is the character as GET /characters?ids= answers it, so the importer takes it in without a second read; the picture is /avatars/{id}.png |
| 400 | Error | empty body, a bad onExisting, or a source that is not a provider namespace |
| 415 | Error | not a PNG (other card files go through /import/stage) |
| 422 | Error | no embedded card |
| Parameter | In | Type | Description |
|---|---|---|---|
name |
query | string | source filename hint, as on /import: carried to the import as its sourceName, never an identity |
application/octet-stream| 200 | object | OK |
| 400 | Error | empty body; or a charx the archive reader refuses: a member past the import cap, members unpacking past the archive budget, or a corrupt member (its local header, its checksum, or inflating past its declared size) |
| 413 | Error | a card PNG past 100 MB |
| 415 | Error | a Content-Type other than application/octet-stream, image/png, image/webp or image/jpeg (a form or JSON post is refused before it is read); or a body that is neither a card PNG nor a charx |
| 422 | Error | no card in the file, or a card.json that is not JSON |
| Parameter | In | Type | Description |
|---|---|---|---|
stageId |
path | string | the id the stage call answered |
application/json| Field | Type | Description |
|---|---|---|
card |
object | the amended card (V1, V2 or V3 shape); omitted, the staged card imports. A charx card's embedded data.assets entries are folded again, so the stored card never points into the container |
onExisting |
copy |
as on /import |
source |
string | as on /import: the provider namespace this import came through |
| 200 | object | {id, created, name, media, row} (media: the gallery rows added; mediaFailed, when any: the files that could not be written, the import standing; row: the character as GET /characters?ids= answers it; the picture is /avatars/{id}.png), or {skipped, reason, id, created:false, name, media} |
| 400 | Error | a stage id outside the uuid grammar, bad onExisting or source, or an amended card that is not a card |
| 404 | Error | no such stage: committed, dropped, or kept past its hour |
| 422 | Error | no card in the file |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
source |
query | string | with a PNG body: the provider namespace the card came through, as on /import |
image/pngapplication/octet-streamapplication/json| Field | Type | Description |
|---|---|---|
stage required |
string | a stage id from /import/stage |
card |
object | the amended card, as on the stage commit |
source |
string | as on /import |
| 200 | object | {id, created:false, replaced:true, name, snapshot, row} (row: the character as GET /characters?ids= answers it; snapshot: the version id of the card as it stood, null when the card and the picture were the ones held; media with a staged charx: the gallery rows added; mediaFailed, when any: its files that could not be written) |
| 400 | Error | no PNG and no stage, a stage id outside the uuid grammar, a bad source, or an amended card that is not a card |
| 404 | Error | no such character, or no such stage |
| 415 | Error | an image or octet-stream body that is not a card PNG (a charx is staged and sent as { stage }); any other body without a stage is a 400 |
| 422 | Error | no card in the file |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
application/json| Field | Type | Description |
|---|---|---|
fields |
object | dot-path updates, for example {'name': 'X', 'extensions.chub.tagline': 'Y'}; the root key must be a V2 or V3 card field or extensions (anything else is refused 400 naming the path, so a mistyped path never mints a junk key; custom data belongs under extensions); extensions.fav and extensions.update_locked set the favourite and update-lock flags (never stored in the card); an extensions.{provider} write sets the character's provider link (one link per character: a whole-namespace object REPLACES any existing link, null unlinks, and a nested write requires that namespace's link to exist), and tags sets its tags |
fav |
boolean | |
mediaLocalized |
boolean | a per-character flag, like fav; never card content |
loreDismissed |
boolean | a per-character flag, like fav; never card content |
application/json| Field | Type | Description |
|---|---|---|
card required |
object | the card's name and the texts the rule scores; anything else on it is ignored |
hits required |
array<object> |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
application/json| Field | Type | Description |
|---|---|---|
hits required |
array<object> |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
format |
query | png | charx |
png (the default) or charx. A charx of a V2 card says V3 in its card.json and records what the export added in extensions.cl.charx, so importing that file back gives the card as stored (identical); a file another app has changed since comes in as the V3 card it became |
application/json| Field | Type | Description |
|---|---|---|
charIds |
array<string> | at most 10000 |
filter |
string | a GET /api/characters query string |
| 200 | object | OK |
| 400 | Error | neither charIds nor a filter, both, more than 10000 charIds, a filter parameter refused in the list's words, or a filter parameter the list does not take |
application/json| Field | Type | Description |
|---|---|---|
charIds |
array<string> | at most 10000 |
filter |
string | a GET /api/characters query string |
fav required |
boolean |
| 200 | object | by charIds {ok, touched, affected, skipped} |
| 202 | object | by filter: the job |
| 400 | Error | no charIds, more than 10000 of them, charIds and a filter both, fav not a boolean, a filter parameter refused in the list's words, or one the list does not take |
application/json| Field | Type | Description |
|---|---|---|
charIds |
array<string> | at most 10000 |
all |
boolean | |
mediaLocalized |
boolean | |
loreDismissed |
boolean |
| 200 | object | by charIds {ok, touched, affected, skipped} |
| 202 | object | all: true: the job |
| 400 | Error | bad body: exactly one of charIds or all, at least one flag, at most 10000 charIds |
application/json| Field | Type | Description |
|---|---|---|
charIds |
array<string> | |
filter |
string | a GET /api/characters query string |
expect |
integer | with filter: the count of characters the reader confirmed |
| 200 | object | by charIds {ok, touched, deleted, missing} |
| 202 | object | by filter: the job |
| 400 | Error | bad body, more than 100 ids, charIds and a filter both, expect not a count, a filter parameter the list refuses or does not take, or an extension's store guard refused an id: nothing was deleted, the error is the guard's words |
| 409 | object | by filter with expect: the set holds another count of characters now (total); nothing was deleted |
application/json| Field | Type | Description |
|---|---|---|
updates required |
array<object> | at most 5000 |
| 200 | object | {ok, touched, affected, failed: [{id, error}]} |
| 400 | Error | bad body, or more than 5000 entries: nothing was written |
Per-character gallery media (uid-keyed files), chat attachments and media download jobs
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
limit |
query | integer | rows a page: default 100, at most 1000; past it, walk nextCursor with after |
after |
query | string | the nextCursor of the page before: the rows after it, O(page) at any depth |
count |
query | 1 | true | yes | 0 | false | no |
count=false skips the total (null in the answer); a walk reads nextCursor for has-more |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
name |
query | string | display name; when the bytes are another kind of file than its extension says (a video named .png), the stored name takes the bytes' extension |
sourceUrl |
query | string | origin url; dedupes by url hash |
*/*| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
application/json| Field | Type | Description |
|---|---|---|
from required |
string | the character whose gallery is copied |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
application/json| Field | Type | Description |
|---|---|---|
url required |
string | |
answerMs |
integer | how long the host gets to start answering, 1000 to 60000 (the default); the whole download keeps its 60 second limit |
| 200 | Media | row, or {skipped:true} when already present |
| 400 | Error | http(s) url required |
| 403 | Error | the net guard refuses the url: an empty host, or one resolving to a private or local address |
| 404 | Error | character not found |
| 413 | Error | file too large |
| 415 | Error | not media |
| 502 | Error | upstream failed, answered empty, or timed out; kind "no-answer" rides along when the host itself gave no answer (silence, a dropped connection, or a 502, 503 or 504) |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
| 200 | object | OK |
| 404 | Error | chat not found |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
name |
query | string | display name; when the bytes are another kind of file than its extension says (a video named .png), the stored name takes the bytes' extension |
*/*| Parameter | In | Type | Description |
|---|---|---|---|
limit |
query | integer | rows a page: default 100, at most 1000; past it, walk nextCursor with after |
after |
query | string | the nextCursor of the page before: the jobs after it, O(page) at any depth |
count |
query | 1 | true | yes | 0 | false | no |
count=false skips the total (null in the answer); a walk reads nextCursor for has-more |
ids |
query | string | job ids, at most 1000: those jobs alone, a page at their own count (limit defaults to it) |
| 200 | object | OK |
| 400 | Error | a limit outside 1 to 1000, an after that is not a cursor, ids that are not job ids or more than 1000 of them, or a count that is not a boolean word |
application/json| Field | Type | Description |
|---|---|---|
charIds |
array<string> | |
filter |
string | |
all |
true |
|
rescan |
boolean |
| 200 | object | total: the set (less the processed when rescan is false); queued: the characters with a pending job now; noMedia: those with no remote url and no provider link; active: those whose job a worker is running |
| 400 | Error | charIds, filter or all, one of them; at most 10000 charIds a request; a filter the list cannot read; rescan or all of the wrong kind |
| 503 | Error | the library closed while the set was queued |
Chat wallpapers: a flat image library plus the bindings that decide which chat wears which
| 200 | array<Background> | OK |
| Parameter | In | Type | Description |
|---|---|---|---|
name |
query | string | display name; the bytes decide what the file is (a video named .png is refused), and the stored name takes their extension |
sourceUrl |
query | string | provenance, and makes a re-run idempotent |
application/octet-stream| 200 | Background | row, or {skipped:true, reason:"url"|"content", duplicateOf} when the bytes are already held |
| 400 | Error | empty body |
| 415 | Error | not an image |
application/json| Field | Type | Description |
|---|---|---|
url required |
string |
| 200 | Background | row, or {skipped:true} |
| 400 | Error | http(s) url required |
| 403 | Error | the net guard refuses the url: an empty host, or one resolving to a private or local address |
| 413 | Error | file too large |
| 415 | Error | not an image |
| 502 | Error | upstream failed or timed out; kind "no-answer" when the host itself gave none |
| Parameter | In | Type | Description |
|---|---|---|---|
mediaId |
path | string | media row id |
| 200 | Background | row, or {skipped:true} when those bytes are already held |
| 404 | Error | media or file not found |
| 415 | Error | not an image |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | background row id |
application/json| Field | Type | Description |
|---|---|---|
displayName required |
string |
| 200 | Background | OK |
| 400 | Error | bad name |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
chatId |
query | string | chat uuid (required) |
| 200 | ResolvedBackground | OK |
| 400 | Error | chatId is required |
| Parameter | In | Type | Description |
|---|---|---|---|
scope |
path | string | global | character | chat |
| 200 | object | OK |
| 400 | Error | bad scope, or a character or chat scope without its id |
| Parameter | In | Type | Description |
|---|---|---|---|
scope |
path | string | global | character | chat |
application/json| Field | Type | Description |
|---|---|---|
backgroundId |
integer | null | null means explicitly none |
fit |
cover | contain | stretch | center | tile |
|
opacity |
number | 0 to 1 |
blur |
integer | 0 to 40 px |
brightness |
number | 0 to 2 |
saturate |
number | 0 to 2 |
renderWidth |
| 0 | 768 | 1280 | 1920 |
which tier the client should request; null is auto, 0 is the original |
| 200 | BackgroundBinding | OK |
| 400 | Error | bad scope, or a character or chat scope without its id; or an unknown enum value or out-of-range knob (the message names the valid set) |
| 404 | Error | scope target or background not found |
| Parameter | In | Type | Description |
|---|---|---|---|
scope |
path | string | global | character | chat |
id |
path | string | character or chat uuid (the global scope takes the path without it) |
| 200 | object | OK |
| 400 | Error | bad scope, or an id on the global scope |
| Parameter | In | Type | Description |
|---|---|---|---|
scope |
path | string | global | character | chat |
id |
path | string | character or chat uuid (the global scope takes the path without it) |
application/json| Field | Type | Description |
|---|---|---|
backgroundId |
integer | null | null means explicitly none |
fit |
cover | contain | stretch | center | tile |
|
opacity |
number | 0 to 1 |
blur |
integer | 0 to 40 px |
brightness |
number | 0 to 2 |
saturate |
number | 0 to 2 |
renderWidth |
| 0 | 768 | 1280 | 1920 |
which tier the client should request; null is auto, 0 is the original |
| 200 | BackgroundBinding | OK |
| 400 | Error | bad scope, or an id on the global scope; or an unknown enum value or out-of-range knob (the message names the valid set) |
| 404 | Error | scope target or background not found |
Chats and their messages: browse, search, edit, branch and export, the prompt a chat would send, and generation on the server, streamed as SSE
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string | optional; default "{charName} - {timestamp}" |
header |
object | optional; merged over the card/settings defaults (user_name, character_name, chat_metadata) |
messages |
array<object> | optional; SillyTavern rows, stored verbatim when present (the greeting is NOT seeded). A ChatMessage is not a row: send its raw. seq and raw are refused on a row, since a stored row is exported as JSONL |
| 200 | ChatDetail | OK |
| 400 | Error | messages must be an array of objects, or an element carrying seq or raw (the native shape's keys: send each message's raw) |
| 404 | Error | character not found |
| 409 | Error | name clash |
| Parameter | In | Type | Description |
|---|---|---|---|
match |
query | string | FTS5 query; this or q |
q |
query | string | plain text in place of match: every word of two letters or more required, each matching as a prefix (a lone letter is passed over); a text with no such words answers no hits |
charId |
query | string | restrict to one character |
limit |
query | integer | hits a page: default 50, at most 500; past it, walk offset |
offset |
query | integer | page start |
count |
query | 1 | true | yes | 0 | false | no |
count=false skips the total (null in the envelope), the expensive leg of a broad match |
| 200 | ChatSearchEnvelope | OK |
| 400 | Error | neither match nor q, or both, invalid FTS syntax, a limit outside 1 to 500, an offset that is not a number, or a count that is not a boolean word |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
query | string | filter to one character |
world |
query | string | bound-world filter: exact name, or 'any' for bound-to-anything |
q |
query | string | substring match on the chat name or its character name |
rules |
query | string | URL-encoded JSON array of structured filter rules [{field, op, value}], the chats view's advanced-filter model evaluated server-side. Chat fields: chatName, charName, messageCount, messageText (contains / not_contains: a message's shown text holds every word of the value of two letters or more, each word a prefix; a value of no such words matches no message), lastMessage, chatLorebook. Character-scoped, read off the chat's character as the character list's rules read them: charFavorite, charTags, charProviderLink, charPlaylist. Unknown field/op fails 400 naming the valid set |
sort |
query | string | recent | oldest | name | messages | created | character | chats (default recent). recent is the newest message, else the creation. character and chats order the characters (by name, by chat count; ties by their newest chat) and list each character's chats newest first |
order |
query | asc | desc |
flips the sort's own key (oldest is recent with order=asc); default is the sort's natural direction |
grouped |
query | 1 | true | yes | 0 | false | no |
rows contiguous per character, ordered by a per-character key for the sort (its name for character, its chat count for chats, its newest chat for every other sort, flipped with recent/oldest), then the sort within the character; every row carries charChatCount |
limit |
query | integer | rows a page: default 100, at most 1000; past it, walk nextCursor with after |
offset |
query | integer | ignored when after is given |
after |
query | string | keyset cursor from a prior response nextCursor, over the sort's whole key (ties included): O(page) at any depth |
count |
query | 1 | true | yes | 0 | false | no |
count=false skips the total (null in the envelope); scroll clients use nextCursor for has-more |
| 200 | ChatEnvelope | OK |
| 400 | Error | invalid parameter, a limit outside 1 to 1000, unknown sort, order, rule field or op, or a junk cursor |
| 200 | object | OK |
| 404 | Error | no chat open, or the chat is gone |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
msgLimit |
query | integer | message page size |
msgOffset |
query | integer | message page start |
msgTail |
query | integer | the LAST n messages, returned in ascending seq order; wins over msgLimit/msgOffset (msgLimit=1 answers with the greeting, which is the other end) |
| 200 | ChatDetail | OK |
| 400 | Error | msgLimit, msgOffset or msgTail is not a number |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string | |
draft |
string | null | the composer text not yet sent; null or empty clears it. Never exported, never moves updatedAt |
chatMetadata |
object | |
personaId |
string | null | per-chat persona override; null CLEARS it so the chat follows the global persona again, omitted leaves it alone |
profileId |
string | null | this chat's own connection; null CLEARS it so the chat follows the default for chats again, omitted leaves it alone. Never moves updatedAt |
presetId |
string | null | this chat's own prompt preset; null CLEARS it so the chat follows the active preset again, omitted leaves it alone. Never moves updatedAt |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
firstShown |
query | integer | the first message the reader's screen shows, which {{firstDisplayedMessageId}} answers |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
| 200 | object | OK |
| 404 | Error | chat not found |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
| 200 | ChatLoreState | OK |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
application/json| Field | Type | Description |
|---|---|---|
seq required |
integer | the message the branch ends on |
swipeId |
integer | optional: the alternate the branch's last message shows, selected as a swipe pick selects it (its generation record with it), in the same write |
messageId |
integer | optional: the id of the message the reader branched from; another message at that seq now refuses the branch (409), no chat made |
| 200 | ChatDetail | OK |
| 400 | Error | seq is not a message seq, swipeId is not an alternate of that message, or a messageId that is not a message id |
| 404 | Error | chat or message not found |
| 409 | Error | another message than the one named holds that seq now (a delete renumbered the chat since it was read): that message changed since it was shown; nothing was written |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
application/json| Field | Type | Description |
|---|---|---|
mes |
string | the text; empty is allowed when attachments name pictures |
attachments |
array<integer> | pictures from the chat's own gallery this turn shows, in order |
firstShown |
integer | the first message the reader's screen shows, which {{firstDisplayedMessageId}} answers |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
application/json| Field | Type | Description |
|---|---|---|
messages required |
array<object> | SillyTavern rows; a ChatMessage is not a row: send its raw |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
seq |
path | string | message row seq |
messageId |
query | integer | the id of the message the reader was shown at this seq: another message there now refuses the write (409). Left out, the write goes to whichever message holds the seq |
application/json| Field | Type | Description |
|---|---|---|
mes |
string | |
swipes |
array<string> | alternates; index swipe_id is the active one |
swipe_id |
integer | |
swipe_info |
array<object> | one entry per alternate, as SillyTavern keeps them; the extra of an entry holds the generation record of its alternate (reasoning, usage, interrupted, edited, guidance) |
extra |
object | null | per-message flags, MERGED key by key: { hidden: true } hides the row from the prompt, { hidden: null } deletes that leaf and touches nothing else; hidden must be boolean or null; null for the whole field drops the bag |
name |
string | |
is_system |
boolean | |
shown |
object | optional: what the reader was shown of this message, never written as a field of it: its active alternate's place, the alternates counted and that alternate's text. When the stored message differs in any of them the request is refused with 409 and nothing is written; left out, it acts on whatever alternate is active |
| 200 | object | OK |
| 400 | Error | bad seq / empty patch / seq or raw in body / a dotted key / extra not an object / extra.hidden not boolean / extra.attachments naming a picture that is not this chat's or is not a picture / a messageId that is not a message id / a shown that is not { index, count, text } (an index outside the count, a count under 1, a text that is not a string) |
| 404 | Error | chat or message not found |
| 409 | Error | another message than the one named holds that seq now (a delete renumbered the chat since it was read): that message changed since it was shown; nothing was written; or the message holds another active alternate, count of alternates or active text than the one named as shown (an alternate added, dropped, picked or rewritten since it was read): that message changed since it was shown; nothing was written |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
seq |
path | string | message row seq |
messageId |
query | integer | the id of the message the reader was shown at this seq: another message there now refuses the write (409). Left out, the write goes to whichever message holds the seq |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
seq |
path | string | message row seq |
application/json| Field | Type | Description |
|---|---|---|
text required |
string | the alternate added, not blank |
count required |
integer | the alternates the reader was shown: swipes.length, 1 for a message with none |
messageId |
integer | optional: the id of the message the reader was shown at this seq; another message there now refuses the write (409) |
| 200 | object | OK |
| 400 | Error | bad seq, a blank or missing text, a count that is not a positive integer, or a messageId that is not a message id |
| 404 | Error | chat or message not found |
| 409 | Error | another message than the one named holds that seq now (a delete renumbered the chat since it was read): that message changed since it was shown; nothing was written; or the message holds another count of alternates than the one named: that message's alternates changed since they were shown; nothing was written |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
seq |
path | string | message row seq |
application/json| Field | Type | Description |
|---|---|---|
index required |
integer | the alternate dropped, 0 to count - 1 |
text required |
string | the text that alternate held as shown |
count required |
integer | the alternates the reader was shown, 2 or more |
messageId |
integer | optional: the id of the message the reader was shown at this seq; another message there now refuses the write (409) |
| 200 | object | OK |
| 400 | Error | bad seq, a count under 2, an index outside the count, a text that is not a string, or a messageId that is not a message id |
| 404 | Error | chat or message not found |
| 409 | Error | another message than the one named holds that seq now (a delete renumbered the chat since it was read): that message changed since it was shown; nothing was written; or the message holds another count of alternates, or another text at that index: that message's alternates changed since they were shown; nothing was written |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
application/json| Field | Type | Description |
|---|---|---|
profileId |
string | the connection that answers this one request; omitted, the chat's own connection answers, else the default for chats, else the first |
params |
object | |
mode |
append | regenerate | swipe | continue | impersonate |
append (default) adds a message; regenerate rewrites targetSeq in place (without a targetSeq, the trailing message when it is a reply; a chat ending on the user's turn gains a new reply); swipe pushes an alternate onto targetSeq and excludes it from the prompt; continue appends into targetSeq and clears its interrupted marker; impersonate writes the USER's next line as a draft: it streams back and stores NOTHING |
targetSeq |
integer | regenerate/swipe/continue; defaults to the trailing row. Must be a non-user, non-system message |
targetId |
integer | optional, beside targetSeq: the id of the message the reader was shown there (without targetSeq, of the trailing message). Another message there now refuses the generation with a 409 before the model is asked; left out, the target is whichever message holds the seq at the resolve |
targetShown |
object | optional: what the reader was shown of the target message (regenerate/swipe/continue), checked before the model is asked, so a reroll, a swipe or a continue from a screen that is behind the server never rewrites or grows an alternate it did not show: its active alternate's place, the alternates counted and that alternate's text. When the stored message differs in any of them the request is refused with 409 and nothing is written; left out, it acts on whatever alternate is active |
firstShown |
integer | the first message the reader's screen shows, which {{firstDisplayedMessageId}} answers |
guidance |
string | steering text that rides as a trailing budget-measured system instruction, never as transcript content. On impersonate it directs the user-side draft; on append it makes a GUIDED REPLY: the character's next turn follows the direction (template: the preset's guidedInstruction setting), and the reply stores it as extra.guidance. A swipe or a regenerate that sends none follows its target's own (the shown alternate's extra.guidance), so another take on a directed reply is directed the same way; one that sends its own uses that. Ignored by continue |
| 200 | text/event-stream | |
| 400 | Error | bad chat/profile/mode/target, firstShown is not a message seq, a targetId that is not a message id, or a targetShown that is not { index, count, text } |
| 404 | Error | chat or target message not found |
| 409 | Error | another message than the one named holds that seq now (a delete renumbered the chat since it was read): that message changed since it was shown; nothing was written; or the message holds another active alternate, count of alternates or active text than the one named as shown (an alternate added, dropped, picked or rewritten since it was read): that message changed since it was shown; nothing was written |
| 502 | Error | upstream failure |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
| 200 | JSONL attachment | |
| 404 | Error | not found |
Out-of-character assistant sessions bound to a chat
| 200 | object | OK |
| Parameter | In | Type | Description |
|---|---|---|---|
chatId |
query | string | chat uuid |
| 200 | array<AssistantSession> | OK |
| 400 | Error | chatId required |
application/json| Field | Type | Description |
|---|---|---|
chatId required |
string | |
name |
string |
| 201 | AssistantSession | OK |
| 400 | Error | chatId required |
| 404 | Error | chat not found |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
| 200 | AssistantSession | OK |
| 404 | Error | not found |
| 500 | Error | this session's transcript could not be read |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string | |
profileId |
string | null |
| 200 | AssistantSession | OK |
| 400 | Error | blank name / nothing to change |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
role |
user | assistant |
|
content |
string | the text; empty is allowed when pictures are named |
pictures |
array<object> | a reader turn's pictures, in order: { kind, id } of the chat's character (its portrait or a gallery image) or the chat's own pictures, each held to it; stored on the turn with its name and size |
retry |
object | a Try again on a reader turn: the reply by its stamp (at) and the changes of it to try again (ids). While it is the last reader turn, the model is sent each change as written and where it stands now |
| 200 | object | OK |
| 400 | Error | a bad role, neither content nor pictures, pictures on a reply, a picture the session may not show, or a retry on a reply |
| 404 | Error | not found |
| 409 | Error | session changed underneath the write, or a retry naming a reply, or a change of it, that changed since it was shown |
| 500 | Error | this session's transcript could not be read |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
seq |
path | string | transcript index |
at |
query | integer | the stamp (at) of the turn the reader was shown; when given and the turn now at seq carries another, the write is refused with 409 |
application/json| Field | Type | Description |
|---|---|---|
content |
string | |
extra |
object |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
seq |
path | string | transcript index |
mode |
query | one | truncate |
default truncate |
at |
query | integer | the stamp (at) of the turn the reader was shown; when given and the turn now at seq carries another, the write is refused with 409 |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
seq required |
integer | |
ids required |
array<string> | proposal ids from the proposals route |
at |
integer | optional: the reply's stamp as the client showed it; a reply at seq carrying another stamp answers 409 |
shown |
array<object> | optional: each change as the client showed it, aligned with ids; one the reply now holds otherwise under that id answers 409 |
overrides |
object | reviewer touch-ups keyed by proposal id, merged before apply and never stored: a key is accepted only where the change already carries it with the same shape (amend, never widen), plus world on a CREATE to redirect the entry to another book |
| 200 | object | OK |
| 400 | Error | bad seq / no ids / an at that is no number / a shown list of another length than ids / nothing left to apply |
| 404 | Error | session or message not found |
| 409 | Error | the reply changed since it was shown: its stamp, or a change under one of the ids |
| 500 | Error | this session's transcript could not be read |
| Parameter | In | Type | Description |
|---|---|---|---|
chatId required |
query | string |
| 200 | object | OK |
| 400 | Error | chatId query required |
The creator studio: sessions over a character draft, their messages and generation, the edits it proposes and applies, and tag suggestions
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | session uuid |
| 200 | object | OK |
| 404 | Error | no such session |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | session uuid |
name |
query | string | display name; when the bytes are another kind of file than its extension says (a video named .png), the stored name takes the bytes' extension |
*/*| 200 | object | OK |
application/json| Field | Type | Description |
|---|---|---|
draft required |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
references |
string | the reference cards block the panel built from a playlist (the inspiration pool) |
scope |
array<string> | the fields the author is working on; the rest of the draft is context |
selection |
object | a passage the author selected to revise: { field, text } |
| 200 | object | OK |
| 400 | Error | a draft field of the wrong shape |
application/json| Field | Type | Description |
|---|---|---|
draft required |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
profileId |
string | the LLM profile to ask; the default profile when omitted |
params |
object | per-call sampler overrides in the neutral vocabulary (temperature, maxTokens, reasoning) |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
query | string | character uuid; omit for drafts |
| 200 | array<StudioSession> | OK |
application/json| Field | Type | Description |
|---|---|---|
charId |
string | null | |
name |
string | |
draft |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
profileId |
string |
| 201 | StudioSession | OK |
| 400 | Error | a draft field of the wrong shape |
| 404 | Error | character not found |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
| 200 | StudioSession | OK |
| 404 | Error | not found |
| 500 | Error | this session's transcript could not be read |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string | |
profileId |
string | null | |
charId |
string | null | the character to bind the session to; null moves it back to the drafts bucket |
draft |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
| 200 | StudioSession | OK |
| 400 | Error | blank name / nothing to change / a draft field of the wrong shape |
| 404 | Error | not found |
| 500 | Error | this session's transcript could not be read |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
role |
user | assistant |
|
content |
string | the text; empty is allowed when pictures are named |
pictures |
array<object> | a reader turn's pictures, in order: { kind, id } of the session's character, when it has one (its portrait or a gallery image), or the session's own pictures, each held to it; stored on the turn with its name and size |
retry |
object | a Try again on a reader turn: the reply by its stamp (at) and the changes of it to try again (ids). While it is the last reader turn, the model is sent each change as written and where it stands now |
| 200 | object | OK |
| 400 | Error | a bad role, neither content nor pictures, pictures on a reply, a picture the session may not show, or a retry on a reply |
| 404 | Error | not found |
| 409 | Error | session changed underneath the write, or a retry naming a reply, or a change of it, that changed since it was shown |
| 500 | Error | this session's transcript could not be read |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
seq |
path | string | transcript index |
at |
query | integer | the stamp (at) of the turn the reader was shown; when given and the turn now at seq carries another, the write is refused with 409 |
application/json| Field | Type | Description |
|---|---|---|
content |
string | |
extra |
object |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
seq |
path | string | transcript index |
mode |
query | one | truncate |
default truncate |
at |
query | integer | the stamp (at) of the turn the reader was shown; when given and the turn now at seq carries another, the write is refused with 409 |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
draft required |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
references |
string | the reference cards block the panel built from a playlist (the inspiration pool) |
scope |
array<string> | the fields the author is working on; the rest of the draft is context |
selection |
object | a passage the author selected to revise: { field, text } |
profileId |
string | |
params |
object |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
seq required |
integer | |
draft required |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
seq required |
integer | |
ids required |
array<string> | |
at |
integer | optional: the reply's stamp as the client showed it; a reply at seq carrying another stamp answers 409 |
shown |
array<object> | optional: each change as the client showed it, aligned with ids; one the reply now holds otherwise under that id answers 409 |
draft required |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
overrides |
object |
| 200 | object | OK |
| 400 | Error | bad seq / no ids / an at that is no number / a shown list of another length than ids / nothing left to apply / a draft field of the wrong shape |
| 404 | Error | session or message not found |
| 409 | Error | the reply changed since it was shown: its stamp, or a change under one of the ids |
| 500 | Error | this session's transcript could not be read |
| Parameter | In | Type | Description |
|---|---|---|---|
sid |
path | string | session uuid |
application/json| Field | Type | Description |
|---|---|---|
draft required |
object | the unsaved card as the form holds it: name, tagline, description, personality, scenario, first_mes, mes_example, system_prompt, post_history_instructions, creator_notes as strings; tags and alternate_greetings as lists of strings |
references |
string | the reference cards block the panel built from a playlist (the inspiration pool) |
scope |
array<string> | the fields the author is working on; the rest of the draft is context |
selection |
object | a passage the author selected to revise: { field, text } |
Lorebooks: the whole-book document plus entry-by-entry writes
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | chat uuid |
| 200 | array<string> | OK |
| 404 | Error | chat not found |
application/json| Field | Type | Description |
|---|---|---|
chatIds required |
array<string> | |
add |
array<string> | |
remove |
array<string> |
| 200 | object | {ok, touched, affected, skipped, deltas: [{chatId, added, removed, worlds}]} |
| 400 | Error | no chatIds, more than 1000, nothing to add or remove, or a name with no book |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | character uuid |
| 200 | array<string> | OK |
| 404 | Error | character not found |
| 200 | object | OK |
application/json| Field | Type | Description |
|---|---|---|
add |
array<string> | |
remove |
array<string> |
| 200 | object | {ok, added, removed} (actual changes only) |
| 400 | Error | nothing to do |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | persona uuid |
| 200 | array<string> | OK |
| 404 | Error | persona not found |
application/json| Field | Type | Description |
|---|---|---|
charIds required |
array<string> | at most 10000 |
add |
array<string> | |
remove |
array<string> |
| 200 | object | {ok, touched, affected, skipped, deltas} |
| 400 | Error | nothing to do, no charIds or more than 10000, or a name with no book |
| Parameter | In | Type | Description |
|---|---|---|---|
limit |
query | integer | rows a page: default 100, at most 1000; past it, walk nextCursor with after |
after |
query | string | the nextCursor of the page before: the books after it, O(page) at any depth |
count |
query | 1 | true | yes | 0 | false | no |
count=false skips the total (null in the answer); a walk reads nextCursor for has-more |
q |
query | string | the names that contain this text, case folded; a % or _ is a character |
counts |
query | 1 | true | yes | 0 | false | no |
each book also carries chars, chats and personas (how many of each bind it) and global (whether the global list holds it) |
placeholders |
query | 1 | true | yes | 0 | false | no |
a false word leaves out the placeholder books (names something binds with no book yet); default they are listed |
| 200 | object | OK |
| 400 | Error | a limit outside 1 to 1000, an after that is not a cursor, or a flag that is not a boolean word |
application/json| Field | Type | Description |
|---|---|---|
provider required |
string | |
keys required |
array<string> |
| 200 | object | OK |
| 400 | Error | provider or keys missing, or more than 500 keys |
| Parameter | In | Type | Description |
|---|---|---|---|
name |
path | string | world name |
| 200 | object | OK |
| 404 | Error | world not found |
application/json| Field | Type | Description |
|---|---|---|
rename |
object | |
remove |
string |
| 200 | object | {touched} |
| 400 | Error | bad sweep |
| Parameter | In | Type | Description |
|---|---|---|---|
prefix |
query | string | the start of a carrier name |
limit |
query | integer | rows per arm: default 200, at most 1000 |
| 200 | array<object> | OK |
| 400 | Error | no prefix, or a limit outside 1 to 1000 |
| Parameter | In | Type | Description |
|---|---|---|---|
q required |
query | string | plain text: every word of two letters or more required, each matching as a prefix (a lone letter is passed over); a text with no such words answers no hits |
limit |
query | integer | hits a page: default 50, at most 500; past it, walk offset |
offset |
query | integer | page start |
count |
query | 1 | true | yes | 0 | false | no |
count=false skips the total (null in the envelope), the expensive leg of a broad match |
| 200 | WorldEntrySearchEnvelope | OK |
| 400 | Error | no q, a limit outside 1 to 500, an offset that is not a number, or a count that is not a boolean word |
| Parameter | In | Type | Description |
|---|---|---|---|
name |
path | string | world name |
| 200 | object | OK |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
name |
path | string | world name |
expect |
query | absent | placeholder |
make the write a create or a placeholder fill |
application/json| Parameter | In | Type | Description |
|---|---|---|---|
name |
path | string | world name |
| 200 | object | {ok, unbound} |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
name |
path | string | world name |
application/json| Field | Type | Description |
|---|---|---|
provider required |
string | |
externalId required |
string | |
path |
string | null | |
url |
string | null | |
onlyIfMissing |
boolean |
Playlists, versions, personas, settings, KV store, backups, bundles, migration, maintenance and background jobs
application/json| Field | Type | Description |
|---|---|---|
providers |
array<string> | provider ids to match against (max 20); or provider: one id |
provider |
string | |
keys required |
array<string> | remote ids or paths, max 500 |
owners |
boolean | also answer the links behind the keys (the import duplicate check), each resolved to its character id |
loose |
boolean | with owners: links whose path begins with the key or that the key begins with, exact links first; a purely numeric or uuid key, and a purely numeric path, only match exactly |
| 200 | object | OK |
| 400 | Error | providers missing, keys missing, a cap exceeded, owners or loose not boolean, or loose without owners |
application/json| Field | Type | Description |
|---|---|---|
path required |
string | the SillyTavern user data folder (holding characters/, chats/, worlds/), a path on the machine running the server |
only |
array<string> | a test pool by character name or file |
sample |
integer | a random test pool of this size |
excludeTags |
array<string> |
| 200 | object | OK |
| 400 | Error | no characters/ under the path, a targetHandle naming another account, or the tool refused (its lines say why) |
| 409 | Error | a migration or a plan is already running: the caller's own run with its tail, anything else without details |
| 500 | Error | the migration tool could not be started |
application/json| Field | Type | Description |
|---|---|---|
path required |
string | |
only |
array<string> | |
sample |
integer | |
excludeTags |
array<string> | |
warmThumbs |
boolean | |
verify |
full | fast | off |
| 200 | text/event-stream: started {mode, target, source, startedAt, options}, line {line}, progress {step, label, done, total, unit, sources?, sizes?, at} (a step's count; steps read, worlds, characters, chats, rest, check, then thumbs and gallery-thumbs when asked, each from done 0 to its total, the total standing from its first record; sources and sizes on the thumbnail steps say what the total counts), done {mode, target, code, cancelled, report, state} (code 0 done, 1 the tool stopped, 2 some cards could not be read, 3 the check found differences; report as GET /migrate/status answers lastReport), error {message, kind} | |
| 400 | Error | no characters/ under the path, or a targetHandle naming another account |
| 409 | Error | a migration or a plan is already running: the caller's own run with its tail, anything else without details |
application/json| Field | Type | Description |
|---|---|---|
path required |
string | |
verify |
full | fast | off |
|
force |
boolean |
| 200 | text/event-stream: started, line, progress (steps check, then purge), done (code 3 when the final check found differences and nothing was removed; its report carries ok, purged and the check as GET /migrate/status answers lastFinalize), error | |
| 400 | Error | no characters/ under the path, or a targetHandle naming another account |
| 409 | Error | a migration or a plan is already running: the caller's own run with its tail, anything else without details |
| 200 | object | OK |
| 404 | Error | no migration is running |
| 200 | object | OK |
| 200 | array<object> | OK |
| 200 | object | OK |
| 200 | object | OK |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | job id |
dismiss |
query | boolean | true lets go of a backup that ended, so it leaves the notifications |
| 200 | object | OK |
| 200 | object | OK |
| 204 | noted |
| 200 | object | OK |
| 200 | object | already tidy |
| 202 | object | the tidy-up running or waiting |
| Parameter | In | Type | Description |
|---|---|---|---|
chatId |
query | string | chat uuid; omit for the global answer |
| 200 | object | OK |
| 200 | object | OK |
application/json| Field | Type | Description |
|---|---|---|
name required |
string | |
description |
string | |
pronouns |
object | any of the five forms, each a string of at most 64 characters once trimmed; a form left out is left alone (empty on a create), and an empty string clears one back to its they/them word |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | persona uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string | |
description |
string | |
pronouns |
object | any of the five forms, each a string of at most 64 characters once trimmed; a form left out is left alone (empty on a create), and an empty string clears one back to its they/them word |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | persona uuid |
| 200 | object | OK |
| 404 | Error | no such persona |
application/json| Field | Type | Description |
|---|---|---|
ids |
array<string> | character uuids, exported in this order, a repeated one once; omit (with no filter) for the whole library (in creation order; a character renamed mid-export goes out once) |
filter |
string | a GET /api/characters query string (read the list's way; sort, order, paging and count ignored): its set, walked in creation order as it stands, so one created mid-walk that matches goes out and one deleted mid-walk is skipped and named. Never with ids |
include |
object | all default true |
| Parameter | In | Type | Description |
|---|---|---|---|
worlds |
query | 1 | true | yes | 0 | false | no |
false (or 0, no) skips the bundled lorebooks AND each character's and chat's lorebook list past its first book (the first rides the card and the chat header); a value outside the boolean words is 400 |
only |
query | string | restrict to these manifest uids, and the bundled lorebooks to the ones those entries name (a pack from before the per-entry lists brings all of its lorebooks) |
copy |
query | string | manifest uids to import as forced NEW copies (the per-entry override for diverged duplicates) |
application/zip| 200 | object | {imported, identical, diverged[], chats, chatLinesDropped (chat file lines left out: torn, or not a JSON object), media, worlds, worldsRenamed, errors} |
| 400 | Error | not a zip / no manifest / pre-v2 pack; or refused by the archive reader: a member past the import cap, members unpacking past the archive budget, or a corrupt member (its local header, its checksum, or inflating past its declared size) |
| 415 | Error | a Content-Type other than application/zip, application/x-zip-compressed or application/octet-stream |
| 200 | object | OK |
application/json| Field | Type | Description |
|---|---|---|
charIds |
array<string> | at most 10000 |
filter |
string | a GET /api/characters query string |
| 200 | object | OK |
| 400 | Error | neither charIds nor a filter, both, charIds not character ids or more than 10000, or a filter parameter the list refuses or does not take |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | playlist id |
application/json| Field | Type | Description |
|---|---|---|
name |
string | |
description |
string | |
icon |
string | |
color |
string |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | playlist id |
after |
query | string | the nextCursor of the page before |
limit |
query | integer | ids a page: default 1000, at most 10000 |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | playlist id |
application/json| Field | Type | Description |
|---|---|---|
add |
array<string> | |
remove |
array<string> | |
filter |
string | a GET /api/characters query string |
op |
add | remove |
with filter |
| 200 | object | OK |
| 202 | object | by filter: the job |
| 400 | Error | nothing to add or remove, a list that is not character ids, more than 10000 ids between add and remove, a filter beside add or remove, an op other than add or remove, or a filter parameter the list refuses or does not take |
| 404 | Error | no such playlist |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
path | string | character uuid |
| 200 | object | OK |
| 404 | Error | no versions for this character |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
path | string | character uuid |
| 200 | Ok | OK |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
path | string | character uuid |
application/json| Field | Type | Description |
|---|---|---|
label |
string | |
source |
string | 'local' (default), 'auto_backup', 'assistant', 'remote' or another source name |
charName |
string | |
data required |
object | the composed card's data |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
path | string | character uuid |
| 200 | Ok | OK |
| 200 | object | OK |
LLM profiles + server-side chat calls (keys stay server-side), prompt presets and regex scripts
| 200 | array<object> | OK |
| 200 | object | OK |
application/json| Field | Type | Description |
|---|---|---|
name required |
string | |
blocks |
array<PresetBlock> | |
regexScripts |
array<RegexScript> | |
settings |
PresetSettings | the settings it starts with (a copy sends the original's); one left out reads its default |
application/json| Field | Type | Description |
|---|---|---|
preset required |
object | |
name |
string |
| 200 | object | OK |
| 400 | Error | not an object / nothing expressible in it |
| Parameter | In | Type | Description |
|---|---|---|---|
chatId |
query | string | chat uuid; omit for the default answer |
with |
query | preset |
preset: the answer also carries the preset in force, with its blocks |
| 200 | object | OK |
| 400 | Error | with is not preset |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | preset uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string | |
blocks |
array<PresetBlock> | |
settings |
PresetSettings |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | preset uuid |
| 200 | object | OK |
| 404 | Error | no such preset |
| 200 | string | the module |
| Parameter | In | Type | Description |
|---|---|---|---|
chatId |
path | string | chat uuid |
| 200 | object | OK |
| 404 | Error | no such chat |
| Parameter | In | Type | Description |
|---|---|---|---|
presetId |
query | string | preset uuid; omit for the reader's own |
| 200 | object | OK |
| 404 | Error | no such preset |
application/json| Field | Type | Description |
|---|---|---|
presetId |
string | null | |
script |
RegexScript | |
scripts |
array<RegexScript> | |
after |
string | |
sample |
string |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | script uuid |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | script uuid |
| 200 | object | OK |
| 404 | Error | no such script |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
path | string | character uuid |
| 200 | object | OK |
| 404 | Error | no such character |
| Parameter | In | Type | Description |
|---|---|---|---|
charId |
path | string | character uuid |
application/json| Field | Type | Description |
|---|---|---|
script required |
RegexScript | |
text |
string | |
where |
1 | 2 | 3 | 5 | 6 |
|
depth |
integer | |
chatId |
string |
| 200 | object | OK |
| 400 | Error | not an object / bad field |
| Parameter | In | Type | Description |
|---|---|---|---|
presetId |
query | string | preset uuid |
charId |
query | string | character uuid |
| 200 | array<RegexScript> | OK |
| 404 | Error | no such preset or character |
| 200 | array<LlmProfile> | OK |
application/json| Field | Type | Description |
|---|---|---|
name required |
string | |
kind |
string | |
baseUrl |
string | |
apiKey |
string | |
model |
string | |
params |
object | |
contextSize |
integer | null | token window this connection declares; overrides the global chat budget, null uses it |
vision |
boolean | null | whether the model sees pictures: true, false, or null when not checked; a call carrying pictures to a connection set false is refused |
maxImages |
integer | null | the most pictures the host takes in one request; a chat prompt over it sends the oldest as text, null is no limit |
| 200 | LlmProfile | OK |
| 400 | Error | a bad kind, a blank or missing name, a contextSize that is not a positive number, a vision that is not true, false or null, a maxImages that is not a whole number above zero or null, or params that are not an object or that the neutral vocabulary refuses (an unknown key, a sampler that is not a number, a bad stop, json or reasoning.effort) |
| Parameter | In | Type | Description |
|---|---|---|---|
chatId |
query | string | chat uuid; omit for the default answer |
| 200 | object | OK |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | profile uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string | |
kind |
string | |
baseUrl |
string | |
apiKey |
string | |
model |
string | |
params |
object | |
contextSize |
integer | null | token window this connection declares; overrides the global chat budget, null uses it |
vision |
boolean | null | whether the model sees pictures: true, false, or null when not checked; a call carrying pictures to a connection set false is refused |
maxImages |
integer | null | the most pictures the host takes in one request; a chat prompt over it sends the oldest as text, null is no limit |
| 200 | LlmProfile | OK |
| 400 | Error | a bad kind, a blank name, a contextSize that is not a positive number, a vision that is not true, false or null, a maxImages that is not a whole number above zero or null, or params that are not an object or that the neutral vocabulary refuses (an unknown key, a sampler that is not a number, a bad stop, json or reasoning.effort) |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | profile uuid |
application/json| Field | Type | Description |
|---|---|---|
name |
string |
| 200 | LlmProfile | OK |
| 404 | Error | not found |
| Parameter | In | Type | Description |
|---|---|---|---|
profileId |
query | string | omit = first profile |
| 200 | array<object> | OK |
| 502 | Error | upstream/list failure with kind |
application/json| Field | Type | Description |
|---|---|---|
profileId |
string | |
overrides |
object |
| 200 | object | {ok} | {ok: false, kind, error, timedOut} |
application/json| Field | Type | Description |
|---|---|---|
profileId |
string | |
overrides |
object |
| 200 | object | {sees: true} | {sees: false, reason: kind|refused|answer, error?, said?} | {sees: null, kind, error} |
application/json| Field | Type | Description |
|---|---|---|
profileId |
string | omit = first profile |
messages required |
array<object> | |
model |
string | |
params |
object | |
stream |
boolean | |
temperature |
number | |
maxTokens |
integer |
Installed extensions: list, switch on or off, install, update and remove; their background jobs and their own routes
| 200 | object | OK |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string |
application/json| Field | Type | Description |
|---|---|---|
enabled required |
boolean |
| 200 | ExtensionRow + object | OK |
| 400 | Error | enabled is not a boolean |
| 404 | Error | no such extension |
| 200 | array<ExtensionJob> | OK |
| 200 | object | {cleared} |
application/json| Field | Type | Description |
|---|---|---|
git required |
string | plain https git url |
application/zip| 200 | object | {id} |
| 400 | Error | bad url / clone, archive or manifest failure / a manifest needing a newer extension api than the server speaks (the error names both versions) / extensions disabled |
| 403 | Error | admin required |
| 409 | Error | already installed |
| 413 | Error | the archive is larger than the upload limit |
| 200 | object | {checkedAt, checking, extensions} |
| 403 | Error | admin required |
application/json| Field | Type | Description |
|---|---|---|
maxAge |
number | answer the last check as it is when it is younger than this many milliseconds; 0 or absent always asks |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | the extension id, or <id>@<digits>: a generation, which serves exactly what the id does (a page reloading an extension asks a new one, so the relative imports of its entry resolve inside it and the module graph is fetched fresh); any other suffix answers 404 |
path |
path | string | path below the extension root |
| 200 | file | |
| 404 | Error | not published by this extension |
Sessions + accounts (multi-user mode)
application/json| Field | Type | Description |
|---|---|---|
handle required |
string | |
password required |
string |
| 200 | object | {handle, displayName, admin, mustChangePassword}; sets the cl_session cookie |
| 400 | Error | multi-user disabled |
| 401 | Error | invalid credentials (one generic error, no account enumeration) |
| 429 | Error | too many failed attempts on this handle or from this address (Retry-After: the seconds until the lock lifts) |
| 200 | Ok | OK |
| 200 | object | OK |
| 401 | Error | signed out (multi-user mode) |
application/json| Field | Type | Description |
|---|---|---|
currentPassword required |
string | |
newPassword required |
string |
User management (admin accounts only)
application/json| Field | Type | Description |
|---|---|---|
handle required |
string | lowercase [a-z0-9-], 2-32 chars; becomes the data/<handle>/ folder |
displayName |
string | |
password required |
string | |
admin |
boolean | true makes an admin; anything else a plain account |
| Parameter | In | Type | Description |
|---|---|---|---|
handle |
path | string |
application/json| Field | Type | Description |
|---|---|---|
displayName |
string | |
admin |
boolean | |
enabled |
boolean | |
password |
string |
| 200 | object | OK |
| 400 | Error | a field not of its type (admin and enabled are booleans, displayName a string, password at least 4 characters), refused before anything is written; a guard-rail refusal (yourself, the last admin); or multi-user is disabled on this server |
| 403 | Error | admin required |
| 404 | Error | no such user |
Health, the app's own updates, thumbnails, proxy, provider services
| 200 | object | OK |
| 200 | object | OK |
| 403 | Error | admin required |
application/json| Field | Type | Description |
|---|---|---|
backup |
boolean | back up every library first; true when absent |
| 200 | object | OK |
| 403 | Error | admin required |
| 200 | object | OK |
Upgrade to a WebSocket and every committed write to your library arrives as it lands, whichever client or server code made it. The server speaks JSON messages and ignores anything sent to it: {type: "hello", clientId, handle} once; {type: "changes", records} per batch, each record {entity, op, ids?, all?, fields?, origin, ...} naming what changed by id (entity and op are one of appUpdate updated, assistantSession created/updated/deleted, attachment created/deleted, background created/updated/deleted, backgroundBinding updated/deleted, backup updated, character created/updated/deleted, chat created/updated/deleted, document updated/deleted, extension updated, extensionJob updated/deleted, library changed, llmProfile created/updated/deleted, maintenance updated, media created/updated/deleted, mediaJob updated/deleted, message created/updated/deleted, persona created/updated/deleted, playlist created/updated/deleted, preset created/updated/deleted, regexConsent updated, regexScript created/updated/deleted, setting updated, studioSession created/updated/deleted, tag updated/deleted, tagRun created/deleted, user created/updated/deleted, version updated/deleted, world created/updated/deleted, worldEntry created/updated/deleted, worldLink updated; all: true, with no ids, when the write spanned more rows than a record names (a whole set, or characters past a thousand); origin is the client id the writing request sent as X-CL-Client, so a tab can skip its own, and null for what an extension wrote through its own routes or listeners; extension, on a record an extension reported for a write to its own tables, is that extension's id, its fields named <id>.<name>: the entity's own data did not change; to, on a tag or lorebook rename, is the name it has now, the old one in ids: a tag merge is the merged tag's deleted record with to the surviving tag's spelling, a tag delete carries no to, and a binding sweep that re-pointed a lorebook is a worldLink record naming the old name as world beside to); and {type: "resync"} when a slow connection fell behind, after which a client re-reads what it shows. The feed carries no history: after a reconnect, re-read. user records reach admins only. The connection closes with 4001 when the session ends (a password change, a disabled account).
| Parameter | In | Type | Description |
|---|---|---|---|
client |
query | string | the id of this tab: the value its API requests send as X-CL-Client (8 to 64 of [A-Za-z0-9-]) |
| 200 | object | OK |
| 200 | object | {ok, started} |
| 409 | Error | already running |
| Parameter | In | Type | Description |
|---|---|---|---|
id |
path | string | background row id |
s |
query | integer | target size, px |
| 200 | image/webp | |
| 404 | Error | background or its file not found |
Byte-verbatim CORS pass-through: body untouched, headers forwarded, accept-encoding pinned to gzip/deflate/br. The request body is passed on unparsed. GET, HEAD, POST, PUT, PATCH and DELETE are proxied; any other method is 405 with an Allow header. The upstream call is aborted when the client disconnects.
| Parameter | In | Type | Description |
|---|---|---|---|
url |
path | string | encoded absolute URL |
Byte-verbatim CORS pass-through: body untouched, headers forwarded, accept-encoding pinned to gzip/deflate/br. The request body is passed on unparsed. GET, HEAD, POST, PUT, PATCH and DELETE are proxied; any other method is 405 with an Allow header. The upstream call is aborted when the client disconnects.
| Parameter | In | Type | Description |
|---|---|---|---|
url |
path | string | encoded absolute URL |
Byte-verbatim CORS pass-through: body untouched, headers forwarded, accept-encoding pinned to gzip/deflate/br. The request body is passed on unparsed. GET, HEAD, POST, PUT, PATCH and DELETE are proxied; any other method is 405 with an Allow header. The upstream call is aborted when the client disconnects.
| Parameter | In | Type | Description |
|---|---|---|---|
url |
path | string | encoded absolute URL |
Byte-verbatim CORS pass-through: body untouched, headers forwarded, accept-encoding pinned to gzip/deflate/br. The request body is passed on unparsed. GET, HEAD, POST, PUT, PATCH and DELETE are proxied; any other method is 405 with an Allow header. The upstream call is aborted when the client disconnects.
| Parameter | In | Type | Description |
|---|---|---|---|
url |
path | string | encoded absolute URL |
Byte-verbatim CORS pass-through: body untouched, headers forwarded, accept-encoding pinned to gzip/deflate/br. The request body is passed on unparsed. GET, HEAD, POST, PUT, PATCH and DELETE are proxied; any other method is 405 with an Allow header. The upstream call is aborted when the client disconnects.
| Parameter | In | Type | Description |
|---|---|---|---|
url |
path | string | encoded absolute URL |
Byte-verbatim CORS pass-through: body untouched, headers forwarded, accept-encoding pinned to gzip/deflate/br. The request body is passed on unparsed. GET, HEAD, POST, PUT, PATCH and DELETE are proxied; any other method is 405 with an Allow header. The upstream call is aborted when the client disconnects.
| Parameter | In | Type | Description |
|---|---|---|---|
url |
path | string | encoded absolute URL |
Provider session + proxy namespace: per-provider login handshakes, RAM sessions, GET proxies, the JanitorAI managed-browser family. Each provider service registers its own routes under this namespace; they are not part of this contract. /health under this namespace reports {ok, basicAuth}.
| Parameter | In | Type | Description |
|---|---|---|---|
route |
path | string | service route |
| 200 | route-specific |
| Field | Type | Description |
|---|---|---|
error required |
string | |
kind |
auth | rate_limit | quota | context | upstream | network | timeout | bad_request |
a model's failure: its kind, which decides the status (bad_request 400, timeout 504, the rest 502) |
| Field | Type | Description |
|---|---|---|
ok |
boolean |
| Field | Type | Description |
|---|---|---|
items |
array<CharacterListItem> | |
total |
integer | null | rows matching the filters, ignoring the window; null when count=false |
limit |
integer | null | |
offset |
integer | |
sort |
string | |
order |
string | |
nextCursor |
string | null | pass as after= to continue past the last item; null when the page was not full or sort=relevance |
| Field | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
creator |
string | |
nickname |
string | |
characterVersion |
string | |
creatorNotesExcerpt |
string | only with fields=creatorNotesExcerpt: the first 200 characters of the creator notes as plain text (the grid tooltip) |
creatorNotes |
string | only with fields=creatorNotes |
fav |
boolean | |
updateLocked |
boolean | |
mediaLocalized |
boolean | |
loreDismissed |
boolean | |
tokenEstimate |
integer | |
tags |
array<string> | |
playlists |
array<string> | the ids of the playlists that hold it |
links |
array<object> | |
providers |
array<string> | |
createdAt |
integer | null | |
importedAt |
integer | |
updatedAt |
integer | when the content of the card itself last changed. Its tags, its provider link, its lorebooks and the per-character flags never move it, by any route |
avatarUrl |
string | |
ext |
object | present when an extension the account has on declares projection fields: { <extension id>: { <key>: value } }, a character with no value reading null |
| Field | Type | Description |
|---|---|---|
id |
string | |
card |
object | |
lastChatAt |
integer | null | newest chat recency across the character's chats (epoch ms): the newest dated message, else a chat's creation; kept current by the server on every chat and message write; null when it has no chats |
chatCount |
integer | number of chats for this character |
mediaCount |
integer | number of gallery items for this character |
playlists |
array<string> | the ids of the playlists that hold it |
| Field | Type | Description |
|---|---|---|
id |
string | |
charId |
string | |
name |
string | |
userName |
string | |
characterName |
string | the ST header's frozen name at chat time |
charName |
string | the LIVE card name (a chat always has its character, and goes with it) |
draft |
string | null | the composer text not yet sent; never in the JSONL export |
chatMetadata |
object | world_info is composed from the head of worlds, never stored; scenario, mes_example and system_prompt, when present, are the chat's own card texts |
worlds |
array<string> | the chat lore list, ordered |
createDate |
integer | null | |
messageCount |
integer | |
lastMesAt |
integer | null | the newest dated message, unix ms, a date without a zone read in the server's zone: it orders the list, so it is the same for every reader |
personaName |
string | null | the persona this chat is played as when it overrides the active one; null while it follows the active persona |
personaPronouns |
object | null | the pronoun forms of the persona this chat overrides to, beside personaName; null while it follows the active persona |
lastMes |
string | null | last non-system message. Stored cut to 300 chars; the LIST projection cuts to a 200-char preview, the detail route returns messages whole |
updatedAt |
integer | |
charChatCount |
integer | the character's chat count; present only on grouped=true list answers |
| Field | Type | Description |
|---|---|---|
items |
array<object> | |
total |
integer | null | null when count=false |
limit |
integer | |
offset |
integer | |
capped |
boolean | true when the match holds more messages than the newest 10000 the hits are ranked among |
| Field | Type | Description |
|---|---|---|
items |
array<object> | |
total |
integer | null | null when count=false |
limit |
integer | |
offset |
integer | |
capped |
boolean | true when the match holds more entries than the newest 10000 the hits are ranked among |
| Field | Type | Description |
|---|---|---|
items |
array<Chat> | |
total |
integer | null | null when count=false |
limit |
integer | |
offset |
integer | |
nextCursor |
string | null | pass as after= to continue past the last item; null when the page was not full |
| Field | Type | Description |
|---|---|---|
id |
integer | |
chatId |
string | null | |
studioId |
string | null | |
file |
string | the uid name it is stored under |
name |
string | its display name |
kind |
image | video |
|
size |
integer | |
width |
integer | null | |
height |
integer | null | |
addedAt |
integer | |
url |
string | /attachments/{ownerId}/{file} |
uses |
integer | how many messages show it (the gallery's list only) |
| Field | Type | Description |
|---|---|---|
id |
integer | the message's own id: never reused, kept through a renumber. A whole-transcript replace or an import makes new messages with new ids |
seq |
integer | its place in the chat, 0 to n-1; every later message moves down one when an earlier one is deleted |
createdAt |
integer | null | when it was written, unix ms: the stored send_date (a number, an ISO string, SillyTavern's "June 19, 2023 4:13pm" and "2023-6-19 @14h 33m 07s 123ms"), a date without a zone read on the reader's clock (X-Time-Zone, else X-UTC-Offset, else the server's zone); null when unreadable |
role |
user | assistant | system |
system when the message is a system note, else user when it is the reader's, else assistant |
name |
string | null | the stored speaker name |
content |
string | the text: the stored mes, which every write keeps equal to the active alternate |
attachments |
array<Attachment> | the pictures the message shows, in order, from its chat's gallery |
raw |
object | the stored SillyTavern row, verbatim (mes, swipes, swipe_id, swipe_info, extra, send_date, ...), with extra.attachments naming its pictures' ids when it shows any. A write sends row fields, never this object; a row written back with extra.attachments keeps its pictures, and a patch's extra.attachments sets them (null clears) |
extends Chat
| Field | Type | Description |
|---|---|---|
messages |
array<ChatMessage> | the window's messages, in seq order. No header line |
msgOffset |
integer | |
msgLimit |
integer | null | |
msgTail |
integer | null | |
embeddedLorebook |
object | null | the card's own character_book, when it has entries. Not a lore source by design: a book goes live once promoted to a world and linked, so this reports that one exists and whether that has happened. null when the card has none |
| Field | Type | Description |
|---|---|---|
id |
string | |
chatId |
string | |
name |
string | |
profileId |
string | null | which LLM profile answers; null follows the app default |
createdAt |
integer | |
updatedAt |
integer | |
messageCount |
integer | list view only |
messages |
array<object> | detail view only. extra.context on an assistant turn is the snapshot of what the model was shown, and is what every apply is validated against |
damaged |
boolean | the stored transcript would not parse; reads refuse rather than reporting it empty, because an empty read invites the next append to overwrite it |
| Field | Type | Description |
|---|---|---|
id |
string | |
charId |
string | null | |
name |
string | |
profileId |
string | null | which LLM profile answers; null follows the surface default |
createdAt |
integer | |
updatedAt |
integer | |
messageCount |
integer | list view only |
draft |
object | detail view only: the draft as the last generate or apply saw it, or as the panel PATCHed it on close |
messages |
array<object> | detail view only. extra.context on an assistant turn is the snapshot of the draft the model was shown (anchors per field, tags, greetings; the scope), and is what every judge and apply reads |
damaged |
boolean | the stored transcript would not parse; reads refuse rather than reporting it empty |
| Field | Type | Description |
|---|---|---|
chatId |
string | |
charId |
string | |
persona |
object | null | whose books the 'persona' source means: the persona resolved for THIS chat (its override, else the global active one); null when none |
settings |
object | the scan settings in force, so the panel can explain a miss instead of just showing one |
scannedMessages |
integer | how many messages the scan window actually covered |
notes |
array<string> | anything matched that is not sent, and why: for example an entry at the author's note while the note is not due, an outlet nothing writes |
worlds |
array<object> | |
extensionBooks |
array<object> | the books an extension added to this scan through lore.candidates, in the prompt like the chat's own: the panel lists them read-only. Each is named ext:<extension id>:<label>, which the runner holds to the extension that added it |
| Field | Type | Description |
|---|---|---|
uid |
object | the entry's key in its book: a whole number in the library's books; an extension's book may use text |
comment |
string | |
keys |
array<string> | |
secondaryKeys |
array<string> | |
content |
string | |
disable |
boolean | |
constant |
boolean | |
position |
integer | |
order |
integer | |
depth |
integer | null | |
selective |
boolean | |
selectiveLogic |
integer | |
role |
integer | |
scanDepth |
integer | null | the entry's own scan depth; null inherits the global |
caseSensitive |
boolean | null | null inherits the global |
matchWholeWords |
boolean | null | null inherits the global |
fired |
boolean | true when this entry is IN THE PROMPT as of the current history: it both matched the scan AND the preset this chat uses (its own, else the active one) has the marker block that places its group (worldInfoBefore / worldInfoAfter / chatHistory for at-depth; for an outlet entry, the prompt writes {{outlet::name}}, which a dry build of the prompt answers). A match with no slot to render into reports false and is explained in notes |
firedVia |
object | null | why it fired: { kind: 'chat', messageSeq }, { kind: 'recursion', feederWorld, feederUid, feederComment }, { kind: 'source', source }, or constant / sticky / decorator |
probabilityPending |
integer | null | a fired entry that still rolls its probability at send, in percent |
groupPending |
number | null | a fired member of a weighted inclusion group: the dry run names no winner, so each member that can win is kept with its odds of winning at send, in percent (one decimal) |
timed |
object | the turns left of an active sticky and cooldown, each null when not running |
suppressedReason |
string | null | why a matching entry was held back, for example 'trigger', 'probability', 'characterFilter', 'cooldown', 'budget' (every matched entry the lore budget left out says budget) |
advanced |
object | the engine fields under ST's own names (probability, sticky, cooldown, delay, the group cluster, the recursion flags, ignoreBudget, outletName, triggers, characterFilter, and matchFlags: the six match-source booleans). The bundled panel edits these, so values are raw config, never display labels |
outlet |
string | null | for a fired entry placed at an outlet: the outlet name, which the prompt writes as {{outlet::name}} |
notHonoured |
object | stored and preserved but not acted on: vectorized, automationId |
| Field | Type | Description |
|---|---|---|
name |
string | |
entryCount |
integer | |
importedAt |
integer | null | |
createdAt |
integer | ms epoch of the first write (an import, a manager create or a placeholder mint); never moves after |
updatedAt |
integer | |
placeholder |
boolean | minted by an import path for a name with no book yet; filled in place when one arrives |
source |
WorldSource |
| Field | Type | Description |
|---|---|---|
provider |
string | |
externalId |
string | the provider id or lowercased path the listing keys on |
path |
string | null | |
url |
string | null | |
linkedAt |
integer | ms epoch of the link |
| Field | Type | Description |
|---|---|---|
id |
string | |
key |
string | |
name |
string | null | the label the block is listed under, stored trimmed and null when empty; an import brings the SillyTavern prompt's name and an export writes it back |
kind |
text | marker |
|
marker |
charDescription | charPersonality | scenario | personaDescription | worldInfoBefore | worldInfoAfter | dialogueExamples | chatHistory | characterPicture | |
what a marker block is filled with; characterPicture shows the model the character's portrait in a user turn, before or after the history, never at a depth |
content |
string | |
role |
system | user | assistant |
|
position |
pre_history | post_history | at_depth |
at_depth anchors the block INSIDE the chat history, `depth` turns back from the newest, which is SillyTavern's absolute injection position |
depth |
integer | turns back from the newest message, at_depth only. 0 sits after the last turn |
injectionOrder |
integer | at_depth only: of several blocks at one depth, a higher order sits nearer the reply. Default 100 |
forbidOverrides |
boolean | main and jailbreak only: the card's system_prompt / post_history_instructions normally replaces the block, and this refuses that |
triggers |
array<string> | the generation types the block is sent on, SillyTavern's injection_trigger: normal (a sent turn), continue, impersonate, swipe, regenerate, quiet. Empty or absent: every type. A type the app does not make (quiet, or one it does not know) is kept, so the block is never sent for it |
enabled |
boolean | |
pos |
integer |
| Field | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
source |
string | null | 'sillytavern' for imports |
settings |
PresetSettings | the settings this preset sets; one absent reads its default (defaultSettings) |
createdAt |
integer | |
updatedAt |
integer | |
blocks |
array<PresetBlock> |
| Field | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
source |
string | null | 'sillytavern' for imports |
createdAt |
integer | |
updatedAt |
integer | |
blockCount |
integer | how many blocks the preset holds |
| Field | Type | Description |
|---|---|---|
personalityFormat |
string | sent for the personality, which goes where {{personality}} is; empty sends the personality as it is |
scenarioFormat |
string | sent for the scenario, which goes where {{scenario}} is; empty sends it as it is |
loreFormat |
string | sent for each lore group placed before or after the character, its entries where {{lore}} is; empty sends them as they are |
chatStart |
string | a system message right before the history; empty sends none |
exampleSeparator |
string | a system message before each example block; empty sends none |
joinSystem |
boolean | adjacent system messages join on a newline, save the chat start line, the example separators and the example turns; an empty text block, or a card or lore marker with nothing to place, in another role ends the run where it stands when it is on for the generation type (Main even when off) and not at a depth |
impersonateInstruction |
string | the last message of a Write My Next Message; empty sends none |
continueInstruction |
string | the last message of a continue; empty sends none |
guidedInstruction |
string | the last message of a directed reply; empty sends none |
continueJoiner |
string | joins a continuation onto the message it continues, unless that ends on a space |
continueAsOpening |
boolean | a continue ends the prompt on the message as the reply's opening, with no instruction after it; a continue with no message to open on (its target is not in the prompt) is sent the continue instruction |
| Field | Type | Description |
|---|---|---|
droppedConnection |
array<string> | connection keys, dropped on purpose |
droppedSamplers |
array<string> | sampler settings, dropped on purpose: they belong to the connection |
droppedUnknown |
array<string> | keys with no equivalent here |
unknownBlocks |
array<string> | prompt identifiers with no expressible equivalent |
regexScripts |
object | the regex scripts the preset carries, stored as its own and off until the reader allows them |
notes |
array<string> |
| Field | Type | Description |
|---|---|---|
id |
string | |
scriptName |
string | |
findRegex |
string | a pattern written /pattern/flags, or bare |
replaceString |
string | {{match}} is the whole match, $1 a numbered group, $<name> a named one; macros expand after |
trimStrings |
array<string> | cut from every group before it fills the replacement |
placement |
array<integer> | 1 the reader's messages, 2 the character's, 3 narrator rows, 5 lore, 6 reasoning |
disabled |
boolean | |
markdownOnly |
boolean | changes only what the screen shows |
promptOnly |
boolean | changes only what the model is sent |
runOnEdit |
boolean | for a script changing the text itself: it still applies to a message edited by hand (extra.edited), and with alterSaved it rewrites the edit as it is saved |
substituteRegex |
0 | 1 | 2 |
macros in the find: 0 none, 1 expanded, 2 expanded with each value escaped |
minDepth |
integer | null | |
maxDepth |
integer | null | |
alterSaved |
boolean | for a script changing the text itself: rewrite the message when it is written instead of each time it is read |
stopped |
boolean | answers only: skipped since it ran out of time, until it is saved again |
| Field | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
description |
string | |
icon |
string | |
color |
string | |
created |
integer | null | |
modified |
integer | null | |
count |
integer | how many characters it holds |
| Field | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
version |
string | null | |
author |
string | null | |
description |
string | null | |
requires |
object | null | |
client |
string | null | |
style |
string | null | |
server |
string | null | |
provider |
boolean | |
extNamespace |
string | null | |
bundled |
boolean | ships with the app and cannot be removed |
defaultOff |
boolean | a bundled extension that is off until an account switches it on |
exclusive |
string | null | the group it shares one seat with, such as theme: switching a member on switches off the others that ran for the account |
git |
boolean | a git install, which update can pull |
settings |
object | the manifest-declared setting defaults |
contributes |
array<string> | |
lazy |
object | null | the entry points a lazy extension declares ({ actions: [{ slot, id, label, icon }], windows: [{ id, label, icon, size?, min? }], views: [{ id, label, icon }] }): the page registers these and imports the code at their first use. A declaration outside the grammar the page's registrars hold, one not named in a declared contributes, or a lazy block with no entry point or no client makes the row broken |
enabled |
boolean | whether it runs for this account |
error |
string | |
serverState |
loaded | failed | restart | removed |
present when it has a server half |
serverError |
string | |
serverHooks |
array<object> | what the server half registered: its store guards, pipeline filters, macros, prompt blocks, job schedules and change listener, each group in the order the half registered it |
browserConsumers |
array<object> | the hosted-browser consumers the server half registered, each id <extension>:<name>, served by /api/provider-services/browser/* only for accounts that switched the extension on |
serverQuery |
object | the query doors the server half declared over its own tables |
serverCalls |
array<object> | what the server half's hooks, model calls (llm.chat, llm.stream) and jobs (jobs.run) cost this account since the server started, costliest first |
| Field | Type | Description |
|---|---|---|
id |
integer | |
extension |
string | |
extensionName |
string | its manifest name, for display |
key |
string | null | |
label |
string | |
status |
queued | running | done | failed | cancelled |
|
progress |
object | null | |
queuedAt |
integer | |
startedAt |
integer | null | |
endedAt |
integer | null | |
error |
string | null | |
position |
integer |
| Field | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
description |
string | |
avatar |
string | null | |
pronouns |
object | the persona's pronoun forms, answered by {{sub}}, {{obj}}, {{poss}}, {{poss_p}} and {{ref}}. An empty form answers its they/them word (they, them, their, theirs, themselves). The case follows how the macro is written: {{sub}} as stored, {{Sub}} with its first letter capitalised, {{SUB}} in upper case, any other mix as stored |
createdAt |
integer | |
updatedAt |
integer |
| Field | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
kind |
string | a registered adapter kind (see /api/llm/kinds) |
baseUrl |
string | |
model |
string | |
hasKey |
boolean | |
keyHint |
string | null | the last four characters of the stored key when it is twelve or longer, so two keys can be told apart on screen; null otherwise |
contextSize |
integer | null | token window this connection declares; overrides the global chat budget, null uses it |
vision |
boolean | null | whether the model sees pictures: true, false, or null when not checked; a call carrying pictures to a connection set false is refused |
maxImages |
integer | null | the most pictures the host takes in one request; a chat prompt over it sends the oldest as text, null is no limit |
params |
object | neutral default generation params; request params override per call. reasoning.effort is one word the host receives as-is |
pos |
integer |
| Field | Type | Description |
|---|---|---|
id |
integer | |
kind |
apply | undo | delete | favorite | flags | playlist |
|
label |
string | |
status |
queued | running | done | stopped | failed |
|
done |
integer | |
total |
integer | |
queuedAt |
integer | |
startedAt |
integer | null | |
endedAt |
integer | null | |
error |
string | null | a failed job's words (an extension's store guard refusing a batch); the batches before it landed |
result |
object | null | once the job ends, per kind: an apply {changed, added: [{name, count}], removed: [{name, count}], runId}; an undo {changed, restored, removed, presets, renamed, runId} (presets: the saved filter preset rules put back; renamed: [{from, to}] the tag names it reported moving, to null for a name that went, which the asking client's own filters follow); a delete {changed, missing} (characters deleted, and characters of the set gone before their batch); a favorite {changed} (characters whose favourite moved; the rest already were); a flags {changed} (characters whose flags moved); a playlist {changed, playlist} (memberships added or removed, and the playlist with its new count) |
| Field | Type | Description |
|---|---|---|
id |
integer | |
status |
queued | running | done | failed | cancelled |
|
phase |
copy | verify | |
while running: copy, then verify (the integrity check of the copy) |
done |
integer | null | while copying: bytes of the copy written so far |
total |
integer | null | about what the copy writes: the library's pages in use when the copy began |
stopping |
boolean | a cancel was asked and the copy is being stopped |
scheduled |
boolean | |
queuedAt |
integer | |
startedAt |
integer | null | |
endedAt |
integer | null | |
error |
string | null | |
file |
string | null | once done: the backup file |
bytes |
integer | null | once done: its size |
| Field | Type | Description |
|---|---|---|
windowEnd |
number | the end of the window it missed |
| Field | Type | Description |
|---|---|---|
id |
integer | |
file |
string | physical uid-named file |
displayName |
string | |
kind |
string | |
sourceUrl |
string | null | |
size |
integer | |
addedAt |
integer | |
url |
string |
| Field | Type | Description |
|---|---|---|
id |
integer | |
file |
string | physical uid-named file |
displayName |
string | |
sourceUrl |
string | null | |
width |
integer | null | source pixels; the picker quotes the memory cost from these |
height |
integer | null | |
size |
integer | |
addedAt |
integer | |
url |
string | the original, immutably cached |
thumb |
string | 192px picker tile |
usedBy |
integer | bindings pointing here (list endpoint only) |
| Field | Type | Description |
|---|---|---|
scope |
global | character | chat |
|
id |
string | null | character or chat uuid; null for global |
background |
Background | null means explicitly none, which STOPS inheritance |
fit |
cover | contain | stretch | center | tile |
|
opacity |
number | |
blur |
integer | |
brightness |
number | |
saturate |
number | |
renderWidth |
integer | null | null is auto, 0 is the original |
updatedAt |
integer |
| Field | Type | Description |
|---|---|---|
source |
chat | character | global | none |
which scope answered |
binding |
BackgroundBinding |
server/openapi.js. Single file, no external assets; safe to share as an attachment.