Skip to content

Authentication

AstroAPI supports multiple authentication methods depending on your use case.

API Key Authentication

API keys are the recommended method for server-to-server communication.

Obtaining an API Key

  1. Log in to the AstroAPI Dashboard
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Configure permissions and rate limits
  5. Copy the generated key (it won't be shown again)

Using API Keys

Include your API key in the X-Api-Key header:

bash
curl -X GET "https://api.astroapi.cloud/api/calc/natal" \
  -H "X-Api-Key: ak_live_xxxxxxxxxxxx"

API Key Permissions

API keys can be scoped to specific permissions:

PermissionDescription
calc:readAccess calculation endpoints
content:readAccess content/interpretation endpoints
chart:readAccess chart rendering endpoints
modules:readAccess purchased modules

Organization Context

For multi-tenant applications, API keys are scoped to organizations. The organization context is automatically applied based on the API key used.

Security Best Practices

  • Never expose API keys in client-side code
  • Rotate API keys periodically
  • Use the minimum required permissions
  • Monitor API key usage in the dashboard

AstroAPI Documentation