{"openapi":"3.1.0","info":{"title":"DedicatedMac API","version":"1.0.0","summary":"Public HTTP API for DedicatedMac, the dedicated Mac mini M4 cloud rental service.","description":"DedicatedMac rents single-tenant, bare-metal Mac mini M4 hardware in the cloud.\n\nThis specification covers the three endpoints that are callable without a staff credential:\ncheck live stock, start a Stripe Checkout session, and join the waitlist for an out-of-stock\nconfiguration. Administrative, cron, dashboard and webhook routes are intentionally excluded.\n\nHuman-readable reference: https://dedicatedmac.io/docs/api\nAgent instructions: https://dedicatedmac.io/agent-instructions.md","contact":{"name":"DedicatedMac Support","email":"support@dedicatedmac.io","url":"https://dedicatedmac.io/contact"}},"servers":[{"url":"https://dedicatedmac.io","description":"Production"}],"externalDocs":{"description":"DedicatedMac developer documentation","url":"https://dedicatedmac.io/docs"},"tags":[{"name":"DedicatedMac","description":"Stock, checkout and waitlist for Mac mini M4 rentals."}],"components":{"securitySchemes":{"firebaseIdToken":{"type":"http","scheme":"bearer","bearerFormat":"Firebase ID token","description":"Optional. A Firebase ID token from a signed-in customer portal session. When present, the token's email replaces the email in the request body."}}},"paths":{"/api/sku-availability":{"get":{"operationId":"getSkuAvailability","summary":"Check live stock for every DedicatedMac plan","description":"Returns a boolean per SKU indicating whether at least one Mac mini of that generation and configuration is AVAILABLE with remote-access credentials. This is the same call the pricing page makes before it decides whether to show a checkout button or a waitlist button. The response is never cached; ask again immediately before starting a checkout.\n\nAuthentication: None. Public, unauthenticated, no API key.","tags":["DedicatedMac"],"responses":{"200":{"description":"Availability map keyed by SKU id.","content":{"application/json":{"schema":{"type":"object"},"example":{"availability":{"standard":true,"standard_plus":false,"ultimate":true}}}}},"500":{"description":"Inventory could not be read.","content":{"application/json":{"schema":{"type":"object"},"example":{"error":"Unable to load availability"}}}}}}},"/api/waitlist":{"post":{"operationId":"postWaitlist","summary":"Join the waitlist for an out-of-stock configuration","description":"Records an email address against a specific SKU and billing period so we can notify that person when the configuration is back in stock. Use this when GET /api/sku-availability reports the SKU as false.\n\nAuthentication: None. Public, unauthenticated, no API key.","tags":["DedicatedMac"],"responses":{"200":{"description":"Recorded.","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true}}}},"400":{"description":"Missing or malformed sku or email.","content":{"application/json":{"schema":{"type":"object"},"example":{"error":"Invalid plan selection"}}}},"500":{"description":"Unexpected server error."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","description":"Which Mac configuration to be notified about.","enum":["standard","standard_plus","ultimate"]},"billing":{"type":"string","description":"Billing period of interest. Defaults to monthly if omitted or unrecognised.","enum":["daily","weekly","monthly","quarterly"]},"email":{"type":"string","description":"Address to notify. Normalised to lowercase."},"name":{"type":"string","description":"Full name, used only to personalise follow-up."}},"required":["sku","email"],"additionalProperties":false}}}}}},"/api/checkout":{"post":{"operationId":"postCheckout","summary":"Create a Stripe Checkout session for a rental","description":"Creates a Stripe subscription Checkout session and returns its hosted URL. The caller (or the end user) must open that URL in a browser to enter payment details; there is no headless purchase path. Daily billing is priced but not self-serve — contact sales for it. M6 supports weekly or monthly billing. If the SKU is out of stock the call fails with 409; use POST /api/waitlist for M4 or POST /api/waitlist/m6 for M6.\n\nAuthentication: Optional. Send `Authorization: Bearer <Firebase ID token>` to bind the session to a signed-in portal account; the token's email then overrides the email in the body. Without a token the call is anonymous and the supplied email is not treated as proof of ownership.","tags":["DedicatedMac"],"responses":{"200":{"description":"Session created. Open `url` in a browser to pay.","content":{"application/json":{"schema":{"type":"object"},"example":{"url":"https://checkout.stripe.com/c/pay/cs_live_..."}}}},"400":{"description":"Invalid plan selection or invalid email.","content":{"application/json":{"schema":{"type":"object"},"example":{"error":"Invalid plan selection"}}}},"409":{"description":"That configuration is out of stock; join the waitlist instead.","content":{"application/json":{"schema":{"type":"object"},"example":{"error":"This configuration is currently out of stock. Join the waitlist to get notified."}}}},"500":{"description":"Stripe or catalog error."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","description":"Mac generation and configuration to rent.","enum":["standard","standard_plus","ultimate","m6_standard","m6_ultimate"]},"billing":{"type":"string","description":"Billing period.","enum":["daily","weekly","monthly","quarterly"]},"email":{"type":"string","description":"Billing email. Ignored when a valid Firebase ID token is supplied."},"name":{"type":"string","description":"Full name passed to Stripe as the customer name."}},"required":["sku","billing","email"],"additionalProperties":false}}}},"security":[{},{"firebaseIdToken":[]}]}}}}