Auth
Get API Token
Obtain a JWT Token using email and password — for external callers to directly access the AI Backend
POST
Obtain a JWT Token directly using email and password, without going through the browser login flow. The token can be used to call any authenticated API on the AI Backend.
Use Cases
- CLI tools calling the Agent API
- Third-party system integrations
- Postman / cURL debugging
- Automation scripts
Authentication Flow
This endpoint is served by the Next.js web layer (not the AI Backend), because JWT issuance relies on Better Auth.
string
required
Registered email address
string
required
Password
string
JWT access token (valid for 1 hour). Usage:
Authorization: Bearer <token>string
Refresh token (valid for 30 days). Use with
POST /api/auth/refresh to obtain a new access token when it expires.object
User information
number
Access token validity in seconds:
3600 (1 hour)