Skip to main content
POST
/
api
/
auth
/
login
Login
curl --request POST \
  --url https://api.example.com/api/auth/login \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'username=<string>' \
  --data 'password=<string>' \
  --data 'grant_type=<string>' \
  --data scope= \
  --data 'client_id=<string>' \
  --data 'client_secret=<string>'
{
  "access_token": "<string>",
  "token_type": "bearer"
}
The Authentication API allows you to authenticate users and obtain access tokens for the OpenMemoryX portal.

Register

Create a new user account.
email
string
required
User email address
password
string
required
User password (min 8 characters)

Request

curl -X POST https://t0ken.ai/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securepassword123"
  }'

Response

{
  "id": 1,
  "email": "user@example.com",
  "message": "User registered successfully"
}

Login

Authenticate and obtain a JWT access token.
username
string
required
User email address
password
string
required
User password

Request

curl -X POST https://t0ken.ai/api/auth/login \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "username=user@example.com&password=securepassword123"

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer"
}

Get Current User

Retrieve information about the currently authenticated user.

Request

curl https://t0ken.ai/api/auth/me \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

{
  "id": 1,
  "email": "user@example.com",
  "created_at": "2026-02-13T10:00:00Z"
}

Body

application/x-www-form-urlencoded
username
string
required
password
string<password>
required
grant_type
string | null
Pattern: ^password$
scope
string
default:""
client_id
string | null
client_secret
string<password>

Response

Successful Response

access_token
string
required
token_type
string
default:bearer