Skip to main content
The Instant Classification API uses OAuth2 password-flow authentication. You send your email and password to the token endpoint and receive a JSON Web Token (JWT). Include that token as a Bearer credential in every subsequent request.

Getting a token

Send a POST to /api/v1/login/access-token with application/x-www-form-urlencoded form data:
Response:

Using the token

Add an Authorization header to every API request:
Treat your access token like a password. Store it in an environment variable or secrets manager. Never check it into source control or include it in client-side code.

Token lifetime

Tokens are valid for 8 days from issue. After that, the API returns 401 and you need to request a new token. There is no refresh-token flow — when your token expires, call /api/v1/login/access-token again with your credentials.
Refresh on 401. A missing, expired or otherwise unusable token all return 401 Could not validate credentials with a WWW-Authenticate: Bearer header.This changed in July 2026. The API previously returned 403 for an expired token, which meant the usual if 401: refresh() branch never fired. If your client was written against 403, switch it to 401.

Testing your token

To verify a token is valid without making a classification request, call:
A valid token returns your user profile. An invalid or expired token returns 401.
is_paid tells you whether your account is still subject to the free-tier quota. See Rate limits & quotas.

Password recovery

If you forget your password:
  1. Send a POST to /api/v1/password-recovery/{email} with your account email.
  2. Check your inbox for a reset link containing a one-time token. The token expires after 48 hours.
  3. Send a POST to /api/v1/reset-password/ with the token and your new password (8–128 characters).
An expired or already-used token returns 400 Invalid token. Request a new one by repeating step 1. The API always returns the same response regardless of whether the email exists, to prevent account enumeration.

Failure modes

Both /login/access-token and /password-recovery/{email} are rate limited to 5 requests per minute in production. Cache your token for its full 8 days rather than fetching a new one per request. See Errors for the full status-code matrix.
Last modified on July 30, 2026