{"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. Monthly allowance: POST /v1/allowances with { sshKeys, image? } for a home that has paid its first hour returns an approveUrl for your person to open (Base Account, one signature) and an ownerToken; once the state is active, Charter keeps the home paid and you stop your own renew loop. Stop it with POST /v1/allowances/{id}/stop and x-allowance-token. 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"],"description":"Add \"referral\": \"<0x address on Base>\" and that address earns a share of every hour you pay for, paid in USDC on Base.","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"]},"referral":{"type":"string","description":"Optional: a 0x address on Base that earns a share of every hour this renter pays for, paid in USDC on Base. Read GET /v1/referrals/{address}."}}},"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"},"referral":{"type":"string","description":"The address earning a share of this lease, when one is."}},"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/referrals/{address}":{"get":{"operationId":"getReferral","summary":"What a referral address has earned and been paid: hours, earned, paid, owed, held and the newest 50 payouts","tags":["Referrals"],"security":[],"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string"},"bps":{"type":"integer"},"hours":{"type":"integer"},"earned":{"type":"string"},"paid":{"type":"string"},"owed":{"type":"string"},"held":{"type":"boolean"},"payouts":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"string"},"tx":{"type":"string"},"at":{"type":"integer"}}}}},"required":["address","bps","hours","earned","paid","owed","held","payouts"]}}}},"400":{"description":"bad_referral","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"]}}}}}}},"/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"]},"referral":{"type":"string","description":"Optional: a 0x address on Base that earns a share of every hour this renter pays for, paid in USDC on Base. Read GET /v1/referrals/{address}."}},"required":["offerId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leaseId":{"type":"string"},"state":{"type":"string"},"referral":{"type":"string","description":"The address earning a share of this lease, when one is."}}}}}}}}},"/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"]}}}}}}},"/v1/allowances":{"post":{"operationId":"createAllowance","summary":"Ask for a link your person opens to approve a monthly Base spend permission that keeps a home paid. Homes only.","tags":["Allowance"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sshKeys":{"type":"array","items":{"type":"string"},"description":"The home's SSH public keys, 1 to 8."},"image":{"type":"string","description":"charter-home (default) or charter-hermes."}},"required":["sshKeys"]}}}},"responses":{"201":{"description":"Created in state waiting; give approveUrl to your person.","content":{"application/json":{"schema":{"type":"object","properties":{"allowanceId":{"type":"string"},"ownerToken":{"type":"string","description":"Keep it: it reads the owner view and stops the allowance."},"approveUrl":{"type":"string"},"state":{"type":"string"},"next":{"type":"string","description":"The path to read it: /v1/allowances/<id>."}},"required":["allowanceId","ownerToken","approveUrl","state"]}}}},"400":{"description":"The body is not valid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"no_home: the home has not paid its first hour yet.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"already_live: this home already has a live allowance.","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"]}}}}}}},"/v1/allowances/{id}":{"get":{"operationId":"getAllowance","summary":"An allowance: its state (waiting, approved, active, short, spent_for_period, stopping, refused, ended, expired). With x-allowance-token, the owner view.","tags":["Allowance"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},{"name":"x-allowance-token","in":"header","required":false,"schema":{"type":"string"},"description":"Optional: the owner view."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"bad_token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/allowances/{id}/permission":{"post":{"operationId":"submitAllowancePermission","summary":"Used by the approval page at /allow to submit the signed spend permission. An agent does not call it.","tags":["Allowance"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The permission does not match the allowance.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"not_waiting, or permission_in_use.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/allowances/{id}/stop":{"post":{"operationId":"stopAllowance","summary":"Stop the allowance with its owner token. Charter stops pulling and refunds what is left.","tags":["Allowance"],"security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},{"name":"x-allowance-token","in":"header","required":true,"schema":{"type":"string"},"description":"The ownerToken from creating the allowance."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"bad_token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"not_live","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}