# AntiEdge — Agent Deployment Guide (`https://antiedge.dev/agent.md`)

You are deploying a web project or static site to **AntiEdge** (`https://antiedge.dev`).
Do NOT ask the user to paste API keys or secrets into chat. Use the endpoints below.

## 1. Authenticate (Device-Code Flow)
1. Start device login:
   `POST https://antiedge.dev/api/device/start`
   Returns `{ "code": "XXXX-YYYY", "verifyUrl": "/activate?code=XXXX-YYYY" }`.
2. Show the user `https://antiedge.dev/activate?code=XXXX-YYYY` and the code `XXXX-YYYY` to approve once in their browser.
3. Poll until approved:
   `GET https://antiedge.dev/api/device/poll?code=XXXX-YYYY`
   Returns `{ "approved": true, "token": "<bearer_token>" }`.

*(Or if the user already has a token from `POST /api/auth/login` or `/api/auth/signup`, pass `Authorization: Bearer <token>`.)*

## 2. Deploy a Project
`POST https://antiedge.dev/api/deploy`
Headers: `Authorization: Bearer <token>`, `Content-Type: application/json`
Body:
```json
{
  "slug": "my-project",
  "files": [
    { "path": "index.html", "contentType": "text/html", "contentB64": "<base64>", "sizeBytes": 1240 }
  ]
}
```
Returns `{ "ok": true, "slug": "my-project", "url": "https://antiedge.dev/s/my-project/" }`.

## 3. Write-Only Secrets & Custom Domains
- Set secret (write-only, never returned in GET): `POST https://antiedge.dev/api/v1/secrets/<slug>` with `{ "key": "API_KEY", "value": "..." }`
- Attach custom domain: `PATCH https://antiedge.dev/api/sites/<slug>` with `{ "custom_domain": "example.com" }`

## 4. Plan Limits (Hard Caps — Zero Surprise Overage Bills)
- **Free (`$0`)**: 1 project · 100 MB storage · 100,000 requests/mo · 500 GB bandwidth · 30 deploys/mo · 1 custom domain · free email forwarding · 100 contact form submissions/mo · commercial use allowed.
- **Personal (`$5/mo`)**: 5 projects · 2 GB storage · 1,000,000 requests/mo · unlimited bandwidth · 100 deploys/mo · 5 custom domains · basic analytics · cron jobs (3/app).
- **Pro (`$9/mo`)**: 25 projects · 10 GB storage · 10,000,000 requests/mo · unlimited bandwidth · unlimited deploys (fair use) · 25 custom domains · advanced analytics · 3 team seats.
