{"openapi":"3.1.0","info":{"title":"Harner","description":"Harner (harner.dev) runs the Pi coding agent as a service: on-demand sandboxes, streaming events, interactive questions, and durable task results.","version":"1.0.0"},"paths":{"/v1/health":{"get":{"tags":["meta"],"summary":"Health","description":"Unauthenticated on purpose: container and load-balancer probes use it.","operationId":"health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/version":{"get":{"tags":["meta"],"summary":"Version","operationId":"version_v1_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionInfo"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/metrics":{"get":{"tags":["meta"],"summary":"Metrics","operationId":"metrics_v1_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Metrics V1 Metrics Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes":{"post":{"tags":["sandboxes"],"summary":"Create Sandbox","operationId":"create_sandbox_v1_sandboxes_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["sandboxes"],"summary":"List Sandboxes","operationId":"list_sandboxes_v1_sandboxes_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["creating","running","degraded","stopped","recovering","destroyed","error"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Sandbox"},"title":"Response List Sandboxes V1 Sandboxes Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}":{"get":{"tags":["sandboxes"],"summary":"Get Sandbox","operationId":"get_sandbox_v1_sandboxes__sandbox_id__get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxDetail"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["sandboxes"],"summary":"Destroy Sandbox","operationId":"destroy_sandbox_v1_sandboxes__sandbox_id__delete","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"keep_volume","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Keep Volume"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/stop":{"post":{"tags":["sandboxes"],"summary":"Stop Sandbox","operationId":"stop_sandbox_v1_sandboxes__sandbox_id__stop_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/start":{"post":{"tags":["sandboxes"],"summary":"Start Sandbox","operationId":"start_sandbox_v1_sandboxes__sandbox_id__start_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/restart":{"post":{"tags":["sandboxes"],"summary":"Restart Sandbox","operationId":"restart_sandbox_v1_sandboxes__sandbox_id__restart_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/recreate":{"post":{"tags":["sandboxes"],"summary":"Recreate Sandbox","description":"Rebuild the container around the same workspace.\n\nRestarting reuses the container it already has, image and all, so this is the\nonly way to move a persistent sandbox onto a newly built image — which is what\nupgrading Pi requires. The volume, and therefore the workspace, the session\nhistory and the event log, are kept.","operationId":"recreate_sandbox_v1_sandboxes__sandbox_id__recreate_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/prompt":{"post":{"tags":["sandboxes"],"summary":"Prompt","operationId":"prompt_v1_sandboxes__sandbox_id__prompt_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptOutcome"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/abort":{"post":{"tags":["sandboxes"],"summary":"Abort","operationId":"abort_v1_sandboxes__sandbox_id__abort_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Abort V1 Sandboxes  Sandbox Id  Abort Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/wait":{"get":{"tags":["sandboxes"],"summary":"Wait","operationId":"wait_v1_sandboxes__sandbox_id__wait_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"after_seq","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"After Seq"}},{"name":"timeout_s","in":"query","required":false,"schema":{"type":"number","maximum":86400,"exclusiveMinimum":0,"default":60,"title":"Timeout S"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptOutcome"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/exec":{"post":{"tags":["sandboxes"],"summary":"Execute","operationId":"execute_v1_sandboxes__sandbox_id__exec_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecResult"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/command":{"post":{"tags":["sandboxes"],"summary":"Raw Command","description":"Escape hatch: send any Pi RPC command verbatim.","operationId":"raw_command_v1_sandboxes__sandbox_id__command_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Raw Command V1 Sandboxes  Sandbox Id  Command Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/state":{"get":{"tags":["sandboxes"],"summary":"State","operationId":"state_v1_sandboxes__sandbox_id__state_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response State V1 Sandboxes  Sandbox Id  State Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/messages":{"get":{"tags":["sandboxes"],"summary":"Messages","operationId":"messages_v1_sandboxes__sandbox_id__messages_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Messages V1 Sandboxes  Sandbox Id  Messages Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/stats":{"get":{"tags":["sandboxes"],"summary":"Stats","operationId":"stats_v1_sandboxes__sandbox_id__stats_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Stats V1 Sandboxes  Sandbox Id  Stats Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/model":{"post":{"tags":["sandboxes"],"summary":"Set Model","operationId":"set_model_v1_sandboxes__sandbox_id__model_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetModelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Set Model V1 Sandboxes  Sandbox Id  Model Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/thinking":{"post":{"tags":["sandboxes"],"summary":"Set Thinking","operationId":"set_thinking_v1_sandboxes__sandbox_id__thinking_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetThinkingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Set Thinking V1 Sandboxes  Sandbox Id  Thinking Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/session/new":{"post":{"tags":["sandboxes"],"summary":"New Session","operationId":"new_session_v1_sandboxes__sandbox_id__session_new_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response New Session V1 Sandboxes  Sandbox Id  Session New Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/compact":{"post":{"tags":["sandboxes"],"summary":"Compact","operationId":"compact_v1_sandboxes__sandbox_id__compact_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Compact V1 Sandboxes  Sandbox Id  Compact Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/extensions":{"get":{"tags":["sandboxes"],"summary":"List Extensions","operationId":"list_extensions_v1_sandboxes__sandbox_id__extensions_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response List Extensions V1 Sandboxes  Sandbox Id  Extensions Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["sandboxes"],"summary":"Install Extension","description":"Install a Pi extension — the plugin mechanism for tools and integrations.\n\nFetching one needs network access, so a `network: \"none\"` sandbox cannot.\nPi reads its extension list at session start, so a new session picks it up.","operationId":"install_extension_v1_sandboxes__sandbox_id__extensions_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionInstall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Install Extension V1 Sandboxes  Sandbox Id  Extensions Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/extensions/remove":{"post":{"tags":["sandboxes"],"summary":"Remove Extension","operationId":"remove_extension_v1_sandboxes__sandbox_id__extensions_remove_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionInstall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Remove Extension V1 Sandboxes  Sandbox Id  Extensions Remove Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/skills":{"get":{"tags":["sandboxes"],"summary":"List Skills","operationId":"list_skills_v1_sandboxes__sandbox_id__skills_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response List Skills V1 Sandboxes  Sandbox Id  Skills Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/skills/{name}":{"put":{"tags":["sandboxes"],"summary":"Install Skill","description":"Install a capability package the agent can load on demand.\n\nDiscovery happens when a Pi session starts, so the skill applies from the\nnext session — POST /session/new to pick it up immediately.","operationId":"install_skill_v1_sandboxes__sandbox_id__skills__name__put","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillInstall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Install Skill V1 Sandboxes  Sandbox Id  Skills  Name  Put"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["sandboxes"],"summary":"Delete Skill","operationId":"delete_skill_v1_sandboxes__sandbox_id__skills__name__delete","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/questions":{"get":{"tags":["sandboxes"],"summary":"List Questions","operationId":"list_questions_v1_sandboxes__sandbox_id__questions_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response List Questions V1 Sandboxes  Sandbox Id  Questions Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/questions/{qid}/answer":{"post":{"tags":["sandboxes"],"summary":"Answer Question","operationId":"answer_question_v1_sandboxes__sandbox_id__questions__qid__answer_post","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"qid","in":"path","required":true,"schema":{"type":"string","title":"Qid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Answer Question V1 Sandboxes  Sandbox Id  Questions  Qid  Answer Post"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/files":{"get":{"tags":["files"],"summary":"List Files","operationId":"list_files_v1_sandboxes__sandbox_id__files_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"path","in":"query","required":false,"schema":{"type":"string","default":".","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileEntry"},"title":"Response List Files V1 Sandboxes  Sandbox Id  Files Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/files/content":{"get":{"tags":["files"],"summary":"Download File","operationId":"download_file_v1_sandboxes__sandbox_id__files_content_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["files"],"summary":"Upload File","operationId":"upload_file_v1_sandboxes__sandbox_id__files_content_put","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["files"],"summary":"Delete File","operationId":"delete_file_v1_sandboxes__sandbox_id__files_content_delete","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/archive":{"get":{"tags":["files"],"summary":"Archive","operationId":"archive_v1_sandboxes__sandbox_id__archive_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/events":{"get":{"tags":["events"],"summary":"Poll Events","description":"Long-poll. Proxied straight to the runner, so it works even if the relay does not.","operationId":"poll_events_v1_sandboxes__sandbox_id__events_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}},{"name":"wait","in":"query","required":false,"schema":{"type":"number","maximum":300,"minimum":0,"default":0,"title":"Wait"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20000,"minimum":1,"default":5000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sandboxes/{sandbox_id}/events/sse":{"get":{"tags":["events"],"summary":"Sse Events","operationId":"sse_events_v1_sandboxes__sandbox_id__events_sse_get","parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/events":{"get":{"tags":["events"],"summary":"Poll","description":"Long-poll every state change, across all sandboxes and tasks.\n\n`oldest` tells a caller whether its cursor fell off the end of the buffer —\nthis is a live feed, so a client that was away long enough has to accept the\ngap and pick up from `head`.","operationId":"poll_v1_events_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}},{"name":"wait","in":"query","required":false,"schema":{"type":"number","maximum":300,"minimum":0,"default":0,"title":"Wait"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"default":1000,"title":"Limit"}},{"name":"task_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"comma-separated event types","title":"Kind"},"description":"comma-separated event types"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/events/sse":{"get":{"tags":["events"],"summary":"Sse","operationId":"sse_v1_events_sse_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/tasks":{"post":{"tags":["tasks"],"summary":"Create Task","description":"With `wait` (the default) this returns when the task finishes *or* when the\nharness needs an answer — the caller replies via /tasks/{id}/answer and the task\ncontinues. Without it, the task runs in the background and is polled.","operationId":"create_task_v1_tasks_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["tasks"],"summary":"List Tasks","operationId":"list_tasks_v1_tasks_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","provisioning","running","awaiting_input","collecting","done","error","timeout","cancelled","interrupted"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"sandbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Task"},"title":"Response List Tasks V1 Tasks Get"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task","operationId":"get_task_v1_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["tasks"],"summary":"Cancel Task","operationId":"cancel_task_v1_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/tasks/{task_id}/transcript":{"get":{"tags":["tasks"],"summary":"Get Transcript","description":"What the agent actually did, kept after its sandbox is gone.\n\nThe result text is the conclusion; this is the work behind it. Captured\nbefore teardown, so it stays available for audit and debugging.","operationId":"get_transcript_v1_tasks__task_id__transcript_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20000,"minimum":1,"default":2000,"title":"Limit"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated event types to keep, e.g. tool_execution_end,agent_settled","title":"Kind"},"description":"Comma-separated event types to keep, e.g. tool_execution_end,agent_settled"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transcript"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/tasks/{task_id}/answer":{"post":{"tags":["tasks"],"summary":"Answer Task","description":"Answer the harness's question and resume the task.","operationId":"answer_task_v1_tasks__task_id__answer_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskAnswerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No such sandbox or task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflicts with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The sandbox is gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Body or upload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request did not validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited, or at capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unhandled failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The sandbox runner could not be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Docker, the image or the agent is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"504":{"description":"The runner timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"schemas":{"AnswerRequest":{"properties":{"value":{"title":"Value"}},"type":"object","title":"AnswerRequest"},"CommandRequest":{"properties":{"command":{"additionalProperties":true,"type":"object","title":"Command"},"timeout_s":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Timeout S","default":30}},"type":"object","required":["command"],"title":"CommandRequest","description":"Raw Pi RPC pass-through, e.g. {\"type\": \"set_model\", \"provider\": ..., \"modelId\": ...}."},"ErrorBody":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"detail":{"anyOf":[{},{"type":"null"}],"title":"Detail"},"request_id":{"type":"string","title":"Request Id","default":"-"}},"type":"object","required":["code","message"],"title":"ErrorBody"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorEnvelope"},"ExecRequest":{"properties":{"command":{"type":"string","minLength":1,"title":"Command"},"timeout_s":{"type":"integer","maximum":3600.0,"minimum":1.0,"title":"Timeout S","default":120},"raw":{"type":"boolean","title":"Raw","default":false}},"type":"object","required":["command"],"title":"ExecRequest"},"ExecResult":{"properties":{"output":{"type":"string","title":"Output"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"truncated":{"type":"boolean","title":"Truncated","default":false}},"type":"object","required":["output"],"title":"ExecResult"},"ExtensionInstall":{"properties":{"source":{"type":"string","maxLength":300,"minLength":1,"title":"Source"}},"type":"object","required":["source"],"title":"ExtensionInstall"},"FileEntry":{"properties":{"name":{"type":"string","title":"Name"},"path":{"type":"string","title":"Path"},"type":{"type":"string","enum":["file","dir","other"],"title":"Type"},"size":{"type":"integer","title":"Size"},"mtime":{"type":"number","title":"Mtime"}},"type":"object","required":["name","path","type","size","mtime"],"title":"FileEntry"},"Health":{"properties":{"status":{"type":"string","enum":["ok","degraded"],"title":"Status"},"docker":{"type":"string","enum":["ok","error"],"title":"Docker"},"image_present":{"type":"boolean","title":"Image Present"},"active_sandboxes":{"type":"integer","title":"Active Sandboxes"},"version":{"type":"string","title":"Version"},"uptime_s":{"type":"number","title":"Uptime S"},"fake_pi":{"type":"boolean","title":"Fake Pi","default":false},"degraded_sandboxes":{"type":"integer","title":"Degraded Sandboxes","default":0},"queued_tasks":{"type":"integer","title":"Queued Tasks","default":0},"reaper_last_run_age_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reaper Last Run Age S"}},"type":"object","required":["status","docker","image_present","active_sandboxes","version","uptime_s"],"title":"Health"},"PromptOutcome":{"properties":{"outcome":{"type":"string","enum":["settled","question","timeout","pi_dead","accepted","failed"],"title":"Outcome"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"question":{"anyOf":[{"$ref":"#/components/schemas/Question"},{"type":"null"}]},"seq":{"type":"integer","title":"Seq","default":0},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stats"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["outcome"],"title":"PromptOutcome"},"PromptRequest":{"properties":{"message":{"type":"string","minLength":1,"title":"Message"},"images":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Images"},"mode":{"type":"string","enum":["prompt","steer","follow_up"],"title":"Mode","default":"prompt"},"wait":{"type":"boolean","title":"Wait","default":true},"timeout_s":{"type":"integer","maximum":86400.0,"minimum":1.0,"title":"Timeout S","default":600}},"type":"object","required":["message"],"title":"PromptRequest"},"Question":{"properties":{"qid":{"type":"string","title":"Qid"},"method":{"type":"string","enum":["select","confirm","input","editor"],"title":"Method"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"created_at":{"type":"number","title":"Created At"},"expires_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Expires At"},"announced_seq":{"type":"integer","title":"Announced Seq","default":0}},"type":"object","required":["qid","method","created_at"],"title":"Question"},"Sandbox":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"agent":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Agent"},"mode":{"type":"string","enum":["temp","persistent"],"title":"Mode"},"network":{"type":"string","enum":["full","none"],"title":"Network"},"status":{"type":"string","title":"Status"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"thinking":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thinking"},"question_policy":{"type":"string","title":"Question Policy","default":"forward"},"idle_ttl_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Idle Ttl S"},"max_lifetime_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Lifetime S"},"restart_count":{"type":"integer","title":"Restart Count","default":0},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"number","title":"Created At"},"last_activity_at":{"type":"number","title":"Last Activity At"}},"type":"object","required":["id","mode","network","status","created_at","last_activity_at"],"title":"Sandbox"},"SandboxCreate":{"properties":{"api_key":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Api Key"},"system_prompt":{"anyOf":[{"type":"string","maxLength":32000},{"type":"null"}],"title":"System Prompt"},"append_system_prompt":{"anyOf":[{"type":"string","maxLength":32000},{"type":"null"}],"title":"Append System Prompt"},"instructions":{"anyOf":[{"type":"string","maxLength":64000},{"type":"null"}],"title":"Instructions"},"tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tools"},"exclude_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exclude Tools"},"skills":{"anyOf":[{"items":{"$ref":"#/components/schemas/SkillSpec"},"type":"array"},{"type":"null"}],"title":"Skills"},"extensions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extensions"},"mode":{"type":"string","enum":["temp","persistent"],"title":"Mode","default":"temp"},"network":{"anyOf":[{"type":"string","enum":["full","none"]},{"type":"null"}],"title":"Network"},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"thinking":{"anyOf":[{"type":"string","enum":["off","minimal","low","medium","high","xhigh","max"]},{"type":"null"}],"title":"Thinking"},"idle_ttl_s":{"anyOf":[{"type":"integer","maximum":604800.0,"minimum":0.0},{"type":"null"}],"title":"Idle Ttl S"},"max_lifetime_s":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Lifetime S"},"question_policy":{"anyOf":[{"type":"string","enum":["forward","auto"]},{"type":"null"}],"title":"Question Policy"},"question_timeout_s":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":5.0},{"type":"null"}],"title":"Question Timeout S"},"env":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Env"}},"type":"object","title":"SandboxCreate"},"SandboxDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"agent":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Agent"},"mode":{"type":"string","enum":["temp","persistent"],"title":"Mode"},"network":{"type":"string","enum":["full","none"],"title":"Network"},"status":{"type":"string","title":"Status"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"thinking":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thinking"},"question_policy":{"type":"string","title":"Question Policy","default":"forward"},"idle_ttl_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Idle Ttl S"},"max_lifetime_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Lifetime S"},"restart_count":{"type":"integer","title":"Restart Count","default":0},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"number","title":"Created At"},"last_activity_at":{"type":"number","title":"Last Activity At"},"runner":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Runner"},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stats"}},"type":"object","required":["id","mode","network","status","created_at","last_activity_at"],"title":"SandboxDetail"},"SetModelRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"}},"type":"object","required":["provider","model"],"title":"SetModelRequest"},"SetThinkingRequest":{"properties":{"level":{"type":"string","enum":["off","minimal","low","medium","high","xhigh","max"],"title":"Level"}},"type":"object","required":["level"],"title":"SetThinkingRequest"},"SkillInstall":{"properties":{"content":{"type":"string","maxLength":512000,"minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"SkillInstall"},"SkillSpec":{"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$","title":"Name"},"content":{"type":"string","maxLength":512000,"minLength":1,"title":"Content"}},"type":"object","required":["name","content"],"title":"SkillSpec"},"Task":{"properties":{"id":{"type":"string","title":"Id"},"sandbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Id"},"released_sandbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Released Sandbox Id"},"status":{"type":"string","title":"Status"},"prompt":{"type":"string","title":"Prompt"},"result":{"anyOf":[{"$ref":"#/components/schemas/TaskResult"},{"type":"null"}]},"question":{"anyOf":[{"$ref":"#/components/schemas/Question"},{"type":"null"}]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"attempts":{"type":"integer","title":"Attempts","default":0},"resume_count":{"type":"integer","title":"Resume Count","default":0},"keep_alive":{"type":"boolean","title":"Keep Alive","default":false},"webhook":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Webhook"},"queue_position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Queue Position"},"created_at":{"type":"number","title":"Created At"},"started_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["id","status","prompt","created_at"],"title":"Task"},"TaskAnswerRequest":{"properties":{"qid":{"type":"string","title":"Qid"},"value":{"title":"Value"},"wait":{"type":"boolean","title":"Wait","default":true},"timeout_s":{"type":"integer","maximum":86400.0,"minimum":1.0,"title":"Timeout S","default":600}},"type":"object","required":["qid"],"title":"TaskAnswerRequest"},"TaskCreate":{"properties":{"api_key":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Api Key"},"system_prompt":{"anyOf":[{"type":"string","maxLength":32000},{"type":"null"}],"title":"System Prompt"},"append_system_prompt":{"anyOf":[{"type":"string","maxLength":32000},{"type":"null"}],"title":"Append System Prompt"},"instructions":{"anyOf":[{"type":"string","maxLength":64000},{"type":"null"}],"title":"Instructions"},"tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tools"},"exclude_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exclude Tools"},"skills":{"anyOf":[{"items":{"$ref":"#/components/schemas/SkillSpec"},"type":"array"},{"type":"null"}],"title":"Skills"},"extensions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extensions"},"prompt":{"type":"string","minLength":1,"title":"Prompt"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"thinking":{"anyOf":[{"type":"string","enum":["off","minimal","low","medium","high","xhigh","max"]},{"type":"null"}],"title":"Thinking"},"network":{"anyOf":[{"type":"string","enum":["full","none"]},{"type":"null"}],"title":"Network"},"sandbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Id"},"wait":{"type":"boolean","title":"Wait","default":true},"timeout_s":{"type":"integer","maximum":86400.0,"minimum":1.0,"title":"Timeout S","default":600},"keep_alive":{"type":"boolean","title":"Keep Alive","default":false},"auto_resume":{"type":"boolean","title":"Auto Resume","default":true},"max_attempts":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Max Attempts"},"question_policy":{"anyOf":[{"type":"string","enum":["forward","auto"]},{"type":"null"}],"title":"Question Policy"},"return_files":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Return Files"},"env":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Env"},"webhook_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Webhook Url"},"webhook_secret":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Webhook Secret"}},"type":"object","required":["prompt"],"title":"TaskCreate"},"TaskFile":{"properties":{"path":{"type":"string","title":"Path"},"size":{"type":"integer","title":"Size"},"content_b64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content B64"},"too_large":{"type":"boolean","title":"Too Large","default":false},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["path","size"],"title":"TaskFile"},"TaskResult":{"properties":{"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"files":{"anyOf":[{"items":{"$ref":"#/components/schemas/TaskFile"},"type":"array"},{"type":"null"}],"title":"Files"}},"type":"object","title":"TaskResult"},"Transcript":{"properties":{"task_id":{"type":"string","title":"Task Id"},"entries":{"items":{"$ref":"#/components/schemas/TranscriptEntry"},"type":"array","title":"Entries"},"next":{"type":"integer","title":"Next"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["task_id","entries","next","total"],"title":"Transcript"},"TranscriptEntry":{"properties":{"seq":{"type":"integer","title":"Seq"},"ts":{"type":"number","title":"Ts"},"kind":{"type":"string","title":"Kind"},"event":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Event"}},"type":"object","required":["seq","ts","kind"],"title":"TranscriptEntry"},"VersionInfo":{"properties":{"gateway":{"type":"string","title":"Gateway"},"pi_version":{"type":"string","title":"Pi Version"},"sandbox_image":{"type":"string","title":"Sandbox Image"}},"type":"object","required":["gateway","pi_version","sandbox_image"],"title":"VersionInfo"}}}}