Troubleshooting
Common issues and their solutions when using MyTokenGate.
Authentication Errors
Invalid API Key
Error: 401 Unauthorized - Invalid API key
Solution:
- Verify your API key in the dashboard
- Ensure no extra spaces or line breaks
- Check if the key has been revoked
- Generate a new key if needed
Expired Token
Error: 401 Unauthorized - Token expired
Solution:
- Refresh your authentication token
- Implement token refresh logic in your application
Rate Limiting
Rate Limit Exceeded
Error: 429 Too Many Requests
Solution:
- Implement exponential backoff:
import time
import random
def retry_with_backoff(func, max_retries=5):
for i in range(max_retries):
try:
return func()
except RateLimitError:
wait = (2 ** i) + random.random()
time.sleep(wait)- Check rate limit headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1682524800Model Errors
Model Not Found
Error: 404 Not Found - Model not available
Solution:
- Check available models:
GET /v1/models - Verify model name spelling
- Some models require special access
Context Length Exceeded
Error: 400 Bad Request - Context length exceeded
Solution:
- Reduce input token count
- Use a model with larger context window
- Implement text chunking
Connection Issues
Timeout Errors
Error: 504 Gateway Timeout
Solution:
- Increase client timeout settings
- Use streaming for long responses
- Check your network connectivity
Connection Refused
Error: ECONNREFUSED
Solution:
- Verify the API endpoint URL
- Check firewall settings
- Ensure SSL/TLS is properly configured
Billing Issues
Insufficient Balance
Error: 402 Payment Required - Insufficient balance
Solution:
- Check your account balance
- Add funds to your account
- Set up auto-recharge
Need More Help?
- Check the FAQ for common questions
- Contact support at support@mytokengate.com
- Join our Community for peer support
Last updated on