Skip to main content
POST
Compose a session prompt
Returns the prompt text, an optional voice hint derived from the subject’s own writing, and a short list of recent org activity worth folding into the agent’s context. expiresAt says how long the result stays fresh enough to cache. Composed for the effective subject: the API key owner by default, or the subject named by the X-Exo-Subject header.

Authorization

This route requires the read scope. A missing or invalid credential returns 401 authentication_error. A valid credential without the scope returns 403 permission_denied, and the problem body names the exact scope required.

Headers

These are request conventions the contract does not declare as parameters, so they do not appear in the schema tables below.

Success responses

Errors

Every error is an RFC 9457 application/problem+json body carrying a stable code, a requestId, and a suggestedAction where Exo has one. See Errors.

Notes

  • The pack is built to be injected, not parsed. Put systemPrompt into your own model’s system message and you get a model that reasons and sounds like the subject.
  • Respect expiresAt. It is how long the pack stays fresh enough to cache. Refetch after a basin.shifted event rather than on a timer if you subscribe to events.
  • userVoiceHint can be absent. The voice profile is withheld until the subject has produced enough writing to measure.

Authorizations

X-Exo-API-Key
string
header
required

An Exo API key (exo_...) sent as the X-Exo-API-Key header.

Body

application/json

POST /v1/condition/session: called by SessionStart hook.

cwd
string
required
orgId
string
required
Minimum string length: 1
userId
string
required
Minimum string length: 1
gitBranch
string | null
recentOrgActivityHours
integer
default:24
Required range: 1 <= x <= 168

Response

The composed system prompt with voice hint, recent org context and cache expiry.

Everything an agent needs to answer as this subject, composed on demand.

This is the object that turns a stored knowledge graph into a working session: a system prompt built from the subject's identity and current manifold basin, a voice hint drawn from how they actually write, and a short digest of what the rest of the org has been doing. An agent that injects the pack at session start reasons from the subject's own history instead of from a blank slate.

expiresAt is a freshness bound, not a hard deadline: the pack stays usable past it, but the identity underneath may have moved, so recompose. userVoiceHint is null until the subject has written enough for a voice profile to exist, and orgRecentContext is empty on a single-member org or a quiet window.

expiresAt
string<date-time>
required
systemPrompt
string
required
orgRecentContext
Orgrecentcontext · object[]
usage
ConditionUsage · object

Usage block on condition responses (spec D13), camelCase on the wire.

The compose builders are pure SQL reads (no LLM call today), so the token fields are null; readUnits meters one unit per compose call. If a future builder version starts spending LLM tokens, it reports them here.

userVoiceHint
string | null