Auth API /api/auth
📝 TODO — this English page is a skeleton. The structure mirrors the Chinese page, which is fully written.
| Method | Path | Description |
|---|---|---|
POST | /api/auth/register | Register; returns a session token |
POST | /api/auth/login | Log in |
GET | /api/auth/me | Current user |
POST | /api/auth/logout | Revoke the current session |
Register
| Field | Type | Required | Notes |
|---|---|---|---|
email | string | yes | Stored lower-cased |
password | string | yes | 8–72 characters, must contain a letter and a digit |
displayName | string | no | Up to 60 characters |
Errors: 400 invalid_email, 400 password_needs_letter_and_digit, 409 email_taken.
Log in
bash
curl -X POST "https://ai.modelfold.online/api/auth/login" \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"Abcd1234"}'Login failures always return the same 401 invalid_credentials body, and a hash is computed even for unknown accounts, so the endpoint cannot be used to enumerate registered emails.