The interface
About page
What StateJar is, in three minutes, including what does not work yet.
A single page covering the problem, the three guarantees, the pipeline, why
there is no domain code, where this matters, current status, and an explicit
list of gaps.
The gaps section is deliberate. Read it before you decide whether StateJar
suits what you are building.
Accepting an invitation
The page an invitation e-mail links to: choose a password for the account an admin made for you.
When an admin adds you to StateJar, an e-mail brings you here with a link that works once, for 7 days. Choose a
password and you are signed in: opening the link proved the address. Nothing is stored about you from this page
beyond the password's hash. If the link says it is not valid or has expired, ask the person who invited you to send a
new one; you can also sign in with an e-mailed code from the sign-in page using the same address.
Details: POST /auth/invite/accept.
Announcement banner
A line at the bottom of the screen with a message from StateJar; Dismiss hides it in this browser.
What this does. Shows an announcement across the site while it is active.
How to use it. Read it, follow the link if there is one, or press Dismiss. The dismissal is remembered in this browser only; a new announcement shows again.
API Docs screen
The endpoint reference, with samples in curl, Python, JavaScript and Node.
Every endpoint with its request shape, its response, and a copyable sample.
Pick your language once at the top and every block on the page follows.
Use it when you are integrating. Use the API section of this help
centre when you want to know why an endpoint behaves the
way it does, the reference tells you the shape, help tells you the reasoning.
API Keys screen
Provider keys in, StateJar keys out.
Two independent halves.
Provider keys, one card per provider you can connect
(OpenRouter, OpenAI,
Anthropic, Google,
and, only on installs that turn the server's Ollama setting on (not statejar.com), Ollama local and Ollama remote).
Paste a key, press Save, then Test connection to confirm it actually works
before you need it in front of an audience. Keys are encrypted at rest and are
never returned by the API, the list shows only the last four characters.
StateJar API keys, keys you generate to call StateJar from your own
code. Generated keys are shown once, at creation. There is no way to retrieve
one later; generate a new key and delete the old one.
Related endpoints: provider keys,
connection test, your API keys.
Audit Log screen
Every disclosure, chat, queries, manual records and tier-3 extraction calls, across every session, filterable, with replay.
The account-wide version of the Playground's Audit tab. Each row is one
disclosure: when, which handle, which fields, which provider and model.
Replay reconstructs exactly what was sent for that request by re-reading
the handle and re-applying the recorded field keys. If the state behind the
handle had been altered, the re-derived handle would not match and the replay
says so, which is what makes the audit trail evidence rather than a log.
No message text is stored here, only field keys. See
audit entry and the replay endpoint.
Audit tab
This session's disclosures, newest highlighted.
The per-session view of the audit trail: one row per disclosure with the handle
used, the field keys sent, and the provider and model they went to.
Every disclosure writes a row, and each row says which kind it is: chat, query_audited (a query sent with audit: true), manual, query (a plain query: the fields went back to the calling client) and extraction (a tier-3 call: the message and the names of known concepts went to your provider, the message itself is never stored). The
"changed by your message" note is sent once per change, by the first row of any of the first four kinds, and its fields are in that row's field keys; only the first three count as turns in the token figures.
The account-wide version is the Audit Log screen.
Billing page
Your plan, the plans you can buy once billing opens, and every order with its receipt; while billing is closed (today) it offers no purchase, and the Android app never does.
Billing in the console sidebar (/billing) shows:
- Your plan: the one your limits follow now, and the date a paid month
ends. Nothing renews by itself: renew from here when you want another
month.
- Plans: each paid plan with its price as the pricing page
lists it. While billing is closed, which is every environment today, the
page says so and offers no purchase. Once a payment provider takes payments,
Buy makes an order on our server, which reads the price from the plans
table (your browser never sends one), and takes you to the provider's own
page to pay. While test mode is on, a note says checkout runs on a stand-in
and no money moves.
- Monthly or Yearly: a year is twelve months for the price of ten, worked
out by our server from the plan's monthly price (your browser never sends a
price). The period is on the order and its receipt.
- Join waitlist: while paid plans are coming soon, a paid plan's button
stores your e-mail and the plan so we can tell you when it opens
(how).
- After paying the page shows one of three results: payment received,
payment did not go through, or waiting for the payment. Your dates, use and
order history are on My orders.
- Orders: every order with its status. An unpaid order can be paid or
cancelled (cancel); a paid one has a
Receipt, which prints or saves as a PDF (receipt).
After paying, the provider sends you back to /billing?order=<id>, which
asks our server about the order every few seconds and shows it once decided.
Coming back does not start the plan: the server starts it only when the
provider confirms the payment to it (how).
In the Android app nothing is for sale and nothing links to a payment page
(Google Play's payments policy): the app shows your plan and your receipts. An
account whose plan StateJar set buys nothing here either. Refunds follow the
refund policy.
Region and gateways. The India / International switch on this page is the
one on the pricing page: it sets the currency a price is written
in and puts the Indian gateways first (or the international ones, then crypto),
grouped under their own headings; every gateway the server has switched on
stays selectable. A receipt is laid out for GST (the receipt):
supplier, its GSTIN ("not yet registered" until one is set), SAC, taxable value, and
tax lines once a supplier GSTIN exists.
GST on rupee orders (13 Nov 2026: prices are GST-exclusive). With the supplier's
GSTIN set, a rupee order is charged the price + 18% GST. Choose Your state:
CGST 9% + SGST 9% inside the seller's state (Bihar), IGST 18% elsewhere (a GSTIN's
state counts first). Under each plan the breakdown shows the price before GST, each
tax line and the Total payable before you press the pay button; a coupon and
coins come off the price before the tax. The invoice, the receipt page, the PDF, the
e-mail and a credit note show the same lines and add up to the paisa.
Brand kit page
The public /brand page: StateJar's logos to download, colours, fonts and the rules for using them.
/brand is public. It shows the StateJar logo as a primary lockup, an icon and a
wordmark, each for light and dark grounds and in black and white, with SVG and PNG
downloads (512, 1024 and 2048 px), the colour codes for the light and dark themes,
the three fonts and their licences, and what to do and not do with the logo. The
whole kit is one zip. For anything it does not cover, see the
contact page.
Change your password
Profile's Password panel: change the password with the current one; every other device is signed out.
Under Profile → Password, press Change password…, type your current password and the new one twice, and
press Change password.
Every other device signed in to your account is signed out; this browser stays signed in. The account gets an
e-mail saying the password was changed, so a change you did not make does not go unnoticed. A wrong current
password counts toward the sign-in lockout (details).
Forgot the current one? Use Forgot password? on the sign-in page. An account made with an
e-mail code, Google or GitHub has no password yet: the panel says so, and Forgot password? is how to add one.
Checkout page
The order page behind Choose on /pricing: plan, period, price, details, promo code and the agreement, ending in Continue to payment; no payment is taken while billing is closed.
/checkout?plan=starter&period=month¤cy=INR is public: anyone can read it without an account. It shows your
order (one plan, quantity 1, the price from the same list as pricing; a rupee price is
GST-exclusive, "₹1,299 + 18% GST"), a monthly or yearly switch, your details (e-mail, name, optional GSTIN, billing
country and, in India, your state from a list), a promo code and a
required agreement to the terms, the privacy policy and the refund policy.
Continue to payment does what is true today. Signed out, it asks you to sign in or create a free account and
brings you back here. Signed in while paid plans are "coming soon", it says that online payment is not open yet,
that nothing has been charged, saves your plan choice on the waitlist and e-mails your
account's address the day payment opens.
GST in the summary. For rupees the summary shows the price before GST, then CGST 9% + SGST 9% when your state is
the seller's (Bihar) or IGST 18% for any other state, and the Total payable (price + GST, to the paisa). Until a
state is chosen it says so. A GSTIN's state counts first. The server charges exactly this (it computes it again). Where billing is open for your account it hands over to the
Billing page, the one place an order is made. The details you type stay in your browser tab.
Chrome extension (StateJar Memory)
A popup that shows and adds to a session's memory, restores a handle and copies the memory context. Not yet in the Chrome Web Store.
What it does. A popup, no content scripts, nothing runs on the pages you
visit. In it you can:
What it needs. A developer key (sj_live_…). The key is
kept in this browser's extension storage only and is never synced. The only
permission it asks for is storage, and it can talk only to the StateJar API.
Status. Version 0.1.0 is built but not yet published in the Chrome Web
Store. When it is, this entry will link to the listing.
Clear memory
Empty the memory of a scope for testing, without deleting any history.
Clear memory in the Playground toolbar asks before it does anything, and
offers two extents:
- This memory: the sessions on the same memory scope as the current one. For a
normal session that is all your normal sessions; for a fresh session it is that
session only; for the demo, the demo sessions. The other scopes are left alone.
- Everything in my account: every session of every scope.
Memory versions are append-only, so nothing is deleted. Each cleared session gets
a new, empty version as its head; every earlier version stays in the version
list and can still be opened or restored by its handle. Because
the empty version is now the newest, a new session that continues your memory
starts from empty rather than from the old facts. Confirmations and held facts
waiting in those sessions are dropped, so a cleared value cannot come back.
Each cleared session adds one row of kind clear to the audit trail,
whose handle is the new empty head. This is the route
POST /memory/clear.
Confirm your e-mail address
Profile asks an account made with a password to confirm its address with a code we e-mail it, so a later sign-in by e-mail never resets it.
Where. Profile, under Your e-mail address, while the address has not been confirmed and this server e-mails
codes. Send me a code mails the account's address an 8-digit code; type it in and press Confirm.
Why. Signing up with a password does not prove that the address is yours. So the first time an address is
proven by a sign-in, an e-mail code, a sign-in link, or a Google or GitHub account that has verified it, StateJar
resets the account: whoever made it may not own the address. The password, every other session, the developer keys,
apps connected through StateJar's MCP server, two-factor sign-in, linked Google or GitHub sign-in and saved provider
keys are removed; the memory, the audit log and the profile stay. A sign-in mail for such an account says this
before you use it.
Confirming the address from inside the account, while signed in, proves that the person who holds the account also
holds the mailbox: nothing is removed, then or later, and a later e-mail sign-in still asks for your
two-factor code.
If you did not make the account. A confirmation mail you did not ask for means someone registered your address:
sign in to StateJar with a code e-mailed to you, and the account becomes yours, with everything they set removed.
No password. An account made by an e-mail code, Google or GitHub, or reset as above, has no password. Where
other accounts give their password, deleting the account, downloading your data,
turning two-factor sign-in off or making new recovery codes, it gives a code we e-mail it, or a
code from its authenticator app when two-factor sign-in is on. API: GET /auth/account,
POST /auth/account/code, POST /auth/account/confirm-email.
Connect with OpenRouter
Let OpenRouter make a key in your own account for StateJar instead of pasting one; its usage is billed to your OpenRouter credits.
The OpenRouter card on the API Keys page has a Connect with OpenRouter
button under the paste form. It uses OpenRouter's own sign-in flow (OAuth with PKCE), and it ends the way a pasted
key does: with an OpenRouter key saved for your account.
- Connect with OpenRouter takes you to openrouter.ai. Sign in there and approve the key; its label is
prefilled as StateJar.
- OpenRouter sends you back to
/connect/openrouter with a one-use code. StateJar checks that the answer belongs
to the connection your account started in this browser, trades the code at OpenRouter for the key
(how), and the page shows the key's last four characters.
The secret part of the flow (the PKCE verifier) is made and kept on StateJar's server, never in your browser.
The key lives in your OpenRouter account, where you can see its activity and revoke it. StateJar stores it
encrypted with AES-256-GCM, exactly like a pasted key, and never shows it again. It is used for the OpenRouter models
you pick in the Playground. It is also used first to read your messages for extraction while OpenRouter is one of
the enabled extraction providers, so what those calls cost is billed to your OpenRouter credits.
Connected. The card then says connected and shows the key's last four characters and the date. Disconnect
deletes the key from StateJar at once; revoke it in your OpenRouter account to end it there too. Pasting a key, or
connecting again, replaces the saved one.
When it does not work. A connection must finish within 10 minutes (OpenRouter's codes expire after 10), in the
browser that started it, signed in to the same account. If you took longer, came back in another browser, or
cancelled at OpenRouter, the page says so and nothing is saved: press the button again. The button is not shown in
the Android app (OpenRouter could not send you back into it) or on a server that does not offer the flow; paste a
key from openrouter.ai/keys there instead.
Connected apps and the consent page
The page an MCP client sends you to when it wants to use your memory, what you are allowing, and the list on API Keys where you disconnect an app.
Two screens belong to the MCP server's OAuth sign-in.
The consent page (/oauth/authorize?req=…) opens when an app that speaks MCP (Claude, ChatGPT, Cursor, Codex,
Gemini CLI, OpenCode, VS Code, Devin) asks to use StateJar as your memory. The server has already checked the app
and its redirect address (how); the page shows what it checked: the app's name, where your
browser is sent back to (a warning when that is your own computer), your account, and what the app may do:
| Scope | Lets the app |
|---|
memory:read | search, get, list, history, audit, verify, export |
memory:write | remember, update, delete |
offline_access | stay connected without asking again (the app gets a refresh token either way) |
Allow issues the app a one-use code; Deny sends it access_denied. Either way you are sent back to the app. Only
allow an app you are connecting yourself: a link someone else sent would connect their app to your memory. Nothing of
your memory is shown or sent on this page.
Connected apps on the API Keys page lists every app that holds tokens for your account, with its
scopes, when it connected and when it last used a token. Disconnect revokes every token at once
(DELETE /oauth/clients/{id}); the app's next call fails and it may ask to connect again.
Deleting your account removes the codes, tokens and the log of these connections with everything else.
Contact page
How to reach StateJar and who runs it: the operator identity, support e-mail and phone.
/contact is public. It names who runs StateJar (the operator's identity sentence, the same on the about, terms and
refund pages), the support e-mail and the phone number, and shows only the details that are set; nothing is shown as a
placeholder. To remove your data, see deleting your account.
Dashboard
Account-level counts and the most recent savings figure.
Four cards:
- Sessions, how many session tags you have used.
- Memory states, how many states you have written. Every accepted turn
writes one, so this is roughly your turn count with facts in it.
- Audit entries, how many disclosures have been made.
- Tokens saved (last chat), the retriever's figure for your most recent
query, measured against the disclosable state, not against a transcript
replay. The card says so underneath. See
token savings.
All four come from GET /memory/stats. See
that endpoint.
Deleting your account
Profile → Delete account schedules the deletion for 7 days later; you can cancel until then. The public /delete-account page explains what goes.
Where. Profile, at the bottom: Delete my account…. The panel asks you to
type the account's email, enter your password and tick a box acknowledging that
the deletion is permanent once it happens. Only then does Delete my account in
7 days enable.
An account without a password (made by an e-mail code, Google or GitHub) presses
Send me a code and types the code we e-mail it instead, or, with two-factor
sign-in on, a code from its app (why).
If the form is missing. The form appears only when the server you are
connected to offers DELETE /account (the page checks the server's route
list). An older server shows an email address instead: write from the
account's address and the deletion is done for you.
The 7 days. Pressing it schedules the deletion for 7 days later and we
e-mail you the date with a link to cancel. Until then nothing changes: you can
sign in, and your developer keys and memory keep working. Every console page
shows a banner with the date and a Cancel deletion button (the same button
is in Profile); cancelling keeps everything and we e-mail you that it was
cancelled. See cancel.
What goes, on the date. Your account, every memory version in every session, the audit
log, saved provider keys, developer API keys (they stop working immediately)
and your profile. Payment records (orders, invoices, payments, refunds and the
wallet ledger) are kept for tax law, anonymized: no account id, e-mail, full
UTR, notes or name given without a GSTIN (a GST invoice's buyer GSTIN and the
business name given with it stay), and deleted after the retention period
(the server's financial record retention days setting).
What it cannot reach. Anything already sent to a model provider you chose
is held under that provider's policy. Chat history kept in other browsers
stays there until you log out of them.
The public page at /delete-account describes the same thing without needing
a sign-in, and is where you land after a deletion. API: DELETE /account.
Docs (the docs home)
/docs opens with the integrations showcase, then getting started in seven steps, each with a recording of it running, then every docs page.
Docs (/docs) opens with the integrations showcase:
one tab for each way in (SDK, agent harness, plugins, MCP and the command
line), each with a snippet to copy, what it does for you in one line, and a
link to its own page.
Then Getting started, step by step: sign up, verify your e-mail, create
an API key, install the package, sign in from the terminal with
statejar login, remember and recall, and see your memory in the console.
Each step carries a recording of it running:
- Terminal steps are real sessions recorded with asciinema, playing the
same code the step shows. Full size opens one at its own size, and The
recording (.cast) downloads the recording itself, which
asciinema play
replays. Pauses longer than 3 seconds are shortened to 3 seconds; nothing
else is changed.
- Browser steps (sign-up, the e-mail code, the API keys page, approving
the terminal, the dashboard) are screenshots of the real pages, taken as the
run went and played in order; waits for the server are shortened. The one
key the API keys page shows is blurred.
All of them were made in one run, in one throwaway account, against a
StateJar server and this site running on one machine. Each caption says what
it shows, when it was recorded, and which version of a package ran. Under
reduced motion each recording shows its last frame, still.
The same seven steps are one page, Getting started,
readable without scripts and as Markdown. Every code block is a file
that a test script runs
against staging (workflow docs-blocks): a block that stops working fails a
check, not a reader.
Every docs page is listed at the end. The complete reference (every
endpoint, field and status) stays on API reference.
Docs pages (one per surface)
Each docs page (/docs/<page>.html) uses one template, and each also exists as Markdown at /docs/<page>.md for agents.
Under the guided page, Docs lists one page for each place you can
use StateJar, and the guides to
how something works for your account, such as Pricing and payments. Every page
uses the same template: what it covers, its sections, an "On this page" list,
and the pages before and after it.
Each page exists in three forms:
- The page itself:
/docs/<page>.html. It is built with its text
already in it, so a reader or a tool that runs no script still sees the
whole page.
- Markdown:
/docs/<page>.md, for agents and anyone who wants the
plain text.
- A line in
/llms.txt: the site's index for language models lists
every page's Markdown address.
The figures on a comparison page come from one measured run, named on the
page. The repository's tests hold every number on the page to that run's
report.
Getting started, the pages for the Python SDK, the Node SDK, the
statejar command and the MCP server, and Any LLM provider show
recordings of their examples running: real runs against a local StateJar
server, in a terminal or in this site, with the date each was made and the
package version it ran in its caption.
Downloading your data
Profile → Download my data saves a JSON copy of everything your account holds, after your password.
Where. Profile, above Delete account: Download my data…. Enter your
password and choose Download; the browser saves
statejar-export-YYYY-MM-DD.json. An account without a password (made by an
e-mail code, Google or GitHub) presses Send me a code and types the code we
e-mail it instead, or, with two-factor sign-in on, a code from its app
(why).
What is in it. Everything the account holds, table by table: every memory
version in every session, the audit log, your profile, plan and usage, your
two-factor and terminal sign-in records, values waiting for your confirmation,
and the names and dates of your keys. What is left out is listed in the file:
the password's hash, the keys themselves and their hashes, the two-factor secret
and the recovery codes' hashes, none of which you need and all of which would
help someone else into the account.
If the panel is missing. It appears only when the server you are connected
to offers POST /account/export (the page checks the server's route list).
API: POST /account/export.
Forgot your password
The Forgot password? link on the sign-in page, the reset e-mail, and the page where you choose a new password.
On the sign-in page, Forgot password? sits under the form whichever way of signing in is chosen.
- Enter the address of your account and press Send me a reset link. The page always answers If this email
exists, a reset link has been sent, for any address, so it never says which addresses have accounts
(details).
- Open the link in the e-mail. It works for 30 minutes, once, on any device: nothing is spent when the page opens,
only when you send the new password.
- Type the new password twice and press Set new password.
- Press Sign in and sign in with the new password. Every device that was signed in to your account has been
signed out, and with two-factor sign-in on, your app's code is asked for as usual
(what a reset does).
No mail? Check the spam folder, and wait a minute before asking again: an address gets at most 3 links an hour. A
link that has expired or was used already says so; ask for a new one from the same page. In the Android app the
link opens in your browser; after the reset, sign in in the app with the new password.
Handles tab
Every version of this session's state, newest first.
One row per state version, each with its handle. Click a row to inspect that
historical state, the panel switches to Inspecting historical state and a
back to latest control returns you.
Inspecting is read-only and changes nothing. To actually adopt an old state,
copy its handle and restore it.
See handle and
active state vs history.
Investors page
What StateJar is, the problem it solves, how it works, what is measured so far, the roadmap, and a form to register interest.
The Investors page (/investors) explains StateJar for investors: the problem,
how it works, measured facts only, and the roadmap. Its form
(how it is handled) records interest only. It is not
an offer or solicitation to buy securities.
Light and dark theme
The sun/moon button switches between the light and dark themes; this browser remembers the choice, and until you choose, your device setting decides.
Where. The sun/moon button in the top bar, the console sidebar and the
sign-in screen.
What it does. Switches every page between the light theme (warm paper)
and the dark theme (the same design on a dark ground). The animated graphics
switch with it.
Remembered per browser. The choice is kept in this browser only, not in
your account; another browser or device starts from its own device setting.
Until you press the button, StateJar follows your device's light or dark
setting and changes with it.
Memory State tab
Everything currently remembered, by namespace.
The active state, rendered as a tree. Fields changed by the last turn are
highlighted, and hovering a field shows which tier
produced it.
Every namespace the API returns is rendered, including dynamic, which is
where concepts nobody wrote a schema for live. See
reading the Memory State panel and
dynamic fields.
Below the tree sits the declined section, which is
where to look when something you said is not in the tree.
After turn. When the session has more than one version, the row of
version buttons above the tree shows the state as it was after each one; the
latest is selected by default. Picking an earlier one opens it read-only, as
the Handles tab does.
Message box
Where you type. Every message goes through the full pipeline.
Enter sends. Each message runs /memory/ingest first, extraction,
canonicalization, handle, store, and then /memory/query and /chat to
produce a reply.
Because ingest is separate, the memory pipeline works without a provider
key. With no key configured you will see the state update and the panels
fill; only the model's reply will report that no provider is set.
A message with no facts in it is normal and stores nothing. See
reading the Memory State panel.
Model selector
Choose which model answers, grouped by provider.
Models are grouped by the provider they belong to, with free ones listed
separately from paid ones where a provider offers both. Only providers you have
configured appear.
Local Ollama models (only on installs that turn on the server's Ollama setting) are enumerated by your browser, not by our server. A
hosted StateJar cannot see http://localhost:11434; your tab can. So the list
is whatever you have actually pulled. See Ollama local.
Custom model lets you type a model id the catalog does not list, and pick
which provider should route it. Useful for a model released after the catalog
was last refreshed.
If a model you had selected disappears from its provider's catalog, StateJar
falls back to the first available one and tells you rather than failing at send
time.
My orders page
Your plan and how long it runs, this month's use against the limit, the next renewal and its price, Renew, Upgrade and Top-up, and every order with its receipt.
My orders in the console sidebar (/billing/orders) shows:
- Your plan: when the paid period started, the date it is valid until, the
days left (marked when seven or fewer remain) and this month's memory
adds and recalls against the plan's limits. On the Free plan there is no start or
end date.
- Next renewal: the date to pay by and the amount of your last order.
Paid plans never renew by themselves and nothing is charged without you
paying, so you also get an e-mail seven days and one day before the end and
a notice when it ends. When it ends the account is on the Free plan and
nothing is deleted.
- Renew, Upgrade (or Change plan) and Top-up buttons. Renew
and Upgrade go to Billing, where you pick the period and the
payment method; a top-up adds adds for this month only (1,000 extra adds, $1 / ₹85). While paid
plans are coming soon the button says Join waitlist instead
(how it works).
- Order history: each order's number (with a Copy button for its
reference), date, plan, amount, currency, payment method and status
(pending, paid, failed, refunded or expired). A paid order has a Receipt,
which opens on its own page to print or save as a PDF; with a GSTIN on the
order and GST registered, the same page is laid out as a GST invoice
(the receipt).
The data is your own account's only (the endpoint).
My tickets page
Ask the StateJar team for help, read its answers and close a ticket; replies also arrive by e-mail.
My tickets (in the sidebar) lists the requests you filed with their status: open, in progress, resolved or closed.
Open one to read the thread, answer it, attach files (png, jpg, pdf or txt; up to 3, 5 MB each) or close it. New
ticket takes a subject, category, priority and description, and optionally a session tag or handle of your own so we
can look at the right memory. We answer here and by e-mail; internal notes the team keeps are never shown to you.
Details: support tickets. Deleting your account deletes your tickets and their files.
New session - Continue my memory or Fresh memory
Choose whether a new Playground session continues your account memory or starts as a separate, empty test user.
+ New session asks which memory the new session uses.
- Continue my memory is how a returning user is treated. The session has no
version of its own yet, so it is answered from, and its first message builds on,
the newest state of your other sessions (the same rule as
cross-session consistency). Your demo sessions and fresh
sessions are never part of that.
- Fresh memory (separate test user) starts empty and stays empty of everything
else. Nothing from your other sessions appears in it, seeds it or answers a
question for it, and it seeds none of them. Its own messages build only on its
own versions. Use it to test what a brand-new user sees, without old facts
turning up in replies.
The choice is made when the session is created and shown by the
memory label beside the session picker. A fresh session
is listed as Fresh 2 - date in the picker.
Behind it, a fresh session is a session tag that starts with fresh-. The server
treats that prefix as its own memory scope, the same way it treats the built-in
demo's demo- prefix. A session you name fresh-... yourself through the API is
isolated in the same way.
To empty a scope instead of starting a new one, use Clear memory.
Notifications
The bell in the console sidebar lists messages from StateJar and how many are unread.
What this does. Shows announcements StateJar sent you inside the console.
How to use it. Press Notifications in the sidebar. The number is how many you have not read. Opening the list marks them read; Mark all read does it at once.
Playground
The working screen: chat on the left, the memory inspector on the right.
The Playground is a full StateJar client. Everything it does is available
through the API.
Left column: the toolbar (sessions,
model picker, restore, demo
buttons), the transcript, and the message box.
Above both columns: the seven-stage pipeline tracker.
Right column: four tabs, Memory State,
Told the model, Handles,
Audit, with the tier chips and the
handle line above them.
Your transcript is stored in this browser, not on the server (where evidence
recall is on for you, dated sentences of your own messages are also kept on the
server, separately, for recall). Switch
sessions and come back and it is exactly as you left it; open the same account
on another device and the memory is all there but the conversation is not. See
the FAQ.
Pricing page
Launch pricing: Free, Starter, Pro and Business with their prices, adds and recalls a month; billing is coming soon until a payment provider takes payments, every account is on Free, and the limits are enforced.
/pricing is public and shows the live price list (GET /plans). StateJar is
in early access: every account is on the Free plan, billing is coming soon
(the page asks billing config, and only once a payment
provider takes payments does a paid plan link to the Billing page,
never in the Android app) and the plan's limits are enforced: adds a month (429
plan_add_limit: messages a model read; a message the rules handle alone is free and unlimited), recalls a month (429
plan_recall_limit: query, chat, restore), fair use (429 fair_use_throttle: a very high rate of adds in an hour or a day), developer keys (403 plan_key_limit), requests a minute per
developer key (429 plan_rate_limit), seats (403
plan_seat_limit) and history retention (a daily job, see
run retention now). Audit export is the one listed
limit not yet enforced.
Launch pricing, per month; rupee prices exclude GST (18% is added at checkout), dollar prices + GST as applicable: Free $0 (3,000 adds, 20,000 recalls), Starter $15 / ₹1,299 (25,000 adds, 200,000 recalls), Pro $199 / ₹16,999 (300,000 adds, 2,000,000 recalls, fair use), Business custom (custom limits and terms). A year costs ten months' price. A top-up is 1,000 extra adds for $1 / ₹85.
A plan belongs to your account, so upgrading applies to the developer keys you
already have; none is reissued. Model usage is never part of a plan: a model
you choose in the Playground runs on your own provider key;
StateJar's cloud providers read your messages and answer in the Playground (the default model) at StateJar's cost, within the
monthly and hourly limits of your plan.
No payment is taken today. See the refund policy, and
pricing and payments in the docs for what each
limit counts and what the API answers at one.
India or International. A switch above the plans picks the currency and
which gateways come first: India shows rupees (INR) and the Indian
gateways first; International shows US dollars (USD), the international
gateways and then crypto. It starts from the region hint, else
your browser's time zone and language, and your own pick wins and is remembered
in that browser only. Every price carries its currency and "per month"; a rupee
price reads "+ 18% GST" (the price is GST-exclusive and checkout adds the tax) and
a dollar price "+ GST as applicable". Once a gateway takes payments the page lists the ways to
pay for the gateways that are on, with each brand's official mark where its
owner's terms allow it and a plain name where not; no gateway is named while
billing is closed.
Privacy page
Your privacy controls, what the service stores, what it never stores, who else sees data, how long it is kept, how to get a copy and how to delete it.
/privacy is public. It lists every kind of row the server keeps, email and
password hash, memory versions, audit entries (field names, not values),
encrypted provider keys, hashed developer keys, the optional profile, the
dated excerpts of your own messages that evidence recall keeps (on for every
account since 14 Nov 2026; deleted with the account), and states that your
conversations are not stored on the server as transcripts. It names OpenAI as the
sub-processor that makes and ranks the vectors for excerpt search.
It opens with Privacy controls: what you can do about your data and where
(download a copy, delete the account, remove a fact, read every disclosure in
the audit log, choose who reads your messages, revoke keys, two-factor sign-in,
chat history kept in the browser).
How long it is kept says what the daily history-retention job does: memory
versions and audit entries older than your plan's history window are deleted,
except the newest version of each session, which is kept whatever its age. The
window shown is the starting plan's, read from the live plans list
(pricing; run retention now). A version
is never edited; account deletion removes every version at once.
It also says what is not known yet: what the hosting provider itself keeps.
See deleting your account and
where chat history is stored.
Product updates
An unchecked box at sign-up and a switch in Profile: whether StateJar may e-mail you about new features.
What this does. Lets you choose whether StateJar sends you product-update e-mails.
How to use it. The box on the sign-up page is unchecked: nothing is sent unless you tick it. Turn it on or off any time in Profile → Product updates, or press Unsubscribe in any such e-mail. Sign-in codes, receipts and account notices are not product updates and are always sent.
Recovery codes
Ten one-time codes shown once when two-factor sign-in is turned on. Each replaces one authenticator code, once.
What they are. When you turn on two-factor sign-in,
StateJar shows ten recovery codes, once. Each one can be typed instead of
an authenticator code at sign-in, and works one time only.
Keep them away from the phone. They exist for the day the phone is lost.
Copy or download them and store them somewhere else, a password manager or
paper.
How they are stored. StateJar keeps only a SHA-256 hash of each code, so
nobody, including the operator, can read them back. That is also why they are
shown only once.
New codes. Profile → Two-factor sign-in → New recovery codes (needs
your password and a current code). The old ten stop working at once.
Lost the phone and the codes? There is no email-based recovery yet:
write to the contact address.
Refund policy
How cancellations and refunds will work once paid plans go on sale; no payment is taken today.
/refund-policy is public. No payment is taken yet, so nothing can be owed
today. From the day paid plans go on sale: cancelling stops the next charge and
the plan runs to the end of the paid period; charges made in error are
refunded in full if reported within 30 days; a first payment is refunded in
full if asked within 7 days. Approved refunds are processed to the original
payment method within 5–7 business days, through the provider that took the
payment. Charges from your own model provider key are not StateJar's.
See contact.
Reporting a reply
The Report button under each model reply in the Playground sends that reply to the StateJar team, with a reason, without leaving the page or the app.
Every reply a model writes in the Playground has a Report link under it. Choose why (offensive, harmful,
sexual, hateful, wrong about a fact, or something else), add a note if you like, and press Send report. The
reply, the provider and model that wrote it, and your reason go to the StateJar team
(POST /reports); nothing else from the conversation does. It works the same on the website and
in the Android app, where Google Play asks every app whose replies are written by AI for this.
A report does not change your memory, and the team reads it in the admin console.
Restore a handle
Adopt a previously sealed state into the current session.
The box in the Playground toolbar. Paste a handle, submit, and that state
becomes the current state of the session you are in.
Restore re-derives the handle from the stored state and refuses if the two do
not match, so a successful restore is a verification, not just a lookup.
This is how memory crosses a session boundary without a shared user id. See
your first handle restore and
the endpoint.
If a restore appears to return different state than you expected, see
the troubleshooting entry.
Session selector and + New session
Pick a thread, or start an isolated one.
The dropdown lists your sessions; + New session adds one and asks whether it
continues your memory or starts with fresh memory (a separate, empty test user): see
New session. The Memory chip beside the picker shows which,
and Clear memory empties a scope.
Switching swaps everything belonging to that session together: the transcript,
the tier chips, the per-field origins, the
pipeline tracker, the last retrieval and the memory
state. Nothing from the session you left stays on screen, showing the previous
session's run beside this session's messages would be worse than showing
nothing.
The session you were last in is remembered, so a reload returns you there
rather than to the first session in the list.
To carry memory across sessions deliberately, copy a handle and
restore it. See session.
Sessions
Profile's Sessions panel: every browser signed in to your account, and Log out everywhere.
Under Profile → Sessions is every browser currently signed in to your account
(GET /auth/sessions): when it signed in, when it was last used, its browser, and this
browser on the one you are reading from. A session ends when you log out, after 7 days unused, or 30 days after
it opened.
Log out everywhere ends all of them at once (details); with two-factor
sign-in on it asks for a fresh app code first. Use it when a device is lost or a session is not yours, and then
change what let it in: a leaked password, or a mailbox someone else can read.
statejar login (sign in from the terminal)
`pip install statejar`, then `statejar login` opens statejar.com/device; approve once and your code has a key.
Since 2026-10-08 the Python package carries a command, the way gh auth login
works:
pip install statejar
statejar login
It prints and opens https://statejar.com/device?code=ABCD-EFGH. Sign in
there as usual (two-factor included), check the device's name and the code,
and press Approve. The terminal, which has been polling, receives a
one-year developer key and stores it, in the OS keychain when the optional
keyring package is installed (pip install "statejar[keyring]"), else in
~/.config/statejar/credentials.json with mode 0600 (%APPDATA%\statejar
on Windows). Your password never passes through the terminal, and the key
never appears in the browser.
From then on StateJar() with no api_key uses STATEJAR_API_KEY when it
is set, else the stored key. statejar whoami says which account the key
belongs to; statejar logout forgets it on this machine (revoke it on the
API Keys page to stop it everywhere). The key is an ordinary
developer key: it reaches the memory API and nothing else, it cannot issue
more keys, read provider keys or change the account.
The JavaScript package reads STATEJAR_API_KEY the same way (Node only,
never in a browser); there is no npx statejar login yet, paste a key from
the API Keys page, or copy the one statejar login stored.
Terms page
Links the StateJar SDK License (proprietary) and marks the service terms as not yet written.
/terms is public and keeps two documents apart. The StateJar SDK License
(Version 1.0) is written, ships as LICENSE in both SDK packages, and is served
in full at /legal/sdk-license.txt. It is proprietary, not open source: it
permits installing and using the unmodified SDK with the StateJar service and
redistribution of unmodified copies by package registries and mirrors, and it
reserves every right it does not grant (section 3 of the licence).
The service terms for statejar.com and api.statejar.com are marked as a
placeholder: not yet written, so nothing on the site promises uptime, support
or a price.
The declined section
Values StateJar refused to store, each with the reason.
Below the state tree. Each row is a value that failed a guard, with the reason
it failed.
This is a feature. The alternative to declining is guessing, and a guess
that lands in the wrong field is indistinguishable, to the user, from a
correct memory. A decline is the system saying I did not store that, and here
is why.
How to read a reason:
unknown_key, nothing in the registry claims that
name. Rephrase using a more common word, or it may belong as a
dynamic field.
rejected_value, the field exists but the value
is the wrong kind. This is the guard doing exactly its job.
low_confidence, the tier that proposed it was
not sure enough for that field.
not an assertion, the clause was a question or
a negation, not a claim.
See decline and _unmapped.
The demos
Two scripted runs that exercise the real pipeline with no provider key.
Short demo, a six-step scripted run that shows extraction, a handle, a
session hop and minimal retrieval in about a minute. Space advances it; R
restarts; Escape exits.
Run 17-turn demo, the longer disaster-relief scenario. See
the demo scenario.
Both call only /memory/ingest and /memory/query. The user turns and the
replies are fixed in the client, so no provider key and no LLM call are
involved, but the memory pipeline underneath is entirely real: real
extraction, real handles, real minimal retrieval, real audit rows.
That is the point of them. They work on a brand-new account with zero keys,
which is the account a judge or a reviewer will have.
The handle line and copy button
The address of the state you are looking at.
Sits under the tier chips: handle: shm_… with a copy button.
The handle is the content address of the current state. It
changes whenever the state changes and is identical whenever the state is
identical.
Copy it to move this exact memory somewhere else, another session, another
model, another vendor. Paste it into restore.
It is safe to share in the sense that it is a hash, but it is a key to your
state: anyone who can call your account's API with it can read that state.
The integrations showcase
Tabs on the landing page and on /docs for every way to use StateJar (SDK, agent harness, plugins, MCP, command line), each with a snippet to copy, a one-line benefit and its docs page.
The landing page's developer section and the top of Docs show the
same five tabs:
- SDK: Python and Node.js;
- Agent harness: OpenClaw and Hermes Agent;
- Plugins: Claude Code, Codex and OpenCode;
- MCP: the configuration for Claude Code, Cursor, VS Code, Codex,
Gemini CLI and Windsurf, and the official MCP Python SDK in your own code;
- CLI:
statejar login.
Each choice shows its name, what it does for you today in one line, a
snippet with a Copy button, and a link to its docs page; where a recording
of it running exists, Watch a recorded run goes to it. The snippets are the
docs pages' own code: the first-turn examples, or the first code block of a
page's Install section, so the tabs and the pages never say different things.
The tabs work from the keyboard: Tab reaches the selected tab, the arrow keys
move between tabs, Home and End jump to the first and last. Your last choice
is remembered in this browser only.
Each tool is named in type. Where a one-colour mark of it is available under an open licence (Simple Icons, CC0), it
is shown beside the name, in the page's text colour. The row says "Works with" and nothing more: the tools' owners
have not reviewed StateJar, and the marks belong to them. Sources are listed in the brand notice served at /brand/NOTICE.md.
The memory label beside the session picker
Which memory the current session uses - your account memory, a fresh separate one, or the demo's.
The small Memory chip beside the session picker says which memory the current
session reads and writes.
- Continues your memory: a normal session. With no version of its own it is
answered from, and seeded by, the newest state of your other normal sessions.
- Fresh memory: a session started with Fresh memory (separate test user).
It is isolated: other sessions never seed it or answer for it, and it seeds none
of them. See New session.
- Demo memory: the built-in demo's own line. It never touches your sessions.
Hover the chip for the full sentence. The scope comes from the session tag
(fresh-..., demo-..., anything else), so it cannot drift from what the server does.
The model badge on a message
A small line under a Playground message says "Cloud model"; an admin of the service sees which model.
Under a message in the Playground, a small line says Cloud model: a model on StateJar's side read your message
(to find the facts in it) or wrote the reply. Which provider and model is not shown to you, and the API never sends
it to an account that is not an admin of the service.
The line is kept with the chat in this browser, like the rest of the transcript. No message or reply text is kept
on the server for it: only a count of tokens, a cost estimate and the time of each model call, which are deleted with
your account and after 90 days. A reply written by a provider key you saved yourself shows the same words; a reply
from a local Ollama model in your own browser shows no badge, because no cloud model was used.
The seven-stage pipeline tracker
A live trace of the seven stages, with a real sublabel on each.
The strip above the chat shows the seven stages a message passes through.
Nothing here runs on a timer of its own, every badge is filled from an actual
API response, so the strip cannot claim a stage the panels did not reach. The
only timed part is the reveal stagger, which paces stages that all completed in
one round trip so the eye can follow them.
| Stage | Sublabel | Means |
|---|
| Ingest | sent | the message reached the API |
| Extract | N fields | how many fields the tiers produced |
| Canonicalize | sorted | keys sorted at every level, the exact bytes the handle is computed from |
| Handle | first 8 hex characters | the content address that was derived |
| Store | v1 or v+1 | a first state, or a new version of an existing chain |
| Retrieve | N of M fields | how many of the eligible fields were disclosed |
| Audit | logged | a disclosure row was written |
Click any stage to see its payload, including the canonical string the handle
was actually computed from.
Retrieve and Audit only light up on a turn that asked something. An ingest-only
turn legitimately stops at Store.
The sign-in link page
/login/link: where a sign-in link lands. Press Sign in; nothing happens until you do.
A sign-in link from your mail opens /login/link. The page shows one button, Sign in, and consumes the link
only when you press it (POST /auth/link/consume), so a mail scanner that opens links
ahead of you cannot spend yours.
It works in the browser you asked from, within ten minutes, once. In another browser the page says so and offers
a code instead (ways to sign in). A used or expired link says to ask for a new one.
This help centre
Search, categories, deep links, and a coverage test that keeps it current.
Every entry has a stable id and its own anchor, so any entry can be linked
directly, #concept.handle jumps to the handle entry.
Search matches titles, summaries, keywords and bodies. Try "declined", "why
wasn't this stored", or "tickets". The FAQ is at the top of the page, and Raise a ticket opens My tickets when you cannot find an answer.
Last updated on each entry comes from the file itself, not from a hardcoded
string, so it cannot claim to be fresher than it is.
Coverage is enforced by a test. Every API endpoint, setting, provider, tier,
decline reason, value type and UI surface in the shipped
product must have an entry here, or the build fails naming exactly what is
undocumented. Deliberate exclusions are listed in the test with a written
reason.
Tier chips
Which extractors ran, how many fields each contributed, and which failed.
One chip per tier that produced something on the
last turn, with a count beside it.
The number counts the fields that tier contributed, not the fields in the
state. rules 2 means rules produced two of them.
A chip that is absent means that tier contributed nothing, usually because
it was not needed. Rules answering completely is the normal, cheap case.
An amber "unavailable" chip is different and important: that tier was
attempted and did not answer. A missing key, a timeout, an unreachable
provider. Without this chip a failed tier and a skipped tier would look
identical, and "rules only" would be ambiguous. See
no LLM chip appearing.
"The model was busy" under the chips (extraction v3): the server's model
was answering someone when this message arrived, so the message was read at
once without it, and the model reads it again when it is free; memory then
takes the model's reading (how). Nothing is lost.
Token savings badge
How much smaller the disclosed subset was, against a stated baseline.
Appears after a question. It reports how much smaller what was sent was than
the disclosable state, every field that was eligible to be disclosed.
Two consequences of that baseline, both deliberate:
- It cannot go negative. It is clamped at zero.
- It is not a comparison against replaying the conversation. The 17-turn
relief demo makes that other comparison, and that one can go negative and
says so on screen.
Neither is a promise that you pay fewer tokens: on a short chat StateJar's memory block costs more than the history
it replaces (measured figures).
A small number early on is honest, not broken: with three fields stored, there
is not much to withhold. Read
token savings and its baseline before quoting any
figure from here.
Told the model tab
The exact subset, and the memory_context text, sent to the model for the last question.
Not your state, the slice of it that was disclosed for the most recent query,
plus how many fields were dropped and why the selector chose these, and the
memory_context text itself: the words the model received. (Before
2026-10-08 this tab was called Retrieved Context.)
This is the tab that makes minimal disclosure checkable. If your state has
twelve fields and this shows two, then ten were withheld, and the
audit entry records the same two keys.
Each reply in the chat also carries its own copy of this, under
What the model was told, so an earlier answer can be
checked after later ones.
Trust page
How data flows, the sub-processors, encryption in transit and at rest, how long each kind of data is kept, forgetting a fact versus deleting the account, and where to report a security problem.
/trust is public. It gathers the security and data-handling facts in one
place, each read from the code or the server configuration:
- How data flows: a diagram from your browser, SDK or MCP client through
the web server on our one server in France to the backend and its database,
out to the cloud model provider that reads a message for extraction, and out
to the recipient's mail server for sign-in codes.
- Sub-processors: the hosting provider and every cloud model provider the
code supports, each marked enabled in production or switched off, with a
link to its data-use terms. A test keeps this list equal to the server's
provider configuration.
- Encryption and region: TLS in transit; which values are encrypted or
hashed at rest; that the database itself and its backups are not encrypted
by us.
- Retention: memory history and audit rows for your plan's window, and the
fixed windows of everything else, backups included.
- Forget versus delete: forgetting a fact removes it from current memory
while older versions keep it until the history window ends; deleting the
account removes everything at once, except copies in backups for up to about
7 days.
- Reporting a security problem: the contact address, also published in
/.well-known/security.txt.
Where something is not known, the page says "not documented". See the
privacy page and deleting your account.
Try StateJar (the sandbox)
/try lets anyone try the real pipeline without an account; everything in it is deleted at 00:00 UTC.
Try it (/try) is StateJar without an account. Tell it something about yourself, then ask about it.
- It is the real pipeline. Each message goes through the same extraction, checks and content-addressed handle an
account's message gets, and each question through the same retrieval. The page shows what each fact became:
stored, held until said again, or declined with its reason. For a question, it shows exactly what a model would
be told.
- Each visitor's memory is apart. The browser keeps a random session id for this tab. The server makes an
account for that session alone, so no other visitor's memory can reach yours.
- Everything is deleted at 00:00 UTC. That covers every sandbox account and everything in it. Do not type
anything private.
- Secrets are removed first. API keys and tokens, private keys, passwords written after their name, and card
numbers are removed before a message is read.
- Limits.
- the server's sandbox max chars setting characters a message.
- the server's sandbox per ip per hour setting requests an hour from one address.
- the server's sandbox daily cap setting actions a day for all visitors together.
- Start over forgets this tab's session. The server deletes it, with the rest, at midnight UTC.
The calls behind it: session, remember,
jobs, ask. For a memory of your own,
sign up free.
Turn strip
The line under each of your messages: what it did to memory.
The small line under each message you send, read from that message's ingest
response:
- vN, the version it created in this session, or no new version when it
changed nothing (a question, or a fact already stored: the handle stays the
same and nothing is written).
- the first characters of the handle the session now has;
- changed, the field paths whose values it set or replaced;
- declined, values it refused to store, with the reason in the
declined section;
- by, the extraction tiers that ran.
It is kept with the chat in this browser only.
Two-factor sign-in
Optional authenticator-app codes at sign-in, ten one-time recovery codes, and the sign-in lockout. Required for admin accounts.
Where. Profile → Two-factor sign-in.
Turning it on. Choose Set up, scan the QR code with an authenticator app
(Google Authenticator, Microsoft Authenticator, Authy, 1Password…) or type the
key shown under it, then enter the 6-digit code the app shows. You get ten
recovery codes once: save them somewhere other than the phone. Each works
once, in place of an app code.
Signing in. After your password, StateJar asks for the current code. A
code is accepted only once.
Lockout. Ten wrong passwords or codes for one email address within 15
minutes lock sign-in for that address for 15 minutes. The answer is the same
whether or not the address has an account. Sign-in is also rate-limited per
IP address.
Admin accounts must have two-factor sign-in on, and the session must have
been opened with a code, to see the admin panel.
An account without a password (made by an e-mail code, Google or GitHub)
turns it off with a code from the app alone, or with a recovery code beside a
code we e-mail it; new recovery codes take the app code alone
(why).
Your address and the second factor. An account made with a password
should confirm its e-mail address: until it does, the
first sign-in by e-mail code, link, Google or GitHub resets the account,
two-factor sign-in included. Once confirmed, every sign-in asks for the code.
There is no email-based recovery of the second factor: if you lose both the
phone and the recovery codes, write to the contact address.
Verify your e-mail before your first key
A new account made with a password confirms its address with an e-mailed code before its first developer key.
Since 10 November 2026, an account made with a password confirms its e-mail address before its first StateJar key.
On API Keys the step shows above the key form: Send me a code, then type the 8-digit code we e-mail you. The
dashboard's first-run checklist shows it as step 0. The same step comes before approving statejar login in a
terminal and before connecting an app (Claude, ChatGPT, Cursor…) through the MCP server.
Why: a password sign-up proves nothing about the address, so throwaway accounts could otherwise take keys and use the
free tier in bulk. A code that reaches your mailbox proves it, and confirming signed in removes nothing from your
account (see confirm your e-mail address).
Who is not asked: accounts made before 10 November 2026, accounts made by an e-mailed code, a sign-in link or
Google/GitHub (their address is proven already), and any server that cannot e-mail codes. Keys you already have keep
working everywhere: the SDKs, the CLI, the MCP server and the plugins. The API answer is 403 email_not_verified
with the two calls that confirm the address (generate a key).
Ways to sign in
The login page's methods: a code or a link by e-mail, a password, Google or GitHub.
The login page offers every method the admin has on (GET /auth/methods):
- Send me a code, type your e-mail; an 8-digit code arrives and you type it in. It works for 10 minutes,
once, and five wrong tries kill it. New to StateJar? The same step creates your account: the address is proved
before anything is stored. (details)
- Send me a link, a one-time link arrives; open it in this browser and press Sign in. It is bound to
the browser that asked, so a link that reaches someone else is useless to them. (details)
- Password, as before, with two-factor sign-in if you turned it on.
- Google / GitHub, live on statejar.com (the login page lists them whenever the owner has connected them;
GET /auth/methods says which). Your account is matched by the address
the provider has verified; a new address gets a new account. An address the provider has not verified signs
nobody in and makes nothing: verify it with the provider, or use a code.
Whichever way you sign in, an account with two-factor sign-in on asks for its code next, once its address is
confirmed. The first sign-in that proves the address of an account made with a password resets that account, in
case someone else registered your address (Confirm your e-mail address). A sign-in opens a
session: a cookie this browser keeps, which Log out ends on the server.
What the assistant remembers (behind a flag, off on statejar.com)
Behind a flag that is off on statejar.com (on only on staging, for testing): the Dashboard panel with your account's switch for notes of what the assistant said, and the newest memories labelled "You said" or "Assistant said". Not shown on statejar.com.
This panel is not shown on statejar.com. It belongs to an assistant-side memory that is switched off there, so
nothing an assistant says on statejar.com is kept by it today. It is switched on only on staging, our test server, for
testing.
Where it is switched on. Dashboard, under Latest handles: What the assistant remembers.
- The switch. Keep notes of what the assistant said is one switch for your whole account: every session and
every developer key of it. StateJar has no separate projects, so your account is the project. It is on unless you
turn it off. Off: nothing new is captured and recall ignores the notes; what is already kept stays until you
delete it. A developer key can read and change the same switch
(the API).
- The labels. Each memory says who said it. You said is a short excerpt of your own message. Assistant said is
a short note of what the assistant recommended, decided, answered or planned, written by a model and marked
unverified.
- Delete. Delete removes one memory. Removing all of them at once, clearing your memory, forgetting a fact by
saying so ("Forget my budget") and deleting your account remove the matching notes too, and Download my data
includes them (export).
- Credentials. Keys, tokens and passwords are removed from the assistant's reply before anything is kept.
What the model was told
Under each reply: the handle, the fields, the retrieval mode and the exact context text.
Under every reply in the Playground. Open it to see what left for the model on
that turn: the handle the answer was built from (or that
there was no memory yet), the retrieval mode, the field paths sent, and the
memory_context text exactly as sent. The audit link opens the
Audit log filtered to the row that recorded it.
The size shown is an estimate: the context text's characters divided by four,
the same rule the dashboard uses. It is not a tokenizer count.
The panel is kept with the chat in this browser only, like the rest of the
transcript; the server keeps the audit row, never the message as such (excerpts an
answer used are listed on it by number, date and hash, never their text).
Working with the API
A background ingest job
The status, and when done the result, of a message read in the background (async, or long).
GET /api/v1/memory/ingest/jobs/{job_id}
A message is read in the background when it is sent with "async": true (reply
first, update memory right after), or, with extraction v3
switched on, when it is longer than
the server's extractor v3 background chars setting
(3,000 characters by default; at most 50,000). POST /memory/ingest answers
202 with job_id, status: "queued" and status_url. A session's jobs run
one at a time in the order they arrived: a job stays queued while an earlier
message of its session is being read, and reads its parent version when it starts.
This endpoint returns status, queued, running, done or failed, and,
once done, result: exactly the body a direct ingest would have returned.
Only the account that sent the message can read its job (404 for anyone else).
The SDKs wait for it with a timeout (ingest(..., wait=True, timeout=...)).
The message itself is never stored on the job: it lives in the server's memory
while it is read (where evidence recall is on for your account, its sentences are
kept separately as excerpts). If the server restarts meanwhile the job reports failed within a minute
("the server restarted while reading this message"); send the message again.
Finished jobs are kept for 2 days.
A code for your own account
POST /api/v1/auth/account/code e-mails the signed-in account an 8-digit code for one purpose (confirm the address, delete, export, 2FA changes).
POST /api/v1/auth/account/code with {"purpose": "…"} (a console session; a developer key gets 401)
Sends the account's own address an 8-digit code for one purpose, from the same machinery as a sign-in code: it
works for 10 minutes, once, and dies after five wrong guesses. It is kept only as a keyed hash, and its
purpose is part of it: a code for one purpose does nothing for another, a sign-in code confirms nothing, and this
code never signs anyone in.
Answers. 202 {"sent": true, "detail": "A code is on its way to your address. …"}. 409 when the purpose
does not apply: the address is confirmed already, the account has a password (give it instead), or two-factor
sign-in is off. 429 past five codes for the address in 15 minutes (sign-in codes count too) or five requests
from one network address in 15 minutes (twenty an hour). 503 when this server does not e-mail codes
(the server's e-mail sign-in switch off, the server's sign-in mail settings not in place), or the
message could not be sent.
The mail says what the code is for. If you did not ask for it, someone is signed in to your account: sign in and
use Log out everywhere under Profile.
A developer key's usage log
The newest calls made with one of your keys, refusals included.
GET /api/v1/apikeys/{id}/usage
Every call made with a developer key leaves one row: the route's template
(/memory/state/{handle}, never the handle itself), the method, the status
code the server answered and the time, with a keyed hash of the address it
came from. Never a request or response body, a header or a value.
The answer gives total, refused (calls answered 400 or above, such as a
403 for a permission the key lacks) and the newest calls (100 by default,
?limit= up to 200). Rows older than 90 days are removed from time to time.
Console only, like issuing and revoking keys: a developer key cannot read its
own log, and another account's key id answers 404. On the
API keys page, Usage beside a key shows the same list.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
A payment QR image
A payment QR image.
GET /api/v1/billing/manual/{method}/qr
Signed in only. The owner's QR image for manual_upi or binance_personal, with no-store caching. 404 when the method is not on offer.
Test mode only (2026-11-05): these methods are not offered on the production deployment and never activate a plan there. Nothing is ever credited on a UTR alone.
The providers listed in the server's list of enabled payment providers are unaffected; these two methods are separate, test-only, and paid plans stay "coming soon".
A token for the cookie's session
Hands a browser that holds only the session cookie the JSON token the console runs on.
POST /api/v1/auth/session/token, with the __Host-sj_session cookie, no other credential.
After a Google or GitHub sign-in the browser is redirected back with the cookie alone; the console calls this
once to get the access_token it uses for every other call. The cookie authenticates the request, so it must
pass the CSRF check every cookie-only change passes: the header X-Requested-With: statejar and a same-origin
Sec-Fetch-Site or an allowed Origin; otherwise 403 csrf_rejected. Without a live session: 401.
Accept an invitation
POST /api/v1/auth/invite/accept {token, password} opens the invitation link an admin sent, sets the account's password and signs in.
POST /api/v1/auth/invite/accept {"token": "…", "password": "…"}, no sign-in needed; the token is the one in
the invitation e-mail's link (/invite?token=…), sent when an admin added the account.
The link works once and for 7 days. Opening it sets the password (8 to 72 bytes, like sign-up), proves the e-mail
address (the link reached the mailbox) and answers an ordinary sign-in (access_token, the session cookie). An
unknown, used, expired or replaced link is 404; a suspended account is 403; password sign-in switched off in
Login methods is 404. Rate-limited per address like sign-in. Written to the login audit
log as a password sign-in.
Account stats
Counts for the Dashboard, plus the last chat's savings figure.
GET /api/v1/memory/stats
Session count, state count, audit count, and token_saved_pct for your most
recent query.
That percentage is measured against the disclosable state, not a transcript
replay, and is clamped at zero. See
token savings and its baseline.
Integrity. Counts are reported as stored; the savings figure is computed
from a state only if its bytes still hash to its handle, otherwise it is
null and token_saved_basis says why. The integrity block lists any state
that failed.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Adding money to your wallet
An order that adds an amount you choose to your wallet, paid through a switched-on payment method; the wallet is credited once the payment is verified.
POST /api/v1/wallet/topups with {"provider": "...", "amount": "500", "currency": "INR"}, a console session.
The amount is checked on the server: ₹10 to ₹100,000 or $1 to $1,200, at most two decimals (422
topup_amount_out_of_bounds otherwise). The order goes through the same payment path as a plan's
order: the wallet is credited only after the payment provider's verified
notice and a server-side status check, and only once however often the notice arrives.
Adding money works with the card, UPI and wallet gateways (409 topup_not_with_this_provider for another method).
A top-up never starts a plan. Its money stays in your wallet and cannot be withdrawn.
Allow or deny an OAuth request
Your decision on the consent page: allow issues a one-use ten-minute code bound to the app, deny sends it access_denied; either way you are sent back to the app.
POST /api/v1/oauth/authorize/decide, body {"req": "…", "allow": true|false}, signed in.
Allow issues an authorization code (sjo_…, one use, ten minutes) bound to the app, its redirect address, its PKCE
challenge, the scopes, the MCP resource and your account; the server keeps only its SHA-256. Deny issues nothing.
The answer is {"allowed": …, "redirect_to": "<the app's address>?code=…&state=…&iss=…"} (or error=access_denied),
and the page sends the browser there. The request is spent either way: a second decision on the same id is 404.
Every decision writes an event row the account can read in its export and that deletion removes.
Approve a terminal sign-in
Issue a one-year developer key for the device and park it for the terminal to collect; the browser never sees the key.
POST /api/v1/device/approve { "user_code": "ABCD-EFGH" }
Signed-in only, two-factor included where the account has it. Creates an
ordinary developer API key, data plane only, one
year, labelled statejar login: <device name>, listed and revocable on the
API Keys page like any other, and parks it, encrypted with the server's
provider-key AES key, for the terminal's next poll. The
response carries only the last four characters: a key shown on a page gets
pasted into chats, and the browser has no use for it. 409 when the code was
already decided, 410 when it expired.
Ask for a password reset link
E-mails a one-time link to choose a new password. Always answers 202 with the same sentence, whether or not the address has an account.
POST /api/v1/auth/password/forgot with {"email": "you@example.com"}.
Answers 202 with the same body in every case: the address has an account, has none, is suspended, asked too
often, or the mail could not go ("If this email exists, a reset link has been sent"). The answer also takes the
same time either way: the mail leaves after the answer, and every answer is padded to the same length. So nobody
can learn from this route which addresses have accounts.
When a mail goes out it carries a link to /reset-password that works for 30 minutes, once
(Reset your password). The server keeps only a keyed hash of the link's token, never
the token. Limits: 3 links per address per hour (further requests are answered the same way, but nothing is sent),
5 requests per IP per 15 minutes and 20 per hour (429).
The route needs the same server settings as an e-mailed sign-in code; without them it
answers 503, whatever the address. It answers 404 while the password method is switched off. For an account
whose address was never confirmed, the mail says that using the link also confirms the address and removes what
the account's creator left (Confirm your e-mail address).
Ask for a sign-in code
Sends an 8-digit one-time code to an e-mail address. Always answers 202, whether or not the address has an account.
POST /api/v1/auth/code/request with {"email": "you@example.com"}.
Answers 202 with the same body in every case, the address has an account, has none (one is created when the
code is verified), is suspended, asked too often, or the server could not send, so nobody can learn from this
route which addresses have accounts. When a mail goes out it carries an 8-digit code that works for 10 minutes,
once, and for five wrong guesses. Limits: 5 codes per address per 15 minutes (further requests are answered
but nothing is sent), 5 per IP per 15 minutes and 20 per hour (429). A wrong code counts toward the
sign-in lockout like a wrong password. The server stores only a keyed hash of the code
(with a server secret); without the server's sign-in mail settings or the
the server's e-mail sign-in switch switch the route answers 503. The admin can turn this method off from
Login methods, after which it answers 404. For an account whose address was never
proven, the mail says that using the code resets what the account's creator left
(Confirm your e-mail address).
A browser that has signed in to the address before carries the cookie __Host-sj_known (a keyed hash of the address,
for a year): its requests count against a per-address budget of their own, the same size, and its wrong codes against
a lockout counter of their own, so someone who only knows your address cannot use up your sign-in by asking for codes
or guessing them from elsewhere. The cookie signs nobody in; a code or a link is still needed. Signing out clears it.
For an address with no account (the code would create one), the same sign-up protection applies: a disposable
domain, the daily number of accounts per network address and, when the operator has set up Cloudflare Turnstile, a
turnstile_token in the body. A refused request gets the same answer as any other and no mail is sent. Signing in
to an existing account never needs a token.
Ask for a sign-in link
Sends a one-time sign-in link, bound to the browser that asked for it. Always answers 202.
POST /api/v1/auth/link/request with {"email": "you@example.com"}.
Answers 202 with the same body whatever the address's state, like a code request. The mail carries a link to
/login/link?token=… on this site that works for 10 minutes, once, and only in the browser that asked: that
browser receives the cookie __Host-sj_link when it asks, and the link is consumed only when the cookie matches.
Opened on another device, the link is refused and the page says to open it where it was requested, or to use a
code instead. Same limits as a code: 5 per address per 15 minutes, 5 per IP per 15 minutes. The token is stored
as a keyed hash only. A link for an address without an account is refused at consumption (409): sign up with a
code, which creates the account. Like a code request it answers 503 while the server's e-mail sign-in switch
is off, and its mail warns an account whose address was never proven (Confirm your e-mail address).
A browser that has signed in to the address before carries the cookie __Host-sj_known (a keyed hash of the address,
for a year): its requests count against a per-address budget of their own, the same size, and its wrong codes against
a lockout counter of their own, so someone who only knows your address cannot use up your sign-in by asking for codes
or guessing them from elsewhere. The cookie signs nobody in; a code or a link is still needed. Signing out clears it.
Assistant-side capture: flush (behind a flag, off on statejar.com)
Behind a flag that is off on statejar.com (on only on staging, for testing): takes `{"session_tag", "summarize"}`: the session's queued assistant turns are distilled now and, with `summarize`, the session's summary is written. Answers 404 on statejar.com.
POST /api/v1/memory/assistant/flush
This answers 404 on statejar.com. It belongs to an assistant-side memory that is switched off there, so nothing
an assistant says on statejar.com is kept by it today. It is switched on only on staging, our test server, for testing.
Where it is switched on: Takes {"session_tag", "summarize"}: the session's queued assistant turns are distilled now and, with summarize, the session's summary is written. Answers with counts and the summary's handle, never a note's text. Used by our evaluation harness at the end of each session.
Assistant-side capture: your switch (behind a flag, off on statejar.com)
Behind a flag that is off on statejar.com (on only on staging, for testing): your account's own switch, `{"capture": true|false, "scope": "account"}`, from the console or a developer key. Answers 404 on statejar.com.
GET /api/v1/memory/assistant/settings · PUT /api/v1/memory/assistant/settings
This answers 404 on statejar.com. It belongs to an assistant-side memory that is switched off there, so nothing
an assistant says on statejar.com is kept by it today. It is switched on only on staging, our test server, for testing.
Where it is switched on: Your account's own switch, {"capture": true|false, "scope": "account"}. StateJar has no
separate projects, so the account is the project: one switch for every session and key. It is on unless you turn it
off. Signed in to the console, or with a developer key: reading needs the history permission, changing it ingest,
and a key limited to one session is refused (403). The Dashboard shows the same switch
(the panel). Off: nothing the assistant says is captured and recall does not read the notes; what is already kept stays until you delete it (DELETE /api/v1/memory/evidence).
Assistant-side notes (behind a flag, off on statejar.com)
Behind a flag that is off on statejar.com (on only on staging, for testing): list, or delete one of, the short notes of what the assistant recommended, decided, answered or planned, and the per-session summaries built from them. Answers 404 on statejar.com.
GET /api/v1/memory/assistant · DELETE /api/v1/memory/assistant/{id}
This answers 404 on statejar.com. It belongs to an assistant-side memory that is switched off there, so nothing
an assistant says on statejar.com is kept by it today. It is switched on only on staging, our test server, for testing.
Where it is switched on: List, or delete one of, the short notes of what the assistant recommended, decided, answered or planned, and the per-session summaries built from them. A summary built from a deleted note is rebuilt from the notes left, or deleted when none is left. Another account's id answers 404, like an unknown one. DELETE /api/v1/memory/evidence and clearing memory remove them too.
Assistant-turn memories (behind a flag, off on statejar.com)
Behind a flag that is off on statejar.com (on only on staging, for testing): send an assistant reply to be distilled into short memories evidence recall would keep. Answers 404 on statejar.com.
POST /api/v1/memory/evidence/assistant
This answers 404 on statejar.com. It belongs to the assistant-side memory, which is switched off there (evidence
recall itself keeps only your own sentences, where it is on for your account), so nothing an assistant says on
statejar.com is kept today. On staging, our test server, the assistant-side memory is switched on for testing, and
this route feeds it the same way a chat reply does.
Where it is switched on, it takes {"session_tag", "assistant_text", "user_text"}: one assistant reply and the
message it answered (used only to make the notes understandable, never kept from this call). A model writes at most
eight short notes of what the reply said or recommended; they are kept beside your excerpts, marked as the
assistant's, never in your memory state, its versions or its handles. The answer gives counts and the new notes' ids;
GET /api/v1/memory/evidence lists them, and every delete route removes them. Secrets are replaced by markers before
anything is sent to the model. A developer key needs the ingest permission; a key limited to one session may write
only to its own session.
Audit facets
The distinct values available to filter the audit trail by.
GET /api/v1/audit/facets
Powers the filter controls on the Audit Log screen: which
sessions, providers and models actually appear in your trail, so the filters
offer real options rather than a guess.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Audit trail
Every disclosure, chat, queries, manual records and tier-3 extraction calls,, filterable by session and scope.
GET /api/v1/audit
One row per disclosure: handle used, field keys sent, provider, model, request
id, timestamp.
Field keys, never values, and never message text. The trail records what
was disclosed, not what it said. See audit entry.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Bank transfer as a payment method
Bank transfer as a payment method
GET /api/v1/billing/invoice
Whether bank transfer (pay by invoice) is offered: {"method": null} while it is off or no bank details are entered, else its currencies (INR by NEFT/RTGS/IMPS, USD by international wire) and the plans it is for (Business and Enterprise, or every paid plan when the owner allows it).
Billing (your plan and orders)
Your plan, the paid period in force, whether payments are open, and your orders newest first, each paid one with its receipt.
GET /api/v1/billing, a console session only; a developer key gets 401,
as for deleting the account.
What the Billing page shows:
plan, the plan the account is on now (slug, name), worked out as the
limits are: an admin-assigned plan first, then a paid period in force, then
the default (Free).
managed, true when an admin assigned the plan; such an account buys
nothing online (orders answer plan_managed).
paid_until, paid_plan, the end of the paid period in force and its
plan, or null.
config, the same object as billing config: which
payment providers take payments, and whether in test mode.
orders, the account's orders, newest first, at most fifty: plan, status
(created, pending, paid, closed, expired, refunding, refunded,
failed), the price as the plans table had it, what the provider charged,
the payment reference, the paid period, test_mode, and checkout_url
while the order is open.
Nothing about how you paid is here or anywhere in StateJar: you pay on the
provider's own page. A paid order has a receipt. Nothing takes payments
until the server's list of enabled payment providers names a provider.
Billing config (are payments open?)
Which payment providers take payments, their names, the currency each is asked to charge in, and the mode (test or live); no account needed.
GET /api/v1/billing/config, no account needed; the
pricing page reads it.
{"enabled": false, "providers": [], "names": {}, "currency": {}, "mode": "test"}
enabled, whether any provider takes payments. While it is false, the
pricing and Billing pages offer no purchase and say billing
is coming soon, and creating an order answers 503
payments_disabled. That is every environment today.
providers, names, currency, each provider that takes payments, the
name a page shows for it, and the currency of the plan price it is asked to
charge (the provider may convert it, and the order then says what it
charged).
mode, test: the provider is a stand-in on the server's own machine and
no money moves (the server's payments mode setting); live: real
payments; off: the mode setting is neither, so nothing takes payments.
A provider is listed only when it is switched on
(the server's list of enabled payment providers) and its
configuration fits the mode; otherwise the server logs why and lists nothing.
Billing orders (buy a plan)
Create an order for a paid plan (the server takes the price from the plans table and asks the payment provider for a checkout), and read an order back; nothing here activates a plan.
POST /api/v1/billing/orders with {"plan_id": 2, "provider": "binance"},
and GET /api/v1/billing/orders/{order_id}, a console session, your own
orders only (another account's order is 404).
The browser sends a plan and a provider, never a price. The server reads
the plan's price from the plans table (the one GET /plans
lists), records the order, asks the provider for a checkout, and answers with
the order and its checkout_url, the provider's own page, where you pay. A
second click while that order is open gets the same order back (200,
"created": false), never a second one.
Refusals, each with error and a message:
| Answer | When |
|---|
503 payments_disabled | no provider takes payments (billing config) |
404 plan_not_found | no active plan has that id |
409 plan_not_for_sale | a free or contact-only plan |
409 plan_managed | an admin set this account's plan |
409 plan_in_force | another plan is paid for until until; change plans when it ends |
409 order_open | an unpaid order for another plan is open: pay or cancel it |
502 provider_error | the provider refused to create the order; nothing was charged, try again |
Reading an order activates nothing. The provider sends your browser back
to /billing?order=<id>, which reads this endpoint until the order says
paid. Only the provider's signed notice to the
webhook, or the server asking the provider
itself, marks an order paid. A paid order buys one month of the plan, from the
end of the same plan's paid period if one is in force; nothing renews by
itself. Nothing takes payments until
the server's list of enabled payment providers names a provider.
Blog images (public)
GET /blog/img/{name} serves an uploaded blog image variant with a one-year immutable cache.
GET /blog/img/{hash}-{480|960|1600}.{webp|avif}, {hash}-og.jpg or {hash}.svg, no sign-in. The name carries the first 16 hex characters of the file's SHA-256, so a changed image has a new name and the response is Cache-Control: public, max-age=31536000, immutable, with X-Content-Type-Options: nosniff and a CSP that allows nothing (an SVG is sandboxed and shown only through an image tag). 404 for any other name.
Blog pages (public)
GET /blog lists published posts (filter by category or tag, pages of 9); GET /blog/{slug} is one post. Finished HTML, no sign-in.
GET /blog (query category, tag, page) and GET /blog/{slug}: no sign-in. The pages are finished HTML with no script (the site is static, so the backend renders them): Open Graph and Twitter tags, Article JSON-LD, a canonical URL and Cache-Control: public, max-age=60. A post that is not published is 404. The text is the markdown an admin wrote, escaped and rebuilt from an allow-list, so HTML typed into a post is shown as text.
Blog post list for AI answer engines (public)
GET /blog/llms.txt lists every published post, with its address and excerpt, in the llms.txt format.
GET /blog/llms.txt, no sign-in, plain text: a list of every published post with its address and excerpt. The site's
own /llms.txt links to it. A post appears when it is published and is gone when it is unpublished; drafts are never
listed. It is cached for a minute.
Blog sitemap (public)
GET /blog/sitemap.xml lists /blog and every published post for search engines.
GET /blog/sitemap.xml, no sign-in: the sitemap of /blog and every published post. Each post's lastmod is the time its live copy was last published, so an edit moves it once it is published. robots.txt points to it.
Drafts and unpublished posts are never listed, and it is cached for a minute.
Buying a top-up
An order for a top-up pack, which adds adds (the pack's 1,000 extra adds, $1 / ₹85) to this month's limit for an account on the pack's plan.
POST /api/v1/billing/topups with {pack_id, provider}, a console session only. It can also take currency,
gstin, and the firstname and phone that one gateway's form needs.
The price comes from the pack, never from the request. The account's plan in force must be the pack's plan; if it
is not, the answer is 409 topup_not_for_plan. Once paid (the same rule as every order: a verified
notice and a server-side status check), the pack's operations are added to this month's
limit. A top-up never starts or extends a plan period.
Pack prices are the owner's, set on the admin console (top-up packs). None is sold until
one is set there.
Cancel an unpaid order
Closes an open, unpaid order at the payment provider and then here, so it can no longer be paid; a paid order is not cancelled, it runs to the end of its month.
POST /api/v1/billing/orders/{order_id}/cancel, a console session, your own
orders only.
An open order (created or pending) is closed at the provider first, so
its checkout page stops taking payment, and then marked closed here; a new
order can be made after it. If the provider will not close it, the answer is
409 cannot_close and the order stays open: a payment may already be under
way, and the provider's notice or the server's own check decides.
An order that is not open is returned as it is. A paid plan is never
cancelled here: each order buys one month and nothing renews by itself, so it
simply ends. A refund goes through StateJar, by the
refund policy. Nothing takes payments until
the server's list of enabled payment providers names a provider.
Cancel your account's deletion
POST /api/v1/account/cancel-deletion cancels a scheduled deletion before its date; nothing is deleted.
POST /api/v1/account/cancel-deletion
Cancels a deletion scheduled by DELETE /account, any time
during its 7 days. Nothing was deleted before the date, so nothing needs to be
restored: the account keeps every memory version, key and setting it had. We
e-mail a short note that the deletion was cancelled.
200 {"cancelled": true}.
404 no_pending_deletion: no deletion is scheduled.
401 no console session (a developer key is not accepted).
In the console: the banner at the top of every page while a deletion is
scheduled, or Profile → Delete account, has a Cancel deletion button.
Cancelling a subscription
Cancel a monthly subscription at the end of the month already paid for; that month is kept.
POST /api/v1/billing/subscriptions/{id}/cancel, a console session, for the account's own
subscription only.
The gateway is asked to cancel at the end of the current cycle, so the month already paid for runs to its end and
nothing more is charged. If the gateway refuses, the answer is 502 and the subscription is left as it was.
Change your password
Changes the password of the signed-in account; needs the current password and signs every other session out.
POST /api/v1/auth/password/change, signed in (a console session; a developer key gets 401), with
{"current_password": "…", "new_password": "…"}.
A wrong current password answers 403 and counts toward the address's
sign-in lockout, like a wrong password at sign-in. The new password needs 8 to 128
characters, at most 72 bytes, and must differ from the current one (422).
On success every other session is signed out (sessions_revoked counts them) and every JSON token issued
before the change stops working; this browser stays signed in with the fresh access_token the answer carries.
Reset links asked for before the change are spent, and the account gets an e-mail saying its password was changed.
An account that has no password of its own (made with an e-mail code, Google or GitHub) answers 409: set a
password with Forgot password instead. In the console this is the
Password panel under Profile.
Chat
Query, then send the subset to a model and return its reply.
POST /api/v1/chat
Composes query and a provider call: retrieve the minimal
subset, build a prompt from it, call the model you named, write an
audit row, return the reply.
The raw transcript is never sent. What the model receives is the retrieved
subset and the current turn.
Requires a provider key. Upstream failures are translated into readable errors
with an appropriate status, a provider 5xx becomes a 502, a timeout becomes a
502, never a leaked payload.
The state is re-derived before the model sees it. Edited bytes are refused
with HTTP 409 before any provider is called. A change made by the latest
message is announced to the model once, with its new value only: if a query
(an MCP search, say) already carried that announcement, the chat does not
repeat it. Every field the announcement shows is in the chat's audit row.
With no memory yet, chat still answers; the model is told that no user state
is stored.
Memory updated after the reply. Like a query, chat first
waits for the session's unfinished background ingests, at most
5 s; pending_ingest: true in the
response says the reply used the version from before them. On the server's own
model a reply goes before any message being read
(the server's extractor v3 max in flight setting).
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Checkout choices
Which payment gateways are switched on, the currencies each takes, whether it sells subscriptions, the top-up packs on sale and the GST note every price carries.
GET /api/v1/billing/checkout. No account is needed. The answer has the same fields as
/billing/config, and adds:
currencies: the currencies each switched-on gateway takes. INR is first for every Indian gateway; USD is offered
where the gateway takes it.
subscriptions: whether each gateway sells a monthly subscription here.
topups: the top-up packs on sale.
gst_note: "+ GST as applicable".
The billing page reads this to let the payer pick a gateway among those switched on. Paid plans stay
"Coming soon" while no gateway is switched on.
Clear memory
Empty a memory scope by writing a new empty head; history is kept and the call is audited.
POST /api/v1/memory/clear
Body: {"session_tag": "...", "scope": "scope" | "account"} (default scope).
Versions are append-only, so this never deletes. For every session in the chosen
extent it writes a new, empty version (the empty state, handle
shm_719a8f7d2aa1b2262d87eade013fc7360f11a194) whose parent is the session's previous head, and
writes one audit row of kind clear with that handle. Earlier versions remain,
verifiable and restorable by their handles.
scope: "scope" clears the memory scope of session_tag: the caller's normal
sessions, or that one fresh- session, or the demo- sessions.
scope: "account" clears every session of the account, every scope.
The response lists cleared (session, previous head, how many held items were
dropped), empty_handle and history_kept: true. A scope with nothing in it
clears nothing and writes nothing. It acts only on the caller's own account.
Because the empty version is the newest in its scope, a session that continues the
account memory (see cross-session memory) is seeded from it. A
fresh- session never reads another session's head; see
New session.
Close a ticket
POST /api/v1/tickets/{id}/close closes one of your tickets; a closed ticket takes no more replies.
POST /api/v1/tickets/{id}/close sets your ticket's status to closed. 404 when it is not yours. Open a new ticket
if you need help again. See support tickets.
Collect the key (terminal poll)
The terminal asks every few seconds whether you approved; the key comes back exactly once.
POST /api/v1/device/poll { "device_code": "…" }
What statejar login repeats every interval seconds. 428
authorization_pending until you decide; 410 once the code has expired (ten
minutes) or the key was already collected; 403 when you denied it; 200 once,
with the key, its last four characters, its expiry and your e-mail. The
server then wipes its parked copy, so a second poll, or anyone who later
reads the database, gets nothing. Limited to 60 calls a minute per address.
Compare input cost
The input tokens of the full chat history against the last N messages plus StateJar's memory_context, and what that input costs for one reply model at the listed price. No model call, nothing stored.
POST /api/v1/memory/cost-compare
Body: the same as POST /memory/token-compare (messages,
memory_context, window), plus provider and model, the model that answers the
chat.
It answers with token-compare's counts and, when that model has a listed price,
price_usd_per_m (input, output), input_usd_without (the full history),
input_usd_with (the last N messages plus the memory context) and input_usd_saved.
The price. Taken from the paid-tier list StateJar keeps for its own cost estimates, dated
in price_date. A model that is not on the list has no price: the dollar fields are
null, never a guess, and the token counts are still given.
What it leaves out. The reply the model writes (it is the same either way), any system
prompt of your own, and StateJar's own extraction calls, which are shown on the dashboard.
Like token-compare it can be negative on a short chat.
Nothing is stored, no memory is read, no model is called and no audit row is written.
Compare input tokens
Count the input tokens of the full chat history against the last N messages plus StateJar's memory_context. No model call, nothing stored.
POST /api/v1/memory/token-compare
Body: messages (the chat so far, role = user or assistant, ending with the
message being answered), memory_context (the string returned by
POST /memory/query for that message) and window (how many
of the latest messages you would send, default 6).
It answers with full_history_tokens, recent_tokens, context_tokens,
tokens_with_statejar (= recent + context) and saved_pct.
How it counts. With tiktoken cl100k_base, the tokenizer the published
benchmark uses. Each message is rendered role: text and the lines are joined
by newlines. Not counted: any other system prompt of your own, the reply the
model writes, or the few tokens a provider's chat format adds per message. The
numbers are an estimate of input tokens, not an invoice.
It can be negative. On a short chat the memory block is larger than the
history it replaces, and saved_pct says so. See
token savings and its baseline.
The text you send is counted and forgotten: it is not stored, no memory is read
or written, no model is called, no audit row is written, and the call is not a
plan operation. If the server cannot load the tokenizer it answers 503 rather
than a guessed number.
Confirm a value before it is stored
Answer a question StateJar asked about a value it was unsure of; yes writes it as a new version, no discards it.
POST /api/v1/memory/confirm
Body: {"id": 12, "accept": true}.
When a message carries a value the rules cannot place with confidence,
money with no stated purpose ("i have 5000 rs"), a ceiling on a bare number
("under 50000"), or a concept that only exists because a misspelling was
corrected ("my slary was 80000rs"), StateJar does not guess and does not
silently drop it. Ingest returns a question under
confirmations, each with an id, the path it would fill, the value and
the reason it is pending:
{"id": 12, "path": "constraints.budget.max",
"value": {"value": 5000, "currency": "INR"},
"reason": "funds_on_hand", "question": "Is ₹5,000 your budget?"}
A pending value is not state: it is never part of a handle, never sent to
a model, never counted on the dashboard. Only the account that owns it can
answer, and only once.
accept: true writes the value as a new append-only version through the
same canonical gate as any message, and returns the new handle (or
stored: false when the state already held it).
accept: false marks it rejected and stores nothing.
- A second answer gets HTTP 409; an id that is not yours, 404.
The Playground shows each question as a chip under your message with Yes
and No. The Python client exposes the same call as client.confirm(id).
Pending rows keep the proposed value and the reason only, never the message
it came from, and are deleted with the account.
Confirm with a fresh code (step-up)
POST /api/v1/auth/stepup, a fresh code from your authenticator app gives a 5-minute token for one sensitive area, such as the owner's database download.
POST /api/v1/auth/stepup {code, scope}, for a signed-in account with two-factor sign-in on. code is a
fresh code from your authenticator app: a code already used (to sign in, say) is refused, and so is a recovery
code, which proves a printed sheet, not you at the keyboard. Wrong codes count toward the
sign-in lockout; 10 a minute per address.
The answer {stepup_token, scope, expires_at} is good for 5 minutes, for that scope only (owner-data: the
SQL console). Scope break-glass (13 Nov 2026) is for opening break glass and the database download: its token works
once and for 2 minutes, so each of those acts asks a code of its own. It is not a session: no
other route accepts it. "Log out everywhere" ends it.
Confirm your account's address
POST /api/v1/auth/account/confirm-email takes a code e-mailed for confirm_email and marks the address confirmed, removing nothing.
POST /api/v1/auth/account/confirm-email with {"code": "12345678"} (a console session)
Ask for the code first with POST /auth/account/code {"purpose": "confirm_email"}.
A right code marks the account's address confirmed (email_verified_at) and changes nothing else: you are signed
in to the account and you read a mail sent to its address, so you are its owner.
Why it matters. A sign-up with a password does not prove the address. The first time an address is proven by
a sign-in, an e-mail code, a sign-in link, or a Google or GitHub account that has verified the address, the
account is reset, because whoever made it may not be the person who owns the address: its password, sessions,
developer keys, connected apps, two-factor sign-in, linked Google or GitHub sign-in and saved provider keys are
removed, and the memory is kept. Confirming the address from inside first means that never happens to you.
Answers. 200 {"email_verified": true, "email_verified_at": "…"}. 403 wrong or expired code (a wrong
code also counts toward the sign-in lockout). 409 the address is confirmed already.
Create an account
Create a StateJar account with an email and a password.
POST /api/v1/auth/signup
Returns the created user. Passwords are hashed with bcrypt before storage.
An account is the namespace: everything you store lives under it, and no
credential can address another account's memory. See scope.
Sign-up protection (since 10 Nov 2026): a disposable e-mail domain is refused (403); one network address
may create a few accounts a day (429 signup_ip_daily_limit, see
the server's signup per ip per day setting); and when the operator has set up Cloudflare
Turnstile, the body carries turnstile_token, the token the sign-up page's check gave (400 turnstile_required
or turnstile_failed otherwise; see the server's turnstile site key setting). Without
Turnstile set up, no token is needed.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Dashboard insights
Aggregates behind the dashboard charts: fields per namespace, declines by reason over time, and handle lineage.
GET /api/v1/memory/insights
Everything the dashboard charts are drawn from, in one response,
scoped to the calling account. Three blocks:
namespaces, how many fields each section currently holds (active)
and how many values it has retired (superseded). One field holds one
value; a replaced value leaves active state entirely and survives in
history, which is what the superseded count reads.
declines, refusals grouped by reason, bucketed by day, plus totals and
the reasons ranked most common first. Both kinds of refusal count: a value
the field could not hold (quarantined in _unmapped) and a field nobody
supplied a value for (unresolved).
lineage, the ordered chain of handles per session, with the field
count at each step.
A decline is counted on the version that introduced it. Quarantine
accumulates down a session, so reading the block as it stands on every version
would report the same refusal again on each later turn and turn a flat line
into a rising one.
This exists so the dashboard makes one request instead of walking
/memory/versions and then fetching every handle, N+1
requests for anyone with real history. It is read-only and touches no state.
Scoping. The account comes from the credential, exactly as everywhere else
here; there is no parameter that widens it. Works with either a console session
or an API key.
Integrity. Charts are drawn from states whose bytes still hash to their
handle. A failed version appears in the lineage marked corrupt, contributes
nothing, and is listed in the integrity block.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Delete a scheduled account now (staging only)
POST /api/v1/account/delete-now ends a scheduled deletion's 7 days at once, on the staging server only; 404 in production.
POST /api/v1/account/delete-now
Staging only. On statejar.com this route answers 404: every deletion
there waits its full 7 days. On the staging server it lets the automated checks
remove the throwaway accounts they create, without waiting a week.
It is a second, explicit step: the deletion must already be scheduled
(DELETE /account), and the request repeats the same
confirmation, the account's address typed out and its password (or, without
a password, the e-mailed or app code):
{ "confirm_email": "you@example.com", "password": "…" }
200 {"deleted": true, "removed": {…}}, row counts per table. Payment
records are anonymized, not deleted, exactly as on the scheduled date.
409 no_pending_deletion: schedule the deletion first.
403 wrong password, or a protected account; 401 no console session.
Delete your account
DELETE /api/v1/account schedules the account's deletion for 7 days later (202 with the date); you can cancel until then.
DELETE /api/v1/account
Schedules the deletion of the signed-in account for 7 days later and
answers 202 with the date. We e-mail a confirmation with the date and a link
to cancel. Until that date nothing changes: you can sign in, and your developer
keys and memory keep working, so nothing you built breaks before the date you
chose. Cancel it any time before then;
GET /account/deletion says whether one is scheduled.
On the date, the account and everything it owns are deleted for good: every
memory version in every session, every audit entry, held readings, saved
provider keys, developer API keys and the profile. There is no recovery after
that, for you or for the operator. Payment records (orders, invoices, payments,
refunds and the wallet ledger) are kept for tax law, anonymized: your
account id, e-mail, the full UTR you typed, every free-text note and any name given without a GSTIN
are removed; amounts, dates, currencies, invoice numbers and references stay, and
so do a GST invoice's buyer GSTIN and the business name given with it.
They are deleted once they are older than the retention period
(the server's financial record retention days setting,
8 years by default).
{ "confirm_email": "you@example.com", "password": "…" }
An account without a password (made by an e-mail code, Google or GitHub) sends
"email_code", a code we e-mail it for delete_account
(POST /auth/account/code), in place of "password", or,
with two-factor sign-in on, "code" from its app.
Answers.
-
202 {"scheduled": true, "requested_at": "…", "scheduled_for": "…", "cancel_url": "…"}.
A second request while one is pending keeps the first date.
-
401 no console session. A developer key (sj_live_…) is not accepted:
a leaked memory-API key must not be able to destroy the account.
-
403 the password does not match (or, without a password, the code is
missing, wrong, used or expired). Not 401, so the console shows the error
instead of logging you out.
-
422 confirm_email is not the signed-in account's email (case and
surrounding spaces are ignored).
-
429 rate-limited like login, because it checks a password.
-
403 protected_account: an account the operator protects cannot be deleted.
After the date the console token, every developer key and the password stop
working at once. The same email can sign up again and starts empty. A token
issued to the deleted account is refused even if a new account is given the
same numeric id.
Versions and deletion. A memory version is never edited, and retracting a
field keeps it in history, that holds while the account exists. Deleting the
account deletes every version. Chat history was never on the server; the
console clears this browser's copy when the deletion succeeds.
In the console: Profile → Delete account. See the deletion page.
Deny a terminal sign-in
Refuse a pairing you do not recognise; nothing is issued and the terminal is told.
POST /api/v1/device/deny { "user_code": "ABCD-EFGH" }
Signed-in only. Marks the pairing denied: no key is created, and the
terminal's next poll answers 403 "denied in the browser".
Use it for a code you did not start, someone who can show you a code cannot
sign in with it unless you approve it.
Download a bank-transfer invoice
Download a bank-transfer invoice
GET /api/v1/billing/invoice/orders/{order_id}/invoice.pdf
The invoice for your own bank-transfer order as a PDF: the amount, the payment reference to quote and the bank details to pay to. StateJar never sends new bank details by e-mail or chat; if anyone asks you to pay another account, do not pay.
Download a copy of your account
POST /api/v1/account/export returns everything the account holds as one JSON file, table by table, without any credential.
POST /api/v1/account/export
Returns one JSON file with everything the signed-in account holds, read from
every table keyed to it: every memory version in every session (the state as an
object, with its handle), every audit entry, the profile, the plan and usage
counters, two-factor and terminal sign-in records, the values held for your
confirmation, extraction v3's held facts, cached readings and background jobs,
and the names and dates of your keys. A table with nothing in it is there as an
empty list, so the file always shows the whole shape.
{ "password": "…" }
An account without a password (made by an e-mail code, Google or GitHub) sends
{"email_code": "12345678"}, a code we e-mail it for export
(POST /auth/account/code), or, with two-factor sign-in
on, {"code": "123456"} from its app.
Answers.
-
200 the file, sent as a download (Content-Disposition: attachment,
statejar-export-YYYY-MM-DD.json) and never cached (Cache-Control: no-store):
{"format": "statejar-account-export/1", "exported_at": "2026-10-20T17:30:00+00:00",
"account": {"id": 7, "email": "you@example.com", "created_at": "…", "disabled_at": null},
"tables": {"memory_states": [{"handle": "shm_…", "state_json": {…}, "session_tag": "trip", …}], …},
"omitted": {"api_keys": ["key_hash"], …}, "omitted_why": {"api_keys.key_hash": "…"},
"not_on_the_server": "Chat history: …"}
-
401 no console session. A developer key (sj_live_…) is not accepted:
a leaked memory-API key must not be enough to take a copy of the whole account.
-
403 the password does not match (or, without a password, the code is
missing, wrong, used or expired). Not 401, so the console shows the error
instead of logging you out.
-
429 rate-limited like login, because it checks a password.
What is left out, and why. The columns that hold a credential or what one is
checked against: your password's hash, each developer key's hash, your provider
keys (stored encrypted), your two-factor secret, your recovery codes' hashes and
a terminal sign-in's codes. The file lists them under omitted. A copy left in a
downloads folder must not be enough to sign in or to decrypt a key; a key's label,
last four characters and dates are kept, so you can still see which keys exist.
What is not on the server at all. Chat history as a conversation: the server
never stores a transcript, and each browser keeps its own. One exception, which
the file does include: evidence recall (on for every account since 14 Nov 2026)
keeps dated sentences of your own messages, never an assistant's reply and never
a whole conversation, and the standing instructions you gave the assistant. Both
are in the export, under memory_evidence and memory_instructions.
Signed in, the console does this from Profile → Download my data
(how). To delete the account instead: DELETE /account.
Download a credit note as a PDF
The credit note made when a refund is done, as a PDF, linked to the order's invoice; its owner's only.
GET /api/v1/billing/orders/{order_id}/credit-notes/{document_id}.pdf, a console session, your own orders only (404
for anyone else's, and for a document id that is not a credit note of that order).
A credit note is made when a refund is completed. It has its own sequential number, names the invoice it credits (its
number and date), and shows the refunded share of that invoice's taxable value and tax as negative amounts. Its ids are
in the documents.credit_notes list of the receipt.
Download an order's invoice as a PDF
The numbered tax invoice or receipt of a paid order as a PDF with the same fields as the receipt page, its owner's only.
GET /api/v1/billing/orders/{order_id}/receipt.pdf, a console session, your own orders only (404 for anyone else's,
the same answer as for an order that does not exist; 404 no_receipt until the order is paid).
The PDF is the stored invoice (or, until the supplier has a GSTIN, receipt) of the order: its sequential number, the
date, the supplier, the buyer, the plan and period, the tax lines, the total and the payment method and reference. It is
the same document the receipt page shows and the payment e-mail attaches. It is
generated by the system and needs no signature. A payment made before invoices existed gets its invoice, with the next
number, the first time it is opened.
Evidence excerpts
List and delete the dated excerpts of your own messages that evidence recall keeps, where it is on for your account. Answers 404 where it is not.
GET /api/v1/memory/evidence · DELETE /api/v1/memory/evidence · DELETE /api/v1/memory/evidence/{id}
Where evidence recall is on for your account (on statejar.com it is on for every account since 14 Nov 2026),
StateJar keeps dated sentences of your own messages, never an assistant's reply, so a question your
stored facts cannot answer can still be answered from what you said (privacy). Where it is not
on for your account, these routes answer 404 and nothing of the kind is kept.
The first lists the excerpts kept for your account (newest first, with their dates and
SHA-256, limit and offset for pages, session_tag to narrow it), the second deletes all of them (or one
session's), and the third deletes one by its id; another account's id answers 404, exactly like an unknown one.
Deleting excerpts never touches your memory state, its versions or its handles. A developer key needs the history
permission to list and the ingest permission to delete; a key limited to one session is refused.
Finish Connect with OpenRouter
Hand over the code and state OpenRouter sent back; the server trades the code for a key in the user's own OpenRouter account and saves it.
POST /api/v1/keys/provider/openrouter/oauth/finish with {"code": "…", "state": "…"}
The second half of Connect with OpenRouter, posted by the /connect/openrouter page with
the code and state OpenRouter put in its address.
- The server finds the connection by its
state. It refuses it unless it is this account's, started in this
browser (its cookie) and under ten minutes old.
- The connection is then used up, whatever happens next, so a state and its verifier work once.
- Only then does the server send
{code, code_verifier, code_challenge_method: "S256"} to OpenRouter's key
endpoint: /auth/keys on OpenRouter's API. It never sends them to an
address from the request, and follows no redirect.
- The key OpenRouter returns is saved the way
POST /keys/provider saves a pasted one:
encrypted, one per account, replacing an earlier key. The listing shows it with "source": "oauth".
The answer is {"provider": "openrouter", "key_last4": "abcd", "saved": true, "source": "oauth"}. The key itself is
never returned or logged.
From then on the key is used for the OpenRouter models you pick in the Playground. It is also used first to read
your messages while OpenRouter is one of the enabled extraction providers (the call record says byok: true). What
those calls cost is billed to your OpenRouter account.
| Status | When |
|---|
201 | The key is saved. |
400 | Start again: this state is not a connection the account has in progress (it is finished, or another account's), it was started in another browser, it is over ten minutes old, or OpenRouter refused the code (its 400 or 403). Nothing is saved, and a key saved earlier stays. |
401 | No console session. A developer key is refused too. |
422 | The code is empty, over 512 characters or not printable ASCII, or the state is not 43 base64url characters. Nothing is sent to OpenRouter. |
429 | More than 10 a minute or 30 an hour for the account. |
502 | OpenRouter could not be reached, answered another status, or sent no key. Nothing is saved. |
To disconnect, use DELETE /keys/provider/openrouter, which deletes the key.
Generate a StateJar API key
Create a key for calling StateJar from your own code. Shown once.
POST /api/v1/apikeys/generate
The full key is returned exactly once, in this response. It is stored
hashed, so it cannot be retrieved later. If you lose it, generate another and
delete the old one.
Use these rather than a login token for anything running unattended.
Give a key only what it needs. Chosen when the key is made, and fixed for
its life (make a new key to change them):
scopes: any of recall (query, chat, the memory graph, recording a
client-side disclosure), ingest (ingest, background jobs, confirmations,
clearing a scope) and history (versions, a state by handle, restore, the
audit trail and replays, stats). Left out, a key gets all three, as every
key made before scopes existed does. A call outside them answers 403
key_permission.
session_tag: the one session the key may touch. Any other session answers
403 key_session_scope; a handle or request id from another session reads
as unknown (404); account-wide reads (stats, usage, the whole trail) are
refused.
expires_in_days (1 to 3650), or expires_in (7d, 30d, 90d, 365d,
never). A new key lasts 90 days unless you choose otherwise; an expired
key answers 401.
ip_allowlist: addresses or CIDR ranges (at most 20) the key may be used
from, checked against the address the server sees. Anywhere else answers 403
key_ip_not_allowed.
Each call made with a key is logged (route template, status, time, a hash of
the address); see the usage log.
A verified e-mail before the first key (since 10 Nov 2026). An account created after that date with a password,
whose address was never confirmed, gets 403 email_not_verified here (and when it approves statejar login or
connects an app) until it confirms the address: the answer names the two calls, POST /api/v1/auth/account/code
with {"purpose": "confirm_email"}, then POST /api/v1/auth/account/confirm-email with the 8-digit code, and the
API Keys page shows the same step. Accounts created earlier, and accounts made by an e-mailed code, a link or
Google/GitHub, are not affected; keys that already exist keep working. The rule is off where the server cannot
e-mail codes. See verify before your first key.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Health check
Liveness probe.
GET /api/v1/health
Returns a small JSON body when the service is up. No authentication, no side
effects. Point your uptime monitor at it.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Ingest a message
Run the memory pipeline on a message: extract, canonicalize, hash, store.
POST /api/v1/memory/ingest
The main write endpoint, and the one to reach for first. Given a session tag
and some text it runs extraction through the tiers,
canonicalizes what they produced, derives a handle, and
stores the new state as a child of the previous one.
The response carries the new state, its handle, its parent, any conflicts, and
metadata that is deliberately outside state: which tiers ran, what each
contributed, and any notice. Keeping that outside the state is not tidiness,
anything inside state reaches the hash, and a handle that moved because a
tier happened to be installed would not be a content address at all.
No provider key is required. Ingest never calls a model unless
tier 3 is enabled and triggers.
Two refusals, both of which store nothing. HTTP 409 if the session's latest
state no longer hashes to its handle, a new version is never built on edited
bytes. HTTP 422 with "error": "inconsistent_extraction" if the message was
read as two different values for one field; say it again differently.
A message that changes nothing writes nothing. "hi", a restatement, or a
message whose only values were declined stores no version: stored is
false, and handle is the session's current head, null while the session
has no state yet. Anything declined is still returned under state._unmapped
with its reason.
With extraction v3 (what statejar.com runs) the
response also carries extraction: what this message stored, what it left
pending (held until said again, never stored, never sent to a model), what
it declined and why (about_someone_else, hypothetical, question,
past, evidence_not_in_message, verifier_no …), and what it removed.
A fact about the user that no catalogue attribute holds (a favourite team, a shift,
an EMI, a birthday) is stored as a dynamic field named in English
(dynamic.favourite_team, its stored entry marked "open": true) after the same
checks as every attribute; sensitive categories (religion, caste, political views …)
are declined. A budget keeps what it is for ("for": "bananas"), and the model
sees it that way ("INR 150 (for bananas only)"); a salary keeps its period
("period": "month").
No confirmation is asked by default; send "review": true to turn each pending
fact into a question for /memory/confirm. A message
over 3,000 characters is answered with 202 and a
job; over 50,000 characters is refused (422).
Reply first, update memory right after. Send "async": true and the answer is
202 with a job at once, at any length: recall and
reply to the user, then ingest; the session's next
query or chat waits for the job at most
5 s and says pending_ingest: true
when it answered without it. A session's ingests run one at a time in the order
they arrived, so a correction never lands before the message it corrects; that is
also why a plain ingest sent while an earlier one of the same session is still
being read becomes a job too (202). No update is refused however many of an
account's messages are still being read (until 2026-10-14 an account could have
5 unfinished, and the next was a 429). Without "async" nothing changes for
existing clients.
A busy model never holds an update back. Replies go first on the server's
model, so while a reply runs or waits, or another update holds the model, a
message is read at once without the model (the rules, GLiNER and every check;
extraction_tiers.llm is "deferred", model_rerun is "queued", and the
notice says so). The model reads it again as soon as no update waits and the
model is free; memory then takes the model's reading as a new version: what the
model adds goes in, and a fact only the first reading stored goes out when the
model's reading does not keep it. A field a later message has changed since is
left as that message left it. A job's result then
carries model_rerun with what happened (done and the fields it changed,
failed, or given_up). A message the model was asked about and did not answer
is read again the same way. Review mode ("review": true) always waits for the
model, since its questions come from the model's reading.
Never half a message. When no model provider answers (every cloud provider and
key failed), extraction_tiers.llm is "unavailable" and the notice says
extraction is temporarily unavailable: the message was read by the rules for now,
nothing only a model would confirm was stored, and it is read again with the
model as soon as a provider answers. When only some of a message's model calls
answered (for example the second part of a long message failed after the first
was read), the partial reading is not stored at all: the whole message is read
without the model, extraction.partial_reading_discarded is true, and the
model's full reading goes in once every call answers.
Read later (Free plan, since 10 Nov 2026). The Free plan reads up to 200 of an account's messages a day with a
cloud model, and all Free accounts together share a daily figure
(the server's free cloud reads per day global setting). Past either, a message is
not refused: the rules read it now, the answer says read_later: true, spend_cap_reason
user_daily_cap or free_daily_cap, model_rerun: "queued" and a plain extraction_notice, and a cloud model reads
it again after midnight UTC. Paid plans are not affected, nor an account using its own provider key.
Assistant turns. A request may also carry assistant turns (messages, or text
with a role). Assistant-side memory is switched off on statejar.com today:
assistant turns are accepted and ignored there, and the user's own turns are read
as before.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Investor interest form
POST /api/v1/investors/interest records an investor's interest. It only records interest; it is not an offer or solicitation to buy securities.
The form on the Investors page sends this request. No account is
needed. Fields: name, e-mail, phone (optional), firm or fund (or individual),
country, LinkedIn or website (http or https only), investor type, what you are
interested in (investing, advising, partnership), an indicative cheque band,
stage, timeline, a message, and consent to be contacted (required).
- You get a confirmation e-mail, and the founder gets a notification.
- The form is limited to a few sends per address per hour, and is refused when
sent faster than a person could fill it in.
- This form only records interest. It is not an offer or solicitation to buy
securities.
Is my account's deletion scheduled?
GET /api/v1/account/deletion says whether the account's deletion is scheduled, and for when.
GET /api/v1/account/deletion
Answers whether the signed-in account's deletion is scheduled
(DELETE /account) and the date it will happen:
{ "pending": true, "requested_at": "2026-11-07T10:00:00+00:00", "scheduled_for": "2026-11-14T10:00:00+00:00" }
With nothing scheduled: {"pending": false, "scheduled_for": null, "requested_at": null}.
The console reads it to show the banner with the date and a Cancel deletion
button on every page. Needs a console session (a developer key gets 401).
To stop the deletion, see POST /account/cancel-deletion.
Join the waitlist for a paid plan
While paid plans are coming soon, leave your e-mail and a plan to hear when it opens; no account needed, no plan starts and nothing is charged.
POST /api/v1/billing/waitlist with {"plan_slug": "plus", "email": "you@example.com", "currency": "INR"}.
No account is needed; a signed-in caller's own address is used whatever
the body says. The plan must be one that is sold (not Free, not a contract
plan): 404 plan_not_found; an address that is not an address: 422
bad_email. Asking again for the same address and plan answers
"already": true. Limited to 5 a minute and 30 an hour per address of the
caller (429).
It stores the address, the plan, the currency and the date, and nothing else.
It does not start a plan and takes no payment. Deleting your account removes
the rows made with your account and those made with its address while signed
out (deleting).
Keep an unpaid order's payment window open
The page's keep-alive while a payment window is open and on Continue payment; it moves the order's end time to a few minutes from now, never past 20 minutes after the order was made.
POST /api/v1/billing/orders/{order_id}/checkout-open, a console session, your
own orders only (another account's order answers 404).
An unpaid order of a hosted payment method (a card, UPI or wallet gateway)
stops being payable a few minutes after you last opened or continued its
payment window (the server's order unpaid minutes setting, 5 by
default). While the window is open the page calls this every minute, and when
you press Continue payment, so the order stays payable for as long as you are
paying. Each call moves expire_at to now plus that time, never past 20
minutes after the order was created and never earlier than it was. It does not
bring back an order that has already run out: that one stays expired.
An order whose payment may already be on its way (a payment reference you
sent, a bank transfer waiting for its money) never expires.
The answer is {order, server_time}; the page counts down to order.expire_at
using server_time, not your device's clock. If a payment still arrives for an
order that expired, it is recognised as any late payment is: the plan or the
wallet balance is credited once.
List state versions
Every handle in a session's chain, oldest to newest.
GET /api/v1/memory/versions
The lineage behind the Handles tab. Each entry is one
version; the newest is the session's current state.
State is append-only, a version is never rewritten, so this list only ever
grows. See active state vs history.
A session with no version of its own yet answers versions: [] and
carried_over: the handle of the account's newest state, which a question in
that session is answered from and its first message builds on (null when the
account has no memory; a demo session only ever carries over a demo state). The
Playground's Memory State shows that state, labelled as carried over.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Log in
Exchange email and password for a bearer token.
POST /api/v1/auth/login
Returns an access token signed with the server's token-signing secret. Send
it as Authorization: Bearer <token> on every other call.
For server-to-server use, prefer a StateJar API key from
/apikeys/generate, it does not expire on a token
rotation and can be revoked individually.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Log out
Ends this browser's session on the server and clears its cookie.
POST /api/v1/auth/logout, signed in.
Revokes the session the cookie __Host-sj_session names (it cannot be used again, from anywhere) and clears the
cookie; sessions_revoked says whether there was one. A caller that signed in with a JSON token only gets 200
with nothing revoked: a token cannot be revoked and lasts its 24 hours, which is why the console also forgets it.
The answer carries Clear-Site-Data so the browser drops this site's cookies and storage.
Log out everywhere
Revokes every session of the account at once, this one included.
POST /api/v1/auth/logout-everywhere, signed in; body {"code": "123456"} when
two-factor sign-in is on (a fresh app code, not a recovery code; 403 without one).
Revokes every live session of the account, this browser's, every other device's, and clears this browser's
cookie. sessions_revoked counts them. Use it when a device is lost or a session on the
Sessions list is not yours. JSON tokens issued before it keep working until they expire (24
hours at most); developer API keys are not sessions and are revoked from API Keys.
Look up a pairing code
What the approval page shows before you decide: the device's name, the code's state and the key's lifetime.
GET /api/v1/device/lookup?code=ABCD-EFGH
Signed-in only (the console's JWT). Answers the device's name, the pairing's
status (pending, approved, denied, claimed or expired), when the
code expires and how long the key would live (365 days), so the
approval page can show you what you are about to allow.
404 for a code that was never issued, 410 for one that has expired.
Mark notifications read
POST /api/v1/notifications/read marks the account's own notifications read.
Body: {"ids": [1, 2]} marks those notifications read, or {"all": true} marks every one of
yours read. Only the caller's own notifications ever change; another account's id is ignored.
The answer is {"unread": n}, the new unread count, which the bell in the console shows.
Model catalog
Which models are available to you, grouped by provider.
GET /api/v1/models
Only providers you have configured appear, with free and paid models listed
separately where a provider offers both.
Local Ollama models are not in here (and the Ollama cards exist only where the server's Ollama setting is on; StateJar runs no model of its own). A hosted backend cannot see
http://localhost:11434; the browser enumerates those itself. See
the model selector.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Model providers in use (public)
GET /api/v1/site/providers lists the cloud model providers StateJar uses now, primary first. No sign-in.
GET /api/v1/site/providers, no sign-in: {providers: [{id, name, role, training, retention, read_on, source_url}], as_of}. It lists only the cloud model providers that are switched on and hold a key the pool may use
for your messages, in the order they are asked: the first is primary, the rest backup. Each entry carries the
provider's training statement and retention line as we read them on read_on, and a link to its terms. Nothing about
keys, counts or providers that are switched off. The Trust and Privacy pages and the pricing FAQ render this list, so
they never name a provider we do not use. Cached for 60 seconds and rate-limited per address; when it cannot be read
the pages say the list is loading or could not be read, and point to Contact.
Monthly subscriptions
Start a recurring monthly plan at a gateway that sells subscriptions; each charged month activates by the same rule as an order.
POST /api/v1/billing/subscriptions with {plan_id, provider}, a console session only. It can also take currency.
The answer's checkout is the gateway's own page, where the payer authorises the mandate.
Each charged month reaches our server as a signed notice. That month starts the plan only
after our server asks the gateway for that charge's status and gets "paid" for the plan's price. An account has one
subscription at a time; a second gets 409 subscription_open.
Only one integrated gateway sells subscriptions today; /billing/checkout says which
(subscriptions). The others sell one month at a time.
My subscription and orders
Your own plan, the paid period in force, this month's use, what renewing costs and your order history; it never returns another account's data.
GET /api/v1/billing/subscription, a console session; a developer key is
refused (401). It answers for the signed-in account only.
plan: the plan your limits follow now (slug, name, and paid, true
while a paid period is in force).
start, valid_until, days_left: the paid period in force, or null on
the Free plan. A paid plan does not renew by itself; at valid_until the
account is on the Free plan again and nothing is deleted.
usage: this month's adds and recalls used against the plan's limits.
renewal: when the paid period ends and what the last order cost, with
auto: false.
orders: your orders, newest first (up to 100): the order number, its
reference, date, plan, amount, currency, provider, status and
whether it has a receipt. The status is one of pending, paid, failed,
refunded or expired; raw_status is the server's own word.
billing, waitlist, is_owner: whether paid plans are open, whether the
page shows Join waitlist instead of a checkout (paid plans are "coming
soon" and the account is not the owner's), and whether this is the owner
account.
The My orders page shows this. A paid order's receipt is
here.
New recovery codes
Replaces all recovery codes; needs your password and a code from the app.
POST /api/v1/auth/2fa/recovery-codes with {"password": "…", "code": "123456"}
Console session only. Every old recovery code stops working and ten new
ones are returned once. The code must come from the authenticator app, a
recovery code cannot be used to mint more of them.
An account without a password sends the app code alone,
{"code": "123456"}; a code we e-mail it (email_code, purpose
recovery_codes, POST /auth/account/code) may go
beside it, never instead of it.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Notifications
GET /api/v1/notifications lists the signed-in account's in-app notifications and the unread count.
Returns {"unread": n, "items": [...]}, newest first (limit, at most 100). Each item
has a title, the text as blocks (paragraphs of text, bold and link runs, never HTML),
an optional link and a read flag. Console session only.
OAuth token endpoint (MCP)
An app exchanges its code (with the PKCE verifier) for an access token and a refresh token, and later rotates the refresh token. Form-encoded, RFC 6749.
POST /api/v1/oauth/token, application/x-www-form-urlencoded.
grant_type=authorization_code: code, client_id (and client_secret for a confidential client),
code_verifier (checked against the code's S256 challenge), redirect_uri (if sent, the one the request had),
resource (if sent, the MCP server's URL). Answers an opaque access_token (sja_…, one hour by default:
the server's oauth access token minutes setting), token_type: Bearer, expires_in, a
refresh_token (sjr_…, the server's oauth refresh token days setting) and the scope. A code
presented twice is refused and the tokens its first exchange issued are revoked.
grant_type=refresh_token: refresh_token, client_id (client_secret), optionally a narrower scope. Each
refresh token works once: the answer carries a new pair and the old pair is revoked. A refresh token presented a
second time means someone holds a copy, so every token of its family is revoked and the app signs in again.
Errors follow RFC 6749 §5.2: invalid_client (401), invalid_grant, invalid_scope, invalid_target,
unsupported_grant_type (400), never cached. The server stores only token hashes; the
MCP server verifies a token by its hash, its expiry, its revocation and its resource.
Order receipt
A paid order's receipt (number, date, account, plan and period, price, amount charged, payment reference, refunds), also e-mailed once when the payment arrives.
GET /api/v1/billing/orders/{order_id}/receipt, a console session, your own
orders only; 404 no_receipt until the order is paid.
The receipt holds what StateJar has, and nothing about how you paid: the
receipt number (the order's reference), the date paid, your account's address,
the plan and the month it covers, the plan's price, what the provider charged
and in which currency, the provider's payment reference, any refund and its
date, and test_mode when the order was paid in test mode (no money moved). Its note says what the document is:
"This is a tax invoice." for an order charged GST by a registered supplier, otherwise "A payment receipt, not a tax
invoice." (an order paid before GST was added to prices, on 13 Nov 2026, stays a payment receipt).
GST-ready layout. The receipt carries a gst block: the supplier's name
and GSTIN: not yet registered while the server's gst supplier gstin setting
is empty, the SAC (the server's gst sac code setting, "to be confirmed" when
unset, never guessed), the taxable value, the buyer's GSTIN if one was given
at checkout, and tax lines. With no supplier GSTIN there are no tax lines and
the status reads "GST not charged: supplier not registered". With one, rupee prices are GST-exclusive: the order was
charged the price + GST (the server's gst rate percent setting), computed when it was made and stored on it,
CGST and SGST (half the rate each) when the buyer is in the supplier's state, IGST otherwise; the place is the
buyer's GSTIN state, else the state picked at checkout. The lines add up to the paisa: base + CGST + SGST (or IGST)
= the total the gateway was asked for. An order priced in another currency gets no Indian GST line.
The numbered invoice. The answer also carries documents: the order's invoice (or receipt, until the supplier has a
GSTIN) with its sequential number, date, supplier, buyer, plan, tax lines, total and payment, and every credit note a
refund made, linked to it. The numbers run in order without gaps by financial year (SJ/2627/000001) and are issued in
the same step that marks the order paid, so a repeat of a payment never makes a second one. The same document is the
PDF and the e-mail's attachment.
By e-mail. The same receipt is mailed to the account's address once, by
the call that activated the plan, after the payment is saved, with the invoice attached as a PDF; a repeat of the
same payment sends nothing. After a refund the provider confirms, a mail with
the updated receipt follows. A mail that cannot go out changes nothing about
the payment, and the receipt stays here and on the Billing page,
which prints it or saves it as a PDF. Nothing takes payments until
the server's list of enabled payment providers names a provider.
Pattern 1: Sidecar
You keep your model call; StateJar supplies the memory subset beside it.
Choose this when you already have a working model integration and you want
memory added without rewriting the call.
How it works. Before you call your model, ask StateJar what matters for
this turn. Build your prompt with the subset. After the turn, hand the user's
message to StateJar to remember.
POST /api/v1/memory/query -> the minimal subset for this question
(your own model call, your own prompt, your own SDK)
POST /api/v1/memory/ingest -> remember what the user said
Why it is the default recommendation. Nothing about your model call
changes. Your prompts, your streaming, your tool use, your vendor, all
untouched. StateJar is a lookup you make, not a layer you route through.
What you keep responsibility for. Building the prompt, and calling
/memory/audit/manual if you want the disclosure in the trail, StateJar
cannot log a call it did not make.
Related: query, ingest,
manual audit.
Pattern 2: Proxy
StateJar makes the model call for you and returns the reply.
Choose this when you want the shortest path from zero to working memory,
and you are content for StateJar to hold the provider key and make the call.
How it works. One endpoint does everything: retrieve, prompt, call, audit,
reply.
POST /api/v1/chat -> subset retrieved, model called, audit written, reply returned
What it does not do, stated plainly so you do not discover it later:
- No streaming. The reply is returned complete.
- No tool or function calling. The model is asked a question and answers.
- No control over the prompt. The prompt is built from the retrieved subset;
you cannot inject a system prompt of your own through this path.
- No vendor-specific parameters. Anything outside model, message and key is
not passed through.
If any of those matter, use the sidecar.
Related: chat.
Pattern 3: MCP
Expose StateJar as tools to an MCP-speaking client.
Choose this when your client already speaks the Model Context Protocol and
you want memory as tools the model can call rather than as plumbing you write.
Status: not shipped. There is no StateJar MCP package yet. It is described
here because the shape is a decision people ask about while choosing a pattern,
and finding out later is worse than reading it now.
The shape it would take. memory_query and memory_ingest as tools, with
the same scoping model, the namespace resolved from the credential, never
passed by the client.
What to do today. Use the sidecar from inside your
MCP server. It is the same two calls, and it works now.
Payment notices (allapi webhook)
Where allapi tells our server an order was paid; a notice is signature-checked and then confirmed by a server-side status query before a plan changes. Off until the adapter is switched on.
POST /api/v1/billing/allapi/webhook, called by allapi, never by a browser.
Answers 404 while the owner has saved no credentials for it. allapi.in publishes no API documentation, so the adapter is written against an assumed API (docs/payments-allapi-research.md); it is off by default and takes no real money until the owner switches test mode off.
A notice is a prompt, not a proof. It changes a plan only if: its
X-Timestamp is within 10 minutes; its X-Signature (HMAC-SHA256 with the
saved webhook secret, or the secret key when none is saved) matches the exact body; its
event_id was not seen before; it names an order of ours with the provider id
we stored; its amount and currency are what the order was given; and then our
server asks allapi itself (a status query) and that answer says PAID for the same
merchant reference, amount, currency and payment reference (utr). A status
query that cannot be made is answered 503, so allapi sends the notice again.
Refused notices are recorded by reason (bad_signature, replayed_nonce,
amount_mismatch, status_check_not_paid, …) with a SHA-256 of the body, never
the body, and appear in the reconciliation report.
The environment-wide list that keeps providers off is
the server's list of enabled payment providers.
Payment notices (Binance Pay webhook)
Where Binance Pay tells our server that an order was paid, closed or refunded; every notice is checked against Binance's signature and our own order before anything changes. Off until a provider is switched on.
POST /api/v1/billing/binance/webhook, called by Binance Pay, never by a
browser or by you. Nothing takes payments until
the server's list of enabled payment providers names
the provider; in test mode the caller is a stand-in
on the server's own machine.
A notice changes something only if every check passes, in this order: its
headers are there; its timestamp is within 10 minutes; its RSA (SHA-256)
signature verifies with Binance's certificate for the serial it names (an
unknown serial is fetched from Binance at most once a minute); its nonce was
not seen in the last 24 hours; it names an order of ours with the provider id
we stored; the amount and currency are what the provider said it would
charge; and its payment reference paid no other order. Then, in one
transaction, the order becomes paid and the plan starts for one month, and
only after that is saved does the server answer {"returnCode": "SUCCESS", "returnMessage": null}, so a crash makes Binance send the notice again. The
same payment told again changes nothing and sends no second
receipt.
A refused notice is answered 400 or 401 with its reason (bad_signature,
replayed_nonce, amount_mismatch, unknown_order, …) and recorded by that
reason with a SHA-256 of the body, never the body. A body over 64 KB is
refused before it is read (413), and one address may call 120 times a minute
(429). Refund notices end the plan when the provider confirms the money went
back. Notices that never arrive are caught by the
reconcile pass.
Payment notices (Razorpay, Stripe, PayU)
Where Razorpay, Stripe and PayU tell our server about a payment, refund or subscription; a notice is signature-checked, counted once by its event id, and confirmed by a server-side status check before a plan changes.
POST /api/v1/billing/{provider}/webhook, where {provider} is razorpay, stripe or payu. Called by the
gateway, never by a browser. It answers 404 for any other name, and while the owner has saved no
credentials for that gateway.
A notice is a prompt, not a proof. A plan changes only when every check below passes:
- The signature holds over the exact body. For Razorpay that is
X-Razorpay-Signature, an HMAC-SHA256 with the
webhook secret. For Stripe it is Stripe-Signature, with a 5-minute tolerance. For PayU it is the reverse hash
with the key and salt. A bad signature gets 401 and nothing in the body is read.
- The event id has not been seen before. Razorpay sends it as
x-razorpay-event-id; Stripe as the event's own id;
PayU's is the payment id and its status. A repeat gets 200 with "duplicate": true and changes nothing. A notice
whose payment is still pending does not keep its id, so the gateway's retry is checked again.
- Our server then asks the gateway itself for the order's status, server to server. That answer must say paid for
our merchant reference, for the amount and currency the order was priced in, and with a payment id that matches
the notice. The payment id must not have paid any other order. If the status check cannot be made, the answer is
503 and the gateway sends the notice again.
For Razorpay the events that matter are payment.captured, payment.failed
and refund.processed; any other event is recorded and ignored. A second
notice for a payment that already started its plan (another event id, the same
payment) changes nothing. The page's own result is checked separately, on the
server (checkout signature).
A failed attempt marks the order on the billing page. It stays open, so the payer can try again.
Refund notices end the paid period only once the gateway confirms the refund. Refused notices are recorded by reason
(bad_signature, amount_mismatch, status_check_not_paid, …) with a SHA-256 of the body, never the body. They
appear in the reconciliation report.
The environment-wide list that keeps providers off is
the server's list of enabled payment providers; the owner's switch per gateway is on the
Payment providers page.
People and relations
A session's everyday facts as rows: the people in your life and what passes between you and them.
GET /api/v1/memory/graph?session_tag=… (include_closed=true for ties a later version dropped)
The everyday facts extraction stores, the people in your life with their relation to you, money you lent or
borrowed (amount, who, what for, due when), reminders and events with their time, live in your memory state as
lists, in your own words, and are versioned, hashed and audited like every other fact. This endpoint reads the same
facts as rows: one entities row per person, one relations row per tie, each naming the version (handle) that
first held it and, once a later version dropped it (a repaid loan, a cancelled plan), the version that closed it.
The rows are an index built from each stored version, never a second copy of your memory: they can never say more
than the state does, and the server can rebuild them from your versions at any time. Nothing about them changes a
handle. Deleting the account deletes them; the account export includes them.
Request and response shapes are in the API Docs, this entry explains the reasoning, not the schema.
Plans (public price list)
The active plans as the admin last saved them; /pricing reads this on every load, so an edit is live without a deploy.
GET /api/v1/plans, no account needed.
The active plans in order: id (what an order names a
plan by), name, monthly price in INR and USD (null = contact us), adds and
recalls per month (null = custom), history retention, seats, developer keys, requests per
minute, feature lines, which one is the default. The
pricing page renders exactly this, and the same rows drive the
server-side limits, so what you see is what is enforced. billing says
"coming soon" while no payment provider takes payments (every environment
today), "test mode" while one does on a stand-in, and "open" once one takes
real payments (billing config); nothing here takes a
payment, and an order reads its price from these same rows.
POST /sandbox/ask
What a model would be told for a sandbox visitor's question: the same query, with the same audit row, as an account's.
POST /api/v1/sandbox/ask with {"session_id": "…", "question": "…"}, at most 500 characters.
It is the query of the session's own account. The answer has:
memory_context: the memory a model would be given;
handle_used: the handle it came from;
- the fields sent, and the mode: the whole state while it is small, or the fields the question needs;
- the
audit_id of the disclosure.
Nothing is sent to a model. Each question counts as one of the day's sandbox actions.
POST /sandbox/jobs/{job_id}
How a sandbox message's reading went: queued, running, done with what was stored, held and declined, or failed.
POST /api/v1/sandbox/jobs/{job_id} with {"session_id": "…"}. It is a POST so that the session id travels in
the body: the web server's access log keeps a request's path, never its body.
It is the ingest job of the session's own account. When it is done, result holds the
ingest's answer: what each fact became (stored, held until said again, or declined with its reason), the state and
its handle. Another session's job answers 404, as does a session the daily wipe has deleted.
POST /sandbox/remember
A sandbox visitor's message, secrets removed, read in the background by the same ingest as an account's message.
POST /api/v1/sandbox/remember with {"session_id": "…", "text": "…"}.
- Secrets are removed first: API keys and tokens, private keys, passwords written after their name, and card
numbers. The answer says how many were removed, and of which kinds (
secrets_removed, kinds), never their
values.
- The message then goes to the same ingest an account's message goes to, as a background job.
The answer is
202 with a job_id and a status_url. Read the result there with
POST /sandbox/jobs/{job_id}.
A message over the server's sandbox max chars setting characters is refused with 422
(message_too_long). Each message counts as one of the day's sandbox actions.
POST /sandbox/session
Starts a sandbox session for a visitor without an account; the answer's session_id names it in every other sandbox call.
POST /api/v1/sandbox/session, with no body and no key: the sandbox's start.
It makes an account for this visitor alone. The account is disabled, so it never signs in, and nobody can sign up
with its address. It answers:
session_id: a random id. Keep it, and send it with every other sandbox call. Only its holder can reach the
session.
deleted_at: the next 00:00 UTC, when every sandbox account and everything in it is deleted.
max_chars: the longest message the sandbox takes (the server's sandbox max chars setting).
A new session counts as one of the day's sandbox actions (the server's sandbox daily cap setting), and
every sandbox call counts toward its address's hourly limit
(the server's sandbox per ip per hour setting). Both answer 429 when spent. With
the server's sandbox enabled setting false, every sandbox call answers 404.
Product-updates opt-in
GET and PUT /api/v1/profile/product-updates read and set whether you get StateJar product-update e-mails.
Off by default. PUT {"opt_in": true} turns it on and records the time and where
(profile, or signup from the sign-up box); PUT {"opt_in": false} turns it off.
GET returns {opt_in, consented_at, source}. It affects product-update e-mails
only: sign-in codes, receipts and account notices are always sent.
Profile
Read and update the signed-in account's profile. Four optional fields, scoped to the caller.
GET · PATCH /api/v1/profile
Four optional fields describing who the account belongs to: display_name,
organization, role, use_case.
Scoped to the caller, with nothing to enumerate. No id is accepted from the
client on either verb, the row is selected by the user id on the verified
credential, so there is no path to anyone else's profile and no id to probe.
Sending user_id in the body does nothing.
An unset profile reads as empty, not 404. Never having filled one in is a
normal state. The response carries exists: false so a client can tell "never
filled in" from "filled in and then cleared".
PATCH is partial. An absent key is left alone; an explicit null or a blank
string clears that field. That distinction is why it is a PATCH and not a PUT.
Rejected, never coerced. A value that fails validation comes back 422 with
a per-field reason, and nothing is written:
{
"detail": {
"error": "profile rejected",
"fields": { "display_name": "must be 80 characters or fewer (got 210)" }
}
}
One bad field rejects the whole request, so a partial write can never leave you
wondering which half of an edit survived. This is the same fail-closed principle
the extractor applies to a value, see decline. The only
liberty taken is trimming surrounding whitespace, because a trailing space is a
typing artefact rather than something you meant.
Deliberately small. No avatar bytes, no uploads, nothing sensitive, and every
field is capped and single-line. A profile that cannot hold a file cannot leak
one, and the length caps also keep the profile from becoming a back door for the
one thing StateJar refuses to store, see
where chat history is stored.
Provider keys
Save, list and remove the model-provider keys StateJar calls on your behalf.
GET · POST /api/v1/keys/provider · DELETE /api/v1/keys/provider/{provider}
Keys are encrypted (AES-256-GCM, with the server's key-encryption secret) before they touch the
database. The listing returns only the last four characters and a
has_key flag, never the key itself, and never in an error message.
Where an install shows it (not on statejar.com), the local Ollama entry stores a base URL and no key at all,
because a local daemon needs none. Saving one provider never disturbs another.
Each listed key says how it arrived: "source": "paste" (saved through this route) or "source": "oauth" (made in
your own OpenRouter account by Connect with OpenRouter). Both are stored the same way and
used the same way. DELETE removes either; for a connected OpenRouter key that is Disconnect on the card.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Query memory
Retrieve the minimal subset relevant to a question, plus a prompt-ready context string. No model call.
POST /api/v1/memory/query
Read-only. Returns the fields a question actually needs, plus metadata: how
many fields were dropped, the retrieval mode, and the
savings figure.
Use it to see what would be disclosed without spending a model call, or to
build your own prompt around the subset.
Bringing your own LLM. The response also carries memory_context: the same
subset already formatted for a system message, built by the same function
POST /chat uses. Drop it in as your system message, send your
own request to your own provider with your own key, and you get the context the
POST /chat path uses, identical by construction, rather than by two
places happening to agree. subset is still there if you would rather format
it yourself. The sidecar example in the Python SDK docs shows it end to end.
Call order. Reading a message (a cloud model provider proposes facts, then
StateJar's own rules and checks decide what is stored) takes seconds or more, so the recommended turn is reply first, update memory right
after: query with the user's message, reply (your model reads the message
itself, so a fact stated in it is used at once), then
ingest with "async": true. The next query of the session
waits for that ingest at most 5 s,
so what turn N said is in memory for turn N+1; when the wait runs out the answer
comes from the last finished version and metadata.pending_ingest is true,
never silently. Ingesting before the query still works and gives a context
that already holds this turn's facts, at the cost of the reading time in front
of every reply.
Every call writes an audit row and returns its audit_id. Without audit the
row's kind is query: the fields went back to your client. Pass audit: true
when your client is about to hand them to a model, the row is then
query_audited and counts as a turn. See the manual audit endpoint.
The state is re-derived before it is used. If the stored bytes no longer
hash to the handle, the request is refused with HTTP 409 and nothing is
returned or audited. A change made by the latest message is announced in
memory_context once, to the first disclosure of that handle in the session
(a plain query, an audited one or a chat), and only its new value is sent;
the old value stays in history. The fields that announcement shows are added
to subset and metadata.subset_keys (and listed in metadata.changed_keys),
so the audit row records everything the context discloses.
No memory yet is an answer. A user with no state gets handle_used: null
and an empty subset (retrieval mode no_state), not an error.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Read a pending OAuth request
What the consent page shows for a request id: the app's name, its redirect host, the scopes in words and your account. Signed-in only.
GET /api/v1/oauth/authorize/request?req=…
The consent page's one read, as the signed-in user (a bearer session; a cookie session later through the same
check): client_name, client_kind (dcr, cimd, manual), redirect_host, redirect_is_local (the app runs
on your own computer: the page warns), the scopes with a sentence each, your account and expires_at. A request
id in a link tells a stranger nothing: without a session it answers 401; an unknown or expired id 404.
Read a state by handle
Fetch the exact state a handle addresses.
GET /api/v1/memory/state/{handle}
The read side of content addressing. Given a handle, return that state, the
same bytes that hashed to it.
Scoped to your account: a handle belonging to someone else is not readable,
even though the handle itself is just a hash.
Verified on read. A state whose stored bytes no longer hash to its handle
is refused with HTTP 409 rather than shown under that handle.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Record a client-side disclosure
Log a disclosure your client made without going through /chat.
POST /api/v1/audit/manual
Exists for one real case: browser-direct Ollama. The prompt
goes from your browser straight to your own daemon and never touches our
server, so our server cannot log it, but the disclosure still happened and
still belongs in the trail.
The client reports the handle it used and the keys it sent. Marked as
client-reported, because that is what it is.
Provenance only for intact state. The handle must be one of yours and its
stored bytes must still hash to it; otherwise HTTP 404 or 409, and no audit row
is written.
With no memory yet, send handle_used: null; the row records that nothing was
disclosed.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Region hint (India or elsewhere)
A hint about the visitor's country, from a header a CDN or proxy may add; the pricing page uses it to show rupees and national gateways first. Never a gate.
GET /api/v1/region, no account needed.
{"country": "IN", "region": "IN", "source": "cf-ipcountry"}
country, a two-letter country code, read from the first of the headers
CF-IPCountry, CloudFront-Viewer-Country, X-Vercel-IP-Country,
X-Country-Code that a CDN or proxy in front of the server sets; null when
none is present. Today's edge sets none, so the answer is usually null.
region, IN for India, INTL for any other country, null when unknown.
It is a hint only. The pricing page and the
Billing page use it, then the browser's time zone and language,
to decide whether to show rupees and the national gateways first or dollars,
the international gateways and crypto; the visitor's own switch on the page
always wins and is remembered in that browser. Nothing is blocked by it, and no
address is read or stored.
Register an MCP client (OAuth)
Dynamic Client Registration (RFC 7591) for the MCP server's OAuth sign-in: an app registers its name and redirect addresses and gets a client id.
POST /api/v1/oauth/register
The first thing an MCP client without a client id does (Claude's "Register automatically", Codex, Gemini CLI,
OpenCode, VS Code). JSON body per RFC 7591: redirect_uris (1–10; each https://…, or http:// on
localhost/127.0.0.1 for an app on your own computer; no fragment), optional client_name,
token_endpoint_auth_method (none, the default: a public client; or client_secret_post), grant_types
(authorization_code, optionally refresh_token), response_types (["code"]), scope. Answers 201 with the
client_id (sjc_…) and the metadata as stored; a confidential client also gets its client_secret once (the
server keeps its SHA-256). No sign-in; rate-limited per address. Redirect addresses are stored exactly and matched
exactly at /oauth/authorize, the loopback port aside.
Clients with a published identity need no registration: a client_id that is an https:// URL is a Client ID
Metadata Document, which the server fetches (public hosts only, the same guard as a remote Ollama URL) and caches for
an hour. The MCP server page says which client does which.
Replay a disclosure
Reconstruct exactly what was disclosed for one audited response.
GET /api/v1/audit/{request_id}/replay
Fetches the state by its handle and re-applies the recorded field keys,
reproducing the exact subset that was sent.
It also re-derives the handle and reports verified. If the stored state had
been altered, the re-derived handle would not match and the replay would say
so. That check is what makes the audit trail evidence rather than a log of
claims.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Reply to a ticket
POST /api/v1/tickets/{id}/replies adds your message and up to 3 attachments to one of your tickets.
POST /api/v1/tickets/{id}/replies (multipart form: body up to 5,000 characters, optional files). 409 when the
ticket is closed; 404 when it is not yours. A reply to a resolved ticket reopens it. The team is told by e-mail.
Sixty replies an hour. See support tickets.
Report a reply
POST /api/v1/reports sends the StateJar team a model's reply you found offensive, harmful or wrong, without leaving the app.
POST /api/v1/reports with {"reason": "…", "excerpt": "…", "note": "…", "provider": "…", "model": "…"}
(a console session or a JWT; signed in).
reason is one of offensive, harmful, sexual, hateful, false (wrong about a fact) or other.
excerpt is the reply you report, as you saw it (1 to 4,000 characters); note is optional (up to 500);
provider and model say which model wrote it. The Playground's Report button under each reply fills
these in for you (Reporting a reply).
Answers. 201 {"id": …, "received": true, "detail": "…"}. 422 for an unknown reason or an empty or
over-long excerpt. 429 past 20 reports an hour from one network address.
StateJar keeps no conversation; a report is the one piece of one it keeps, because you sent it: the reply, its
provider and model, your reason and note, never the message that led to it. It is yours: in
your data export, and deleted with your account.
Request an invoice to pay by bank transfer
Request an invoice to pay by bank transfer
POST /api/v1/billing/invoice/orders · GET /api/v1/billing/invoice/orders/{order_id}
Body {"plan_id", "currency": "INR"|"USD", "period": "month"|"year", "buyer_name"?, "gstin"?}. Creates a pending order and an invoice with a unique payment reference to quote in the transfer; the amount is the plan's own price, never from the request. 409 quote_needed for a plan priced on request, not_for_this_plan when bank transfer is offered for Business and Enterprise only.
The plan starts only when the transfer reaches StateJar's account and is confirmed by hand (usually 1-3 working days). Nothing you send marks it paid. You can cancel the order while it waits.
Reset your password
Sets a new password with the token from a reset link, signs every session out, and leaves two-factor sign-in on.
POST /api/v1/auth/password/reset with a JSON body of two fields: token (from the link) and password (the new one).
The token comes from the link Forgot password e-mails. It works for 30 minutes,
once; an unknown, used or expired token answers 400 with one sentence for all three. The new password needs
8 to 128 characters and at most 72 bytes (422 otherwise; the link is not spent by a refused password).
A reset:
- sets the new password;
- signs out every session and makes every JSON token issued before it invalid, as
Log out everywhere does;
- spends every other reset link of the account;
- clears the address's sign-in lockout;
- e-mails the account a short notice that its password was changed.
It does not sign you in. Sign in with the new password; with two-factor sign-in on, the code
from your app is still asked for. Developer API keys are not sessions and keep working; revoke them from
API Keys if you think someone else had your password.
The link also proves that you hold the mailbox. On an account whose address was never confirmed, that is its first
proof, with the same effect as a sign-in code: what the account's creator left (developer keys, connected apps,
two-factor sign-in, linked Google or GitHub sign-in, saved provider keys) is removed and your memory is kept
(Confirm your e-mail address).
Restore a handle
Adopt a sealed state into a session, verifying it on the way in.
POST /api/v1/memory/restore
Re-derives the handle from the stored state and refuses if the two disagree.
A restore that succeeds is therefore a verification: the bytes are what they
claimed to be. A refusal is HTTP 409 and writes nothing into the target
session; a handle that is not in your account is HTTP 404.
This is how memory crosses a session boundary. See
your first handle restore.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Revoke an OAuth token
An app gives a token back (RFC 7009): a refresh token takes its whole family with it; an access token goes alone. Always 200.
POST /api/v1/oauth/revoke, form fields token, optional token_type_hint, client_id (client_secret).
RFC 7009: the client that holds a token gives it back. A refresh token revokes every token of its family (the access
tokens issued beside it and the ones it rotated to); an access token is revoked alone. The answer is 200 whether
the token was live, already revoked, unknown or another client's, so nothing can be learnt by probing. A revocation
of a live token writes an event row. The user's own way to do the same for a whole app is
DELETE /oauth/clients/{id}.
Seats (organisation members)
The people an account owner lets into their organisation, counted against the plan's seats; adding one past the count is refused with 403 plan_seat_limit.
GET /api/v1/org/members · POST /api/v1/org/members · DELETE /api/v1/org/members/{id}
Console session (JWT) only. The owner of the account is the first seat; every
member added is one more. The list answers with the plan's seat count, how
many are in use, the owner's address and the members:
{"seats": 5, "used": 2, "owner": "you@example.com",
"members": [{"id": 7, "email": "colleague@example.com", "created_at": "2026-10-09T10:00:00+00:00"}]}
Adding a seat. POST with {"email": "colleague@example.com"} (201). The
address is stored lower-cased and once; the owner's own address is refused
(409), as is a duplicate (409). Past the plan's count the request is refused
with 403 and {"error": "plan_seat_limit", "plan": "pro", "limit": 1, "used": 1, "message": …}. A plan with no seat figure (contract) has no limit.
An admin's edit to a plan's seats is live at once (plans manager).
Removing a seat. DELETE /api/v1/org/members/{id} (200), only for your own
members; another owner's row is 404.
What a seat is today. A counted membership by e-mail address. It gives the
member no access to the owner's memory: shared memory across an organisation
is a later step (docs/plans.md §4). The rows are the owner's and are
deleted with the account.
Session turns
Per-turn provenance for a session. Contains no message text, by design.
GET /api/v1/sessions/{session_id}/turns
Returns, for each turn: the handle that was current, its parent, the state
version, when it happened, and what was disclosed from it.
It is not a transcript endpoint and never will be. StateJar does not store
raw transcripts, the storage layer refuses them at write time, so there is no
message text to return. (Where evidence recall is on for your account, dated
sentences of your own messages are kept separately, for recall; they are listed
by their own route, never here.) The response says so explicitly with
contains_message_text: false.
The division is the point: your client holds the words, the server holds the
provenance, and joining them is the caller's job. See
the FAQ.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Sign in with Google or GitHub
Starts the provider's sign-in flow (state, PKCE, nonce) and sends the browser to the provider.
GET /api/v1/auth/oauth/{provider}/start (the browser navigates here: a 302 to the provider) or POST
(the console's fetch: answers {"url"} to navigate to). provider is google or github.
The server builds the provider's authorization URL, state against cross-site forgery, a PKCE challenge
(S256), and for Google the OpenID nonce, and keeps those three values for the callback in the cookie
__Host-sj_oauth (encrypted, HttpOnly, ten minutes). Google is asked for openid email, GitHub for
user:email (no profile scope: the public profile is read without one): enough to know who you are and which address the provider has verified, nothing more.
A provider the admin has not switched on, or has switched on without a client id and secret, answers 404
(Login methods).
Sign in, second step
Exchanges the mfa_token from /auth/login and a code for a session token.
POST /api/v1/auth/login/2fa with {"mfa_token": "…", "code": "123456"}
When two-factor sign-in is on, /auth/login answers
{"mfa_required": true, "mfa_token": "…"} instead of a session. The
mfa_token lasts five minutes and is accepted by this route only. Send it
with a 6-digit code from the app, or one unused recovery code. A code is
accepted once: the same code a second time is refused. Wrong codes count
toward the lockout (10 failures in 15 minutes locks sign-in for that address
for 15 minutes) and the route is also rate-limited per IP.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Site banners
GET /api/v1/banners returns the announcement banners to show now. Public: no sign-in, no personal data.
Returns {"banners": [{"id", "title", "text", "link"}]}: broadcasts with a banner
channel that have been sent, not stopped, and are inside their start and end. The
page shows one line of plain text and an optional https link, and remembers a dismissal
per banner in this browser only.
Site content (public)
GET /api/v1/site/content returns the published text blocks of every public page, never a draft. No sign-in.
GET /api/v1/site/content, no sign-in: {pages: {<page>: {<key>: {text, html}}}} with the published copy of each
block an owner has published in the admin console. Drafts are never included. html is rendered on
the server from an allow-list (paragraphs, bold, italic, lists, links to http, https, mailto or this site). Cached
for 60 seconds in each server process and sent with Cache-Control: public, max-age=60. A block absent here shows
the page's built-in copy.
Site images (public)
GET /api/v1/site/images/{id} serves an uploaded share image with its detected type and nosniff.
GET /api/v1/site/images/{id}, no sign-in: the image an admin uploaded, with the type detected from its bytes,
X-Content-Type-Options: nosniff, Content-Security-Policy: default-src 'none'; sandbox and a one-day cache.
404 for an unknown id.
Standing instructions
List and delete the standing instructions evidence recall keeps, where it is on for your account. Answers 404 where it is not.
GET /api/v1/memory/evidence/instructions · DELETE /api/v1/memory/evidence/instructions · DELETE /api/v1/memory/evidence/instructions/{id}
Where evidence recall is on for your account (on statejar.com it is on for every account since 14 Nov 2026);
elsewhere these answer 404 and no instruction of yours is kept. The instructions are kept, not currently
shown to the model.
Where it is on, a sentence in which you tell the assistant how to behave from now on ("Always answer in
bullet points.") is kept in your own words with its date. The first route lists them (newest first, a superseded one
marked with the instruction that replaced it, limit and offset for pages, session_tag to narrow it), the second
deletes all of them (or one session's), and the third deletes one by its id; another account's id answers 404.
Deleting them never touches your memory state, its versions or its handles. A developer key needs the history
permission to list and the ingest permission to delete; a key limited to one session is refused.
Start a manual payment
Start a manual payment.
POST /api/v1/billing/manual/orders
Body {"plan_id", "method"}. The amount comes from the plan and the method's settings (extra fee; for Binance a unique cents suffix in USDT), never from the request; 409 amount_out_of_range outside the method's limits. The order stays pending until it is checked.
Test mode only (2026-11-05): these methods are not offered on the production deployment and never activate a plan there. Nothing is ever credited on a UTR alone.
The providers listed in the server's list of enabled payment providers are unaffected; these two methods are separate, test-only, and paid plans stay "coming soon".
Start a terminal sign-in
What `statejar login` calls first, a pairing code for the browser and a secret for the terminal.
POST /api/v1/device/start
The first call of statejar login. No sign-in needed
and nothing is issued yet: the server records a pairing and answers with a
device_code the terminal keeps secret (stored hashed, never shown), a short
user_code such as ABCD-EFGH (an alphabet without 0/O/1/I), the
verification_url to open, expires_in (600 s) and the polling interval
(3 s). Rate-limited per address like a sign-in. device_name is what the
approval page shows, the CLI sends the host's name.
Start an OAuth sign-in (MCP)
Where an MCP client sends your browser: the request is checked (PKCE S256, exact redirect, the MCP resource), stored for ten minutes, and the consent page opens.
GET /api/v1/oauth/authorize?response_type=code&client_id=…&redirect_uri=…&code_challenge=…&code_challenge_method=S256&state=…&scope=…&resource=https://statejar.com/mcp
Step one of connecting an app. The server checks the client and its redirect address first (a mismatch is answered
400 here, never by a redirect), then everything else: response_type=code, a PKCE code_challenge with S256
(the only method), the scopes (memory:read, memory:write, offline_access), and the
resource (RFC 8707: it must be the MCP server's own URL; a client that sends none gets that one). A failed check
sends the browser back to the app with error, state and iss. A passed one stores the request for ten minutes
and sends the browser to the consent page (/oauth/authorize?req=…), which shows the app's
name, where it sends you back, your account and the scopes, and posts your decision to
/oauth/authorize/decide. Rate-limited per address.
Start Connect with OpenRouter
Begin OpenRouter's OAuth PKCE flow for the signed-in account and get the address of OpenRouter's authorization page.
POST /api/v1/keys/provider/openrouter/oauth/start (no body)
The first half of Connect with OpenRouter. The server makes the PKCE code_verifier and
keeps it for ten minutes, encrypted with the server's key-encryption secret and bound to the signed-in account and to
this browser. The verifier never leaves the server: the browser gets an HttpOnly cookie holding a random nonce
(__Host-sj_openrouter; sj_openrouter over plain http on localhost) and this answer:
{"authorize_url": "https://openrouter.ai/auth?callback_url=…&code_challenge=…&code_challenge_method=S256&state=…&key_label=StateJar", "expires_in": 600}
code_challenge is the base64url SHA-256 of the verifier (S256).
state comes back on the callback, and is how the server finds this connection again.
callback_url is always this site's own page,
the server's openrouter oauth callback url setting, and never anything the request said.
key_label prefills the new key's label on OpenRouter's page.
Errors:
401: no console session. A developer key is refused too, as on every provider-key route.
503: the callback setting is not an address OpenRouter can return to. Paste a key instead.
429: more than 10 starts a minute or 30 an hour for the account.
Each start replaces nothing: two tabs can each have a connection under way. Every expired connection, from any
account, is deleted when a new one starts.
Start two-factor setup
Creates a new authenticator secret and returns it once, with its otpauth link and a QR code.
POST /api/v1/auth/2fa/setup
Console session only. Returns the secret (base32), the otpauth:// link and
a QR code (SVG) for your authenticator app. The secret is stored encrypted
(AES-256-GCM) and never shown again; nothing changes at sign-in until you
confirm it with /auth/2fa/enable. Calling it again
before confirming replaces the secret. 409 if 2FA is already on.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
StateJar Demo Pay checkout page
The payment simulator's own checkout page, with Success, Failure and Pending buttons. Shown only to the owner and the demo account; no money ever moves.
GET /api/v1/billing/demopay/pay/{id}?t=… shows the page; POST the same
address records the choice. Only the owner and the accounts in
the server's demo pay emails setting can create a Demo Pay order;
everyone else sees the paid plans as "Join waitlist".
- Success marks the simulated payment as paid, Failure as declined,
Pending leaves it open.
- After a choice, StateJar gets a signed notice and then asks Demo Pay for the
order's status, the same two steps as a real gateway. The plan changes only
when both agree on the order, the amount and the currency.
- Every Demo Pay order is a test order: the receipt says so, and it is never
counted as revenue. Demo Pay cannot be switched to live.
Submit your UTR
Submit your UTR.
POST /api/v1/billing/manual/orders/{order_id}/utr
Body {"utr", "amount"}. The UTR is 12 digits; the amount must equal the order's amount exactly; a UTR already used on any order is refused (409). The order then waits for an admin to check the bank statement. Submitting a false UTR is fraud.
Test mode only (2026-11-05): these methods are not offered on the production deployment and never activate a plan there. Nothing is ever credited on a UTR alone.
The providers listed in the server's list of enabled payment providers are unaffected; these two methods are separate, test-only, and paid plans stay "coming soon".
Support tickets
POST /api/v1/tickets files a support ticket; GET /api/v1/tickets lists yours and GET /api/v1/tickets/{id} reads one with its thread.
POST /api/v1/tickets (multipart form) files a ticket: subject (3 to 120 characters), description (up to 5,000),
category (account, memory, billing, api, bug, other), priority (low, normal, high, urgent),
optionally a session_tag or handle that must be one of your own (anything else is 422), and up to 3 files
(see attachments). Ten tickets an hour. Answers 201 with the ticket's id.
GET /api/v1/tickets lists your tickets, newest activity first. GET /api/v1/tickets/{id} returns one with its thread
of messages (yours and the team's) and their attachments. Internal notes the team writes are never part of it. A ticket
that is not yours answers 404, the same as one that does not exist.
A ticket moves open, in progress, resolved, closed. Your reply to a resolved ticket reopens it. See the
My tickets page.
Test a provider connection
Check a saved key really works, before you need it live.
POST /api/v1/keys/provider/{provider}/test
Actually calls the provider and reports what happened, in plain language: a bad
key, a rate limit, an unknown model, or an unreachable address. It never
returns the provider's raw error body, those bodies have been observed to echo
the request, including the key.
Worth pressing before a demo. A key that was pasted with a trailing space fails
here in three seconds instead of on stage.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
The checkout breakdown
What an order would cost with a coupon and coins: plan price, minus the coupon, minus coins, then GST on a rupee order (each tax line and the total payable), computed on the server. One coupon per order; a coupon and coins can be combined.
POST /api/v1/billing/quote with {"plan_id": 2, "currency": "INR", "period": "month", "coupon": "CODE", "coins": 100}, a console session. Nothing is reserved: the order computes the same breakdown
again when it is made, with the same coupon and coins fields, and the price a browser sends is never used.
The breakdown: plan (the price), coupon (its code and amount), coins_amount, and total = plan − coupon −
coins, before GST. GST (13 Nov 2026: rupee prices are GST-exclusive): tax has base (the total above),
tax_lines (CGST + SGST when buyer_state, or the GSTIN's state, is the seller's, else IGST), tax_total and total
(the amount payable), all in rupees to the paisa; send buyer_state (a GST state code such as "27") and optionally
gstin. Without a state tax.needs_state is true and tax.total is null. Tax = base x 18%, rounded half up to the
paisa once; CGST = half rounded down, SGST = the rest. A dollar order has tax_mode none. One coupon per
order; a coupon and coins can be used together: the coupon comes off first, then coins, which pay at most
max_percent of what is left.
A coupon may be limited to some plans or a currency, a minimum order, a start and end date, a number of uses in all
or per account, a first order, or new accounts; when it does not apply the answer is 422 with the reason (for
example coupon_expired, coupon_used_up, coupon_first_order_only). A coupon's use is held while its order is
open or paid and given back if the order is cancelled, expires, fails or is refunded. A total of zero is paid with
no payment method.
The quote is limited to 60 requests a minute and 600 an hour per account; past that the answer is 429; try again
a minute later.
The hosted MCP server
StateJar's memory as Model Context Protocol tools at https://statejar.com/mcp, with a developer key or an OAuth sign-in as the credential.
https://statejar.com/mcp, Streamable HTTP, stateless, JSON responses; the 2026-07-28 revision (one exchange per
request, MCP-Protocol-Version header) and the earlier handshake revisions both answered.
Any MCP client (Claude Code, Claude Desktop and claude.ai connectors, ChatGPT connectors, Cursor, VS Code, Codex,
Gemini CLI, OpenCode, Devin/Windsurf) can use it, with one of two credentials:
- A developer key (
sj_live_…, from the API keys page) as Authorization: Bearer <key>: the
account's full memory credential.
- An OAuth 2.1 sign-in: the client discovers StateJar's authorization server from the
401 and its two
discovery documents (/.well-known/oauth-protected-resource/mcp, /.well-known/oauth-authorization-server),
identifies itself (a published identity or a registration), opens the
consent page in your browser, and exchanges the code for tokens
(token endpoint). An access token lives an hour and carries the scopes you allowed:
memory:read for the read tools, memory:write for the write tools. Disconnect an app on the API keys page.
A request without a valid credential gets 401 with WWW-Authenticate: Bearer resource_metadata="…", scope="memory:read memory:write", and no tool runs; a token without a tool's scope gets a 403 insufficient_scope tool error.
Tools (each takes an optional session, the scope inside your account; the default is mcp):
| Tool | Scope | What it does |
|---|
remember | write | Stores the facts in a message. Secrets are removed first; the reply lists what was stored, held or declined, with reasons. Optional facts: facts the client's own model read, each with its verbatim evidence; the server checks them against the text and its gates and reports the accepted and refused ones. |
search | read | The memory a question needs as memory_context, the handle it came from and the audit id of the disclosure. |
get | read | The current state, one fact of it, or the state a handle names; the handle is re-derived first. |
list | read | Every fact of the current state as path and value. |
update | write | A correction in the user's words, stored as a new version; facts as in remember. |
delete | write | Removes one fact from the current state as a new version; history keeps it. |
history | read | The versions, newest first, by handle, each with what it changed against its parent (every fact set, replaced or removed, with the old and the new value). Pass field (a word such as budget, or a path such as constraints.budget) to get only the versions that changed that fact, which answers "what was it before?". Newest 20 by default (limit up to 50); more says older versions exist. |
audit | read | What was disclosed, newest first. |
verify | read | Re-derives a handle from the stored state. |
export | read | Every version with its handle and state. |
Each tool calls the same routes as the REST API as your account, so the same limits, checks and audit rows apply. A
fact a client proposed and the server accepted is stored with the source host, and the extraction audit row names
the client as the model. Limits: a message of at most 20,000 characters, 32 proposed facts, a request of at most
256 KB, and the server's mcp rate per min setting requests per credential per minute. Nothing of a message
is logged.
The manual payment methods on offer
The manual payment methods on offer.
GET /api/v1/billing/manual/methods
Signed in. Lists the enabled and fully set up methods with their limits, extra fee, bonus and the fraud warning. Empty on the production deployment.
Test mode only (2026-11-05): these methods are not offered on the production deployment and never activate a plan there. Nothing is ever credited on a UTR alone.
The providers listed in the server's list of enabled payment providers are unaffected; these two methods are separate, test-only, and paid plans stay "coming soon".
The provider's return
Where Google or GitHub send the browser back; checks the flow, finds or creates the account, redirects to the console.
GET /api/v1/auth/oauth/{provider}/callback?code=…&state=…, registered with the provider as the redirect
URI (the server's public api url setting). Not called by hand.
The state must match the flow cookie's (an ?error= reply too), and a flow is answered once: the same
cookie and state sent again are refused with state_mismatch, whatever the provider would say. The code is exchanged with the PKCE verifier; Google's ID token is
validated (issuer, audience, nonce, signature against the JWKS). Nothing happens on an address the provider
has not verified (Google email_verified, a GitHub verified address): no account is made, linked or
signed into, and the answer is email_unverified whether or not an account holds the address. Otherwise the
identity is matched by the provider's own account id: seen before, it signs its account in; new, it is
linked to the account that holds the verified address, or creates one with it. Linking to an account whose
address was never proven is that address's first proof: what the account's creator left is removed first
(Confirm your e-mail address). Every outcome is a redirect to the console's
/login/oauth: with the session cookie set (and ?account_reset=1 after such a reset), with #mfa_token=…
when two-factor sign-in is on, or with ?error= one of provider_error, flow_expired,
state_mismatch, no_email, email_unverified, disabled, cannot_sign_up.
Ticket attachments
GET /api/v1/tickets/{id}/attachments/{attachment_id} downloads an attachment of your own ticket; png, jpg, pdf and txt only, 5 MB each, 3 per message.
GET /api/v1/tickets/{id}/attachments/{attachment_id} sends the file as a download (Content-Disposition: attachment,
X-Content-Type-Options: nosniff), to the ticket's owner only; anyone else gets 404.
What may be attached: png, jpg, pdf or plain text (UTF-8, no control characters), decided by the file's first bytes and
not by its name, up to 5 MB each and 3 per message. Anything else is 422, an oversized file 413. Files are
stored outside every served path under a random name, never opened or run by the server, and deleted with your account.
See support tickets.
Tokens and dollars saved
What StateJar sent to a model against what sending the whole memory state would have cost, from your own audit rows and verified states, with StateJar's extraction cost beside it.
GET /api/v1/memory/bill
For the newest 200 audited turns of your account: the memory_tokens_sent (the
memory context StateJar actually built, counted with tiktoken cl100k_base) against
whole_state_tokens (the same builder given the whole active state), and the difference,
tokens_saved_vs_whole_state. A turn whose state fails verification is counted in
excluded_unverified and left out.
usd_saved_vs_whole_state prices that difference at the reply model's listed input price
and is null when no turn used a model with a listed price. extraction shows how many
extraction readings your account had, and what the cloud ones cost at the listed price,
using the service's measured tokens per reading; it is null until usage has been
measured. net_usd_saved_vs_whole_state subtracts it.
What is not here. full_history_tokens_saved is always null: the server never stores a
transcript, so it cannot know what re-sending your chat would have cost. The Playground's
Tokens tab counts that for the chat in front of you, from your browser's copy.
Turn off two-factor sign-in
Needs your password and a current code (or a recovery code); removes the secret and every recovery code.
POST /api/v1/auth/2fa/disable with {"password": "…", "code": "…"}
Console session only. Both the password and a code are required, so a
session left open on a shared machine cannot switch it off. A wrong pair
answers 403 and counts toward the lockout.
An account without a password (made by an e-mail code, Google or GitHub;
see Confirm your e-mail address) sends a fresh code from
the app alone, {"code": "123456"}, or, having lost the phone, a recovery
code beside a code we e-mail it for 2fa_disable
(POST /auth/account/code):
{"code": "abcde-fghjk", "email_code": "12345678"}. An admin account that turns 2FA
off loses access to the admin panel until it is turned on again.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Turn on two-factor sign-in
Confirms setup with a 6-digit code; returns ten one-time recovery codes, once.
POST /api/v1/auth/2fa/enable with {"code": "123456"}
Console session only. The code must come from the secret created by
/auth/2fa/setup. On success, sign-in asks for a code
from then on, and the response carries ten recovery codes, shown only
here, each usable once if you lose the phone, plus a new session token
marked as verified. A wrong code answers 400 and counts toward the
sign-in lockout.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Two-factor status
Whether two-factor sign-in is on for your account, how many recovery codes are left, and whether this session passed a code.
GET /api/v1/auth/2fa
Console session only. Returns enabled, pending (setup started but not
confirmed), recovery_codes_remaining and session_verified (this session was
issued after a code, the admin panel needs that). See
two-factor sign-in.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Unsubscribe from founder e-mails
The link at the end of a bulk e-mail from StateJar's founder. One click stops further e-mails of that kind to your address.
GET /api/v1/leads/unsubscribe?e=…&t=… is the link at the end of a bulk e-mail
sent from StateJar's lead inbox (investor updates, the paid-plan waitlist). It
records only a keyed hash of your address, and no further mail of that kind is
sent to it. Account and sign-in e-mails are not affected.
Unsubscribe from product updates
GET /api/v1/broadcast/unsubscribe?t=… shows a confirm page; POST does the unsubscribe. The link in every product-update e-mail.
Every product-update e-mail carries a signed link and the List-Unsubscribe and
List-Unsubscribe-Post: List-Unsubscribe=One-Click headers. GET shows a confirm page and
changes nothing; POST turns the product-updates opt-in off (idempotent) and records
it on the mail's log row. A bad token is 400. Account and payment e-mails are not
affected.
Usage
Aggregate disclosure volume across your audited calls.
GET /api/v1/usage
Sums the retriever's work over every audited call: how much was disclosed, and
an estimate of what was saved against the disclosable baseline.
An estimate, and labelled as one, it is derived from stored field keys and
sizes, not from a provider's billing.
Integrity. The request and state counts are as stored; the tokens-saved
estimate uses verified states only and is null (not 0) when none verify.
Plan. plan holds the account's plan and this month's use against it:
adds (adds_used of adds_limit: messages a model read, with the month's top-ups) and recalls (recalls_used of recalls_limit: query, chat, restore), developer keys, retention,
seats, and cloud_extractions_used of cloud_extractions_limit, the
messages the server's own cloud providers read for the account this month
against the plan's budget (null = no budget). Past the budget the account's
messages are read without a model, their weak facts held, until your own provider key reads them or the month turns; nothing is refused. A message
read with your own saved provider key does not count.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Use a sign-in link
The page's POST that turns a link's token into a session. Never on the mail scanner's GET.
POST /api/v1/auth/link/consume with {"token": "…"}, sent by the link page when
you press Sign in, not when the page opens, so a mail scanner that prefetches the link cannot spend it.
Needs the __Host-sj_link cookie of the browser that asked for the link; without it or with another browser's,
403 and the link stays usable where it was requested. A token that is unknown, expired or already used
answers 401. Otherwise the answer is a session, as a verified code gives:
access_token, the __Host-sj_session cookie, or mfa_required for an account with two-factor sign-in on.
The link proves the address. On an account whose address was never proven (made by a sign-up with a password),
that first proof resets what the account's creator left before the session opens, and the answer carries
"account_reset": true: see Confirm your e-mail address.
Verify a Razorpay checkout on the server
The page sends what Razorpay's checkout returned; the server checks the signature and then asks Razorpay itself, and only a captured payment for the order's own amount starts the plan.
POST /api/v1/billing/orders/{order_id}/checkout-signature with
{"payment_id": "pay_…", "signature": "…"}, a console session, your own orders
only (404 for anyone else's).
When Razorpay's checkout closes after a payment, it hands the page a payment
id and a signature. The page sends them here. That alone starts nothing:
- The server computes an HMAC-SHA256 of its own stored order id and the
payment id, with the key secret, and compares it with the signature. The
order id a browser names is never used. A wrong signature gets 400
bad_signature; it is recorded and nothing else happens.
- With a right signature the server asks Razorpay, server to server. The
plan starts only if Razorpay says that payment is captured, for this
order, for the amount and currency the order was priced in. Anything else
gets 409 with the reason (
amount_mismatch, payment_ref_mismatch, …), or
the order stays pending while the payment is not captured yet.
An order that is already paid is answered as it stands. Razorpay's signed
payment notice for the same payment arrives as well;
whichever comes second finds the order paid and changes nothing, so a payment
starts one paid period, once. Coming back to the billing page
without either never starts a plan.
Nothing takes payments until
the server's list of enabled payment providers names a
provider or the owner switches one on.
Verify a sign-in code
Exchanges the e-mailed code for a session; creates the account on its first verified code.
POST /api/v1/auth/code/verify with {"email": "you@example.com", "code": "12345678"} (spaces in the code are
ignored).
A right code within its ten minutes signs the account in: the answer carries access_token (the JSON token every
client uses) and sets the session cookie __Host-sj_session (see Sessions). An address with no
account gets one here, this is the moment the address is proved, so such an account has no password; it signs
in by code, link, Google or GitHub. An account with two-factor sign-in on gets mfa_required
and a five-minute mfa_token instead, for POST /auth/login/2fa, exactly as a password does. A wrong, expired
or used code answers 401 wrong or expired code; the sixth guess at one code finds it dead. A suspended
account answers 403 after the code check, and nothing else changes.
The first proof of an address. An account made by a sign-up with a password has never proven its address.
The code is that proof, so before the session opens, whatever the account's creator left is removed, its
password, every other session and token, developer keys, connected apps, two-factor sign-in, linked Google or
GitHub sign-in and saved provider keys, and the answer carries "account_reset": true; the memory stays. The
code's mail says so first. An owner who confirms the address from inside the account never sees this
(Confirm your e-mail address). Only sign-in codes sign in: a code from
POST /auth/account/code answers 401 here.
What the account's forms need
GET /api/v1/auth/account says whether the account has a password it set, whether its address is confirmed, whether 2FA is on and whether codes can be e-mailed.
GET /api/v1/auth/account (a console session; a developer key gets 401)
{"email": "you@example.com", "password_set": false, "email_verified": true,
"email_verified_at": "2026-10-27T09:00:00+00:00", "two_factor": false, "email_codes": true}
password_set, whether you set this account's password yourself. An account made by an e-mail code, Google or
GitHub has none, and neither has one whose address was first proven by a sign-in (see
Confirm your e-mail address). Without one, deleting the account, downloading your data and
the two-factor changes ask for a code we e-mail you where they would ask for the
password; with two-factor sign-in on, a code from your app works too.
email_verified / email_verified_at, whether and when the address was first proven: by a sign-in code or
link e-mailed to it, a Google or GitHub account that has verified it, or your own confirmation.
A sign-up with a password proves nothing.
two_factor, whether two-factor sign-in is on.
email_codes, whether this server e-mails codes now (the server's e-mail sign-in switch,
and the server's sign-in mail settings).
Which account is this key? (whoami)
`statejar whoami`, the account, label and expiry behind the presented key, never the key.
GET /api/v1/device/whoami with X-API-Key
Answers the account's e-mail and the key's last four characters, label and
expiry. The key itself is never returned. A console JWT also answers (with no
key details), so the page and the terminal agree on who is signed in.
Which sign-in methods are on
Public: the methods the admin has enabled, for the login page.
GET /api/v1/auth/methods, no sign-in needed.
methods lists what is on, in order, from password, code, link, google, github; the login page shows
only those. email_configured says whether the server can send codes and links: the
the server's e-mail sign-in switch switch and the server's sign-in mail
settings. A method that is off answers 404 on every one of its own
routes, so a page that shows a stale button cannot sign anyone in with it. Changed from
Login methods in the admin panel.
Your coins
Reward coins: earned at sign-up, for referrals and from StateJar; spent only as a discount at checkout. They have no cash value and expire if you earn none for a while.
GET /api/v1/coins, a console session. The answer gives your coins, when they expire (expires_at), what 100
coins are worth in each currency (rate), the most of an order coins may pay (max_percent) and the history.
Coins are earned at sign-up, for a referral, or given by StateJar. They are spent only as a
discount on a StateJar order (checkout quote). They have no cash value: they cannot be
exchanged, withdrawn or transferred. They expire a set number of days after you last earned coins; earning more
renews the whole balance. Coins spent on an order that is then cancelled, expires, fails or is refunded come back.
One reward per person: an account that matches an earlier one (the same address, with Gmail's dots and "+" tags
ignored, the same sign-up network or the same browser) or uses a disposable e-mail address earns no coins.
Your connected apps
The apps this account connected through OAuth, with their scopes and last use; disconnecting one revokes every token it holds for you.
GET /api/v1/oauth/clients and DELETE /api/v1/oauth/clients/{id}, console session only.
The list behind Connected apps on the API Keys page: one row per app that ever held a token for
this account, client_name, client_id, kind, the scopes of its newest grant, connected_at, last_used_at
and whether it is active (holds a live token). DELETE revokes every token the app holds for this account at once
({"revoked": n}): its next MCP call gets 401 and its refresh fails; it may ask to connect again, and you decide
again. 404 for an app this account never connected. Both write nothing but the revocation's event row.
Your referral link
Your personal sign-up link and the people who signed up with it; you earn coins once each of them proves their e-mail address and makes a first paid order or enough memory adds.
GET /api/v1/referrals, a console session. The answer gives your code, your link (the sign-up page with
?ref= and the code), the coins a referral earns, and each person who signed up with it (waiting, rewarded or
refused), never who they are.
You earn the coins once the person you invited has proved their e-mail address and then made a first
paid order or reached the number of memory adds shown. Each person rewards you once. Referring yourself, or an
account from the same browser or network, earns nothing, and neither does an account with a disposable address.
Your sessions
Lists the account's live sessions, masked, and which one is this browser's.
GET /api/v1/auth/sessions, signed in.
Every live session of the account: when it was opened, last used and expires, the browser's user-agent string
(shortened), whether it was opened with a two-factor code, and current: true on the one this request came with.
No token and no address are in the answer: the server holds only their hashes. current_is_cookie is false for
a caller that signed in with a JSON token only, which has no session row of its own. Shown in Profile under
Sessions.
Your StateJar API keys
List the keys you have generated, and revoke one.
GET /api/v1/apikeys · DELETE /api/v1/apikeys/{key_id}
The listing never contains a usable key, only an id, a label, a prefix and
timestamps. There is no endpoint that returns a full key after creation,
because a store that can show you a key can show it to whoever reads the
database.
Deleting is immediate. A revoked key fails on its next request.
Request and response shapes, with copyable samples in four languages, are in the API Docs, this entry explains the reasoning, not the schema.
Your wallet
Your StateJar wallet's INR and USD balances and their history. Wallet money can be spent only on StateJar; it cannot be withdrawn, transferred or paid out.
GET /api/v1/wallet, a console session. The answer gives your INR and USD balances, the newest 100 movements in
history (each with its reason: a top-up, a purchase, a refund into the wallet, or a credit or debit by StateJar
with the reason stated), your coins, the payment methods that can add money (topup_providers) and the top-up
limits.
Money gets into the wallet only through a paid top-up, a refund into the wallet, or a credit
by StateJar. It leaves only to pay for a StateJar plan or top-up, when a top-up is refunded to the method that paid
it, or by a debit StateJar states a reason for. Wallet money cannot be withdrawn, transferred to another account
or paid out in cash (the Terms).
To pay for a plan from the balance, make the order with "provider": "wallet"; it is paid at
once when the balance covers the total, else the answer is 402 wallet_insufficient and nothing changes. A refund
of an order paid from the wallet goes back to the wallet.