{"openapi":"3.1.0","info":{"title":"VPS Broker","version":"0.3.0","description":"Provision Fly.io VMs via MPP — pay once, get SSH access instantly. No accounts, no API keys.","guidance":"Use POST /v1/vm/create to provision a VM. First call GET /v1/tiers to see available tiers (small/medium/large) and pricing. The create endpoint is MPP-gated — attach payment before calling. On success you receive SSH credentials and a management token; save both as they are shown only once. Use GET /v1/vm/:appName with the management token to check VM status, and DELETE /v1/vm/:appName to destroy it. Bring your own Fly token (flyToken field) to deploy VMs into your own org — this avoids the dedicated IP surcharge and lets you SSH via 'fly ssh console'."},"x-discovery":{"ownershipProofs":[]},"components":{"securitySchemes":{"managementToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Management token issued at VM creation — pass as 'Bearer <token>'. Required for status and destroy operations."}}},"paths":{"/v1/tiers":{"get":{"operationId":"listTiers","summary":"List available VM tiers and pricing","tags":["VMs"],"security":[],"responses":{"200":{"description":"Available tiers","content":{"application/json":{"schema":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tier ID: small, medium, or large"},"name":{"type":"string"},"specs":{"type":"string"},"price":{"type":"string"},"regions":{"type":"array","items":{"type":"string"}}}}}}}}}}}}},"/v1/vm/create":{"post":{"operationId":"createVm","summary":"Provision a new VM with SSH access","tags":["VMs"],"security":[],"x-payment-info":{"pricingMode":"range","minPrice":"5.000000","maxPrice":"23.000000","protocols":["mpp"]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tier":{"type":"string","enum":["small","medium","large"],"default":"small","description":"VM tier. small=$5, medium=$10, large=$20 (per 30 days)"},"region":{"type":"string","enum":["ewr","iad","lax","ams","lhr","cdg","sin","syd","gru"],"default":"ewr","description":"Fly.io region code"},"duration":{"type":"integer","minimum":1,"maximum":90,"default":30,"description":"Duration in days (1-90)"},"sshKey":{"type":"string","description":"OpenSSH public key. If omitted, an ed25519 key pair is generated and returned."},"image":{"type":"string","description":"Docker image for the VM. Defaults to Alpine sshd."},"dedicatedIp":{"type":"boolean","default":true,"description":"Allocate a dedicated IPv4 (+$3). Required for direct SSH. Not needed if you provide flyToken."},"flyToken":{"type":"string","description":"Your Fly.io API token. Deploys VM into your org, waives dedicated IP surcharge."}}}}}},"responses":{"200":{"description":"VM created — includes SSH credentials and management token","content":{"application/json":{"schema":{"type":"object","properties":{"vmId":{"type":"string"},"appName":{"type":"string"},"managementToken":{"type":"string","description":"Save this — required for status/destroy, shown once"},"mode":{"type":"string","enum":["managed","byof"]},"tier":{"type":"string"},"specs":{"type":"string"},"region":{"type":"string"},"state":{"type":"string"},"ssh":{"type":"object","description":"SSH connection details","properties":{"host":{"type":"string"},"port":{"type":"integer"},"user":{"type":"string"},"command":{"type":"string"},"privateKey":{"type":"string","description":"Generated private key (only if sshKey was not provided)"}}},"expiresAt":{"type":"string","format":"date-time"},"price":{"type":"string"}},"required":["vmId","appName","managementToken","ssh","expiresAt"]}}}},"400":{"description":"Invalid tier or missing configuration"},"402":{"description":"Payment Required"},"502":{"description":"Fly.io provisioning error"}}}},"/v1/vm/{appName}":{"get":{"operationId":"getVm","summary":"Get VM status","tags":["VMs"],"security":[{"managementToken":[]}],"parameters":[{"name":"appName","in":"path","required":true,"schema":{"type":"string"},"description":"App name returned at creation"}],"responses":{"200":{"description":"VM status","content":{"application/json":{"schema":{"type":"object","properties":{"vmId":{"type":"string"},"appName":{"type":"string"},"state":{"type":"string"},"region":{"type":"string"},"tier":{"type":"string"},"mode":{"type":"string"},"expiresAt":{"type":"string"},"createdAt":{"type":"string"}}}}}},"401":{"description":"Management token required"},"404":{"description":"VM not found"}}},"delete":{"operationId":"destroyVm","summary":"Destroy a VM","tags":["VMs"],"security":[{"managementToken":[]}],"parameters":[{"name":"appName","in":"path","required":true,"schema":{"type":"string"},"description":"App name returned at creation"}],"responses":{"200":{"description":"VM destroyed","content":{"application/json":{"schema":{"type":"object","properties":{"appName":{"type":"string"},"status":{"type":"string"}}}}}},"401":{"description":"Management token required"},"502":{"description":"Destroy failed"}}}}}}