Back to Docs

Authentication

API Authentication

All API requests require authentication via an API key. Include your key in thex-api-keyheader with every request.

Get Your API Key

  1. Visit our pricing page and choose a plan
  2. Choose a subscription plan that fits your needs
  3. Navigate to your Dashboard
  4. Your API key will be displayed in the API Key section

Base URL

https://astro-api-1qnc.onrender.com

Required Headers

HeaderValueRequired
x-api-keyYour API keyYes
Content-Typeapplication/jsonYes (for POST)

Authentication Examples

curl -X POST "https://astro-api-1qnc.onrender.com/api/v1/natal/calculate" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"year": 1990, "month": 5, "day": 15, "hour": 10, "minute": 30, "lat": 40.7128, "lng": -74.006}'

Security Best Practices

  • Never expose your API key in client-side code. Make API calls from your backend server.
  • Use environment variables to store your API key, not hardcoded strings.
  • Rotate your API key if you suspect it has been compromised.
  • Monitor your usage in the dashboard to detect unusual activity.

Authentication Errors

StatusMessageDescription
401Missing API keyx-api-key header not provided
401Invalid API keyThe API key does not exist or was revoked
429Rate limit exceededYou've exceeded your plan's request limit
403Subscription requiredYour subscription has expired or is inactive

Rate Limits

Rate limits vary by subscription plan. The following headers are included in every response:

HeaderDescription
X-RateLimit-LimitTotal requests allowed per period
X-RateLimit-RemainingRequests remaining in current period
X-RateLimit-ResetTimestamp when the limit resets

Next Steps