HTTP API
Base URL https://addtothese.com/api/v1. Xác thực bằng Authorization: Bearer att_... (token API) hoặc phiên trình duyệt kèm X-CSRF-Token. Mọi body đều là JSON; lỗi có dạng {"error": "...", "code": "..."}.
| Phương thức | Path | Mục đích |
|---|---|---|
| POST | /auth/register | {email, password, name} |
| POST | /auth/login | {email, password}; có thể trả về {mfa_required: true} |
| POST | /auth/totp/verify | {code} |
| POST | /auth/logout | |
| POST | /auth/password/forgot | /auth/password/reset | {email} | {token, password} |
| GET | /auth/oauth/{google|github} | bắt đầu OAuth |
| GET/PATCH | /me | tài khoản; PATCH {name} |
| POST | /me/totp/setup | enable | disable | xác thực hai lớp |
| POST | /me/password | {current_password, new_password} |
| GET/POST/DELETE | /tokens[/{id}] | token API; POST {name} trả về secret một lần duy nhất |
| GET/POST/DELETE | /endpoints[/{id}] | POST {subdomain, protocol} |
| POST | /endpoints/ephemeral | {protocol} tên ngẫu nhiên |
| GET/POST/DELETE | /domains[/{id}] | POST {domain, endpoint_id} |
| POST | /domains/{id}/verify | kiểm tra DNS |
| POST | /agent-token | {endpoints: []} trả về {token, upstream_url, endpoints, expires_at} |
| GET | /usage | chu kỳ hiện tại và lịch sử |
| GET | /tunnels | các agent đang kết nối |
| GET | /billing/prices | các gói và giá Stripe |
| POST | /billing/checkout | /billing/portal | {price} trả về {url} |