{"openapi":"3.1.0","info":{"title":"Opzero.sh Deployment API","version":"1.0.0","description":"AI-powered web deployment platform. Deploy HTML, React, and full-stack applications to Cloudflare, Netlify, or Vercel directly from AI agents.\n\n## Getting Started\n\n1. Authenticate using OAuth 2.0 or an API key\n2. Use the MCP endpoint for full functionality, or these REST endpoints for simple operations\n3. Deploy websites in seconds\n\n## MCP Integration (Recommended)\n\nFor full functionality, use the MCP server at `https://opzero.sh/mcp` with Streamable HTTP transport.\n\n## Quick Deploy Example\n\n```json\nPOST /api/deploy\n{\n  \"html\": \"<!DOCTYPE html><html><body><h1>Hello World</h1></body></html>\"\n}\n```\n\nReturns: `{ \"url\": \"https://abc123.pages.dev\", \"deploymentId\": \"dep_xyz\" }`","contact":{"name":"Opzero.sh Support","url":"https://opzero.sh"},"termsOfService":"https://opzero.sh/terms"},"servers":[{"url":"https://opzero.sh","description":"Production server"}],"security":[{"bearerAuth":[]},{"oauth2":["deploy"]}],"paths":{"/api/deploy":{"post":{"operationId":"quickDeploy","summary":"Quick Deploy HTML","description":"Deploy a single HTML file or simple website instantly. Returns a live URL.","tags":["Deployment"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string","description":"HTML content to deploy","example":"<!DOCTYPE html><html><head><title>My Site</title></head><body><h1>Hello!</h1></body></html>"},"files":{"type":"object","description":"Map of file paths to contents (alternative to html)","additionalProperties":{"type":"string"},"example":{"index.html":"<!DOCTYPE html>...","style.css":"body { font-family: sans-serif; }"}},"name":{"type":"string","description":"Project name (optional, auto-generated if not provided)"},"target":{"type":"string","enum":["cloudflare","netlify","vercel"],"default":"cloudflare","description":"Deployment target platform"}}}}}},"responses":{"200":{"description":"Deployment successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"url":{"type":"string","example":"https://my-site-abc123.pages.dev"},"deploymentId":{"type":"string","example":"dep_xyz789"},"projectId":{"type":"string","example":"proj_abc123"}}}}}},"401":{"description":"Unauthorized - API key or OAuth token required"},"429":{"description":"Rate limit exceeded"}}}},"/api/projects":{"get":{"operationId":"listProjects","summary":"List Projects","description":"List all deployment projects for the authenticated user.","tags":["Projects"],"responses":{"200":{"description":"List of projects","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"target":{"type":"string","enum":["cloudflare","netlify","vercel"]},"createdAt":{"type":"string","format":"date-time"}}}}}}}}}}},"post":{"operationId":"createProject","summary":"Create Project","description":"Create a new deployment project.","tags":["Projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Project name"},"description":{"type":"string","description":"Project description"},"target":{"type":"string","enum":["cloudflare","netlify","vercel"],"default":"cloudflare"}}}}}},"responses":{"201":{"description":"Project created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"target":{"type":"string"}}}}}}}}},"/api/deployments":{"get":{"operationId":"listDeployments","summary":"List Deployments","description":"List recent deployments, optionally filtered by project.","tags":["Deployments"],"parameters":[{"name":"projectId","in":"query","schema":{"type":"string"},"description":"Filter by project ID"},{"name":"limit","in":"query","schema":{"type":"integer","default":10},"description":"Maximum number of deployments to return"}],"responses":{"200":{"description":"List of deployments","content":{"application/json":{"schema":{"type":"object","properties":{"deployments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["pending","building","ready","error"]},"createdAt":{"type":"string","format":"date-time"}}}}}}}}}}}},"/api/templates/{template}":{"get":{"operationId":"getTemplate","summary":"Get Template","description":"Get starter template files for common frameworks.","tags":["Templates"],"parameters":[{"name":"template","in":"path","required":true,"schema":{"type":"string","enum":["static","vite-react","landing","portfolio","blog","react-esm"]},"description":"Template name"}],"responses":{"200":{"description":"Template files","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"object","additionalProperties":{"type":"string"},"description":"Map of file paths to contents"}}}}}}}}},"/mcp":{"post":{"operationId":"mcpRequest","summary":"MCP JSON-RPC Endpoint","description":"Model Context Protocol endpoint for full tool access. Use Streamable HTTP transport.","tags":["MCP"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"method":{"type":"string","enum":["initialize","tools/list","tools/call","resources/list","prompts/list"]},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"JSON-RPC response","content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"type":["string","integer","null"]},"result":{"type":"object"},"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key (wcd_*) or OAuth Token (oat_*)","description":"API key from dashboard or OAuth access token"},"oauth2":{"type":"oauth2","description":"OAuth 2.0 with PKCE","flows":{"authorizationCode":{"authorizationUrl":"https://authkit.open0p.com/oauth/authorize","tokenUrl":"https://authkit.open0p.com/oauth/token","scopes":{"openid":"OpenID Connect","profile":"User profile","email":"User email","deploy":"Deploy websites","read":"Read-only access"}}}}}},"tags":[{"name":"Deployment","description":"Deploy websites and applications"},{"name":"Projects","description":"Manage deployment projects"},{"name":"Deployments","description":"View deployment history"},{"name":"Templates","description":"Get starter templates"},{"name":"MCP","description":"Model Context Protocol endpoint"}],"externalDocs":{"description":"Full documentation","url":"https://opzero.sh/docs"}}