Authentication Issues
Invalid API Key
Error:401 Unauthorized
Common Causes:
-
Missing Authorization header
-
Incorrect key format
- API keys must start with
sk-clb- - Verify you’re not using a ChatGPT API key by mistake
- API keys must start with
-
Key has been deleted or deactivated
- Check the API Keys page in the dashboard
- Verify the key’s
is_activestatus istrue
-
Key has expired
- Check the
expires_atfield in the dashboard - Create a new key or extend the expiration
- Check the
Check Key Status
In the dashboard, verify:
- Key exists in the API Keys list
is_activeistrueexpires_atis in the future (ornull)
OAuth Flow Failed
Error: “OAuth error: access_denied” or “Invalid OAuth callback state” Common Causes:-
User denied authorization
- User clicked “Deny” or closed the browser window
- Session expired during authorization
-
State token mismatch
- CSRF protection detected a potential attack
- Session cookie was cleared or expired
- Multiple OAuth flows started simultaneously
-
Callback port not available
- Default callback port
1455is already in use - Firewall blocking the callback server
- Default callback port
Complete Authorization Quickly
Don’t leave the authorization page open for extended periods. Complete it within a few minutes.
Account Deactivated
Symptom: Account shows statusdeactivated in the dashboard
Common Causes:
-
Refresh token expired
- ChatGPT refresh tokens have a limited lifetime
- Token was revoked on the ChatGPT side
-
Account credentials revoked
- Password changed on ChatGPT account
- Account logged out of all sessions
- 2FA settings changed
-
Permanent authentication failure
- Account deleted or suspended
- Terms of service violation
Verify ChatGPT Account
Log in to ChatGPT directly to ensure:
- Account is active and in good standing
- No security alerts or verification required
- Subscription is active (if applicable)
Rate Limiting Issues
API Key Rate Limit Exceeded
Error:429 Too Many Requests
Common Causes:
-
Configured limit reached
- API key has hit one of its rate limits
- Check
current_valuevsmax_valuein the dashboard
-
Underestimated usage
- Actual usage higher than expected
- Large prompts or long completions
- Reasoning tokens for o1 models
Wait for Reset
If you can wait, the limit will automatically reset at the This indicates 43,200 seconds (12 hours) until reset.
reset_at time.Use the Retry-After header to know when to retry:Increase Limit
If you need immediate access:
- Edit the API key in the dashboard
- Increase the
max_valuefor the limit - Save changes
- Retry your request
Account Rate Limited
Symptom: Account shows statusrate_limited in the dashboard
Common Causes:
-
ChatGPT rate limit hit
- Account hit ChatGPT’s rate limits (requests per minute, tokens per day, etc.)
- This is separate from Codex-LB API key limits
-
High traffic spike
- Sudden increase in request volume
- Not enough accounts to handle load
Check Reset Time
ChatGPT rate limits typically reset after 3-60 minutes. Check the account’s
reset_at field if available.Wait for Recovery
Codex-LB automatically routes requests to other accounts. The rate-limited account will recover automatically.
Quota Exceeded
Symptom: Account shows statusquota_exceeded in the dashboard
Common Causes:
-
ChatGPT quota exhausted
- Free tier accounts have daily/weekly quotas
- Plus/Team accounts have higher but still limited quotas
-
All accounts exhausted simultaneously
- Insufficient total quota for traffic volume
Check Account Plan
Verify the account’s plan type:
- Free: Very limited quota
- Plus: Higher quota
- Team/Enterprise: Highest quota
Routing Issues
No Available Accounts
Error:503 Service Unavailable
Common Causes:
-
No accounts added
- Load balancer has no accounts configured
-
All accounts unavailable
- All accounts are
rate_limited,quota_exceeded,paused, ordeactivated
- All accounts are
-
Token refresh failures
- All accounts have failed token refresh and are deactivated
Check Account Status
In the dashboard, review all accounts:If all accounts are unavailable, you’ll see this error.
Add New Accounts
If no accounts exist or all are deactivated:
- Click “Add Account” in the dashboard
- Complete OAuth flow
- Verify new account shows
activestatus
Reactivate Paused Accounts
If accounts are paused:
- Select the paused account
- Click “Reactivate”
- Verify status changes to
active
Model Not Allowed
Error:403 Forbidden
Common Causes:
-
Model not in allowed_models list
- API key has
allowed_modelsconfigured - Requested model is not in the list
- API key has
-
Case mismatch
- Model names are case-sensitive
gpt-4vsGPT-4vsGpt-4
Check Allowed Models
In the dashboard, check the API key’s If
allowed_models:gpt-4 is not in this list, it will be rejected.Update Allowed Models
Add the requested model to the list:
- Edit the API key
- Add the model to
allowed_models - Ensure exact case match (e.g.,
gpt-4) - Save changes
Sticky Sessions Not Working
Symptom: Requests with the sameprompt_cache_key are routed to different accounts
Common Causes:
-
Sticky threads disabled
- Setting
sticky_threads_enabledisfalse
- Setting
-
Missing prompt_cache_key
- Request doesn’t include
prompt_cache_keyin body
- Request doesn’t include
-
Account became unavailable
- Sticky account hit rate limit or was deactivated
- Session reallocated to different account
Request Issues
Upstream Error
Error:502 Bad Gateway or 503 Service Unavailable
Common Causes:
-
ChatGPT API downtime
- Upstream ChatGPT API is experiencing issues
- Check OpenAI Status
-
Network connectivity
- Codex-LB cannot reach ChatGPT API
- Firewall or proxy blocking requests
-
Invalid request payload
- Malformed JSON or unsupported parameters
- Check request body for errors
Check OpenAI Status
Visit https://status.openai.com/ to see if there are ongoing incidents.
Check Logs
Review Codex-LB logs for detailed error messages:Look for connection errors, DNS failures, or timeout messages.
Timeout Errors
Symptom: Request takes a very long time or times out Common Causes:-
Large prompts or completions
- Very long input or output
- O1 models with high reasoning effort
-
Upstream ChatGPT slow
- ChatGPT API is experiencing high latency
-
Client timeout too short
- Client has a timeout shorter than the request duration
Invalid Response Format
Symptom: Response doesn’t match expected OpenAI format Common Causes:-
Error response
- Request failed and returned an error object
- Check for
errorfield in response
-
Streaming mode mismatch
- Client expects streaming but
stream: false - Client expects non-streaming but
stream: true
- Client expects streaming but
Performance Issues
High Latency
Symptom: Requests take longer than expected Common Causes:-
Upstream latency
- ChatGPT API is slow
- Check OpenAI status
-
Account selection overhead
- Many accounts to evaluate
- Complex routing logic
-
Database queries
- Slow database reads for account/key lookup
Measure Latency Components
Check the
X-Request-ID header and review logs to see:- Time to select account
- Time for upstream request
- Time for response processing
Optimize Routing
Use simpler routing strategy:
- Switch to
round_robinif usingusage_weighted - Disable “prefer earlier reset” if enabled
- Disable sticky sessions if not needed
High Error Rate
Symptom: Many requests fail with 429, 503, or 502 errors Common Causes:-
Insufficient capacity
- Not enough accounts for request volume
- Accounts hitting rate limits frequently
-
Account issues
- Accounts becoming deactivated
- Token refresh failures
Dashboard Issues
Cannot Access Dashboard
Symptom: Dashboard login page doesn’t load or returns error Common Causes:-
Codex-LB not running
- Service is stopped or crashed
-
Wrong URL or port
- Dashboard runs on a different port (default: 3000)
-
Firewall blocking access
- Network firewall blocking dashboard port
Login Failed
Symptom: Cannot log in to dashboard Common Causes:-
Wrong password
- Incorrect admin password
-
TOTP enabled
- 2FA required but not provided
-
Session expired
- Previous session timed out
Verify Password
Double-check your admin password. If you’ve forgotten it, reset via environment variable or config file.
Getting Help
If you’re still experiencing issues:-
Check Logs: Review Codex-LB logs for detailed error messages
-
Enable Debug Logging: Set log level to DEBUG for more details
- Review Documentation: Check other guides for related information:
-
Contact Support: Reach out with:
- Error messages (sanitized)
- Steps to reproduce
- Relevant log excerpts
- Configuration details (without secrets)
Next Steps
API Reference
Explore the complete API documentation
Development
Set up a development environment