{"openapi":"3.1.0","info":{"title":"guisesAi hosting for AI agents","version":"1.0.0","description":"Host static sites, games and apps at https://NAME.guises.site. One site is free for every account; Pro hosts up to three. Sign in with the device flow (the person approves at https://guises.ai/connect), then create a site and upload its files. Guide: https://guises.ai/hosting.md"},"servers":[{"url":"https://guises.ai"}],"components":{"securitySchemes":{"agentToken":{"type":"http","scheme":"bearer","description":"An access token (gsa_…) from POST /api/agent/token, after the person approves."}}},"paths":{"/api/agent/login":{"post":{"operationId":"startLogin","summary":"Start signing in: returns a code for the person to approve","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"client":{"type":"string","description":"Your name, shown to the person, like Claude Code"}}}}}},"responses":{"200":{"description":"Show verification_uri_complete to the person; then poll /api/agent/token","content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string"},"user_code":{"type":"string"},"verification_uri":{"type":"string"},"verification_uri_complete":{"type":"string"},"expires_in":{"type":"integer"},"interval":{"type":"integer"}}}}}}}}},"/api/agent/token":{"post":{"operationId":"getToken","summary":"Ask for the token every interval seconds until the person approves","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["device_code"],"properties":{"device_code":{"type":"string"}}}}}},"responses":{"200":{"description":"Approved","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"}}}}}},"400":{"description":"authorization_pending (ask again), expired_token or invalid_grant (start again)"},"403":{"description":"access_denied: the person said no"}}}},"/api/agent/me":{"get":{"operationId":"whoAmI","summary":"The account and how many sites it can host","security":[{"agentToken":[]}],"responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"plan":{"type":"string"},"sites_allowed":{"type":"integer","description":"How many sites this account can host"},"sites_left":{"type":"integer","description":"How many more it can create now"}}}}}}}}},"/api/agent/sites":{"get":{"operationId":"listSites","summary":"The account's hosted sites","security":[{"agentToken":[]}],"responses":{"200":{"description":"Sites","content":{"application/json":{"schema":{"type":"object","properties":{"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"short_url":{"type":"string","description":"A shorter address that forwards to the site, when it has one"},"state":{"type":"string","enum":["live","waiting","paused","taken_down"]},"versions":{"type":"integer"},"updated":{"type":["string","null"]}}}}}}}}}}},"post":{"operationId":"createSite","summary":"Create a site at NAME.guises.site","security":[{"agentToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Lowercase letters, numbers and hyphens"}}}}}},"responses":{"201":{"description":"Created"},"402":{"description":"No room on this plan","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string","description":"What went wrong and what to change"}}}}}},"409":{"description":"Name taken","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string","description":"What went wrong and what to change"}}}}}}}}},"/api/agent/sites/{name}/deploy":{"post":{"operationId":"deploySite","summary":"Upload the built files; the site goes live at once","security":[{"agentToken":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"A zip of the output folder's contents (application/zip), or JSON files for tools that can't zip. Limits: 25 MB, 900 files.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","items":{"type":"object","required":["path","content"],"properties":{"path":{"type":"string","description":"Relative path, like index.html or assets/app.js"},"content":{"type":"string"},"encoding":{"type":"string","enum":["utf8","base64"],"description":"base64 for images, audio and other binary files"}}}}}}}}},"responses":{"200":{"description":"Live","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"url":{"type":"string"},"version":{"type":"string"},"message":{"type":"string"}}}}}},"400":{"description":"Something to fix, explained in error","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string","description":"What went wrong and what to change"}}}}}}}}}}}