Create a run
Starts a coding agent on your prompt in a fresh sandbox. A one-shot run, the default, ends when the agent finishes; otherwise the run waits idle for follow-up prompts until you end it or it times out. Send an Idempotency-Key header to retry without creating a second run. The run gets the label started_by: key:<id>, with the id of the API key that created it, in place of any started_by you send. Runs start only while your organization’s balance is above $0.
Authorizations
An API key of your organization, starting with trk_, sent as Authorization: Bearer <key>.
Headers
A unique value you choose, up to 255 characters, to retry safely: a request with a key already used in your organization returns the run the first request created, without starting another, whatever its body.
1 - 255Body
The coding agent and the model it uses.
What you ask the agent to do first.
1Up to 20 uploaded file ids, staged in the sandbox before setup and referenced in the first prompt.
20Reference returned when requesting a file upload.
Labels you attach to the run to find it again, as keys and values, such as { "ticket": "ENG-42" }. We never read them. Keys match ^[A-Za-z0-9_.-]{1,64}$; at most 20 labels with values of up to 256 characters.
Maximum the run may spend, in US dollars. Defaults to a standard budget when omitted. The run ends with budget_exceeded once it is reached.
0.01 <= x <= 10000Whether the run ends as soon as its first prompt finishes. Defaults to true. Set it to false to send follow-up prompts while the run is idle.
How long the run waits for a follow-up prompt before it ends with idle_timeout, in seconds, from 120 to 900. Defaults to 900. Only allowed when one_shot is false.
120 <= x <= 900Longest the run may last, in seconds from when it starts, from 60 to 43200. Defaults to 7200. Once reached, the run ends with time_limit, even in the middle of a prompt.
60 <= x <= 43200Response
A coding agent working on your prompt in an isolated sandbox.
- Option 1
- Option 2
- Option 3
A coding agent working on your prompt in an isolated sandbox.
Unique identifier of the run.
Labels you attach to the run to find it again, as keys and values, such as { "ticket": "ENG-42" }. We never read them. Keys match ^[A-Za-z0-9_.-]{1,64}$; at most 20 labels with values of up to 256 characters.
The coding agent and the model it uses.
What the agent works on.
Whether the run ends as soon as its first prompt finishes.
Longest the run may last, in seconds from when it starts.
-9007199254740991 <= x <= 9007199254740991One instruction to the agent and the work it did in response.
- Option 1
- Option 2
preparing while its sandbox gets ready, working while the agent works on a prompt, idle while it waits for a follow-up prompt.
preparing, working, idle How long the run waits for a follow-up prompt before it ends, in seconds. Absent for a one-shot run.
-9007199254740991 <= x <= 9007199254740991