Skip to Content
WikiTroubleshooting

Troubleshooting

Common issues and their solutions when using MyTokenGate.

Authentication Errors

Invalid API Key

Error: 401 Unauthorized - Invalid API key

Solution:

  1. Verify your API key in the dashboard
  2. Ensure no extra spaces or line breaks
  3. Check if the key has been revoked
  4. 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:

  1. 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)
  1. Check rate limit headers:
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1682524800

Model Errors

Model Not Found

Error: 404 Not Found - Model not available

Solution:

  1. Check available models: GET /v1/models
  2. Verify model name spelling
  3. Some models require special access

Context Length Exceeded

Error: 400 Bad Request - Context length exceeded

Solution:

  1. Reduce input token count
  2. Use a model with larger context window
  3. Implement text chunking

Connection Issues

Timeout Errors

Error: 504 Gateway Timeout

Solution:

  1. Increase client timeout settings
  2. Use streaming for long responses
  3. Check your network connectivity

Connection Refused

Error: ECONNREFUSED

Solution:

  1. Verify the API endpoint URL
  2. Check firewall settings
  3. Ensure SSL/TLS is properly configured

Billing Issues

Insufficient Balance

Error: 402 Payment Required - Insufficient balance

Solution:

  1. Check your account balance
  2. Add funds to your account
  3. Set up auto-recharge

Need More Help?

Last updated on