Back to Docs

API Reference

REST API endpoints for AI Tao Hoo. Base URL: https://api.gateway.aitaohoo.com

Authentication

All endpoints except /health and /api/auth/* require authentication.

Include your JWT token or API key in the Authorization header:

Authorization: Bearer your_token_or_api_key
POST
/api/auth/register

Create 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 }
POST
/api/auth/login

Authenticate 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" } }
GET
/api/user/me

Get 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..." }
GET
/api/keys

List all API keys for the authenticated user.

Response

[ { "id": "uuid", "key_prefix": "moji_abc12345", "name": "dev-key", "created_at": "..." } ]
POST
/api/keys

Create 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" }
DELETE
/api/keys/:id

Revoke an API key by its ID.

Response

{ "success": true }
GET
/api/subdomains

List reserved subdomains for the authenticated user.

Response

[ { "id": "uuid", "subdomain": "myapp", "reserved": true, "created_at": "..." } ]
POST
/api/subdomains

Reserve a subdomain (Pro tier or higher).

Request Body

{ "subdomain": "myapp" }

Response

{ "id": "uuid", "subdomain": "myapp", "reserved": true }
GET
/api/tunnels

List active and recent tunnel sessions.

Response

[ { "id": "uuid", "subdomain": "myapp", "protocol": "http", "status": "active", "started_at": "..." } ]
GET
/api/analytics

Get usage analytics for the last N days.

Response

{ "total_requests": 48200, "total_bytes": 734003200, "avg_duration_ms": 45.2 }
GET
/health

Health check endpoint. Returns server status.

Response

{ "status": "ok", "version": "0.1.0" }