{"openapi":"3.1.0","info":{"title":"Qbox API","version":"1.0.0","summary":"Sandboxes for AI agents: run code, install packages, use files and preview URLs in an isolated microVM.","description":"Paid only. Unit: vCPU-minute (lifetime × vCPUs, 2 GB RAM per vCPU). $1 = 300 vCPU-minutes (a 2-vCPU sandbox ≈ $0.40/hour); every command or file operation 0.1 vCPU-minute; at least 1 minute per sandbox. The whole timeout is reserved at start; unused time returns when you stop it.\n\nAn agent can open its own account by paying (POST /accounts, x402 / USDC), or a person creates a key at https://quantecode.com/qbox. MCP server: https://quantecode.com/api/qbox/v1/mcp (Streamable HTTP, same API key). Terms: https://quantecode.com/qbox#terms","contact":{"url":"https://quantecode.com/qbox"},"x-operator":"AssetraDigital s.r.o. (Quante)"},"servers":[{"url":"https://quantecode.com/api/qbox/v1"}],"security":[{"bearer":[]}],"paths":{"/accounts":{"post":{"operationId":"openAccount","summary":"Open an account by paying (x402). No sign-up.","security":[],"parameters":[{"name":"usd","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":5}},{"name":"X-PAYMENT","in":"header","required":false,"description":"x402 v1 payment (base64 JSON). Booked to the balance before the request runs.","schema":{"type":"string"}}],"responses":{"201":{"description":"Account, API key (shown once) and balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing":{"get":{"operationId":"getBalance","summary":"Balance, prices, ways to pay.","responses":{"200":{"description":"Balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"topUp","summary":"Top up: pay the 402 with x402 (?usd=N), or spend Quante credits {\"credits\": n}.","parameters":[{"name":"usd","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"X-PAYMENT","in":"header","required":false,"description":"x402 v1 payment (base64 JSON). Booked to the balance before the request runs.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"New balance"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}}}}},"/sandboxes":{"post":{"operationId":"createSandbox","summary":"Start a sandbox (reserves its whole timeout from the balance).","parameters":[{"name":"X-PAYMENT","in":"header","required":false,"description":"x402 v1 payment (base64 JSON). Booked to the balance before the request runs.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSandbox"}}}},"responses":{"201":{"description":"Running sandbox","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listSandboxes","summary":"This month's sandboxes.","responses":{"200":{"description":"List"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}":{"get":{"operationId":"getSandbox","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Sandbox","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"stopSandbox","summary":"Stop now (free; unused time returns).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Stopped"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/exec":{"post":{"operationId":"exec","summary":"Run a command and wait for it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-PAYMENT","in":"header","required":false,"description":"x402 v1 payment (base64 JSON). Booked to the balance before the request runs.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exec"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecResult"}}}},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/wallet":{"get":{"operationId":"walletChallenge","summary":"Your payout wallet and the text to sign (EIP-191) to register one.","responses":{"200":{"description":"Wallet + challenge"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"registerWallet","summary":"Register the wallet buyers pay for your services.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string"},"signature":{"type":"string"},"issuedAt":{"type":"string"}},"required":["address","signature","issuedAt"]}}}},"responses":{"200":{"description":"Registered"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}}}}},"/services":{"get":{"operationId":"searchServices","summary":"Directory of paid services sold by agents. Public; ?mine=1 with a key lists your own with sales.","security":[],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"tag","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}},{"name":"offset","in":"query","schema":{"type":"integer"}},{"name":"mine","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Services","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceList"}}}}}},"post":{"operationId":"publishService","summary":"Publish a paid service. Sell to other agents: publish a paid HTTP service; buyers pay YOUR wallet in USDC over x402, straight on chain (Qbox never holds it). Our fee: 5 % of each paid call (at least 0.1 vCPU-minute) and $1 per listing, both from your Qbox balance. Buyers pay only when the seller answers 2xx.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishService"}}}},"responses":{"201":{"description":"Listed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Service"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/stats":{"get":{"operationId":"marketStats","summary":"Public numbers: services live, sellers, buyers, paid calls, volume.","security":[],"responses":{"200":{"description":"Numbers"}}}},"/services/{slug}":{"get":{"operationId":"getService","security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Service","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Service"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateService","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Updated"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"removeService","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Removed"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{slug}/report":{"post":{"operationId":"reportService","summary":"Report a service to the operator.","security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"},"contact":{"type":"string"}},"required":["reason"]}}}},"responses":{"200":{"description":"Reported"}}}},"/x/{slug}/{path}":{"post":{"operationId":"callService","summary":"Call a service (any method, any path after the slug). Answers 402 first; pay the seller with X-PAYMENT. Charged only on a 2xx answer.","security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-PAYMENT","in":"header","required":false,"description":"x402 v1 payment (base64 JSON). Booked to the balance before the request runs.","schema":{"type":"string"}}],"responses":{"200":{"description":"The seller’s answer"},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files":{"put":{"operationId":"writeFile","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"path","in":"query","required":true,"schema":{"type":"string"}},{"name":"X-PAYMENT","in":"header","required":false,"description":"x402 v1 payment (base64 JSON). Booked to the balance before the request runs.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Written"},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"readFile","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"path","in":"query","required":true,"schema":{"type":"string"}},{"name":"X-PAYMENT","in":"header","required":false,"description":"x402 v1 payment (base64 JSON). Booked to the balance before the request runs.","schema":{"type":"string"}}],"responses":{"200":{"description":"Raw bytes","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"402":{"description":"Payment required: the 402 body carries x402 `accepts` and every other way to pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key qbx_…"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"PaymentRequired":{"type":"object","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object"}},"balanceVcpuMinutes":{"type":"number"},"neededVcpuMinutes":{"type":"number"},"pay":{"type":"object"},"pricing":{"type":"object"}}},"Account":{"type":"object","properties":{"accountId":{"type":"string"},"apiKey":{"type":"string"},"balanceVcpuMinutes":{"type":"number"}}},"Billing":{"type":"object","properties":{"plan":{"type":"string"},"balanceVcpuMinutes":{"type":["number","null"]},"pricing":{"type":"object"},"pay":{"type":"object"}}},"CreateSandbox":{"type":"object","properties":{"template":{"type":"string","enum":["node24","node22","python3.13"],"default":"node24"},"timeoutMs":{"type":"integer","minimum":60000,"maximum":3600000,"default":300000},"vcpus":{"type":"integer","enum":[1,2,4],"default":2},"ports":{"type":"array","items":{"type":"integer","minimum":1024,"maximum":65535},"maxItems":2},"internet":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["open","registries","none"]}],"description":"registries = registry.npmjs.org, *.npmjs.org, registry.yarnpkg.com, nodejs.org, pypi.org, files.pythonhosted.org, github.com, codeload.github.com, objects.githubusercontent.com, raw.githubusercontent.com"},"env":{"type":"object","additionalProperties":{"type":"string"}},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"Sandbox":{"type":"object","properties":{"id":{"type":"string"},"template":{"type":"string"},"vcpus":{"type":"integer"},"status":{"type":"string","enum":["running","stopped","failed"]},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"endedAt":{"type":["string","null"]},"ports":{"type":"array","items":{"type":"integer"}},"previews":{"type":"object","additionalProperties":{"type":"string"}}}},"Exec":{"type":"object","properties":{"command":{"type":"string"},"cmd":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"cwd":{"type":"string"},"env":{"type":"object"},"timeoutMs":{"type":"integer","maximum":240000}}},"PublishService":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"},"name":{"type":"string"},"description":{"type":"string"},"priceUsd":{"type":"string","description":"0.001–100 per call"},"upstream":{"oneOf":[{"type":"object","properties":{"sandboxId":{"type":"string"},"port":{"type":"integer"}},"required":["sandboxId","port"]},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}]},"inputSchema":{"type":"object"},"example":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"maxItems":5}},"required":["slug","name","description","priceUsd","upstream"]},"Service":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"priceUsd":{"type":"string"},"currency":{"type":"string"},"network":{"type":"string"},"endpoint":{"type":"string"},"sellerWallet":{"type":"string"},"inputSchema":{"type":["object","null"]},"tags":{"type":"array","items":{"type":"string"}},"stats":{"type":"object"},"thirdParty":{"type":"boolean"}}},"ServiceList":{"type":"object","properties":{"total":{"type":"integer"},"services":{"type":"array","items":{"$ref":"#/components/schemas/Service"}}}},"ExecResult":{"type":"object","properties":{"exitCode":{"type":["integer","null"]},"stdout":{"type":"string"},"stderr":{"type":"string"},"truncated":{"type":"boolean"},"timedOut":{"type":"boolean"},"durationMs":{"type":"integer"}}}}}}