API

Sandboxes

Read the containers that agents run in, and their live metrics.

GET
/sandboxes/capacity

Query Parameters

orgId?string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/sandboxes/capacity"
{  "orgId": "string",  "running": 0,  "limit": 1,  "waiting": [    {      "issueId": "string",      "projectId": "string",      "role": "string",      "reason": "org",      "waitedMs": 0    }  ],  "platformSaturated": true,  "capturedAt": 0}
GET
/sandboxes

Query Parameters

projectId?string
status?string

How the agent's run in this sandbox stands. running: the agent works now. completed: the agent finished its work. stopped: something ended the run on purpose before it finished, for example a newer run, a stop of the mission or a person. failed: the agent reported a failure, or exited without a report. stale: the platform closed the run without a report, after its time limit or after a later attempt replaced it.

Value in

  • "running"
  • "stale"
  • "completed"
  • "stopped"
  • "failed"
issueId?string

Only the runs of this mission, by its issue id (for example ENG-42).

Length1 <= length
role?string

Only the runs of this agent role.

Value in

  • "planner"
  • "builder"
  • "reviewer"
  • "qa"
limit?integer
Range1 <= value <= 500
Default200
cursor?string

nextCursor from the previous page, with the same filters. Leave it out for the newest runs.

Length1 <= length

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/sandboxes"
{  "data": [    {      "sandboxId": "string",      "issueId": "string",      "projectId": "string",      "role": "string",      "harness": "string",      "harnessVersion": "string",      "runId": "string",      "status": "running",      "terminationReason": "string",      "instanceType": "string",      "createdAt": 0,      "timeoutAt": 0,      "lastHeartbeatAt": 0,      "endedAt": 0,      "lastCpuPct": 0,      "lastMemUsedMb": 0,      "lastMemTotalMb": 0,      "lastDiskUsedPct": 0,      "lastMetricAt": 0    }  ],  "nextCursor": "string"}
GET
/sandboxes/{sandboxId}

Path Parameters

sandboxId*string
Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://example.com/sandboxes/string"
{  "sandbox": {    "sandboxId": "string",    "issueId": "string",    "projectId": "string",    "role": "string",    "harness": "string",    "harnessVersion": "string",    "runId": "string",    "status": "running",    "terminationReason": "string",    "instanceType": "string",    "createdAt": 0,    "timeoutAt": 0,    "lastHeartbeatAt": 0,    "endedAt": 0,    "lastCpuPct": 0,    "lastMemUsedMb": 0,    "lastMemTotalMb": 0,    "lastDiskUsedPct": 0,    "lastMetricAt": 0  },  "runSessionId": "string",  "metrics": [    {      "t": 0,      "cpuPct": 0,      "memUsedMb": 0,      "memTotalMb": 0,      "diskUsedPct": 0    }  ],  "sessions": [    {      "role": "string",      "sessionId": "string",      "ts": "string",      "outcome": "string",      "logKey": "string",      "systemKey": "string",      "totalCostUsd": 0    }  ],  "liveFragments": [    {      "kind": "thought",      "t": 0,      "body": "string",      "action": "string",      "parameter": "string",      "result": "string",      "toolUseId": "string",      "items": [        {          "content": "string",          "status": "string"        }      ]    }  ]}
GET
/sandboxes/{sandboxId}/logs

Path Parameters

sandboxId*string
Length1 <= length

Query Parameters

role*string
sessionId*string
part?string
Default"session"

Value in

  • "session"
  • "system"
  • "prompt"

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/sandboxes/string/logs?role=string&sessionId=string"
{  "sandboxId": "string",  "role": "string",  "sessionId": "string",  "part": "session",  "content": "string",  "bytes": 0,  "promptScope": "repo-contributed",  "promptSpans": [    {      "id": "string",      "content": "string",      "kind": "repo-conventions"    }  ]}
POST
/sandboxes/{sandboxId}/stop

Path Parameters

sandboxId*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/sandboxes/string/stop"
{  "ok": true,  "sandboxId": "string"}
GET
/sandboxes/{sandboxId}/events

Path Parameters

sandboxId*string
Length1 <= length

Query Parameters

since?|

The id of the last event that you have. The stream sends the events after it, at most the newest 800. Ids count up by one, so a jump shows that older events were left out. Without a cursor, the stream starts with the last 20 events of the run. A Last-Event-ID header has the same effect.

Range0 <= value
maxSeconds?integer

The longest time that the stream stays open, in seconds (default 300, at most 600). At that time the stream sends end with the reason time_cap.

Range1 <= value <= 600
Default300

Response Body

text/event-stream

application/json

application/json

curl -X GET "https://example.com/sandboxes/string/events"
{  "event": "state",  "data": {    "sandboxId": "string",    "issueId": "string",    "role": "string",    "status": "running",    "stage": "pending"  }}

How is this page?