2 minute readAPIAgent-ready
Run pricing functions in a chain
One request can now run several pricing functions in order, each stage's price feeding the next, with your guardrails applied once to the final price and each stage metered as one call.
Pricing chains run built-in and workspace functions one after another in a single request. A typical chain prices from cost, holds the result at or under a competitor, then rounds to a charm ending.
- Each stage's price becomes the next stage's current price, and the metadata you give a stage stays available to every later stage.
- A clamp stage holds the price under a maximum, over a minimum, or within a percentage of the competitor price, without calling a function.
- Your workspace guardrails apply once, to the final price, measured from the current price you sent, so a 10% change limit holds the whole chain.
- Each function stage that returns a price is metered as one compute call, at the same cost as the call on its own. Clamp stages and skipped stages are free, and the response shows every stage's price and cost.
- A failing stage can try a fallback function, then either pass the price through or stop the chain. A chain that stops charges nothing.
- Agents can run chains with their API key. Vision and LLM stages are planned and are refused for now.
