{"openapi":"3.1.0","info":{"title":"Charter","version":"1.0.0","description":"Sandboxed compute by the hour, paid per interval in USDC on Base over x402. No account, only a wallet.","x-guidance":"Rent a sandboxed machine by the hour with a wallet and no account. Read GET /v1/offers (free) for prices and images. POST /v1/rent with a job (python: { script } with NumPy and no network; urls: up to five pages fetched in a headless browser) or a home ({ home: { sshKeys } }: a box with its own disk (home.diskGiB) kept 7 days, plain SSH in with ssh -p <port> tenant@<host> from access.ssh (also root on a host whose offer says home.root); image charter-hermes for Hermes Agent preinstalled). offerId is optional: left out, the door picks by host record, then price. Homes are limited (home.slots in the offer); a full host answers busy. Hosts are run by independent operators, not vetted by Charter; an operator can see what runs on its machine. Each offer carries the host's record (probes passed, leases finished, success rate). It answers 402 with the price of one interval (hosts set their own; one hour at 0.007 USDC today), exact first (no deposit) or batch-settlement, USDC on Base. Pay it and the lease opens with its first interval paid. Keep it running: POST /v1/leases/{leaseId}/ticks with { \"index\": n } from 1, in order, paid the same way, before paidThrough runs out. Stop by not paying. Read the state free with GET /v1/leases/{leaseId}; a job's output is in GET /v1/leases/{leaseId}/output/{part}; a home's SSH address is in access.ssh (a host may also publish access.onion, which needs an Anyone client). Grants: a fund pays 30 days of a home to agents that pitch a use for one. POST /v1/grants with { name, pitch, sshKeys } is free; GET /v1/grants shows the balance, the grants left and every decision. The whole procedure, prices, what to tell your operator and the trust section: https://charterhome.dev/agents","contact":{"name":"Charter","url":"https://github.com/drew-dot-com/charter/issues"}},"externalDocs":{"description":"How an agent rents","url":"https://charterhome.dev/agents"},"paths":{"/v1/rent":{"post":{"operationId":"rent","summary":"Rent compute: open a lease and pay its first interval in one call","tags":["Compute"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.007000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offerId":{"type":"string","description":"An offerId from GET /v1/offers. Left out: the first listed offer in the door's ranking (host record, then price) that runs the job."},"python":{"type":"object","description":"A python job: the script runs once with NumPy and no network; stdout, stderr and the exit code come back.","properties":{"script":{"type":"string","maxLength":8192}},"required":["script"]},"urls":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"string","description":"An http or https URL."},"description":"A fetch job: each page loaded in a headless browser (through a hidden exit on an offer with hiddenEgress)."},"home":{"type":"object","description":"A home: a box with its own disk (home.diskGiB in the offer) kept 7 days, reached by plain SSH with these keys (ssh -p <port> tenant@<host>, from the lease's access.ssh).","properties":{"sshKeys":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string"}},"image":{"type":"string","enum":["charter-home","charter-hermes"]}},"required":["sshKeys"]}}},"example":{"python":{"script":"print(2 + 2)"}}}}},"responses":{"200":{"description":"The lease is open and its first interval paid.","content":{"application/json":{"schema":{"type":"object","properties":{"leaseId":{"type":"string"},"state":{"type":"string"},"paidIntervals":{"type":"integer"},"paidThrough":{"type":"integer","description":"Epoch ms the paid time runs out."},"next":{"type":"object","properties":{"path":{"type":"string"},"index":{"type":"integer"}}},"offer":{"type":"object"}},"required":["leaseId","paidIntervals","paidThrough","next"],"example":{"leaseId":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","state":"running","paidIntervals":1,"paidThrough":1760000000000,"next":{"path":"/v1/leases/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ticks","index":1}}}}}},"400":{"description":"The body is not a job or a home, or the offer does not run that image.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment Required: one interval, exact first or batch-settlement, USDC on Base."},"403":{"description":"payer_blocked: this payer cost the door a failed settlement in the last 24 hours.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No listed offer for this body.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"payment_reused, busy, channel_withdrawing, or home_host_gone: the host that holds this home's disk is not listed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"The host failed. When the lease opened, leaseId is in the body: pay index 0 on the tick route.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"capacity, or retry_later with leaseId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/offers":{"get":{"operationId":"listOffers","summary":"The machines for rent now, with their prices and images","tags":["Compute"],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}}}},"/v1/hosts":{"get":{"operationId":"listHosts","summary":"Every host the door knows, with its state and track record. Hosts are run by independent operators.","tags":["Hosts"],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}}},"post":{"operationId":"registerHost","summary":"Register a host by its HTTPS URL: the door reads GET {url}/v1/offer, then probes it with a paid job before listing it","tags":["Hosts"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The host's https base URL."}},"required":["url"]}}}},"responses":{"202":{"description":"Registered; listed once a probe passes.","content":{"application/json":{"schema":{"type":"object","properties":{"hostId":{"type":"string"},"state":{"type":"string"}},"required":["hostId","state"]}}}},"400":{"description":"bad_url, or bad_offer with a reason: open and status reads must be free, the tick at most the door's maximum, payTo an address, url the registered one.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"rate_limited: 10 registrations an hour per IP, 1 per URL.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/leases":{"post":{"operationId":"openLease","summary":"Open a lease without paying (then pay index 0 on the tick route); POST /v1/rent does both","tags":["Compute"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offerId":{"type":"string","description":"An offerId from GET /v1/offers. Left out: the first listed offer in the door's ranking (host record, then price) that runs the job."},"python":{"type":"object","description":"A python job: the script runs once with NumPy and no network; stdout, stderr and the exit code come back.","properties":{"script":{"type":"string","maxLength":8192}},"required":["script"]},"urls":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"string","description":"An http or https URL."},"description":"A fetch job: each page loaded in a headless browser (through a hidden exit on an offer with hiddenEgress)."},"home":{"type":"object","description":"A home: a box with its own disk (home.diskGiB in the offer) kept 7 days, reached by plain SSH with these keys (ssh -p <port> tenant@<host>, from the lease's access.ssh).","properties":{"sshKeys":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string"}},"image":{"type":"string","enum":["charter-home","charter-hermes"]}},"required":["sshKeys"]}},"required":["offerId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leaseId":{"type":"string"},"state":{"type":"string"}}}}}}}}},"/v1/leases/{leaseId}":{"get":{"operationId":"getLease","summary":"A lease: state, paid intervals, paidThrough, output parts, a home's SSH access","tags":["Compute"],"security":[],"parameters":[{"name":"leaseId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/leases/{leaseId}/output/{part}":{"get":{"operationId":"getLeaseOutput","summary":"One part of a finished job's output","tags":["Compute"],"security":[],"parameters":[{"name":"leaseId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},{"name":"part","in":"path","required":true,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}