LifeAstroAPILifeAstroAPI

Authentication

All requests (except /healthz, /readyz, /v1/meta/* and the OpenAPI spec at /v1/docs) require a bearer token.

Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with the key from your dashboard. Keys start with dv_live_. The word Bearer is not case-sensitive.

The same key is also accepted in an X-API-Key header:

X-API-Key: YOUR_API_KEY

Send the key in a header, not in the query string. Call the API from your server: it sends CORS headers only for lifeastroapi.com, so a call from browser code on another site is blocked by the browser (and would expose your key).

API keys

Create keys from your dashboard → API Keys. You can create, label, rotate, and revoke keys independently. Each key is scoped to its owning account — all usage counts toward the account's plan quota.

IP allowlisting

On the Business, Scale and Enterprise plans you can restrict a key to a list of IPs or CIDR ranges. Requests from outside the list return 403 with error code ip_not_allowed. An empty list means no restriction. The check uses the real client IP even though the API sits behind Cloudflare.

203.0.113.10/32       # specific IP
198.51.100.0/24       # range

Set allowed IPs from dashboard → API Keys → edit.

Best practices

  1. Generate separate keys per environment — prod, staging, CI, local.
  2. Use IP allowlisting on prod keys (Business, Scale and Enterprise plans), so only your servers' IPs can use the key.
  3. Never embed dv_live_* keys in mobile apps, web bundles, or public GitHub repos.
  4. Rotate regularly — create a new key, switch your servers over, then revoke the old one. Both keys work during the switch, so rotation is zero-downtime.
  5. Use environment variables — never hardcode keys.

WWW-Authenticate challenge

If you send a missing/invalid token, the response is 401 Unauthorized with:

WWW-Authenticate: Bearer realm="LifeAstroAPI"

Dashboard sessions vs. API keys

The website dashboard signs you in with Firebase (Google or email/password) and calls /v1/auth/* and /v1/dashboard/* with a short-lived Firebase ID token. Those tokens and dv_live_* keys are not interchangeable — ID tokens cannot call compute endpoints, and API keys cannot access dashboard routes. Your integration only ever needs the API key.