Runs on the hosted service are paid from prepaid credits. Every run has a budget. Ephemeral reserves the whole budget before the run starts, charges what the run used and releases the rest.
Units
All amounts are whole numbers in US dollars, in one of two units.
| Unit | Used for | One dollar |
|---|---|---|
*_ | Run budgets, run costs, wallet balances and ledger entries | 1000000 |
*_ | Stripe purchases, automatic top-ups and payment history | 100 |
So cost_micros: 10000 is one cent, and amount_cents: 2500 is $25. A money field that is missing from a run object is zero.
What a run costs
A run's cost has up to five parts, plus the zero data retention surcharge when it applies. Storage is charged separately, below.
| Part | Price on the hosted service |
|---|---|
| Run fee | $0.005 for each run whose worker starts |
| Compute | $0.0002 per second ($0.72 an hour) |
| Model calls | The model provider's price plus 15% |
| Web fetch | $0.001 per request |
| Web search | $0.015 per search |
| Zero data retention | 10% more on the whole run |
There are no free or starter credits. GET /v1/me returns the rates as run_fee_micros, compute_micros_per_second, model_markup_percent, web_fetch_micros and web_search_micros.
- Run fee. A fixed fee, charged once when the run leaves the queue and its worker starts. A run that is refused, cancelled while queued or that fails before its worker starts does not pay it. The run object reports it as
run_fee_micros, and it is part ofcost_micros. - Compute. The time from when the run leaves the queue until it ends, rounded up to whole seconds, at the compute rate. It never exceeds the charge for the full timeout.
GET /v1/mereturns the rate ascompute_micros_per_second. - Model calls. Before each model call, Ephemeral looks up the model's current price and authorizes a conservative upper bound for the call. When the provider reports what the call actually cost, that amount replaces the authorization. The price is the provider's price plus 15%, which covers payment processing and provider fees; the run object reports the rate as
markup_percentand the added amount asmarkup_micros. If a response is lost, interrupted or arrives without a trustworthy cost, the upper bound stays charged. A call the provider refuses with an error, such as a rate limit, without reporting a cost, is not charged. - Web requests. When the run has web access, each request costs $0.001 and each search $0.015, charged when it is sent. Refused requests are not charged. Web requests are flat prices, without the markup.
- Zero data retention. A run with
zero_data_retention: truecosts 10% more on the whole run, applied on top of the run fee, compute, the marked-up model calls and web requests. The extra amount counts toward the budget.
Put together, cost_micros is the run fee, plus compute, plus the model calls at the provider's price, plus the markup, plus web requests, plus the zero data retention surcharge when it applies.
Hosted runs support text and models whose price can be bounded in advance. GET /v1/models lists the models that qualify, with their prices.
Storage
Files (uploads and the files runs save) and state are stored for you, and storage is billed separately from runs.
| Part | Price on the hosted service |
|---|---|
| Stored files and state | $0.04 per GB-month |
| State writes | $0.01 per 1,000 writes. Reads are free. |
- A GB is 109 bytes. Usage is measured hourly and charged from your credits when it reaches $0.01, or at the end of the month.
- A state write the agent makes inside a run counts toward that run's cost and budget.
GET /v1/storageshows your usage, your retention policy and what has been charged.GET /v1/mereturns the prices asstorage_micros_per_gb_monthandstate_write_micros.- Delete files and state, or set a retention policy, to stop paying for them.
Budgets
Set the budget with max_cost_micros on the run request. It can be 1 to 100,000,000 ($100). If you leave it out, the default budget applies; GET /v1/me returns it as default_max_cost_micros.
The budget must cover the run fee plus the compute charge for the full timeout: at least run_fee_micros plus timeout_seconds multiplied by compute_micros_per_second (10% more for a zero data retention run). A smaller budget is rejected with 400; shorten the timeout or raise the budget. The error says by how much: its budget object gives the figures, required_max_cost_micros (the least budget for that timeout) and longest_timeout_seconds (the longest timeout that budget allows).
{
"error": "budget is below the run fee plus the maximum compute charge: max_cost_micros 50000 is below the 65000 needed for the default 300 s timeout (5000 run fee + 300 s x 200 micros/s compute); raise max_cost_micros to at least 65000, or set timeout_seconds to 225 or less",
"code": "invalid_request",
"budget": {
"max_cost_micros": 50000,
"max_cost_micros_from": "given",
"timeout_seconds": 300,
"timeout_seconds_from": "default",
"run_fee_micros": 5000,
"compute_micros_per_second": 200,
"required_max_cost_micros": 65000,
"longest_timeout_seconds": 225
}
}At 200 micro-dollars per second ($0.72 an hour), with the $0.005 run fee (5,000), the default 300-second timeout needs at least 65,000 and the 3,600-second maximum needs 725,000. The default budget of 500,000 covers timeouts up to 2,475 seconds.
During the run, any model call whose upper bound would take the run past its budget is refused, and so is any web request that would. This keeps the run within its budget. The refused call returns an error to the agent, and the run normally ends as failed.
Reserve, charge, release
- When you create a run, its status is
reservingwhile the whole budget is reserved from your available credits. If too little is available, the request fails with402and the run is recorded asfailed. - While the run is active,
cost_microsincludes the run fee once the worker has started, the compute charge for the full timeout plus each model call, at its reported cost once the provider sends it or its upper bound until then, plus each web request. - After the run ends, the compute charge is recalculated from the time actually used.
- Ephemeral charges the final cost to your balance and releases the rest of the reservation. Then
billing_pendingbecomesfalse.
cost_micros as final only when the run's status is final and billing_pending is false. Before that, it can be higher than the amount you are charged.Credits and payments
Owners and admins buy credits in the customer portal under Billing, through Stripe Checkout. Each purchase is $5 to $10,000. Credits are added when Stripe confirms the payment, usually within seconds. Returning from the Checkout page does not add credits by itself.
| Wallet field | Meaning |
|---|---|
balance_ | Credits you hold. |
reserved_ | Credits reserved for runs that have not settled yet. |
available_ | Balance minus reservations. New runs reserve from this. |
The wallet also shows the latest 100 ledger entries, linked to the run or payment behind each one. The ledger is an account history and is not an invoice; Stripe provides a receipt for each payment.
Automatic top-up charges a saved card when a run's charge leaves your balance below a threshold you choose. It needs a saved card and your explicit consent. The top-up amount is $5 to $10,000, and the threshold is at least $1 and no more than the top-up amount. Saving a card does not turn it on. Removing the selected card without choosing another default turns it off.
Refunds and disputes are deducted from the balance and turn automatic top-up off. If a refund leaves the balance negative, new runs are blocked until you add credits.
Credits never expire. Within 14 days of a purchase, you can ask through support for the credits from that purchase that you have not used to be refunded to your card. Credits already used or reserved by a running run are not refunded. See the Terms of Service.