billing

Prose Auto Refresh

Decide whether a just-ready snapshot should get AI explanations written.

Lives beside the other Modal-facing internal routes because it is the same trust boundary and, like them, it can move money: the decision it reaches may place a credit hold. The indexer cannot make this call itself -- the policy, the selection, the billing principal and the daily cap all live in the backend, and the prose_jobs hold/settle ledger is only ever written from here.

mode="authorize" returns the authorization for the caller to act on, which is what lets the indexer write explanations in the container that already holds the parsed tree. mode="spawn" (the default, and what a pre-existing deploy sends) dispatches a dedicated container instead. Either way the money is committed here and settled through the same ledger claim.

Always 200 with a reason. The caller is a best-effort callback on an already-published snapshot, so "we decided not to" and "we could not decide" must be equally harmless; an exception here would be retried by nobody and read as a failure of an index run that in fact succeeded.

post/billing/internal/prose-auto-refresh

Headers

x-service-tokenstring required

Request body

snapshot_idstring required
stale_countinteger
mode'authorize' | 'spawn'
job_idstring nullable

Response

Successful Response

{"stackTrail":"paths:/billing/internal/prose-auto-refresh:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes

No recorded changes to this endpoint across all 1 revision of this API.