# Cost per Action

URL: /code/builders/startup/cost-per-action · Id: `page:code/builders/startup/cost-per-action`

> Every Action settles a Cost that rolls up per Verb, Offer and Customer, so unit economics and price floors read the same rows.

Every [Action](/business/nouns/action) settles a [Cost](/business/nouns/cost), and Costs roll up per [Verb](/business/nouns/verb), [Offer](/business/nouns/offer) and [Customer](/business/nouns/customer). Unit economics, [Price](/business/nouns/price) floors and margin work all read the same rows.

## What an Action records
Each Action records a span with its parent Action, so the calls a [Workflow](/business/nouns/workflow) makes form one trace. When it finishes, it settles a Cost for each kind of work it used: compute, model tokens, upstream calls and human minutes.

Each Verb declares the kinds of Cost its Actions settle, so the rollup knows what to expect before the first call.

## Reserve, settle, release
A call an outside service prices reserves its worst case before it runs. That is the quoted maximum of every attempt it may be charged for, misses included. The [Limit](/business/nouns/limit) check reads the reservation, so concurrent calls never commit more than the Limit allows.

The call settles at its actual Cost, one Cost per charged attempt, and the unused reservation is released at once. A Cost above the reservation is recorded in full with its overrun, and an overrun past a Limit opens an [Approval](/business/nouns/approval).

A lookup reserves $0.05, its quoted maximum across two upstreams. The first misses and charges $0.01, the second answers for $0.03, and the Action settles two Costs and releases $0.01.

## Costs fall on their own
An agentic [Function](/business/nouns/function) converges when its traces show the same tool sequence and output shape, with an [Evaluator](/business/nouns/evaluator) pass rate of 95% or more. The [Engineering Lead](/agents/engineering/engineering-lead) then distills a code Function from them.

The code Function arrives as a [Change](/business/nouns/change) that replays recorded Actions as its regression suite. It runs first in the Verb's cascade with the agentic Function as fallback, and the Cost per call drops to compute.

## Example
```json
{
  "$type": "Cost",
  "action": "action_7",
  "kind": "upstream",
  "attempt": 2,
  "amount": { "amount": 0.03, "currency": "USD" }
}
```