{"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 a 2 GiB disk kept 7 days, SSH in at an onion address; image charter-hermes for Hermes Agent preinstalled). offerId is optional. It answers 402 with the price of one interval (one hour at 0.007 USDC on the live host), 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. The whole procedure, prices, what to tell your operator and the trust section: https://charter.mainnet.toonprotocol.dev/agents","contact":{"name":"Charter","url":"https://github.com/drew-dot-com/charter/issues"}},"externalDocs":{"description":"How an agent rents","url":"https://charter.mainnet.toonprotocol.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 cheapest listed offer 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."},"home":{"type":"object","description":"A home: a box with a 2 GiB disk kept 7 days, SSH in at an onion address with these keys.","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, or channel_withdrawing.","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/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 cheapest listed offer 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."},"home":{"type":"object","description":"A home: a box with a 2 GiB disk kept 7 days, SSH in at an onion address with these keys.","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"]}}}}}}}}}