REST API endpoints for AI Tao Hoo. Base URL: https://api.gateway.aitaohoo.com
All endpoints except /health and /api/auth/* require authentication.
Include your JWT token or API key in the Authorization header:
/api/auth/registerCreate a new user account with a 14-day Pro trial.
Request Body
{ "email": "user@example.com", "password": "securepass", "name": "John" }Response
{ "id": "uuid", "email": "user@example.com", "tier": "pro", "trial_active": true }/api/auth/loginAuthenticate with email and password. Returns a JWT token.
Request Body
{ "email": "user@example.com", "password": "securepass" }Response
{ "token": "eyJ...", "user": { "id": "uuid", "email": "...", "tier": "pro" } }/api/user/meGet the current authenticated user's profile, tier, and trial status.
Response
{ "id": "uuid", "email": "...", "tier": "pro", "role": "user", "trial_active": true, "trial_ends_at": "2026-03-08T..." }/api/keysList all API keys for the authenticated user.
Response
[ { "id": "uuid", "key_prefix": "moji_abc12345", "name": "dev-key", "created_at": "..." } ]/api/keysCreate a new API key. The full key is only returned once.
Request Body
{ "name": "my-key" }Response
{ "id": "uuid", "key": "moji_abc12345...", "key_prefix": "moji_abc12345", "name": "my-key" }/api/keys/:idRevoke an API key by its ID.
Response
{ "success": true }/api/subdomainsList reserved subdomains for the authenticated user.
Response
[ { "id": "uuid", "subdomain": "myapp", "reserved": true, "created_at": "..." } ]/api/subdomainsReserve a subdomain (Pro tier or higher).
Request Body
{ "subdomain": "myapp" }Response
{ "id": "uuid", "subdomain": "myapp", "reserved": true }/api/tunnelsList active and recent tunnel sessions.
Response
[ { "id": "uuid", "subdomain": "myapp", "protocol": "http", "status": "active", "started_at": "..." } ]/api/analyticsGet usage analytics for the last N days.
Response
{ "total_requests": 48200, "total_bytes": 734003200, "avg_duration_ms": 45.2 }/healthHealth check endpoint. Returns server status.
Response
{ "status": "ok", "version": "0.1.0" }