API Runs
Billing for workflow runs triggered through the REST API, including spend caps.
Developers running workflows through the API.
Overview#
API-triggered runs use the same billing as runs started from the product UI. Funding is wallet-based, with bundle draw first if the API caller has an eligible bundle for that workflow version.
API keys can set an optional spend cap. Before a run starts, its creator margin plus its estimated compute hold is reserved against the cap. If that would take the key past its cap, the endpoint returns spend_cap_reached and does not start a run.
Authentication and spend caps#
Requests require a valid API key with run scope. The reservation against a key's spend cap covers the creator margin plus the estimated compute hold, so a run whose price would take the key past its cap does not start. When the run finishes, the cap counts what the run was actually charged and the rest of the reservation is released. A run that is not charged releases its whole reservation.
The public endpoint has no separate account-level spend cap. Keys without an API-key cap are limited by wallet balance, bundle availability, input limits, and rate limits.
Funding and execution#
Funding order matches the UI: eligible locked bundle first, then wallet. Insufficient wallet after bundle exhaustion blocks the run.
The API enforces the same input envelope limits as the product UI. Oversized input is rejected before any charge.
On success, billing is identical to UI runs: the wallet is charged or one eligible bundle run is consumed. Ordinary failed and cancelled runs are not charged. If a run is separately labeled as stopped at the compute limit, already-consumed compute may be retained.
Response behavior#
POST /runs may return 202 Accepted before funding checks finish. An insufficient wallet can therefore appear later as a failed run rather than as an immediate payment error. An API-key spend-cap failure is returned immediately.
See Create Run for response, charge, and retry outcomes.
Special cases#
- Bundle via API: Works the same as the product UI when the bundle matches the workflow version.
- BYOK via API: The same displayed pricing terms apply as for UI BYOK runs.
- Composed workflow: The displayed price covers the complete run.
What you see in Edgaze#
- API Vault: key creation with optional spend cap and window
- API responses: clear messages when funds or spend cap block a run
- Wallet history: the same charge lines as UI runs for the same account
Related policies#
- API Reference: REST endpoints, authentication, playground, and webhooks
- Funding Runs
- Run a Workflow
- API Vault: BYOK provider keys (not REST API keys)
- When Runs Fail
Was this useful?
Your response helps us improve the documentation.
Related documentation
How workflow runs are priced, funded, settled, and refunded. Step-by-step guides for buyers, creators, and developers.
How to open a workflow, fund a run, and what happens when it completes.
How the per-run price is built, what the creator earns, and what Edgaze keeps.