{"openapi":"3.1.0","components":{"securitySchemes":{"apiKey":{"bearerFormat":"hmk_…","description":"An API key from the dashboard or `homemade api-key create`.","scheme":"bearer","type":"http"}},"schemas":{"ApiKey":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"id":{"type":"string"},"keyPrefix":{"type":["string","null"]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"name":{"type":["string","null"]}},"required":["createdAt","expiresAt","id","keyPrefix","lastUsedAt","name"]},"ApiKeyList":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["keys"]},"Error":{"type":"object","properties":{"code":{"description":"Machine-readable reason, when there is one.","type":"string"},"error":{"type":"string","description":"What went wrong, in a sentence a person can read."}},"required":["error"]},"CreatedApiKey":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"id":{"type":"string"},"key":{"type":"string","description":"The secret. Shown once; store it now."},"keyPrefix":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["createdAt","expiresAt","id","key","keyPrefix","name"]},"ValidationError":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"name":{"type":"string","const":"ZodError"}},"required":["message","name"],"additionalProperties":{}},"success":{"type":"boolean","const":false}},"required":["error","success"]},"RenamedApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},"Deleted":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]},"SshKey":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"fingerprint":{"type":"string"},"id":{"type":"string"},"keyType":{"type":"string","description":"The key's algorithm, such as ED25519 or RSA."},"label":{"type":"string"}},"required":["createdAt","fingerprint","id","keyType","label"]},"SshKeyList":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/SshKey"}}},"required":["keys"]},"CreatedSshKey":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"fingerprint":{"type":"string"},"id":{"type":"string"},"label":{"type":"string"}},"required":["createdAt","fingerprint","id","label"]},"Organization":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["createdAt","id","name","slug"],"additionalProperties":{},"description":"A team. VMs and projects belong to one."},"Me":{"type":"object","properties":{"organizations":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}},"session":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"id":{"type":"string"}},"required":["expiresAt","id"],"additionalProperties":{}},{"type":"null"}],"description":"The browser session; null for an API key."},"sshHostSuffix":{"type":"string"},"user":{"type":"object","properties":{"email":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["email","id","name"],"additionalProperties":{}}},"required":["organizations","session","sshHostSuffix","user"]},"SignedOut":{"type":"object","properties":{"organizations":{"type":"null"},"session":{"type":"null"},"sshHostSuffix":{"type":"string"},"user":{"type":"null"}},"required":["organizations","session","sshHostSuffix","user"]},"ProjectListItem":{"type":"object","properties":{"defaultBranch":{"type":"string"},"githubRepoFullName":{"type":["string","null"]},"id":{"type":"string"},"latestCommitAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"name":{"type":"string"},"rootDirectory":{"type":["string","null"]},"slug":{"type":"string"},"status":{"type":"string"}},"required":["defaultBranch","githubRepoFullName","id","latestCommitAt","name","rootDirectory","slug","status"],"additionalProperties":{}},"ProjectList":{"type":"object","properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/ProjectListItem"}}},"required":["projects"]},"Project":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"defaultBranch":{"type":"string"},"githubRepoFullName":{"type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"orgId":{"type":"string"},"rootDirectory":{"type":["string","null"]},"slug":{"type":"string"},"status":{"type":"string"}},"required":["createdAt","defaultBranch","githubRepoFullName","id","name","orgId","rootDirectory","slug","status"],"additionalProperties":{},"description":"A project: one repository (or starter) that VMs boot from."},"WelcomeVm":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"created"},"vmId":{"type":"string"}},"required":["status","vmId"]},{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string","const":"doctor"}},"required":["runId","status"]},{"type":"object","properties":{"status":{"type":"string","const":"waiting_for_build"}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"verification_required"}},"required":["status"]},{"type":"object","properties":{"code":{"type":["string","null"]},"error":{"type":"string"},"status":{"type":"string","const":"failed"}},"required":["code","error","status"]}],"description":"The first VM a new project starts on its own."},"CreatedProject":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"welcomeVm":{"$ref":"#/components/schemas/WelcomeVm"}},"required":["project","welcomeVm"]},"RateLimited":{"type":"object","properties":{"error":{"type":"string","const":"rate_limited"},"message":{"type":"string"}},"required":["error","message"]},"ProjectBranches":{"type":"object","properties":{"branches":{"type":"array","items":{"type":"string"}}},"required":["branches"]},"ProjectResponse":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}},"required":["project"]},"Ok":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]},"VmSummary":{"type":"object","properties":{"agentSignal":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["attention_required","implementation_completed"]},"message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"setAt":{"type":"string"}},"required":["kind","message","setAt"]},{"type":"null"}]},"asleepAt":{"type":["string","null"]},"bootScriptFailure":{"anyOf":[{"type":"object","properties":{"error":{"type":["string","null"]},"step":{"type":"string"}},"required":["error","step"]},{"type":"null"}]},"branch":{"type":"string"},"chunkDegraded":{"type":"boolean"},"costCents":{"type":"number"},"createdAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"image":{"type":["string","null"]},"name":{"type":"string"}},"required":["id","image","name"]},{"type":"null"}]},"deepAsleepAt":{"type":["string","null"]},"diskGb":{"type":"number"},"editorEnabled":{"type":"boolean"},"id":{"type":"string"},"isPreview":{"type":"boolean"},"lastActiveAt":{"type":["string","null"]},"linearIssueIdentifier":{"type":["string","null"]},"linearIssueUrl":{"type":["string","null"]},"name":{"type":["string","null"]},"newBuildAvailable":{"type":"boolean"},"orgSlug":{"type":"string"},"prNumber":{"type":["number","null"]},"projectId":{"type":"string"},"projectName":{"type":"string"},"projectSlug":{"type":"string"},"ramMb":{"type":"number"},"reapAt":{"type":["string","null"]},"region":{"type":"string","enum":["eu","us"]},"requestedByVmId":{"type":["string","null"]},"sleepAfterMinutes":{"type":"number"},"sleepAt":{"type":["string","null"]},"slug":{"type":"string"},"startedAt":{"type":["string","null"]},"state":{"type":"string","enum":["queued","placing","booting","injecting","running","asleep","deep_sleeping","deep_asleep","stopped","failed"]},"templateId":{"type":["string","null"]},"unresponsive":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["conn_failures","livelock"]},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reason","since"]},{"type":"null"}]},"urls":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"vcpu":{"type":"number"}},"required":["agentSignal","asleepAt","bootScriptFailure","branch","chunkDegraded","costCents","createdAt","createdBy","deepAsleepAt","diskGb","editorEnabled","id","isPreview","lastActiveAt","linearIssueIdentifier","linearIssueUrl","name","newBuildAvailable","orgSlug","prNumber","projectId","projectName","projectSlug","ramMb","reapAt","region","requestedByVmId","sleepAfterMinutes","sleepAt","slug","startedAt","state","templateId","unresponsive","urls","vcpu"]},"VmList":{"type":"object","properties":{"vms":{"type":"array","items":{"$ref":"#/components/schemas/VmSummary"}}},"required":["vms"],"description":"Every VM you can see that is not deleted, newest first."},"CreatedVm":{"type":"object","properties":{"branch":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"diskGb":{"type":"number"},"forkParentVmId":{"type":["string","null"]},"id":{"type":"string"},"isPreview":{"type":"boolean"},"keepServicesRunning":{"type":["boolean","null"]},"linearIssueIdentifier":{"type":["string","null"]},"linearIssueUrl":{"type":["string","null"]},"name":{"type":["string","null"]},"prNumber":{"type":["number","null"]},"projectId":{"type":"string"},"ramMb":{"type":"number"},"region":{"type":"string","enum":["eu","us"]},"size":{"type":"string"},"sleepAfterMinutes":{"type":"number"},"slug":{"type":"string"},"state":{"type":"string","enum":["queued","placing","booting","injecting","running","asleep","deep_sleeping","deep_asleep","stopped","failed"]},"templateId":{"type":["string","null"]},"ticketProvider":{"anyOf":[{"type":"string","enum":["linear","github"]},{"type":"null"}]},"urls":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Public URL of each service, keyed by port."},"vcpu":{"type":"number"}},"required":["branch","createdAt","diskGb","forkParentVmId","id","isPreview","keepServicesRunning","linearIssueIdentifier","linearIssueUrl","name","prNumber","projectId","ramMb","region","size","sleepAfterMinutes","slug","state","templateId","ticketProvider","urls","vcpu"]},"CreatedVmResponse":{"type":"object","properties":{"vm":{"$ref":"#/components/schemas/CreatedVm"}},"required":["vm"]},"NameRefusal":{"type":"object","properties":{"error":{"type":"string"},"suggestions":{"type":"array","items":{"type":"string"}}},"required":["error","suggestions"]},"PlanRefusal":{"type":"object","properties":{"code":{"type":"string"},"error":{"type":"string"},"upgrade":{"type":"boolean","const":true}},"required":["error","upgrade"]},"LimitExceeded":{"type":"object","properties":{"code":{"type":"string","const":"limit_exceeded"},"error":{"type":"string"},"limit":{"type":"string","enum":["starts_per_minute","starts_per_hour","starts_per_day","concurrent_vms","vm_hours_per_month","concurrent_terminals","doctor_runs_per_week"]},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"plan":{"type":"string","enum":["hobby","pro","enterprise"]},"resetsAt":{"type":["string","null"]},"retryAfterSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"window":{"type":"string"}},"required":["code","error","limit","max","plan","resetsAt","retryAfterSeconds","used","window"]},"SleepExtended":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"sleepAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."}},"required":["ok","sleepAt"]},"VmEvent":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"data":{},"id":{"type":"string"},"initiatorKind":{"type":["string","null"]},"initiatorRef":{"type":["string","null"]},"reason":{"type":["string","null"]},"type":{"type":"string","description":"What happened: created, running, asleep, renamed, …"}},"required":["createdAt","data","id","initiatorKind","initiatorRef","reason","type"]},"Vm":{"type":"object","properties":{"asleepAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"branch":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},"diskGb":{"type":"number"},"id":{"type":"string"},"lastActiveAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"name":{"type":["string","null"]},"projectId":{"type":"string"},"ramMb":{"type":"number"},"region":{"type":"string","enum":["eu","us"]},"sleepAfterMinutes":{"type":"number"},"sleepAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"slug":{"type":"string"},"sshHost":{"type":"string","description":"Host name for `ssh` through the CLI's proxy."},"startedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO 8601 date-time (UTC)."},{"type":"null"}]},"state":{"type":"string","enum":["queued","placing","booting","injecting","running","asleep","deep_sleeping","deep_asleep","stopped","failed"]},"urls":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Public URL of each service, keyed by port."},"vcpu":{"type":"number"}},"required":["asleepAt","branch","createdAt","diskGb","id","lastActiveAt","name","projectId","ramMb","region","sleepAfterMinutes","sleepAt","slug","sshHost","startedAt","state","urls","vcpu"],"additionalProperties":{}},"VmResponse":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/VmEvent"},"description":"The newest 50 events, newest first."},"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"additionalProperties":{}},"services":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"port":{"type":["number","null"]}},"required":["name","port"],"additionalProperties":{}}},"vm":{"$ref":"#/components/schemas/Vm"}},"required":["events","project","services","vm"],"additionalProperties":{}},"VmLost":{"type":"object","properties":{"code":{"type":"string","const":"vm_lost"},"lost":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","lost"],"description":"The VM was lost with its disk saved; it can be recovered in the dashboard."},"DeletedVm":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"state":{"type":"string","enum":["queued","placing","booting","injecting","running","asleep","deep_sleeping","deep_asleep","stopped","failed"]}},"required":["ok","state"]},"VmStateChange":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"pending":{"description":"Accepted; the change finishes in the background.","type":"boolean","const":true},"state":{"type":"string","enum":["queued","placing","booting","injecting","running","asleep","deep_sleeping","deep_asleep","stopped","failed"]}},"required":["ok","state"]},"VmStateConflict":{"type":"object","properties":{"code":{"type":"string"},"error":{"type":"string"},"state":{"description":"The VM's state, when known.","anyOf":[{"type":"string","enum":["queued","placing","booting","injecting","running","asleep","deep_sleeping","deep_asleep","stopped","failed"]},{"type":"null"}]}},"required":["error"]},"TerminalSession":{"type":"object","properties":{"attachedClients":{"type":"integer","minimum":0,"maximum":9007199254740991},"cols":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","enum":["terminal","service"]},"name":{"type":"string"},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sessionId":{"type":"string"},"title":{"type":"string"}},"required":["attachedClients","cols","createdAt","kind","name","rows","sessionId"]},"TerminalSessions":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/TerminalSession"}}},"required":["sessions"]},"ChatSession":{"type":"object","properties":{"activeTurn":{"type":"boolean"},"attachedClients":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queuedTurns":{"type":"integer","minimum":0,"maximum":9007199254740991},"sessionId":{"type":"string","maxLength":41,"pattern":"^[cC][hH][aA][tT]-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"},"title":{"type":"string","minLength":1,"maxLength":80},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["activeTurn","attachedClients","createdAt","sessionId","title","updatedAt"]},"ChatSessions":{"type":"object","properties":{"availability":{"type":"string","enum":["available","unsupported","vm_stopped"]},"defaultModel":{"type":["string","null"]},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/ChatSession"}},"supported":{"type":"boolean"}},"required":["availability","defaultModel","sessions","supported"]},"ChatSessionCreated":{"type":"object","properties":{"sessionId":{"type":"string","maxLength":41,"pattern":"^[cC][hH][aA][tT]-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"}},"required":["sessionId"]},"VmRuntime":{"type":"object","properties":{"bootScript":{"anyOf":[{"type":"object","properties":{"currentStep":{"default":null,"anyOf":[{"type":"object","properties":{"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"step":{"type":"string"}},"required":["startedAt","step"]},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"plan":{"default":[],"type":"array","items":{"type":"string"}},"servicesReady":{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ok":{"type":"boolean"},"service":{"default":null,"type":["string","null"]}},"required":["at","ok","service"]},"steps":{"type":"array","items":{"type":"object","properties":{"durationMs":{"type":"number","minimum":0},"error":{"type":["string","null"]},"ok":{"type":"boolean"},"step":{"type":"string"}},"required":["durationMs","error","ok","step"]}}},"required":["currentStep","finishedAt","plan","steps"]},{"type":"null"}]},"chunk":{"anyOf":[{"type":"object","properties":{"chunkDegraded":{"type":"boolean"},"chunkDirty":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkFatalErrors":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkFaultFatalTimeouts":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkFaulted":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkPendingUpload":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkPrefetched":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkR2ClassAOps":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkR2ClassBOps":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkR2Misses":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkRetries":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkSourceBound":{"type":"boolean"},"chunkStoredBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkStoredOwnBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkTransientErrors":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkUnmaterialized":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkUploadLagMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"chunkWriteCapRejections":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["chunkDegraded","chunkDirty","chunkPendingUpload","chunkR2ClassAOps","chunkR2ClassBOps","chunkStoredBytes","chunkStoredOwnBytes","chunkUploadLagMs","chunkWriteCapRejections"]},{"type":"null"}]},"cliVersion":{"type":["string","null"]},"cpu":{"anyOf":[{"type":"object","properties":{"sampledAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"utilization":{"type":"number","minimum":0}},"required":["sampledAt","utilization"]},{"type":"null"}]},"disk":{"anyOf":[{"type":"object","properties":{"totalMb":{"type":"number","minimum":0},"usedMb":{"type":"number","minimum":0}},"required":["totalMb","usedMb"]},{"type":"null"}]},"guestAgentStale":{"default":null,"type":["boolean","null"]},"guestAgentVersion":{"default":null,"type":["string","null"]},"memory":{"anyOf":[{"type":"object","properties":{"agentExternalMb":{"type":"number","minimum":0},"agentHeapMb":{"type":"number","minimum":0},"agentRssMb":{"type":"number","minimum":0},"availableMb":{"type":"number","minimum":0},"psiFullAvg10":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"psiSomeAvg10":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"swapFreeMb":{"type":"number","minimum":0},"swapTotalMb":{"type":"number","minimum":0},"totalMb":{"type":"number","minimum":0}},"required":["availableMb","psiFullAvg10","psiSomeAvg10","swapFreeMb","swapTotalMb","totalMb"]},{"type":"null"}]},"net":{"anyOf":[{"type":"object","properties":{"inBytesPerSec":{"type":"number","minimum":0},"outBytesPerSec":{"type":"number","minimum":0},"sampledAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["inBytesPerSec","outBytesPerSec","sampledAt"]},{"type":"null"}]},"services":{"type":"array","items":{"type":"object","properties":{"exitCode":{"default":null,"type":["number","null"]},"health":{"default":null,"anyOf":[{"type":"string","enum":["initializing","healthy","unhealthy"]},{"type":"null"}]},"name":{"type":"string"},"pid":{"type":["number","null"]},"port":{"type":"number"},"restarts":{"type":"number"},"running":{"type":"boolean"}},"required":["exitCode","health","name","pid","restarts","running"]}},"uptimeSeconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["bootScript","cliVersion","cpu","disk","guestAgentStale","guestAgentVersion","memory","net","services","uptimeSeconds"]},"VmRuntimeResponse":{"type":"object","properties":{"runtime":{"$ref":"#/components/schemas/VmRuntime"}},"required":["runtime"]}}},"info":{"title":"Homemade API","description":"The Homemade API creates and runs dev VMs for your projects: create a VM, run commands in it, sleep it, wake it, delete it.\n\nAuthenticate every request with an API key in the `Authorization` header: `Authorization: Bearer hmk_…`. Create keys in the dashboard (Account → API keys) or with `homemade api-key create`.\n\nErrors answer a JSON body with an `error` message, and a machine-readable `code` where there is one.","version":"1.0.0","contact":{"email":"support@homemade.dev","name":"Homemade"},"license":{"name":"Proprietary","url":"https://homemade.dev/terms"}},"security":[{"apiKey":[]}],"servers":[{"url":"https://api.homemade.dev"}],"tags":[{"description":"Who the key belongs to and which teams it can reach.","name":"Account"},{"description":"Projects: one repository (or starter) your VMs boot from.","name":"Projects"},{"description":"Create, list, sleep, wake and delete VMs.","name":"VMs"},{"description":"Run commands in a running VM.","name":"Exec"},{"description":"Terminal and agent chat sessions inside a VM.","name":"Sessions"},{"description":"API keys and SSH keys.","name":"Keys"}],"paths":{"/api/api-keys":{"get":{"operationId":"listApiKeys","description":"Your API keys. The secret itself is shown only once, when the key is created.","responses":{"200":{"description":"The keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List API keys","tags":["Keys"],"x-cli":{"command":"api-key list"},"parameters":[]},"post":{"operationId":"createApiKey","description":"Creates an API key. Store `key` now: it is never shown again.","responses":{"201":{"description":"The new key, with its secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Create an API key","tags":["Keys"],"x-cli":{"command":"api-key create"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expiresInDays":{"type":"integer","minimum":1,"maximum":365},"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"]}}}},"parameters":[]}},"/api/api-keys/{keyId}":{"delete":{"operationId":"deleteApiKey","description":"Revokes the key at once. Requests that use it get 401 from then on.","responses":{"200":{"description":"Revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Delete an API key","tags":["Keys"],"x-cli":{"command":"api-key delete","confirm":"yes-no","destructive":true,"positional":["keyId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"keyId","required":true}]},"patch":{"operationId":"renameApiKey","responses":{"200":{"description":"Renamed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenamedApiKey"}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Rename an API key","tags":["Keys"],"x-cli":{"command":"api-key rename","positional":["keyId"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"keyId","required":true}]}},"/api/config/validate":{"post":{"operationId":"validateConfig","description":"Checks a `.homemade/config.json` or `.jsonc` file against the config schema. `.ts` and `.js` configs are checked at the first build instead.","responses":{"200":{"description":"The verdict; `error` says what is wrong.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Why the file is invalid (present when ok is false).","type":"string"},"ok":{"type":"boolean"},"path":{"type":"string","enum":[".homemade/config.ts",".homemade/config.js",".homemade/config.jsonc",".homemade/config.json"]}},"required":["ok","path"]}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Validate a project config","tags":["Projects"],"x-cli":{"command":"config validate","handwritten":true},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","maxLength":262144},"path":{"type":"string","enum":[".homemade/config.ts",".homemade/config.js",".homemade/config.jsonc",".homemade/config.json"]}},"required":["content","path"]}}}},"parameters":[]}},"/api/me":{"get":{"operationId":"getMe","description":"The key's owner and the teams it can reach. A team's `id` is the `orgId` other calls take.","responses":{"200":{"description":"You and your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedOut"}}}}},"summary":"Get the current user","tags":["Account"],"x-cli":{"command":"whoami"},"parameters":[]}},"/api/projects":{"get":{"operationId":"listProjects","description":"Every project in your teams, newest first. Pass `orgId` for one team's projects.","responses":{"200":{"description":"The projects.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectList"}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List projects","tags":["Projects"],"x-cli":{"command":"project list"},"parameters":[{"in":"query","name":"orgId","schema":{"type":"string"}}]},"post":{"operationId":"createProject","description":"Creates a project from a GitHub repository your team connected (`githubInstallationId` + `githubRepoId`), from a starter (`template`), or empty. A new project starts its first VM on its own; `welcomeVm` says how that went.","responses":{"201":{"description":"The project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedProject"}}}},"400":{"description":"The repository could not be used. Or: The request body or query did not match the schema.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Create a project","tags":["Projects"],"x-cli":{"command":"project create"},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","properties":{"$schema":{"type":"string"},"agent":{"type":"object","properties":{"instructions":{"type":"string","maxLength":32768},"skills":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200,"pattern":"^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?\\/[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?(?:#[A-Za-z0-9._/-]+)?$"}}}},"base":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"compose":{"type":"string"},"editor":{"default":{"enabled":false},"type":"object","properties":{"enabled":{"default":false,"type":"boolean"}}},"env_schema":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"default":{"description":"Value used when no env var with this key is set (org, project or VM). May reference ${HOMEMADE_URL_<port>}. Not for secrets: it is part of the repo.","type":"string","maxLength":4096},"generate":{"description":"true: the platform makes a random secret for this key once per VM (a VM env var marked secret, kept across reboots). Never part of a warm snapshot.","type":"boolean"},"key":{"type":"string","minLength":1},"warmup":{"default":false,"type":"boolean"}},"required":["key"]}]}},"install":{"default":[],"type":"array","items":{"type":"string"}},"network":{"type":"object","properties":{"egress":{"type":"object","properties":{"allow":{"description":"Egress allowlist — IPv4 addresses, IPv4 CIDRs, exact domains, or *.wildcard domains. Present ⇒ default-deny egress: only these destinations (minus anything in `deny`) are reachable. An empty allow list behaves as if omitted (deny-only).","type":"array","items":{"type":"string"}},"deny":{"description":"Egress denylist, same entry grammar as `allow`. Deny always wins over allow, even when a destination also matches `allow`.","type":"array","items":{"type":"string"}}},"description":"Outbound network policy. Domain matching is EXACT: `github.com` does not cover `api.github.com` — use `*.github.com` for subdomains (which in turn does not cover the bare apex `github.com`). IPv6 is not accepted here (guest networking is IPv4-only)."},"ingress":{"type":"object","properties":{"allow":{"description":"Ingress allowlist — client IPv4/IPv6 addresses or CIDRs (no domains). Present ⇒ default-deny ingress: only these clients (minus anything in `deny`) may reach the VM's routed ports. An empty allow list behaves as if omitted (deny-only).","type":"array","items":{"type":"string"}},"deny":{"description":"Ingress denylist, same entry grammar as `allow`. Deny always wins over allow, even when a client also matches `allow`.","type":"array","items":{"type":"string"}}},"description":"Inbound network policy. Matches the connecting CLIENT's IP address — never a domain."}},"description":"Network egress/ingress policy. Absent entirely ⇒ allow everything (current default behavior)."},"parameters":{"type":"array","items":{"type":"object","properties":{"default":{"type":["string","number","boolean"]},"description":{"type":"string"},"icon":{"description":"Plain optional label glyph — rendered as literal text if at all, never fetched as an image. No icon rendering in v1: accepted and stored only.","type":"string"},"name":{"type":"string","maxLength":64,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$"},"options":{"minItems":1,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"required":["value"]}},"required":{"default":false,"type":"boolean"},"type":{"type":"string","enum":["string","number","boolean","select"]},"validation":{"type":"object","properties":{"errorMessage":{"type":"string"},"max":{"type":"number"},"min":{"type":"number"},"regex":{"type":"string"}}}},"required":["name","type"]}},"services":{"type":"object","propertyNames":{"type":"string","maxLength":32,"pattern":"^[A-Za-z][A-Za-z0-9_-]*$"},"additionalProperties":{"type":"object","properties":{"autostart":{"default":true,"type":"boolean"},"cmd":{"type":"string","minLength":1},"depends_on":{"description":"Services this one waits for before its `cmd` starts, by name, each with a `condition` (\"healthy\" by default, or \"started\"). Replaces sleep loops: a web service waits for its database, however long it takes. If a dependency exits, this service does not start and its terminal says why; it starts once the dependency is restarted and healthy.","type":"object","propertyNames":{"type":"string","maxLength":32,"pattern":"^[A-Za-z][A-Za-z0-9_-]*$"},"additionalProperties":{"type":"object","properties":{"condition":{"default":"healthy","description":"\"healthy\" (default): wait until the dependency reports healthy (its `healthcheck`, or something listening on its `port`). \"started\": wait only until its terminal started.","type":"string","enum":["started","healthy"]}}}},"displayName":{"description":"Human-friendly name shown instead of the service key in the dashboard.","type":"string","minLength":1,"maxLength":64},"healthcheck":{"description":"Probe the service over localhost HTTP (guest-side) and report health on the `health` command / VM runtime. Success is any HTTP status below 500 — a 404 still counts as up. Requires `port`.","type":"object","properties":{"cmd":{"description":"A shell command probed instead of HTTP, run as the VM user in the workspace: exit code 0 counts as up. Needs no `port`.","type":"string","minLength":1},"interval":{"default":5,"description":"Seconds between probes. Default 5.","type":"integer","minimum":1,"maximum":300},"path":{"default":"/","description":"HTTP path probed on the service's own port (http://127.0.0.1:{port}{path}). Default \"/\".","type":"string","minLength":1},"threshold":{"default":6,"description":"Consecutive failing probes before the service flips to unhealthy. Any single success flips it back to healthy. Default 6.","type":"integer","minimum":1,"maximum":60}}},"hidden":{"default":false,"description":"Hide the service from the VM workspace's Services pane. Does not affect autostart, and does not stop the service's own terminal from existing.","type":"boolean"},"icon":{"description":"A short text/emoji glyph shown next to the service — rendered as literal text, never fetched as an image.","type":"string","minLength":1,"maxLength":32},"order":{"description":"Sort position among services in the dashboard (ascending). Services without an order sort after those with one.","type":"integer","minimum":0,"maximum":9007199254740991},"port":{"type":"integer","minimum":1,"maximum":65535},"publicHost":{"description":"By default the preview proxy hands the app each request as if it came to http://localhost:<port> (Host, Origin and Referer rewritten; redirects to localhost:<port> rewritten back to the preview URL), so dev servers' host checks (Vite allowedHosts, Django ALLOWED_HOSTS, Rails config.hosts, Next allowedDevOrigins) pass with no app config. true sends the real preview hostname with X-Forwarded-Host/Proto instead, for apps that need it (multi-tenant hosts, absolute URLs built from the request). Only meaningful when `url` is true.","type":"boolean"},"share":{"default":"public","description":"Who may open the service's public URL. \"public\": anyone with the link. \"authenticated\": members of the organization that owns the VM. \"owner\": only the user who created the VM (platform admins always allowed). Only meaningful when `url` is true.","type":"string","enum":["public","authenticated","owner"]},"signInUrl":{"description":"A per-VM sign-in or pairing link the VM page shows under the service, with copy and open buttons. A template: ${HOMEMADE_URL_<port>} is that port's VM URL, ${KEY} the value of the VM's env var KEY (e.g. one `generate: true` in env_schema). Only meaningful when `url` is true.","type":"string","minLength":1,"maxLength":1024},"url":{"default":false,"type":"boolean"}}}},"setup":{"default":[],"type":"array","items":{"type":"string"}},"size":{"anyOf":[{"type":"string","enum":["nano","tiny","small","medium","large"]},{"type":"object","properties":{"disk":{"type":"string","pattern":"^\\d+(?:mb|gb)$"},"ram":{"type":"string","pattern":"^\\d+(?:mb|gb)$"},"vcpu":{"type":"integer","minimum":1,"maximum":64}},"required":["disk","ram","vcpu"]}]},"sleep_after":{"type":"string","pattern":"^(?:never|[0-9]+(?:m|h))$"},"troubleshootingUrl":{"type":"string","format":"uri"},"version":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"warmup":{"default":[],"type":"array","items":{"type":"string"}}}},"defaultBranch":{"type":"string"},"githubInstallationId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"githubRepoId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":100},"orgId":{"type":"string"},"rootDirectory":{"anyOf":[{"type":"string","maxLength":220},{"type":"null"}]},"setupWithAgent":{"type":"boolean"},"template":{"type":"string","minLength":1,"maxLength":64}}}}}},"parameters":[]}},"/api/projects/{projectId}":{"get":{"operationId":"getProject","responses":{"200":{"description":"The project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No project with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Get a project","tags":["Projects"],"x-cli":{"command":"project get","positional":["projectId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]},"delete":{"operationId":"deleteProject","description":"Deletes the project and every VM in it. This cannot be undone.","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No project with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Delete a project","tags":["Projects"],"x-cli":{"command":"project delete","confirm":"typed","destructive":true,"positional":["projectId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/api/projects/{projectId}/branches":{"get":{"operationId":"listProjectBranches","description":"The branches a VM of this project can boot, the default branch first.","responses":{"200":{"description":"Branch names.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectBranches"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No project with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List branches","tags":["Projects"],"x-cli":{"command":"project branches","positional":["projectId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/api/projects/{projectId}/settings":{"patch":{"operationId":"updateProjectSettings","description":"Changes the project's slug, default branch, default auto-sleep and other settings. Every field is optional.","responses":{"200":{"description":"The updated project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"400":{"description":"A value is not allowed. Or: The request body or query did not match the schema.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Your plan does not include this setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No project with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The new slug clashes with another project or VM.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Update project settings","tags":["Projects"],"x-cli":{"command":"project update","positional":["projectId"]},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"bootTimeoutSeconds":{"anyOf":[{"type":"integer","minimum":60,"maximum":900},{"type":"null"}]},"defaultBranch":{"type":"string","minLength":1,"maxLength":250},"defaultSleepAfterMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"icon":{"anyOf":[{"type":"string","maxLength":69},{"type":"null"}]},"iconColor":{"anyOf":[{"type":"string","enum":["gray","red","orange","amber","yellow","green","teal","blue","indigo","violet","purple","pink"]},{"type":"null"}]},"keepServicesRunning":{"type":"boolean"},"linearTriggerLabel":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"prPreviewsEnabled":{"type":"boolean"},"rootDirectory":{"anyOf":[{"type":"string","maxLength":220},{"type":"null"}]},"slug":{"type":"string","minLength":2,"maxLength":50,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"wakeOnVisit":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/api/ssh-keys":{"get":{"operationId":"listSshKeys","responses":{"200":{"description":"The keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SshKeyList"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List SSH keys","tags":["Keys"],"x-cli":{"command":"ssh-key list"},"parameters":[]},"post":{"operationId":"createSshKey","description":"Adds an SSH public key. Running VMs in your teams accept it within seconds.","responses":{"201":{"description":"The key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedSshKey"}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"This key is already registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Add an SSH key","tags":["Keys"],"x-cli":{"command":"ssh-key add","handwritten":true},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":64},"publicKey":{"type":"string","maxLength":8192,"pattern":"^(?:ssh-ed25519|ssh-rsa|ecdsa-sha2-nistp256|ecdsa-sha2-nistp384|ecdsa-sha2-nistp521) [A-Za-z0-9+/]+=*(?: .+)?$"}},"required":["label","publicKey"]}}}},"parameters":[]}},"/api/ssh-keys/{id}":{"delete":{"operationId":"deleteSshKey","responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Remove an SSH key","tags":["Keys"],"x-cli":{"command":"ssh-key delete","confirm":"yes-no","destructive":true,"positional":["id"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/api/vms":{"get":{"operationId":"listVms","description":"Every VM in your teams that is not deleted, newest first. Pass `projectId` to list one project's VMs.","responses":{"200":{"description":"The VMs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmList"}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List VMs","tags":["VMs"],"x-cli":{"command":"vm list"},"parameters":[{"in":"query","name":"projectId","schema":{"type":"string"}}]},"post":{"operationId":"createVm","description":"Creates a VM from a project's latest build and starts it. The answer comes at once with the VM in `queued` or `booting`; poll `GET /api/vms/{vmId}` until `state` is `running`.","responses":{"201":{"description":"The VM was created and is starting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedVmResponse"}}}},"400":{"description":"The name is refused or the input is invalid. Or: The request body or query did not match the schema.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/NameRefusal"},{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Your plan does not allow this VM (size, count or verification).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanRefusal"}}}},"404":{"description":"No project with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The name is in use.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/NameRefusal"},{"$ref":"#/components/schemas/Error"}]}}}},"429":{"description":"A plan limit or the rate limit was reached.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/LimitExceeded"},{"$ref":"#/components/schemas/RateLimited"}]}}}}},"summary":"Create a VM","tags":["VMs"],"x-cli":{"command":"vm create"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"branch":{"default":"main","type":"string","minLength":1,"maxLength":250},"keepServicesRunning":{"type":"boolean"},"name":{"type":"string","maxLength":50},"parameterValues":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"projectId":{"type":"string"},"region":{"type":"string","enum":["eu","us"]},"size":{"type":"string","enum":["nano","tiny","small","medium","large"]},"ticket":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"provider":{"type":"string","enum":["linear","github"]}},"required":["id","provider"]}},"required":["projectId"]}}}},"parameters":[]}},"/api/vms/{vmId}":{"get":{"operationId":"getVm","description":"The VM, its project, its services and its newest events. `vm.urls` holds each service's public URL by port.","responses":{"200":{"description":"The VM.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmResponse"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"The VM was lost with its disk saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmLost"}}}}},"summary":"Get a VM","tags":["VMs"],"x-cli":{"command":"vm get","positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]},"delete":{"operationId":"deleteVm","description":"Deletes the VM and its data. This cannot be undone.","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedVm"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Delete a VM","tags":["VMs"],"x-cli":{"command":"vm delete","confirm":"yes-no","destructive":true,"positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]},"patch":{"operationId":"updateVm","description":"Renames the VM, changes its auto-sleep or who can open its services. Every field is optional.","responses":{"200":{"description":"Saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"A value is not allowed (sleep setting for your plan, unknown port). Or: The request body or query did not match the schema.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only the VM's creator or a team admin can change sharing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Update a VM","tags":["VMs"],"x-cli":{"command":"vm update","positional":["vmId"]},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"keepServicesRunning":{"type":["boolean","null"]},"name":{"type":"string","maxLength":50},"shareLevels":{"type":"object","propertyNames":{"type":"string","pattern":"^\\d+$"},"additionalProperties":{"type":"string","enum":["public","authenticated","owner"]}},"sleepAfterMinutes":{"type":"integer","minimum":0,"maximum":9007199254740991}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/agent-send":{"post":{"operationId":"sendToAgent","description":"Sends a prompt to a coding agent in the VM, in a new chat or the one named by `sessionId`. It answers at once; follow the chat in the dashboard or with the CLI.","responses":{"202":{"description":"Delivered; the agent works on it in the background.","content":{"application/json":{"schema":{"type":"object","properties":{"delivery":{"type":"string","enum":["queued","started","steered"]},"isNewSession":{"type":"boolean"},"sessionId":{"type":"string","maxLength":41,"pattern":"^[cC][hH][aA][tT]-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"},"turnId":{"type":"string","maxLength":41,"pattern":"^[tT][uU][rR][nN]-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"}},"required":["isNewSession","sessionId","turnId"]}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or its machine could not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Send a message to an agent","tags":["Sessions"],"x-cli":{"command":"chat send","hidden":true,"positional":["vmId"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":65536},"model":{"type":"string","minLength":1,"maxLength":128},"permissionMode":{"type":"string","enum":["unrestricted","ask","plan"]},"sessionId":{"type":"string","maxLength":41,"pattern":"^[cC][hH][aA][tT]-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"}},"required":["message"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/chat-sessions":{"get":{"operationId":"listChatSessions","responses":{"200":{"description":"The VM's agent chats and the agents you can start.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessions"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or its machine could not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List agent chats","tags":["Sessions"],"x-cli":{"command":"chat list","hidden":true,"positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]},"post":{"operationId":"createChatSession","description":"Starts a chat in the VM. A VM keeps at most one empty chat: when it already has one, you get that.","responses":{"200":{"description":"The chat to open.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionCreated"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or its machine could not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Start an agent chat","tags":["Sessions"],"x-cli":{"command":"chat new","hidden":true,"positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/chat-sessions/{sessionId}":{"delete":{"operationId":"deleteChatSession","responses":{"200":{"description":"Ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or its machine could not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"End an agent chat","tags":["Sessions"],"x-cli":{"command":"chat delete","destructive":true,"hidden":true,"positional":["vmId","sessionId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}]}},"/api/vms/{vmId}/dismiss-signal":{"post":{"operationId":"dismissVmSignal","description":"Clears the attention signal an agent in the VM raised. Does nothing when there is none.","responses":{"200":{"description":"Cleared.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Dismiss the agent signal","tags":["VMs"],"x-cli":{"command":"vm dismiss-signal","positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/exec":{"post":{"operationId":"execVm","description":"Runs one command in a running VM as its user, with `/bin/sh -lc`, and answers its exit code and output. It opens no terminal. Use `?stream=1` for commands that run longer than about 90 seconds.","responses":{"200":{"description":"The finished command. With `?stream=1`: one JSON frame per line as it runs (`output`, `keepalive`, then `exit` or `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"exitCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stderr":{"type":"string"},"stderrTruncated":{"type":"boolean"},"stdout":{"type":"string"},"stdoutTruncated":{"type":"boolean"},"timedOut":{"type":"boolean"}},"required":["durationMs","exitCode","stderr","stderrTruncated","stdout","stdoutTruncated","timedOut"]}},"application/x-ndjson":{"schema":{"oneOf":[{"type":"object","properties":{"data":{"type":"string"},"stream":{"type":"string","enum":["stdout","stderr"]},"type":{"type":"string","const":"output"}},"required":["data","stream","type"]},{"type":"object","properties":{"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"exitCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stderr":{"type":"string"},"stderrTruncated":{"type":"boolean"},"stdout":{"type":"string"},"stdoutTruncated":{"type":"boolean"},"timedOut":{"type":"boolean"},"type":{"type":"string","const":"exit"}},"required":["durationMs","exitCode","stderr","stderrTruncated","stdout","stdoutTruncated","timedOut","type"]},{"type":"object","properties":{"error":{"type":"string"},"type":{"type":"string","const":"error"}},"required":["error","type"]},{"type":"object","properties":{"type":{"type":"string","const":"keepalive"}},"required":["type"]}]}}}},"400":{"description":"The request body or query did not match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or the command could not run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Run a command","tags":["Exec"],"x-cli":{"command":"vm exec","handwritten":true,"positional":["vmId"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":65536},"cwd":{"type":"string","minLength":1,"maxLength":4096},"env":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":"string"}},"timeoutMs":{"default":60000,"type":"integer","exclusiveMinimum":0,"maximum":600000}},"required":["command"]}}}},"parameters":[{"in":"query","name":"stream","schema":{"type":"string","enum":["0","1","false","true"]}},{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/runtime":{"get":{"operationId":"getVmRuntime","description":"What the VM reports right now: its boot steps, service health, CPU, memory and disk.","responses":{"200":{"description":"Boot steps, services, CPU, memory and disk.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmRuntimeResponse"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or its machine could not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Get VM runtime status","tags":["VMs"],"x-cli":{"command":"vm runtime","hidden":true,"mcp":false,"positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/sleep":{"post":{"operationId":"sleepVm","description":"Puts a running VM to sleep. It keeps its memory and disk and wakes where it left off. Sleeping an asleep VM answers 200.","responses":{"200":{"description":"Asleep, or falling asleep (`pending`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmStateChange"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM cannot sleep in its current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmStateConflict"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Sleep a VM","tags":["VMs"],"x-cli":{"command":"vm sleep","positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/sleep-extend":{"post":{"operationId":"extendVmSleep","description":"Moves a running VM's auto-sleep deadline by `minutes` (negative pulls it in).","responses":{"200":{"description":"The new deadline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SleepExtended"}}}},"400":{"description":"The VM is not counting down to sleep. Or: The request body or query did not match the schema.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"Extend auto-sleep","tags":["VMs"],"x-cli":{"command":"vm sleep-extend","hidden":true,"mcp":false,"positional":["vmId"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"minutes":{"type":"integer","minimum":-720,"maximum":720}},"required":["minutes"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/terminal-sessions":{"get":{"operationId":"listTerminalSessions","description":"The VM's open terminals. Each one keeps running when nobody is attached.","responses":{"200":{"description":"The VM's terminals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TerminalSessions"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or its machine could not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List terminal sessions","tags":["Sessions"],"x-cli":{"command":"shell list","positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}},"/api/vms/{vmId}/terminal-sessions/{sessionId}":{"delete":{"operationId":"deleteTerminalSession","responses":{"200":{"description":"Ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such VM or terminal.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM is not running, or its machine could not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many changes in a minute (60 per minute per caller).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}}},"summary":"End a terminal session","tags":["Sessions"],"x-cli":{"command":"shell delete","confirm":"yes-no","destructive":true,"positional":["vmId","sessionId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}]}},"/api/vms/{vmId}/wake":{"post":{"operationId":"wakeVm","description":"Wakes an asleep VM. Poll `GET /api/vms/{vmId}` until `state` is `running`.","responses":{"200":{"description":"Waking, or already running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmStateChange"}}}},"401":{"description":"No API key, or the key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The team may not start VMs right now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No VM with this id in your teams.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The VM cannot wake in its current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmStateConflict"}}}},"429":{"description":"A plan limit or the rate limit was reached.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/LimitExceeded"},{"$ref":"#/components/schemas/RateLimited"}]}}}}},"summary":"Wake a VM","tags":["VMs"],"x-cli":{"command":"vm wake","positional":["vmId"]},"parameters":[{"schema":{"type":"string"},"in":"path","name":"vmId","required":true}]}}}}