{"openapi":"3.1.0","info":{"title":"WorkerWizard Agent API","version":"0.1.0","summary":"Wallet-authenticated API for prepaid isolated Linux workspaces.","description":"Isolated, non-root workspaces on Cloudflare Sandbox/Containers, rented by the prepaid hour at a fixed size. Agents authenticate with a SIWE wallet signature and will pay with x402 USDC on Base when settlement is enabled. Shell access is an authenticated PTY or exec API, not root SSH. Project files are intended to persist through documented snapshot/restore to R2; R2 is not a POSIX block device, and memory is not guaranteed across restart. The human dashboard uses this same API and is not the required gate. Payments and workspace provisioning are not live in this deployment: start, stop, destroy, exec, terminal, and any payment payload will not charge funds or return a running sandbox.","contact":{"name":"PDP Limited","url":"https://workerwizard.com"}},"servers":[{"url":"https://workerwizard.com","description":"Public control plane"}],"tags":[{"name":"discovery"},{"name":"auth"},{"name":"workspaces"},{"name":"payments"}],"paths":{"/api/health":{"get":{"tags":["discovery"],"summary":"Liveness","responses":{"200":{"description":"Service is up"}}}},"/api/runtime":{"get":{"tags":["discovery"],"summary":"Honest runtime readiness","description":"Reports whether payments and provisioning are actually enabled.","responses":{"200":{"description":"Runtime report"}}}},"/api/catalog":{"get":{"tags":["discovery"],"summary":"Workspace sizes and billing terms","description":"Rates are unpublished until the runtime and payments are connected. Not a live offer. Hourly prepaid only.","responses":{"200":{"description":"Catalog"}}}},"/api/x402":{"get":{"tags":["payments"],"summary":"x402 payment discovery","description":"Returns protocol version and enabled=false with an empty accepts list. No pay-to address is included.","responses":{"200":{"description":"Payment rail is documented but not enabled"}}}},"/api/x402/pay":{"post":{"tags":["payments"],"summary":"Submit an x402 payment payload","description":"Always rejected in this deployment. Does not settle, charge, or provision.","responses":{"409":{"description":"Payments are not enabled; paid=false, charged=false, provisioned=false"}}}},"/api/auth/nonce":{"post":{"tags":["auth"],"summary":"Issue a one-time SIWE nonce","responses":{"200":{"description":"Nonce and SIWE fields"}}}},"/api/auth/verify":{"post":{"tags":["auth"],"summary":"Verify a SIWE signature and create a session","description":"Proves wallet ownership only. Does not authorize a payment.","responses":{"200":{"description":"Session cookie set"},"401":{"description":"Bad signature"}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Revoke the session","responses":{"200":{"description":"Logged out"}}}},"/api/session":{"get":{"tags":["auth"],"summary":"Current session","responses":{"200":{"description":"Authenticated or not"}}}},"/api/workspaces":{"get":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"List workspace requests for the signing wallet","responses":{"200":{"description":"List"},"401":{"description":"Not signed in"}}},"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Record a workspace request","description":"Stores a request only. Does not start a sandbox, expose a PTY, or charge funds.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["planId","billingTerm"],"properties":{"planId":{"type":"string","enum":["nano","micro","small"]},"billingTerm":{"type":"string","enum":["hourly"]},"name":{"type":"string"},"budgetHours":{"type":"integer","minimum":1,"maximum":2160}}}}}},"responses":{"201":{"description":"Request recorded; provisioned=false, charged=false"}}}},"/api/machines":{"get":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Alias of GET /api/workspaces","responses":{"200":{"description":"List"},"401":{"description":"Not signed in"}}},"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Alias of POST /api/workspaces","description":"Stores a request only. Does not start a sandbox, expose a PTY, or charge funds.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["planId","billingTerm"],"properties":{"planId":{"type":"string","enum":["nano","micro","small"]},"billingTerm":{"type":"string","enum":["hourly"]},"name":{"type":"string"},"budgetHours":{"type":"integer","minimum":1,"maximum":2160}}}}}},"responses":{"201":{"description":"Request recorded; provisioned=false, charged=false"}}}},"/api/workspaces/{id}":{"get":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Get one workspace request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Workspace"},"404":{"description":"Not found"}}}},"/api/workspaces/{id}/start":{"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Start a workspace","description":"Blocked until the Cloudflare Sandbox runtime is enabled and payments are live. Never returns a fake running workspace or a paid success. Isolation, when enabled, is a Sandbox microVM — not a shared-host non-root user, and not root SSH.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Blocked; provisioned=false, charged=false, blocked=true"}}}},"/api/workspaces/{id}/stop":{"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Stop workspace compute","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Blocked or stopped; charged=false"}}}},"/api/workspaces/{id}/destroy":{"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Destroy a workspace","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Blocked or destroyed; charged=false"}}}},"/api/workspaces/{id}/events":{"get":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Audit log for a workspace","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Events"}}}},"/api/workspaces/{id}/exec":{"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Run a command in a workspace","description":"Blocked until the Cloudflare Sandbox runtime is enabled and payments are live. Never returns a fake running workspace or a paid success. Isolation, when enabled, is a Sandbox microVM — not a shared-host non-root user, and not root SSH. Today this returns 409 with executed=false.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"409":{"description":"Runtime not enabled; provisioned=false, charged=false, executed=false"}}}},"/api/workspaces/{id}/terminal":{"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Open an authenticated PTY","description":"Blocked until the Cloudflare Sandbox runtime is enabled and payments are live. Never returns a fake running workspace or a paid success. Isolation, when enabled, is a Sandbox microVM — not a shared-host non-root user, and not root SSH. Today this returns 409 with started=false. This is not root SSH.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"409":{"description":"Runtime not enabled"}}}},"/api/machines/{id}":{"get":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Alias of GET /api/workspaces/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Workspace"},"404":{"description":"Not found"}}}},"/api/machines/{id}/start":{"post":{"tags":["workspaces"],"security":[{"siweSession":[]}],"summary":"Alias of POST /api/workspaces/{id}/start","description":"Blocked until the Cloudflare Sandbox runtime is enabled and payments are live. Never returns a fake running workspace or a paid success. Isolation, when enabled, is a Sandbox microVM — not a shared-host non-root user, and not root SSH.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Blocked"}}}}},"components":{"securitySchemes":{"siweSession":{"type":"apiKey","in":"cookie","name":"ww_session","description":"Session cookie issued after SIWE verification."}}}}