Start runs, follow them and read their results. Every endpoint on this page works with member and admin keys. See runs for the lifecycle and limits.
Start a run
/v1/runsprompt or the name of a saved workflow.promptstringworkflow is set; with a workflow, it replaces the saved prompt. Up to 128 KiB.inputany JSONworkflowstringmodelstringdefault_model from GET /v1/models.filesarray{"file": "<id or name>", "path": "..."} or {"path": "...", "content": "..."}. See files.connectionsobject{"ref": "<saved name>"} with optional allowed_methods or allowed_tools, or an inline definition. See connections.descriptionstringinput_schemaobjectinput must match; a mismatch returns 400 with the path and reason, such as input.city: required. With a workflow, it replaces the saved schema. See describing inputs and outputs.output_schemaobjectfailed. With a workflow, it replaces the saved schema. See describing inputs and outputs.timeout_secondsintegershellbooleantrue. The shell has no network access: web requests go through web, and pip or npm cannot download packages. Python 3.14 with common packages is preinstalled (GET /v1/me lists them); any other Python package can come as a wheel in files, installed with pip install --no-index and the wheel's path as listed in the agent's task.webboolean | objecttrue, or { "allow": [domains], "search": false } to limit it. Default off. Fetches follow each site's robots.txt, including its rules for every crawler (User-agent: *); a refused fetch reaches the agent as an error, not as an empty page. See web access.zero_data_retentionbooleanfalse.max_cost_microsintegerdefault_max_cost_micros from GET /v1/me. On the hosted service it must cover the run fee plus the compute charge for the full timeout (10% more for zero data retention); a smaller budget is refused with 400 and a budget object that gives the figures. See budgets.callbackobject{"url": "...", "secret": "..."} for a signed request when the run ends. See callbacks. A run cannot have both callback and notify.notifyobject{"connection": "team-chat", "path": "/hooks/ephemeral", "on": "failure"}. When the run has finished and its cost is final, Ephemeral posts JSON to the saved HTTP connection, with the connection's credentials: {"event": "run.finished", "run": {…}, "text": "one line"}, with the headers X-Ephemeral-Event and X-Ephemeral-Run. The connection must allow POST. path is relative to its URL. on is always (default) or failure. Failed deliveries are retried with backoff. See being told when a run ends.outputsstring[]/tmp/. Each is saved as an organization file named runs/<run id>/<path>, at most 10 MiB each and 25 MiB per run. A missing file becomes an output_missing event; the run does not fail. A run without a shell writes them with the save_output tool. See outputs.statestringstate_get, state_set, state_delete and state_list. Writes it makes count toward the run's cost.Idempotency-Keystring200.curl $EPHEMERAL_URL/v1/runs \
-H "Authorization: Bearer $EPHEMERAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7d0f3c1e-6a52-4b8e-9f21-0c4d5e6a7b89" \
-d '{
"workflow": "investigate-payment",
"input": { "payment_id": "pay_123" },
"max_cost_micros": 500000
}'The response is 202 Accepted with the new run object. A request that fails validation returns 400 and creates nothing. On the hosted service, 402 means your available credits do not cover the budget.
The run object
idstringrun_4abb0f420c6623a12d2889610eb67284.statusstringreserving, queued, starting, running, succeeded, failed, cancelled, timed_out or interrupted.outputstringerrorstringWorker failed: Model request failed: …. External actions may have completed.. A run whose sandbox could not be started says so and that no run fee was charged, and can be retried. A zero-data-retention run's error stays generic. Omitted when empty.workflowstringworkflow_versionintegerprogressobjectreport_progress tool: message, percent and at. Not set for zero-data-retention runs.filesarrayid, name, path, size and content_type. See files a run saves.modelstringcreated_attimestampstarted_attimestampfinished_attimestampmax_cost_microsintegercost_microsintegerbilling_pending is false on a finished run. Omitted when zero.billing_pendingbooleanschedule_idstringqueue_reasonstringqueued: organization_limit when your organization already has its most runs in progress, capacity when every worker is busy. Omitted otherwise, and in run lists.zero_data_retentionbooleantrue for a zero-data-retention run.surcharge_percentintegerrun_fee_microsintegercost_micros. Omitted when zero.markup_percentintegermarkup_microsintegercost_micros added by that percentage. Omitted when zero.surcharge_microsintegercost_micros added by the zero-data-retention surcharge. Omitted when zero.output_availablebooleanoutput_expires_attimestamp{
"id": "run_4abb0f420c6623a12d2889610eb67284",
"status": "succeeded",
"output": "The card issuer declined pay_123 for insufficient funds. The processor had no incidents. Ask the customer to retry or use another card.",
"model": "anthropic/claude-haiku-5.5",
"created_at": "2026-10-03T09:14:05.118Z",
"started_at": "2026-10-03T09:14:05.402Z",
"finished_at": "2026-10-03T09:14:41.877Z",
"max_cost_micros": 500000,
"cost_micros": 14390,
"billing_pending": false
}List runs
/v1/runslimitintegercursorstringnext_cursor from the previous page.statusstringschedulestring{
"items": [
{ "id": "run_91c0…", "status": "failed", "error": "Worker failed: Model request failed: the provider is overloaded. External actions may have completed.", "created_at": "2026-10-03T08:51:12.004Z", "max_cost_micros": 500000, "cost_micros": 61200, "billing_pending": false },
{ "id": "run_3fd2…", "status": "failed", "error": "Credit reservation failed", "created_at": "2026-10-02T17:20:44.390Z", "max_cost_micros": 500000, "billing_pending": false }
],
"next_cursor": "eyJvIjoib3JnXzVlMmIi…"
}Without limit or cursor, the response is a plain array of the 100 most recent matching runs. See pagination.
Get a run
/v1/runs/{id}Start a batch of runs
/v1/batchesThe body is a run request without input: a prompt or a workflow and any other run fields, given once for every run. Every input is checked against the input_schema before any run starts. If one fails, no run starts and the 400 response lists each failure in errors, with its index and a reason such as inputs[3].url: required.
inputsarray{"input": ..., "model": "...", "idempotency_key": "..."}. idempotency_key is optional and replaces the one derived from the batch's key. model is optional and runs that input with another model, so one batch can compare models on the same task; when the runs use more than one model, the batch summary gains by_model with each model's runs, statuses, cost and whether it is final.max_total_cost_microsintegermax_cost_micros is above it, so the batch can never cost more. It is a check, not a shared budget: each run keeps its own cap.Idempotency-Keystring200. Each input without its own key gets the key followed by : and its index.curl $EPHEMERAL_URL/v1/batches \
-H "Authorization: Bearer $EPHEMERAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: payments-2026-11-30" \
-d '{
"workflow": "investigate-payment",
"max_cost_micros": 500000,
"inputs": [
{ "input": { "payment_id": "pay_123" } },
{ "input": { "payment_id": "pay_124" } }
]
}'{
"batch_id": "bat_0c6e2f1a9b8d4c7e5f3a2b1c0d9e8f7a",
"created_at": "2026-11-30T09:00:00.000Z",
"run_ids": ["run_4abb0f420c6623a12d2889610eb67284", "run_91c0e5d2a7b34f18c6d09e2b5a7f3c41"],
"model": "anthropic/claude-haiku-5.5",
"summary": {
"total": 2,
"finished": 0,
"by_status": { "queued": 2 },
"total_cost_micros": 120000,
"cost_final": false,
"pending_run_ids": ["run_4abb0f420c6623a12d2889610eb67284", "run_91c0e5d2a7b34f18c6d09e2b5a7f3c41"]
}
}The response is 202 Accepted. Each run is an ordinary run: it has its own budget, is billed on its own and waits in the queue when your organization already has its most runs in progress. Check that limit and your credit with GET /v1/me first. On the hosted service, 402 means your available credits do not cover every run's budget, and nothing starts. If the runs cannot all be admitted (for example, a budget that your credits no longer cover), the response says which input failed in failed_index and lists the runs already started in admitted_run_ids. Retrying with the same Idempotency-Key keeps them and starts the rest.
Get a batch
/v1/batches/{id}total_cost_micros is final when cost_final is true: every run has finished and its billing has settled. Until then pending_run_ids lists the runs to wait for.Stream events
/v1/runs/{id}/eventsdone with the run object and closes.Last-Event-IDinteger: connected
id: 88412
event: status
data: {"id":88412,"type":"status","data":{"status":"running"},"created_at":"2026-10-03T09:14:05.431Z"}
id: 88415
event: worker_started
data: {"id":88415,"type":"worker_started","data":{"runtime":"pi","mode":"pi","shell":false},"created_at":"2026-10-03T09:14:07.906Z"}
id: 88419
event: tool_start
data: {"id":88419,"type":"tool_start","data":{"tool":"http_0","id":"call_1","arguments":{"method":"GET","path":"/payments/pay_123"}},"created_at":"2026-10-03T09:14:10.215Z"}
id: 88431
event: result
data: {"id":88431,"type":"result","data":{"output":"The card issuer declined pay_123 for insufficient funds."},"created_at":"2026-10-03T09:14:41.702Z"}
event: done
data: {"id":"run_4abb0f420c6623a12d2889610eb67284","status":"succeeded", …}Each message's data is an event object with id, type, data and created_at, except done, which carries the run object. Lines starting with a colon are comments; a heartbeat comment is sent every 15 seconds. The event types are listed under event types. Disconnecting does not cancel the run.
curl -N $EPHEMERAL_URL/v1/runs/run_4abb0f420c6623a12d2889610eb67284/events \
-H "Authorization: Bearer $EPHEMERAL_API_KEY"Read events as JSON
/v1/runs/{id}/events?format=jsonafterinteger0. Pass next_after from the previous page.limitintegertypestringmax_string_bytesintegermax_bytesinteger{
"run_id": "run_91c0…",
"status": "failed",
"events": [
{ "id": 88415, "type": "worker_error", "data": { "message": "Model request failed: the provider is overloaded" }, "created_at": "2026-10-03T08:51:40.210Z" }
],
"next_after": 88415,
"has_more": false
}While has_more is true, call again with after set to next_after. The MCP tool get_run_events wraps this endpoint.
Estimate the cost of runs
/v1/estimatesworkflowstringpromptstringmodelstringrunsintegermax_cost_microsintegerdefault_max_cost_micros.zero_data_retentionbooleanThe answer holds runs, model, basis (the workflow or prompt, matched_runs, succeeded and since), per_run (typical_micros, high_micros, min_seen_micros, max_seen_micros and cap_micros), total (typical_micros, high_micros and cap_micros), typical_seconds and a note. Typical is the median and high the 90th percentile of your settled runs of the same workflow or prompt with the same model, still within the retention window. With no history, only the cap is known. The MCP tool is estimate_cost.
Cancel a run
/v1/runs/{id}/cancelreserving, queued, starting or running, and returns the run object. A run that has already finished is returned unchanged.Delete a run
/v1/runs/{id}409: cancel it first. What the run cost stays charged. The files it saved stay in your files unless you add ?delete_files=true. The MCP tool is delete_runs, for up to 100 runs at once; in the dashboard, use Delete on the run's page.Read a run definition
/v1/runs/{id}/definition{
"request": {
"prompt": "Find out why this payment failed. Follow the playbook.",
"model": "anthropic/claude-haiku-5.5",
"files": [{ "file": "file_9c41d2a07be35f1e8a6c0d4b9e2f7a13", "path": "playbook.md" }],
"connections": {
"payments": { "ref": "payments-api", "allowed_methods": ["GET"] },
"crm": { "type": "http", "url": "https://api.example.com", "allowed_methods": ["GET"] }
},
"timeout_seconds": 120,
"shell": false,
"max_cost_micros": 500000,
"input": { "payment_id": "pay_123" }
},
"requires_credentials": ["crm"]
}request is the resolved definition. File names are replaced by the IDs that were used, and a workflow's saved fields are filled in. The workflow name and callback are left out. Saved connections keep only their reference and allowlists. Inline connections lose their credentials and any secrets in their URL.
requires_credentials lists inline connections that need credentials or their original URL restored. To run it again, add those back, choose a new max_cost_micros, and send the request to POST /v1/runs. Saved connection references are resolved again at that point, and the request fails if a referenced file or connection has been deleted.
Zero data retention runs
Zero data retention covers what Ephemeral records about a run: its events, output and definition. Files and state a run is told to save are your storage, kept as your retention settings say.
A run with zero_data_retention returns its output once. The first GET /v1/runs/{id} after it finishes includes output and deletes it; later reads omit it and report output_available: false. When the run has a callback, the callback delivers the output, and GET leaves it in place until then. An undelivered output is deleted after at most an hour.
The event stream works while the run works and for a few minutes afterwards. GET /v1/runs/{id}/definition returns 410, and run lists never include output. On the hosted service cost_micros includes the surcharge, and the budget must cover it.