The stateful agent API is the first-class way to run persistent agentic conversations: create a session, post messages, and each message executes a real agent run — with sources, files, and full conversation continuity. It replaces the deprecated session hints on chat/completions (see Deprecations). All endpoints live under /v1/agent/*, authenticate with your sk-rav- key, and are scoped (sessions:*, messages:*, runs:* — granted by default on all keys).

Model

Every run reports credits and usage from the billing ledger receipt — the number you see is the number that was charged, never an estimate.

Lifecycle

Endpoints

Semantics worth knowing

  • One active run per session. Posting while a run is queued or in_progress returns 409 (enforced at the database level). Wait for the terminal state or cancel first.
  • Cancel means stop waiting. A turn already executing server-side completes and its charge stands; the run’s status becomes cancelled and is never overwritten.
  • Runs are billed as chat turns (standard multiplier). The run object’s credits comes from the charge receipt.
  • Restarts are safe, not silent. A server restart fails stranded runs with interrupted by server restart — resubmit the message; you will never see a run stuck in queued forever.
  • Powered accounts (own Claude token) get 403 powered_token_required on execution until the account’s Claude connection is set up in the app; their runs record zero-credit receipts.

chat/completions and the stateless split

POST /v1/chat/completions is now the stateless fast surface — fast mode is the default and needs no selector. The legacy agentic behavior over chat/completions (mode: "standard" or metadata.ravchat.session_id hints) is deprecated: responses carry Deprecation: true and Sunset: Fri, 14 Aug 2026 headers until the sunset date, after which those requests return invalid_request pointing here. Migrate stateful workloads to /v1/agent/* — the model above is strictly more capable.