Skip to content

Auth API /api/auth ​

📝 TODO — this English page is a skeleton. The structure mirrors the Chinese page, which is fully written.

MethodPathDescription
POST/api/auth/registerRegister; returns a session token
POST/api/auth/loginLog in
GET/api/auth/meCurrent user
POST/api/auth/logoutRevoke the current session

Register ​

FieldTypeRequiredNotes
emailstringyesStored lower-cased
passwordstringyes8–72 characters, must contain a letter and a digit
displayNamestringnoUp 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.

See also ​

ModelFold — one API for all the best AI models.