logo

Authentication

Learn how to authenticate your API requests using API keys and OAuth 2.0.

Authentication

API Cheap supports multiple authentication methods to secure your API requests. Choose the method that best fits your use case.

API Key Authentication

The simplest way to authenticate is using your API key. Include it in the request headers:

curl -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     https://api.apicheap.com/v1/endpoint

Getting Your API Key

  1. Log in to your dashboard
  2. Navigate to the “API Keys” section
  3. Click “Generate New Key”
  4. Copy and securely store your key

Important: Keep your API key secret! Never expose it in client-side code or public repositories.

Rate Limiting

All requests are subject to rate limiting:

  • Free tier: 1,000 requests/hour
  • Pro tier: 10,000 requests/hour
  • Enterprise: Custom limits

Rate limit headers are included in all responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

Error Handling

Authentication errors return standardized error responses:

{
  "error": "unauthorized",
  "message": "Invalid API key",
  "code": 401
}

Common authentication errors:

  • 401 Unauthorized: Invalid or missing API key
  • 403 Forbidden: Valid key but insufficient permissions
  • 429 Too Many Requests: Rate limit exceeded