Create runs in a batch
create_runsStart up to 100 runs of one task with different inputs in one call, and return at once with batch_id, run_ids (in input order), model and a summary. Give the definition once (everything create_run takes except input: a prompt or a saved workflow, input_schema, output_schema, model, web, shell, files, connections, timeout_seconds, max_cost_micros, zero_data_retention) and inputs, one item per run: {input, idempotency_key?, model?}. An item's model replaces the batch's for that run, so one batch can compare models on the same input; when the runs use more than one model, the summary's by_model gives each model's runs, statuses and total cost side by side. Every input is checked against input_schema before any run starts: if one fails, no run starts and the error lists each failure with its index, such as "inputs[3].url: required". Each run is an ordinary run: it has its own max_cost_micros cap, is queued and billed on its own, and counts toward the organization's concurrency limit, so runs beyond it wait in the queue (queue_reason organization_limit). Call get_account first for the limit and the available credit; on the hosted service a batch whose runs' caps together exceed the available credit is refused before it starts. max_total_cost_micros refuses the batch when the number of runs times max_cost_micros exceeds it: a bound on the most the batch can cost, not a shared budget. idempotency_key makes a retry return the same batch instead of starting the runs again; each input without its own key gets <idempotency_key>:. If admission stops part way (for example the wallet refuses a reservation), the error lists admitted_run_ids, and a retry with the same key keeps them and starts the rest. Follow the runs with wait_for_runs and the batch_id. Costs are provisional until cost_final is true. On the hosted service a run costs a run fee once its worker starts, compute per second, model calls at the provider's price plus a percentage, and web requests and searches at flat prices; get_account (REST: GET /v1/me) reports the rates.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"inputs": "<inputs>"
},
"name": "create_runs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| web | No | Web access through Ephemeral's web_fetch and web_search tools: true, false, or an object limiting it. Fetches follow each site's robots.txt, including its rules for every crawler (User-agent: *) when none name EphemeralBot; a refused fetch reaches the agent as an error saying why, not as an empty page, and is not charged. | |
| files | No | Files placed in the sandbox: inline content, or a file saved in the organization. | |
| model | No | A model id from list_models. Omit for the default. | |
| shell | No | Whether the agent may run shell commands in its sandbox (default true). The shell has no network access: web requests go through the web tools (see web), and pip or npm cannot download packages. Python 3.14 with common packages is preinstalled; get_account lists them (python_version, preinstalled_python_packages). Any other Python package can come as a wheel in files, installed with pip install --no-index <path>, where <path> is the wheel's path as listed in the agent's task: files are mounted read-only there, not in the shell's working directory. | |
| state | No | A state store the agent may read and write with its state tools (state_get, state_set, state_delete, state_list), kept across runs: for example, a scheduled run keeps what it saw and reports only what changed since the previous run. Any name: the store is created with its first entry. State is billed with storage, and each write the agent makes is charged to the run (get_storage). | |
| inputs | Yes | One item per run, in order: the run's input and, optionally, its own idempotency key. | |
| notify | No | Tell a saved HTTP connection when every run of the batch has finished and settled (one delivery for the whole batch, with its summary and runs): Ephemeral POSTs JSON (event, the run or batch with its status, output, error and final cost, and a one-line text) to the connection's URL plus path, with the connection's own credentials. The connection must be an HTTP connection that allows POST (see list_connections); a failed delivery is retried for a while. | |
| prompt | No | What the agent should do. Required unless workflow is set. | |
| outputs | No | Files the agent makes that are saved when the run ends, such as ["chart.png", "/tmp/report.docx"]: paths relative to the agent's working directory, or under /tmp/. The agent is told to write them there. Each becomes an organization file named runs/<run id>/<path>, listed in the finished run's files (with its id) and by list_files with run_id; read one with read_file. At most 20 files, 10 MiB each and 25 MiB in all; a missing path is reported in the run's events (output_missing), not as a failure. Stored files are billed with storage (get_storage). | |
| workflow | No | Name of a saved workflow to run instead of a prompt (see list_workflows). | |
| connections | No | Saved connections the agent may use, keyed by the name the agent sees. Each refers to a connection saved in the organization and can only narrow it. | |
| description | No | What the workflow does and what input it expects, in a sentence or two, for people and agents. At most 500 characters. | |
| input_schema | No | A JSON Schema (draft 2020-12 or 7, at most 32 KiB, no references to other documents) that this run's input must match. A run whose input does not match is refused with the path and the reason, such as "input.city: required". | |
| output_schema | No | A JSON Schema (draft 2020-12 or 7, at most 32 KiB, no references to other documents) that this run's output must match. The agent is told the schema and asked to reply with JSON only; the output is then checked, and a run whose output does not match fails with the reason. | |
| idempotency_key | No | A retry with the same key returns the original batch instead of starting its runs again. | |
| max_cost_micros | No | Cost cap in millionths of a dollar; the run stops at the cap. Defaults to default_max_cost_micros (get_account). On the hosted service it must cover at least the run fee plus compute for the whole timeout: run_fee_micros + timeout_seconds x compute_micros_per_second, plus zdr_surcharge_percent for a zero-data-retention run (rates from get_account). A smaller cap is refused, and the error's budget object gives the figures, required_max_cost_micros for this timeout and longest_timeout_seconds for this cap. | |
| timeout_seconds | No | Wall-clock limit for the run, in seconds: default 300 (the workflow's, if it has one), at most 3600. On the hosted service max_cost_micros must cover compute for all of it. | |
| zero_data_retention | No | Record nothing of the run's content: no events kept, no definition, and the output kept only briefly and released on first retrieval. Output files and state the run is told to save are your storage and are kept as your retention policy says. | |
| max_total_cost_micros | No | Refuse the batch if the number of runs times max_cost_micros exceeds this, in millionths of a dollar. |