# Headwaters - [Introduction](https://docs.headwaters.ai/introduction.md): Faces are causal models. Compile one from an author's texts; prompt it, and it works out a cause that steers your AI. - [Quickstart](https://docs.headwaters.ai/quickstart.md): Set up Faces with your agent, or by hand: create a face, compile a document, and ask it what it would do. - [Authentication](https://docs.headwaters.ai/authentication.md): JWT and API key authentication, budget caps, and face/model restrictions. - [Errors](https://docs.headwaters.ai/errors.md): One error shape, which status codes are worth retrying, and the reference code to quote when you report a failure. - [Faces](https://docs.headwaters.ai/guides/faces.md): Create, configure, and manage your faces. - [People](https://docs.headwaters.ai/guides/people.md): Account pictures, following, and the reads that draw a wall without asking per row. - [System Faces](https://docs.headwaters.ai/guides/system-faces.md): Ready-to-use faces provided by Faces that any account can use. - [Sharing Faces](https://docs.headwaters.ai/guides/sharing.md): Keep a face private, share it with named accounts, or publish it to everyone. - [Groups](https://docs.headwaters.ai/guides/groups.md): Organize your faces into named groups. - [Naming a model](https://docs.headwaters.ai/guides/models.md): One model parameter on every endpoint. Our upstream model, a face and its maestro, over the downstream model that writes the answer. - [Choices](https://docs.headwaters.ai/guides/choices.md): Ask a face what it would do. It proposes the options it would weigh, or the question it would ask. - [Chat](https://docs.headwaters.ai/guides/chat.md): Chat with a face on any chat model, through OpenAI- and Anthropic-compatible endpoints. - [Decisions](https://docs.headwaters.ai/guides/decisions.md): Ask what a face would decide, in OpenAI's Decisions format or TypeSafe Jev's System One. - [States](https://docs.headwaters.ai/guides/states.md): A state your agent builds and Faces keeps and watches: your premises with their status and what they depend on, and the decisions faces made, each kept with what it rests on. - [Compile](https://docs.headwaters.ai/guides/compile.md): Turn source texts into a compiled face. - [Synthetic Faces](https://docs.headwaters.ai/guides/synthetic-faces.md): Compose faces from boolean expressions over existing faces. - [Style](https://docs.headwaters.ai/guides/style.md): Build a style for how a face uses language in different situations. - [Media](https://docs.headwaters.ai/guides/media.md): The kinds of writing a source can be, and a chat request can be in. Each with a description and what it covers. - [Benchmark](https://docs.headwaters.ai/guides/benchmark.md): Put your face against a reference model on your own writing, and see which sounds more like you. - [Fidelity](https://docs.headwaters.ai/guides/fidelity.md): Score a face yourself, in ten blind turns against another model. - [Billing](https://docs.headwaters.ai/guides/billing.md): Credits, subscription plans, allowances, and Stripe payments. - [Connect ChatGPT](https://docs.headwaters.ai/guides/oauth.md): On Connect and Pro, link your ChatGPT account so interviews, style builds and Codex-eligible chat models run on your ChatGPT plan instead of credits. - [Causes (removed)](https://docs.headwaters.ai/guides/causes.md): POST /v1/causes is removed. A face's cause steers chat and decisions and is never returned. - [Compiled Faces](https://docs.headwaters.ai/concepts/compiled-faces.md): What a compiled face is, and what makes a good source text. - [Centroids](https://docs.headwaters.ai/concepts/centroids.md): Face similarity, neighbors, and the geometric structure of compiled faces. - [Root](https://docs.headwaters.ai/api-reference/root.md) - [Health](https://docs.headwaters.ai/api-reference/health.md) - [Login With Email](https://docs.headwaters.ai/api-reference/authentication/login-with-email.md): Login with email or username and password. - [Register With Email](https://docs.headwaters.ai/api-reference/authentication/register-with-email.md): Register a new IAM account with email/password. - [Refresh Token](https://docs.headwaters.ai/api-reference/authentication/refresh-token.md): Exchange a valid (non-expired) JWT for a fresh one with a new expiry. - [Get Me](https://docs.headwaters.ai/api-reference/authentication/get-me.md): Return the authenticated user's profile (username, email, name). Accepts JWT or API key. - [Update Me](https://docs.headwaters.ai/api-reference/authentication/update-me.md): Update the authenticated user's username and/or email. Requires current password. - [Change Password](https://docs.headwaters.ai/api-reference/authentication/change-password.md): Change the authenticated user's password. Requires current password. - [Forgot Password](https://docs.headwaters.ai/api-reference/authentication/forgot-password.md): Send a password-reset email. Always returns 200 to avoid email enumeration. - [Reset Password](https://docs.headwaters.ai/api-reference/authentication/reset-password.md): Reset password using a token from the forgot-password email. - [Get Account State](https://docs.headwaters.ai/api-reference/account/get-account-state.md): Return all account state needed for frontend routing decisions in a single call. - [Get User Preferences](https://docs.headwaters.ai/api-reference/account/get-user-preferences.md): Return user preferences (api_fallback, etc.). - [Update User Preferences](https://docs.headwaters.ai/api-reference/account/update-user-preferences.md): Update user preferences. - [Preview Close Own Account](https://docs.headwaters.ai/api-reference/account/preview-close-own-account.md): What closing your account would destroy. Changes nothing. - [Close Own Account](https://docs.headwaters.ai/api-reference/account/close-own-account.md): Close your account: destroy every face and all content, keep the ledger. - [List Api Keys](https://docs.headwaters.ai/api-reference/api-keys/list-api-keys.md): List all API keys for the authenticated user. - [Create Api Key](https://docs.headwaters.ai/api-reference/api-keys/create-api-key.md): Create a new API key for programmatic access. - [Revoke Api Key](https://docs.headwaters.ai/api-reference/api-keys/revoke-api-key.md): Revoke an API key. - [Update Api Key](https://docs.headwaters.ai/api-reference/api-keys/update-api-key.md): Update an API key's metadata, budget, and access control allowlists. - [List Faces](https://docs.headwaters.ai/api-reference/faces/list-faces.md): List all faces owned by the authenticated user. - [Create Face](https://docs.headwaters.ai/api-reference/faces/create-face.md): Create a new face. - [Get Faces Stats](https://docs.headwaters.ai/api-reference/faces/get-faces-stats.md): Return compile quota + chat usage stats for all owned faces in one call. - [List Supported Attributes](https://docs.headwaters.ai/api-reference/faces/list-supported-attributes.md): Every `basic_facts` key and field: what each holds, its format, and whether it is core. - [Get Faces Count](https://docs.headwaters.ai/api-reference/faces/get-faces-count.md): Return the total number of synced faces in the system. - [Diff Faces](https://docs.headwaters.ai/api-reference/faces/diff-faces.md): Compare how similar several of your faces are to one another. - [Get Face](https://docs.headwaters.ai/api-reference/faces/get-face.md): Get a specific face by ID (username). - [Delete Face](https://docs.headwaters.ai/api-reference/faces/delete-face.md): Permanently delete a face and everything compiled from it. - [Update Face](https://docs.headwaters.ai/api-reference/faces/update-face.md): Update a face by ID (username). - [Get Face Neighbors](https://docs.headwaters.ai/api-reference/faces/get-face-neighbors.md): Find faces most (or least) similar to a given face. Each `similarity` is rounded to one decimal place when either face is not yours. When it is, rows are ordered, and the top `k` chosen, on the rounded score, and rows with the same score are listed by owner and alias. - [Replace Face Groups](https://docs.headwaters.ai/api-reference/faces/replace-face-groups.md): Replace the face's group-membership list with the given group_ids. - [Delete Face Corpus](https://docs.headwaters.ai/api-reference/faces/delete-face-corpus.md): Delete the corpus uploaded for a face. - [Set Face Shared With](https://docs.headwaters.ai/api-reference/faces/set-face-shared-with.md): Share a face with specific accounts, or revoke that sharing. - [Set Face Published](https://docs.headwaters.ai/api-reference/faces/set-face-published.md): Publish or unpublish a face system-wide. - [Set Face Lock](https://docs.headwaters.ai/api-reference/faces/set-face-lock.md): Lock or unlock a face. - [Get Face Avatar](https://docs.headwaters.ai/api-reference/faces/get-face-avatar.md): Fetch the face's avatar as an image: the bytes themselves, not base64. - [Save Face Avatar](https://docs.headwaters.ai/api-reference/faces/save-face-avatar.md): Generate a portrait of this face and keep it as the face's avatar. - [Upload Face Avatar](https://docs.headwaters.ai/api-reference/faces/upload-face-avatar.md): Supply your own picture for this face, instead of a generated portrait. - [Upload Face Avatar](https://docs.headwaters.ai/api-reference/faces/upload-face-avatar-1.md): Supply your own picture for this face, instead of a generated portrait. - [Delete Face Avatar Upload](https://docs.headwaters.ai/api-reference/faces/delete-face-avatar-upload.md): Remove the uploaded picture, so the face shows its generated avatar again. - [List Face Avatars](https://docs.headwaters.ai/api-reference/faces/list-face-avatars.md): Every stored version of this face's avatar, newest first (metadata only). - [Transcribe Face File](https://docs.headwaters.ai/api-reference/faces/transcribe-face-file.md): Transcribe an audio or video file using AssemblyAI with speaker diarization. Returns raw transcript text and speaker-labelled segments. Charged to the user's credit account (USD). Does NOT create any document or thread. The client should use the returned text to call POST /faces/{face_id}/upload. - [Upload Face Source File](https://docs.headwaters.ai/api-reference/faces/upload-face-source-file.md): Create a compile document or thread from an uploaded file. - [Import Face Source Url](https://docs.headwaters.ai/api-reference/faces/import-face-source-url.md): Import a YouTube video as a compile document or thread. - [List Supported Models](https://docs.headwaters.ai/api-reference/models/list-supported-models.md): Returns all supported underlying LLM models with pricing. - [List Media](https://docs.headwaters.ai/api-reference/media/list-media.md): Every medium a client may declare (`medium` on a document, a thread or a request). - [Chat Completions Route](https://docs.headwaters.ai/api-reference/chat-completions/chat-completions-route.md): Create a chat completion. - [List Compile Document Status](https://docs.headwaters.ai/api-reference/compile/list-compile-document-status.md): The compile status of every compile document, one row each: what `GET /compile/documents/{id}?status_only=true` answers, for all of them. - [List Compile Thread Status](https://docs.headwaters.ai/api-reference/compile/list-compile-thread-status.md): The compile status of every compile thread, one row each: what `GET /compile/threads/{id}?status_only=true` answers, for all of them. - [List Compile Threads](https://docs.headwaters.ai/api-reference/compile/list-compile-threads.md): List all compile threads across all owned model IAMs. - [Start Compile Thread](https://docs.headwaters.ai/api-reference/compile/start-compile-thread.md): Start a new compile thread for conversational training. - [Send Compile Message](https://docs.headwaters.ai/api-reference/compile/send-compile-message.md): Send a user message to a compile thread and receive an assistant reply. - [Set Compile Thread Messages](https://docs.headwaters.ai/api-reference/compile/set-compile-thread-messages.md): Replace all messages in a compile thread (e.g. after upload, before it compiles). - [Make Compile Thread](https://docs.headwaters.ai/api-reference/compile/make-compile-thread.md): Compile a thread into its face. Returns 202 at once, with `status: "queued"`. - [Pause Compile Thread](https://docs.headwaters.ai/api-reference/compile/pause-compile-thread.md): Pause a running compilation. Progress is preserved. Resume with POST /make. - [Reset Compile Thread](https://docs.headwaters.ai/api-reference/compile/reset-compile-thread.md): Reset compilation progress. Messages are preserved; call `/make` to recompile. - [Get Compile Thread](https://docs.headwaters.ai/api-reference/compile/get-compile-thread.md): Get a compile thread. Use ?status_only=true for lightweight polling. - [Delete Compile Thread](https://docs.headwaters.ai/api-reference/compile/delete-compile-thread.md): Delete a compile thread and remove what it contributed to the face. - [Update Compile Thread](https://docs.headwaters.ai/api-reference/compile/update-compile-thread.md): Update a compile thread: its label, the medium it is read as, or both. - [List Compile Documents](https://docs.headwaters.ai/api-reference/compile/list-compile-documents.md): List all compile documents across all owned model IAMs. - [Submit Compile Document](https://docs.headwaters.ai/api-reference/compile/submit-compile-document.md): Submit a new document for a model. Token count is a preview; it is charged when it compiles. - [Get Compile Document](https://docs.headwaters.ai/api-reference/compile/get-compile-document.md): Get a single compile document. Use ?status_only=true for lightweight polling. - [Delete Compile Document](https://docs.headwaters.ai/api-reference/compile/delete-compile-document.md): Delete a compile document and remove what it contributed to the face. - [Edit Compile Document](https://docs.headwaters.ai/api-reference/compile/edit-compile-document.md): Edit a compile document (label, content, or perspective). Auto-versions on content change. - [Pause Compile Document](https://docs.headwaters.ai/api-reference/compile/pause-compile-document.md): Pause a running compilation. Progress is preserved. Resume with POST /make. - [Reset Compile Document](https://docs.headwaters.ai/api-reference/compile/reset-compile-document.md): Reset compilation progress. Content is preserved; call `/make` to recompile. - [Make Compile Document](https://docs.headwaters.ai/api-reference/compile/make-compile-document.md): Compile a document into its face. Returns 202 at once, with `status: "queued"`. - [Compile Activity](https://docs.headwaters.ai/api-reference/compile/compile-activity.md): What is compiling on this account right now, grouped by face. - [Get Llm Costs](https://docs.headwaters.ai/api-reference/billing/get-llm-costs.md): Return every supported LLM with its base pricing and the authenticated user's all-time usage on that model in a single response. - [Get Balance](https://docs.headwaters.ai/api-reference/billing/get-balance.md): Return the credit balance and frozen status for the authenticated user. - [Get Usage Query](https://docs.headwaters.ai/api-reference/billing/get-usage-query.md): Return aggregated usage data grouped by a chosen dimension. - [Topup Balance](https://docs.headwaters.ai/api-reference/billing/topup-balance.md): Top up credit balance. - [Create Card Setup Session](https://docs.headwaters.ai/api-reference/billing/create-card-setup-session.md): Create a Stripe Checkout session in 'setup' mode to collect and save a payment method without charging the user. - [List Payment Methods](https://docs.headwaters.ai/api-reference/billing/list-payment-methods.md): The saved cards (brand, last 4, expiry) and which one is the default: the card the subscription renews on and a top-up charges unless it names another. - [Set Default Payment Method](https://docs.headwaters.ai/api-reference/billing/set-default-payment-method.md): Make a saved card the default. The next renewal and every top-up that names no card charge it. - [Remove Payment Method](https://docs.headwaters.ai/api-reference/billing/remove-payment-method.md): Remove a saved card. Removing the default makes the newest other card the default. The last card cannot be removed while a paid subscription renews on it (409): add another card first, or cancel the subscription. - [Get Subscription Status](https://docs.headwaters.ai/api-reference/billing/get-subscription-status.md): Return the authenticated user's current subscription plan, status, IAM count vs plan limit, and renewal date. - [Get Rates](https://docs.headwaters.ai/api-reference/billing/get-rates.md): Every price and limit a caller pays or runs into: the cause and compile rates, the markup on model spend, each plan's monthly price and allowances, and the input limits on chat and `/decisions`. Per-model token prices are in GET /v1/models. - [Create Checkout Session](https://docs.headwaters.ai/api-reference/billing/create-checkout-session.md): Create a Stripe Checkout session for a FIRST subscription: Connect ($17/month) or Pro ($49/month). Returns a checkout_url the client should redirect the user to. - [Change Plan](https://docs.headwaters.ai/api-reference/billing/change-plan.md): Switch an existing subscription between Connect and Pro. The Stripe subscription's price is changed in place, prorated; the webhook it sends updates the plan, and so does this call, so the new allowances apply at once. Without a subscription, use checkout. - [List Invoices](https://docs.headwaters.ai/api-reference/billing/list-invoices.md): Return the authenticated user's Stripe invoice history. - [Activate Account](https://docs.headwaters.ai/api-reference/billing/activate-account.md): Create a Stripe Checkout session for the initial $5 account activation purchase. - [Cancel Subscription](https://docs.headwaters.ai/api-reference/billing/cancel-subscription.md): Cancel the authenticated user's subscription at period end. The user retains paid plan access until current_period_end. - [Reactivate Subscription](https://docs.headwaters.ai/api-reference/billing/reactivate-subscription.md): Reactivate a subscription that is pending cancellation. - [Messages Route](https://docs.headwaters.ai/api-reference/proxy/messages-route.md): Anthropic-native transparent proxy. - [Responses Route](https://docs.headwaters.ai/api-reference/proxy/responses-route.md): OpenAI Responses API transparent proxy. - [Create Group](https://docs.headwaters.ai/api-reference/groups/create-group.md) - [List My Groups](https://docs.headwaters.ai/api-reference/groups/list-my-groups.md) - [Get Group](https://docs.headwaters.ai/api-reference/groups/get-group.md) - [Delete Group](https://docs.headwaters.ai/api-reference/groups/delete-group.md) - [Update Group](https://docs.headwaters.ai/api-reference/groups/update-group.md) - [List Group Members](https://docs.headwaters.ai/api-reference/groups/list-group-members.md) - [Add Group Members](https://docs.headwaters.ai/api-reference/groups/add-group-members.md) - [Remove Group Member](https://docs.headwaters.ai/api-reference/groups/remove-group-member.md) - [List Group Tags](https://docs.headwaters.ai/api-reference/groups/list-group-tags.md) - [Set Group Tags](https://docs.headwaters.ai/api-reference/groups/set-group-tags.md) - [Add Group Tags](https://docs.headwaters.ai/api-reference/groups/add-group-tags.md) - [Remove Group Tag](https://docs.headwaters.ai/api-reference/groups/remove-group-tag.md) - [List My Tags](https://docs.headwaters.ai/api-reference/tags/list-my-tags.md): Union of all tags across faces owned by the caller, sorted and deduped. - [List Tags](https://docs.headwaters.ai/api-reference/tags/list-tags.md) - [Set Tags](https://docs.headwaters.ai/api-reference/tags/set-tags.md): Replace all tags on the IAM with the given list. - [Add Tags](https://docs.headwaters.ai/api-reference/tags/add-tags.md): Add one or more tags (idempotent). Enforces the overall max after merge. - [Remove Tag](https://docs.headwaters.ai/api-reference/tags/remove-tag.md) - [Follow Account](https://docs.headwaters.ai/api-reference/users/follow-account.md): Follow an account. Idempotent: following twice is a success, not a 409. - [Unfollow Account](https://docs.headwaters.ai/api-reference/users/unfollow-account.md): Unfollow an account. Idempotent: unfollowing someone you do not follow is a success, so a client that lost track of state can always converge. - [List Following](https://docs.headwaters.ai/api-reference/users/list-following.md): The accounts this one follows, paged by username. - [List Followers](https://docs.headwaters.ai/api-reference/users/list-followers.md): The accounts following this one, paged by username. - [Get Account](https://docs.headwaters.ai/api-reference/users/get-account.md): One account, enough to title a creator's wall. - [Start Device Auth](https://docs.headwaters.ai/api-reference/oauth/start-device-auth.md): Begin the OAuth 2.0 Device Authorization Grant flow for OpenAI. - [Poll Device Auth](https://docs.headwaters.ai/api-reference/oauth/poll-device-auth.md): Poll OpenAI for the authorization grant tied to a previously-started device_auth_id, and on success exchange + persist tokens. - [Cancel Device Auth](https://docs.headwaters.ai/api-reference/oauth/cancel-device-auth.md): Drop a pending device-code session. Idempotent: silently no-ops if the session is already gone (expired or completed). Call it when the user cancels mid-polling. - [List Connected Providers](https://docs.headwaters.ai/api-reference/oauth/list-connected-providers.md): List all OAuth providers connected to the authenticated user's account. - [Disconnect Provider](https://docs.headwaters.ai/api-reference/oauth/disconnect-provider.md): Remove the stored OAuth tokens for the given provider. - [List Builds](https://docs.headwaters.ai/api-reference/style/list-builds.md): The caller's build/refine jobs for a self face, newest first (default: just the latest). This is the durable re-attach handle: a client that lost its job_id (quit/crash mid-build) calls this to find the current or last attempt and resumes polling it. `kind` distinguishes refine jobs (best-effort, si… - [Start Build](https://docs.headwaters.ai/api-reference/style/start-build.md): Build a face's style from the material you uploaded to it. - [Get Build](https://docs.headwaters.ai/api-reference/style/get-build.md) - [List Style Versions](https://docs.headwaters.ai/api-reference/style/list-style-versions.md): The styles kept for this face: the active one and the step before it. - [Revert Style Version](https://docs.headwaters.ai/api-reference/style/revert-style-version.md): Go back one step: reactivate the style this face had before the last build. - [Purge Style](https://docs.headwaters.ai/api-reference/style/purge-style.md): Delete the face's style build, and nothing else. - [List Runs](https://docs.headwaters.ai/api-reference/benchmark/list-runs.md): This caller's benchmark runs, newest first. - [Start Run](https://docs.headwaters.ai/api-reference/benchmark/start-run.md): Start a benchmark of a face you own against a reference model. - [Get Run](https://docs.headwaters.ai/api-reference/benchmark/get-run.md) - [Get Results](https://docs.headwaters.ai/api-reference/benchmark/get-results.md): The finished result: winner, gap and its interval, by length and by medium. - [Start Fidelity](https://docs.headwaters.ai/api-reference/fidelity/start-fidelity.md): Start a fidelity run on a face you own: ten blind turns, scored out of 10. - [Fidelity Turn](https://docs.headwaters.ai/api-reference/fidelity/fidelity-turn.md): Send this turn's message. Returns two answers, `a` and `b`, in random order. - [Fidelity Choice](https://docs.headwaters.ai/api-reference/fidelity/fidelity-choice.md): Pick `a` or `b` for a turn, and accept it or send a correction. Returns the turn's score; after the tenth turn the run's score is saved on the face. - [Get Fidelity Run](https://docs.headwaters.ai/api-reference/fidelity/get-fidelity-run.md): A run's progress, its turns and, once finished, its score. Which answer was the face's is shown only after the run is finished. - [Save Fidelity Thread](https://docs.headwaters.ai/api-reference/fidelity/save-fidelity-thread.md): Save a finished run's conversation as a thread on the face, so it can be compiled. Each turn becomes your message and the reply you settled on: your correction where you made one, otherwise the answer you accepted. - [Decisions](https://docs.headwaters.ai/api-reference/decisions/decisions.md): OpenAI's Decisions API: `input` and an array of `questions`, answered in OpenAI's format. `model` is `@face:maestro-1/` (a composite `(@a | @b):maestro-1/` too, operators | & - ^; `@owner~face` for another account's face; `maestro-1-flash` for the steering sooner, at 10x on the s… - [Systemone](https://docs.headwaters.ai/api-reference/decisions/systemone.md): TypeSafe Jev's System One API: `state` and `questions` keyed by id, answered in Jev's format. `model` is `@face:maestro-1/` (a composite `(@a | @b):maestro-1/` too, operators | & - ^; `@owner~face` for another account's face; `maestro-1-flash` for the steering sooner, at 10x on t… - [Choices](https://docs.headwaters.ai/api-reference/decisions/choices.md) - [Causes](https://docs.headwaters.ai/api-reference/causes/causes.md): Refused, 422, nothing charged: the face's cause is never returned. To steer a decision use POST /v1/decisions with `@face:maestro-1/`; for the face's own options, POST /v1/choices with `@face:maestro-1`. - [Create Session](https://docs.headwaters.ai/api-reference/sessions/create-session.md): Turns that send its id as `session` are grouped in it, and `POST /v1/sessions/{id}/compact` writes the face's cause over all of them. - [Get Session](https://docs.headwaters.ai/api-reference/sessions/get-session.md) - [Close Session](https://docs.headwaters.ai/api-reference/sessions/close-session.md) - [Compact Session](https://docs.headwaters.ai/api-reference/sessions/compact-session.md): The face's cause over the whole session, stored under a `compaction_id`. Send `"compaction": ""` on a later request with the same face to use it in place of the history. Billed at the cause rate (GET /v1/rates `cause`). - [Create Conversation](https://docs.headwaters.ai/api-reference/sessions/create-conversation.md): Open a state. `causes_visible` (default true) shows one face the other faces' causes. `items` (optional) are the first items: the client's messages and premise readings, each premise {key, value, description, status, depends_on, role, origin} as on `POST /v1/states/{id}/items`; `premises` is taken a… - [Create Conversation](https://docs.headwaters.ai/api-reference/sessions/create-conversation-1.md): Open a state. `causes_visible` (default true) shows one face the other faces' causes. `items` (optional) are the first items: the client's messages and premise readings, each premise {key, value, description, status, depends_on, role, origin} as on `POST /v1/states/{id}/items`; `premises` is taken a… - [Get Conversation](https://docs.headwaters.ai/api-reference/sessions/get-conversation.md): The state. `version` is 23 (the default) or 22; it changes nothing here. - [Close Conversation](https://docs.headwaters.ai/api-reference/sessions/close-conversation.md): Closes it: no more turns join it. Its items go with it when it expires. - [Get Conversation](https://docs.headwaters.ai/api-reference/sessions/get-conversation-1.md): The state. `version` is 23 (the default) or 22; it changes nothing here. - [Close Conversation](https://docs.headwaters.ai/api-reference/sessions/close-conversation-1.md): Closes it: no more turns join it. Its items go with it when it expires. - [List Items](https://docs.headwaters.ai/api-reference/sessions/list-items.md): The conversation's items, paged as OpenAI's list of conversation items is: `limit` (1 to 100, default 20) at a time, `order` `desc` (newest first, the default) or `asc`, starting after the item `after`; `first_id`, `last_id` and `has_more` say where the page sits. `format=faces` (the default) keeps… - [Add Items](https://docs.headwaters.ai/api-reference/sessions/add-items.md): Add the client's own messages and premise readings (`items`, or `premises` as [{key, value, description, status, depends_on, role, origin}]). A newer reading of a key replaces it from here on, and the response lists `decisions_made_under_old_values`: every earlier decision made while a key read here… - [List Items](https://docs.headwaters.ai/api-reference/sessions/list-items-1.md): The conversation's items, paged as OpenAI's list of conversation items is: `limit` (1 to 100, default 20) at a time, `order` `desc` (newest first, the default) or `asc`, starting after the item `after`; `first_id`, `last_id` and `has_more` say where the page sits. `format=faces` (the default) keeps… - [Add Items](https://docs.headwaters.ai/api-reference/sessions/add-items-1.md): Add the client's own messages and premise readings (`items`, or `premises` as [{key, value, description, status, depends_on, role, origin}]). A newer reading of a key replaces it from here on, and the response lists `decisions_made_under_old_values`: every earlier decision made while a key read here… - [Compact Conversation](https://docs.headwaters.ai/api-reference/sessions/compact-conversation.md): `POST /v1/sessions/{id}/compact` under the conversation's name. A conversation open to any face names the face to compact in `model` (`@face`, as on POST /v1/states). - [Compact Conversation](https://docs.headwaters.ai/api-reference/sessions/compact-conversation-1.md): `POST /v1/sessions/{id}/compact` under the conversation's name. A conversation open to any face names the face to compact in `model` (`@face`, as on POST /v1/states). ## OpenAPI Specs - [openapi](/api-reference/openapi.json) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.