Session-Based Authentication
All Management API requests require a valid session token in theAuthorization header:
Obtaining a Session Token
- Log in to the LLM Gateway dashboard at https://llmgateway.io
- Open your browser’s developer tools (F12)
- Go to the Network tab
- Make any API request from the dashboard
- Look for the
Authorizationheader in the request - Copy the token value (without the “Bearer ” prefix)
Session tokens are tied to your user account and inherit your permissions. Keep them secure and never share them publicly.
Development Mode
For local development and testing, you can use the test token:Example Requests
Authentication Errors
401 Unauthorized
Returned when the session token is missing, invalid, or expired:- Verify your session token is correct
- Check if your session has expired (log in again)
- Ensure the
Authorizationheader is properly formatted
403 Forbidden
Returned when you don’t have permission to access the resource:- Verify you have the correct role (owner/admin/developer)
- Check if you’re accessing resources from your organization
- Contact your organization owner if you need elevated permissions
Security Best Practices
Recommendations
- Store securely: Use environment variables or secure secret management
- Rotate regularly: Log out and back in to refresh your session
- Monitor usage: Check audit logs for unexpected API activity
- Use HTTPS: Always use HTTPS in production to encrypt token transmission
- Limit scope: Use service accounts with minimal permissions when possible
Session Expiration
Session tokens expire after a period of inactivity. When your session expires:- You’ll receive a
401 Unauthorizedresponse - Log back in to the dashboard to obtain a new token
- Update your API client with the new token