Concepts

Budgets and billing

How prepaid credits are reserved up front as a hard per-run budget, what a run costs, and how the unused part is released after settlement.

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.

UnitUsed forOne dollar
*_microsRun budgets, run costs, wallet balances and ledger entries1000000
*_centsStripe purchases, automatic top-ups and payment history100

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.

PartPrice on the hosted service
Run fee$0.005 for each run whose worker starts
Compute$0.0002 per second ($0.72 an hour)
Model callsThe model provider's price plus 15%
Web fetch$0.001 per request
Web search$0.015 per search
Zero data retention10% 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 of cost_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/me returns the rate as compute_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_percent and the added amount as markup_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: true costs 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.

PartPrice 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/storage shows your usage, your retention policy and what has been charged. GET /v1/me returns the prices as storage_micros_per_gb_month and state_write_micros.
  • Delete files and state, or set a retention policy, to stop paying for them.
Unpaid storage
A storage charge takes only the credit that is available, and the rest is owed. While $0.01 or more is owed, new files, run outputs and state writes are refused. Owners and admins get emails when the debt starts, 7 days before deletion and at deletion. If it is still unpaid 30 days after it started, the organization's files and state are deleted. Adding credit pays the debt within an hour.

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).

JSON
{
  "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

  1. When you create a run, its status is reserving while the whole budget is reserved from your available credits. If too little is available, the request fails with 402 and the run is recorded as failed.
  2. While the run is active, cost_micros includes 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.
  3. After the run ends, the compute charge is recalculated from the time actually used.
  4. Ephemeral charges the final cost to your balance and releases the rest of the reservation. Then billing_pending becomes false.
Costs are provisional until settled
Read 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 fieldMeaning
balance_microsCredits you hold.
reserved_microsCredits reserved for runs that have not settled yet.
available_microsBalance 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.

Self-hosted installations
Self-hosted runs do not use the hosted wallet and are not charged by Ephemeral, and neither is storage. You pay your model provider and your cloud provider directly. See self-hosting.
esc

Nothing matches “”.