Troubleshooting Overview

Quick Access: Support | Errors | Request Logs

This section provides solutions to common issues you may encounter when using LangMart. Use these guides to quickly diagnose and resolve problems.

Common Issues

Connection Problems

Issues connecting to providers or the LangMart API:

  • Invalid API key errors
  • Provider connection failures
  • Rate limiting issues
  • Timeout errors

Troubleshoot Connection Issues

Billing Problems

Issues with credits, payments, and charges:

  • Insufficient credits errors
  • Payment failures
  • Unexpected charges
  • Credit balance questions

Troubleshoot Billing Issues

API Errors

HTTP errors and API-specific issues:

  • Authentication errors (401)
  • Validation errors (400)
  • Model not found (404)
  • Gateway unavailable (503)

Troubleshoot API Errors

Quick Diagnostics

Check Your Connection

# Test API connectivity
curl -X GET "https://api.langmart.ai/health"

# Test authentication
curl -X GET "https://api.langmart.ai/api/public/providers" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Test a simple completion
curl -X POST "https://api.langmart.ai/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "groq/llama-3.3-70b-versatile", "messages": [{"role": "user", "content": "Hi"}]}'

Check Provider Status

  1. Navigate to Connections in the dashboard
  2. Look for the connection status indicator
  3. Click Test to verify connectivity
  4. Check for any error messages

Check Your Balance

curl -X GET "https://api.langmart.ai/api/account/balance" \
  -H "Authorization: Bearer YOUR_API_KEY"

View Recent Errors

curl -X GET "https://api.langmart.ai/api/account/errors?limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

Error Code Quick Reference

Code Category Common Cause
400 Client Error Invalid request format
401 Authentication Invalid or missing API key
402 Payment Required Insufficient credits
403 Forbidden Access denied
404 Not Found Model or resource not found
429 Rate Limited Too many requests
500 Server Error Internal error
502 Bad Gateway Provider communication error
503 Unavailable Service temporarily unavailable
504 Timeout Request timed out

Getting Help

Self-Service Resources

  1. Documentation: Browse the docs for detailed guides
  2. Analytics: Check your request logs for error details
  3. Status Page: Check system status for outages

Contact Support

If you cannot resolve an issue:

  1. Gather Information:

    • Request ID (from error response)
    • Timestamp of the error
    • Full error message
    • Request details (model, endpoint)
  2. Submit a Ticket:

    • Navigate to Support in the dashboard
    • Describe the issue with gathered information
    • Include any relevant screenshots
  3. Response Time:

    • Critical issues: 1 hour
    • General issues: 24 hours
    • Feature requests: 1 week

Preventive Measures

Implement Error Handling

import requests
from time import sleep

def make_request_with_retry(url, headers, data, max_retries=3):
    for attempt in range(max_retries):
        response = requests.post(url, headers=headers, json=data)

        if response.status_code == 200:
            return response.json()

        if response.status_code == 429:  # Rate limited
            retry_after = int(response.headers.get('Retry-After', 60))
            sleep(retry_after)
            continue

        if response.status_code >= 500:  # Server error
            sleep(2 ** attempt)  # Exponential backoff
            continue

        # Client error - don't retry
        response.raise_for_status()

    raise Exception("Max retries exceeded")

Set Up Monitoring

  1. Enable Alerts: Set up cost and error rate alerts
  2. Check Logs: Review request logs regularly
  3. Monitor Trends: Watch for increasing error rates

Keep Credentials Secure

  1. Never expose API keys in client-side code
  2. Rotate keys periodically
  3. Use environment variables
  4. Monitor for unauthorized usage

Next Steps

Choose the troubleshooting guide that matches your issue: