Skip to main content

1. Register an Account

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

2. Login to Get Token

curl -X POST https://t0ken.ai/api/auth/login \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "[email protected]&password=securepassword123"

3. Get Your API Key

curl https://t0ken.ai/api/keys \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Default",
      "key": "omx_xxxxxxxxxxxxxxxxxxxxxxxx",
      "is_active": true
    }
  ]
}

4. Create Your First Memory

curl -X POST https://t0ken.ai/api/v1/memories \
  -H "Content-Type: application/json" \
  -H "X-API-Key: omx_your_api_key" \
  -d '{
    "content": "User prefers dark mode in all applications",
    "project_id": "default",
    "metadata": {
      "source": "user_settings",
      "importance": "high"
    }
  }'

5. Search Memories

curl -X POST https://t0ken.ai/api/v1/memories/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: omx_your_api_key" \
  -d '{
    "query": "user preferences",
    "limit": 10
  }'

Next Steps