Skip to main content
POST
/
api
/
auth
/
api-token
curl --request POST \
  --url https://zeus.agentspro.cn/api/auth/api-token \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "user@example.com",
    "password": "your-password"
  }'
{
  "token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6Inh4eCJ9...",
  "refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
  "user": {
    "id": "user_abc123",
    "email": "user@example.com",
    "name": "Frank"
  },
  "expires_in": 3600
}
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.
email
string
required
Registered email address
password
string
required
Password
token
string
JWT access token (valid for 1 hour). Usage: Authorization: Bearer <token>
refreshToken
string
Refresh token (valid for 30 days). Use with POST /api/auth/refresh to obtain a new access token when it expires.
user
object
User information
expires_in
number
Access token validity in seconds: 3600 (1 hour)
curl --request POST \
  --url https://zeus.agentspro.cn/api/auth/api-token \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "user@example.com",
    "password": "your-password"
  }'
{
  "token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6Inh4eCJ9...",
  "refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
  "user": {
    "id": "user_abc123",
    "email": "user@example.com",
    "name": "Frank"
  },
  "expires_in": 3600
}