Skip to main content

API Keys

All API requests require authentication using your Costrace API key. You can find your API key in the dashboard.

Header Format

Include your API key in the Authorization header:

Example Request

Key Management

Getting Your Key

  1. Sign up at costrace.dev/auth
  2. Navigate to your dashboard
  3. Copy your API key from the settings or API keys section

Security Best Practices

Never commit API keys to version control. Use environment variables instead.
Good:
Bad:

Rotating Keys

If your API key is compromised:
  1. Generate a new key in the dashboard
  2. Update your application environment variables
  3. Revoke the old key

Rate Limits

API keys are subject to rate limits based on your plan: Rate limit headers are included in API responses:

Error Responses

401 Unauthorized

Invalid or missing API key:

429 Too Many Requests

Rate limit exceeded: