HTTP API

基础 URL 为 https://addtothese.com/api/v1。使用 Authorization: Bearer att_...(API 令牌)或浏览器会话加 X-CSRF-Token 进行身份验证。所有请求体和响应体均为 JSON;错误格式为 {"error": "...", "code": "..."}。

方法路径用途
POST/auth/register{email, password, name}
POST/auth/login{email, password};可能返回 {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}发起 OAuth
GET/PATCH/me账户;PATCH {name}
POST/me/totp/setup | enable | disable双重验证
POST/me/password{current_password, new_password}
GET/POST/DELETE/tokens[/{id}]API 令牌;POST {name} 仅返回一次密钥
GET/POST/DELETE/endpoints[/{id}]POST {subdomain, protocol}
POST/endpoints/ephemeral{protocol} 随机名称
GET/POST/DELETE/domains[/{id}]POST {domain, endpoint_id}
POST/domains/{id}/verifyDNS 检查
POST/agent-token{endpoints: []} 返回 {token, upstream_url, endpoints, expires_at}
GET/usage当前周期和历史记录
GET/tunnels已连接的客户端
GET/billing/prices套餐和 Stripe 价格
POST/billing/checkout | /billing/portal{price} 返回 {url}