Concepts

Runs

One agent in one disposable microVM, from queue to settlement.

A run is one agent working on one task in its own microVM. You send a prompt, JSON input, and the files and connections it may use. Ephemeral queues it, starts a fresh machine, records every step, and destroys the machine when the run ends.

What a run is made of

Every run has a prompt and optional input. The rest of the definition decides which model it uses, what it can read, what it can call, how long it may take and how much it may spend. You can send the whole definition inline, or name a saved workflow and send only the input.

POST /v1/runs
{
  "prompt": "Find out why this payment failed. Follow the playbook.",
  "input": { "payment_id": "pay_123" },
  "model": "anthropic/claude-haiku-5.5",
  "files": [{ "file": "playbook.md" }],
  "connections": { "payments": { "ref": "payments-api", "allowed_methods": ["GET"] } },
  "timeout_seconds": 120,
  "shell": false,
  "max_cost_micros": 500000
}

Inside the microVM the agent can always read the files you mounted. With shell on, which is the default, it can also run shell commands and write files in its working directory. Each connection you grant adds tools it can call, and with web access on it can read pages, search and call public APIs. The machine itself has no internet. The working directory is discarded with the machine, so nothing carries over to the next run.

Lifecycle

A run moves through these statuses. The last five are final; once a run reaches one of them it does not change again.

StatusMeaning
reservingHosted only. Credits for the run's budget are being reserved.
queuedWaiting for a free worker slot.
startingTaken from the queue. The definition and files are being loaded.
runningThe microVM is starting or the agent is working.
succeededThe agent finished and returned output.
failedThe worker failed, or credits could not be reserved. The error field says which.
cancelledSomeone cancelled the run.
timed_outThe run reached its timeout before finishing.
interruptedThe engine restarted during the run, or admission did not complete.

Runs leave the queue in the order they were created. A self-hosted installation runs two at a time by default; the rest wait in queued. The timeout counts from the moment a run leaves the queue, so time spent waiting does not use it up.

Limits

LimitValue
timeout_seconds1 to 3,600. Default 300.
Prompt128 KiB
Input1 MiB of JSON
Files32 per run, 1 MiB each, 4 MiB in total
Connections16 per run
Model calls100 per run
Output per model replyThe model's own limit, up to 32,000 tokens, shortened to fit what is left of the budget. A reply cut off at the limit is continued automatically, twice at most.
Web requests and searches50 per run, when web access is on
OutputUp to 1 MiB. A longer answer is cut there, and the run records that it was.
EventsThe record keeps up to 256 KiB per event and 10,000 events or 16 MiB per run. Larger tool results are shortened in the record and marked; the agent still receives them in full. When the record is full, later detail is skipped and counted. Neither ever fails the run.
max_cost_micros1 to 100,000,000 (up to $100)

Following a run

There are three ways to learn what a run is doing and when it ends.

  • Poll GET /v1/runs/{id} until the status is final.
  • Stream GET /v1/runs/{id}/events. This is a server-sent event stream that replays everything recorded so far, then continues live until the run ends.
  • Set a callback on the run. Ephemeral sends a signed request to your server when the run reaches a final status.

Closing the event stream does not affect the run. You can reconnect with the last event ID you received and continue from there.

Event types

TypeRecorded when
statusThe run starts running or reaches a final status.
microvm_startingEphemeral requests a microVM.
microvm_readyThe microVM is up.
worker_startedThe agent process starts. Includes whether the shell is on.
connection_readyAn MCP connection is ready, with the tools the run may call.
tool_startThe agent calls a tool. Includes the arguments.
tool_endA tool call returns. Includes the result and whether it was an error. A result over 256 KiB is shortened here and carries trimmed_from_bytes.
text_deltaThe model streams text, in batches about ten times a second.
model_usageA model response ends. Token usage as reported by the worker; not used for billing.
usageEphemeral authorizes or reconciles the cost of a model call.
connectionThe engine makes an HTTP request or MCP tool call on the run's behalf.
web_requestThe engine sends a web request for the agent. Includes the URL, status, cost and safety check.
web_searchThe engine runs a web search for the agent.
web_refusedA web request or search was refused before it was sent. Includes the reason.
resultThe agent returns its final output. The run's output field holds all of it; this event may be shortened.
model_call_refusedA model call was refused, for example because its worst-case cost exceeds what is left of the budget. Includes the reason.
output_limitA reply reached the model's output limit and the agent was asked to continue.
output_truncatedThe final output was longer than 1 MiB and was cut there.
events_skippedThe run record was full, so later events were not stored. Includes how many.
worker_errorThe worker stops with an error.
microvm_terminatedThe microVM is confirmed destroyed.
microvm_cleanup_pendingTermination could not be confirmed yet and will be retried.
doneLast message on the stream. Carries the final run object.

Ephemeral removes known credential values, such as connection tokens, from events and output before storing them. The API reference shows the exact stream format.

Cancelling a run

POST /v1/runs/{id}/cancel stops a run that is reserving, queued, starting or running. The worker is stopped and the microVM is terminated. Cancelling a run that has already finished changes nothing.

Cancellation cannot undo external actions
If the agent already called an API that changed something, such as issuing a refund, cancelling the run does not reverse it. The same applies to runs that fail, time out or are interrupted. Ephemeral never retries a run automatically, so a side effect is not repeated either.

Zero data retention

Set zero_data_retention to true on a run, or in a saved workflow, when the task is sensitive. Ephemeral then records nothing of the run's content: you only get the output.

KeptNot kept
Run ID, organization, status, timestamps, schedule, cost and usage figures, and a generic error category with no worker text.Events and output once delivered, worker error text, and the run's definition: prompt, input, file list and connection references. A run's definition cannot be fetched or run again.
  • Events still stream while the run works, through GET /v1/runs/{id}/events on any engine. They are held in a transient store and deleted a few minutes after the run ends.
  • The output is returned once. The first GET /v1/runs/{id} after the run ends includes it and deletes it. With a callback, the callback delivers it and reads leave it in place until then. Either way it is deleted after at most an hour. output_available and output_expires_at say whether it is still held.
  • Model calls go only to providers that neither retain your data nor train on it. A model with no such provider is refused with 400 before anything is reserved.
  • On the hosted service the run costs 10% more: the surcharge applies to compute, model calls and web requests, counts toward the budget and appears in the cost breakdown. Self-hosted installations charge nothing extra.
  • Transient data lives in tables that every backup leaves out, so a restored database never contains it.

After a run

The run keeps its output, error message, timestamps, events and cost. Treat the cost as final once the status is final and billing_pending is false; see budgets and billing.

Finished runs are deleted 30 days after they end, together with their events. A run is kept longer while its billing, callback delivery or microVM cleanup is still pending. Self-hosted installations can change the retention period.

To run the same task again, fetch GET /v1/runs/{id}/definition. It returns the definition the run actually used, with credentials removed, so you can review it, set a new budget and submit it.

A run definition keeps the prompt, input and inline file contents you sent. Do not put secrets in them; use a saved connection instead.
© 2026 EphemeralProduced by erni.works
esc

Nothing matches “”.