Authentication
The Char AI API uses Bearer token authentication with WorkOS JWT tokens.Authorization Header
Include your JWT token in the Authorization header of every request:Authorization Levels
The API has three authorization levels:| Level | Description | Required Claims |
|---|---|---|
| Public | No authentication required | None |
| Protected | Valid JWT token required | User authentication |
| Organization | JWT with organization context | org_id claim |
Most endpoints require organization context. Ensure your JWT token includes the
org_id claim.Obtaining a Token
JWT tokens are obtained through the WorkOS AuthKit authentication flow:- User authenticates via WorkOS
- WorkOS returns a signed JWT token
- Include this token in all API requests
Token Validation
Tokens are validated on every request. If a token is:- Missing: Returns
401 UNAUTHORIZED - Invalid or Expired: Returns
401 UNAUTHORIZED - Missing Organization Context: Returns
403 FORBIDDEN
Error Responses
Authentication errors follow a consistent format:Security Best Practices
Secure Storage
Never expose JWT tokens in client-side code or version control
Token Rotation
Refresh tokens before they expire to maintain session continuity

