{"openapi":"3.1.2","info":{"title":"Hyperbox API","version":"v1","description":"List Hyperboxes, retrieve connection credentials, and manage Mac purchases and reservations. Treat connection credentials and connection URLs as secrets. All authenticated responses use Cache-Control: no-store."},"servers":[{"url":"https://hyperbox.sh"}],"externalDocs":{"description":"Hyperbox API documentation","url":"https://hyperbox.sh/docs"},"security":[{"BearerAuth":[]}],"paths":{"/api/v1/hyperboxes":{"get":{"operationId":"listHyperboxes","summary":"List Hyperboxes","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"A page of Hyperbox metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HyperboxPage"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}},"post":{"operationId":"purchaseHyperbox","summary":"Purchase a Mac mini","description":"Starts a monthly subscription using the authorized card. Requires a verified email. Fetch offers and confirm the price before purchasing. Retry with the same idempotency key and body.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Use a unique key for each intended purchase. Reuse it with the same body on retries.","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseRequest"}}}},"responses":{"202":{"description":"Purchase was accepted. Poll statusUrl for the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseResponse"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/api/v1/hyperboxes/credentials":{"get":{"operationId":"listConnectionCredentials","summary":"List connection credentials","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"A page of Hyperboxes with credential availability.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialsPage"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/api/v1/hyperboxes/offers":{"get":{"operationId":"listMacOffers","summary":"List Mac mini offers","responses":{"200":{"description":"Current monthly offers and availability.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffersResponse"}}}},"401":{"$ref":"#/components/responses/Error401"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/api/v1/hyperboxes/purchases/{purchaseId}":{"parameters":[{"$ref":"#/components/parameters/PurchaseId"}],"get":{"operationId":"getPurchase","summary":"Get purchase status","responses":{"200":{"description":"Current state of the purchase, including any required billing action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseResponse"}}}},"401":{"$ref":"#/components/responses/Error401"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/api/v1/hyperboxes/reservations":{"post":{"operationId":"reserveHyperbox","summary":"Reserve a Mac mini","description":"Queues a reservation without an upfront charge. Requires a verified email and an authorized default card. When matching inventory is available, Hyperbox charges the agreed price and starts the monthly subscription.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Use a unique key for each intended reservation. Reuse it with the same body on retries.","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReservationRequest"}}}},"responses":{"202":{"description":"Reservation accepted. Poll reservation.statusUrl for updates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReservationResponse"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"402":{"$ref":"#/components/responses/Error402"},"403":{"$ref":"#/components/responses/Error403"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/api/v1/hyperboxes/reservations/{reservationId}":{"parameters":[{"name":"reservationId","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getReservation","summary":"Get reservation status","responses":{"200":{"description":"Current reservation state and any associated purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReservationResponse"}}}},"401":{"$ref":"#/components/responses/Error401"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}},"delete":{"operationId":"cancelReservation","summary":"Cancel a reservation","description":"Cancel a queued reservation or a legacy reservation before activation, or dismiss a failed reservation.","responses":{"200":{"description":"Reservation was cancelled.","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string"},"status":{"const":"cancelled"}}}}}},"401":{"$ref":"#/components/responses/Error401"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/api/v1/hyperboxes/{hyperboxId}/credentials":{"parameters":[{"$ref":"#/components/parameters/HyperboxId"}],"get":{"operationId":"getConnectionCredentials","summary":"Get connection credentials","responses":{"200":{"description":"Current credentials for a single Hyperbox.","content":{"application/json":{"schema":{"type":"object","required":["hyperbox"],"properties":{"hyperbox":{"$ref":"#/components/schemas/ReadyHyperbox"}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"404":{"$ref":"#/components/responses/Error404"},"409":{"$ref":"#/components/responses/Error409"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/api/v1/hyperboxes/{hyperboxId}":{"parameters":[{"$ref":"#/components/parameters/HyperboxId"}],"delete":{"operationId":"deleteHyperbox","summary":"Delete a Hyperbox","description":"Starts deletion of the Hyperbox and cancellation of its associated billing. This action can destroy workspace data.","responses":{"202":{"description":"Deletion was accepted.","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string"},"status":{"const":"deleting"}}}}}},"401":{"$ref":"#/components/responses/Error401"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Revocable Hyperbox API key. The limit is 60 requests per minute per key."}},"parameters":{"HyperboxId":{"name":"hyperboxId","in":"path","required":true,"schema":{"type":"string"}},"PurchaseId":{"name":"purchaseId","in":"path","required":true,"schema":{"type":"string"}},"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},"Cursor":{"name":"cursor","in":"query","description":"Opaque nextCursor from the previous response for the same endpoint.","schema":{"type":"string","maxLength":8192}}},"responses":{"Error400":{"description":"Invalid input. Check the error code and the request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"description":"Bearer authentication challenge.","schema":{"const":"Bearer"}}}},"Error402":{"description":"An authorized default card is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error403":{"description":"Account email verification is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error404":{"description":"The resource is missing or unavailable to this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error409":{"description":"The current resource state, stock, price, or previous idempotent request prevents the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error429":{"description":"Per-key request limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds before retrying.","schema":{"type":"integer","minimum":1}}}},"Error503":{"description":"The API is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","resolution"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"resolution":{"type":"string"}}}}},"Hyperbox":{"type":"object","required":["id","name","product","status","createdAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"product":{"type":"string","enum":["cloud-pro","mac-mini"]},"status":{"type":"string","enum":["provisioning","starting","running","stopping","stopped","terminating","failed"]},"createdAt":{"type":"number","description":"Unix timestamp in milliseconds."}}},"Pagination":{"type":"object","required":["nextCursor"],"properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"HyperboxPage":{"type":"object","required":["hyperboxes","pagination"],"properties":{"hyperboxes":{"type":"array","items":{"$ref":"#/components/schemas/Hyperbox"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"CredentialsPage":{"type":"object","required":["hyperboxes","pagination"],"properties":{"hyperboxes":{"type":"array","items":{"$ref":"#/components/schemas/HyperboxWithCredentials"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"HyperboxWithCredentials":{"allOf":[{"$ref":"#/components/schemas/Hyperbox"},{"type":"object","required":["credentials","unavailableReason"],"properties":{"credentials":{"anyOf":[{"$ref":"#/components/schemas/Credentials"},{"type":"null"}]},"unavailableReason":{"anyOf":[{"type":"string","enum":["not_ready","no_longer_assigned"]},{"type":"null"}]}}}]},"ReadyHyperbox":{"allOf":[{"$ref":"#/components/schemas/Hyperbox"},{"type":"object","required":["credentials","unavailableReason"],"properties":{"credentials":{"$ref":"#/components/schemas/Credentials"},"unavailableReason":{"type":"null"}}}]},"Credentials":{"type":"object","required":["login","ssh","screenSharing","rustdesk"],"properties":{"login":{"type":"object","required":["username","password"],"properties":{"username":{"type":"string"},"password":{"type":"string","format":"password"}}},"ssh":{"anyOf":[{"type":"object","required":["host","port","username","password"],"properties":{"host":{"type":"string"},"port":{"type":"integer","minimum":1,"maximum":65535},"username":{"type":"string"},"password":{"type":"string","format":"password"}}},{"type":"null"}]},"screenSharing":{"anyOf":[{"type":"object","required":["host","port","username","password","url"],"properties":{"host":{"type":"string"},"port":{"type":"integer","minimum":1,"maximum":65535},"username":{"type":"string"},"password":{"type":"string","format":"password"},"url":{"type":"string","format":"uri-reference"}}},{"type":"null"}]},"rustdesk":{"anyOf":[{"type":"object","required":["id","password","url","server"],"properties":{"id":{"type":"string"},"password":{"type":"string","format":"password"},"url":{"type":"string","format":"uri-reference"},"server":{"anyOf":[{"$ref":"#/components/schemas/RustDeskServer"},{"type":"null"}]}}},{"type":"null"}]}}},"RustDeskServer":{"type":"object","required":["hbbsHost","hbbsPort","hbbrHost","hbbrPort","publicKey"],"properties":{"hbbsHost":{"type":"string"},"hbbsPort":{"type":"integer","minimum":1,"maximum":65535},"hbbrHost":{"type":"string"},"hbbrPort":{"type":"integer","minimum":1,"maximum":65535},"publicKey":{"type":"string"}}},"MacSku":{"type":"string","enum":["m1-8gb","m2-8gb","m1-16gb","m2-16gb","m4-16gb-512gb"]},"OffersResponse":{"type":"object","required":["catalogMode","offers"],"properties":{"catalogMode":{"type":"string","enum":["tiered","generic"]},"offers":{"type":"array","items":{"$ref":"#/components/schemas/Offer"}}}},"Offer":{"type":"object","required":["macSku","label","monthlyPriceCents","currency","interval","available"],"properties":{"macSku":{"anyOf":[{"$ref":"#/components/schemas/MacSku"},{"type":"null"}]},"label":{"type":"string"},"monthlyPriceCents":{"type":"integer","minimum":0},"currency":{"const":"usd"},"interval":{"const":"month"},"available":{"type":"boolean"}}},"PurchaseRequest":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Workspace name, measured after trimming whitespace."},"macSku":{"$ref":"#/components/schemas/MacSku","description":"Required for a tiered catalog unless supplied by a reservation."},"reservationId":{"type":"string","description":"Existing reservation owned by the calling account."},"maxMonthlyPriceCents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Optional maximum monthly price in USD cents before discounts."}}},"ReservationRequest":{"type":"object","additionalProperties":false,"required":["name","monthlyPriceCents"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"macSku":{"$ref":"#/components/schemas/MacSku"},"monthlyPriceCents":{"type":"integer","minimum":0,"description":"Exact quoted monthly USD price in cents."}}},"ReservationResponse":{"type":"object","required":["reservation"],"properties":{"reservation":{"type":"object","required":["id","name","macSku","status","monthlyPriceCents","currency","interval","statusUrl","hyperboxId","purchase"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"macSku":{"anyOf":[{"$ref":"#/components/schemas/MacSku"},{"type":"null"}]},"status":{"type":"string","enum":["reserved","queued","processing","requires_action","failed","fulfilled","cancelled"]},"monthlyPriceCents":{"type":["integer","null"],"minimum":0},"currency":{"const":"usd"},"interval":{"const":"month"},"statusUrl":{"type":"string"},"hyperboxId":{"type":["string","null"]},"purchase":{"anyOf":[{"$ref":"#/components/schemas/Purchase"},{"type":"null"}]}}}}},"PurchaseResponse":{"type":"object","required":["purchase"],"properties":{"purchase":{"$ref":"#/components/schemas/Purchase"}}},"Purchase":{"type":"object","required":["id","status","name","macSku","monthlyPriceCents","currency","interval","hyperboxId","subscriptionId","errorCode","statusUrl","authenticationUrl","credentialsUrl"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","requires_action","succeeded","failed"]},"name":{"type":"string"},"macSku":{"anyOf":[{"$ref":"#/components/schemas/MacSku"},{"type":"null"}]},"monthlyPriceCents":{"type":"integer","minimum":0},"currency":{"const":"usd"},"interval":{"const":"month"},"hyperboxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"subscriptionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"statusUrl":{"type":"string","format":"uri-reference"},"authenticationUrl":{"anyOf":[{"type":"string","format":"uri-reference"},{"type":"null"}]},"credentialsUrl":{"anyOf":[{"type":"string","format":"uri-reference"},{"type":"null"}]}}}}}}