Skip to main content

Authentication

Every endpoint except sign-up and login needs a Bearer token. You get one by logging in with your TryOn AI account.

Base URL: https://api.tryonlabs.ai

info

Create a free account at the TryOn AI Playground, or use the API below.

1. Create an account (optional)​

curl -X POST https://api.tryonlabs.ai/api/v1/user/create/ \
-H "Content-Type: application/json" \
-d '{
"username": "jane",
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com",
"password": "a-strong-password"
}'

We email a one-time code (valid for 5 minutes). Confirm it to activate the account:

curl -X POST https://api.tryonlabs.ai/api/v1/user/verify/ \
-H "Content-Type: application/json" \
-d '{"email": "jane@example.com", "otp": "123456"}'

2. Get an access token​

curl -X POST https://api.tryonlabs.ai/api/v1/user/token/ \
-H "Content-Type: application/json" \
-d '{"email": "jane@example.com", "password": "a-strong-password"}'
{
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOi...",
"access": "eyJ0eXAiOiJKV1QiLCJhbGciOi..."
}

3. Send the token on every request​

-H "Authorization: Bearer <access>"
warning

Keep your token secret and never ship it in client-side code. Your account must be email-verified to log in.