LifeAstroAPILifeAstroAPI

Going to production

What stays stable, how long calls may take, what is billed, and how to watch your usage. For uptime, backups and incident reports see Reliability & Security and the SLA.

Versioning and deprecation

Every endpoint lives under /v1. Within /v1 we make additive changes only:

  • new endpoints;
  • new optional parameters (leaving them out keeps today's behaviour);
  • new fields in responses, and new values in a list (for example a new language code).

Write your client to ignore fields it does not know. The official SDKs do.

A breaking change is anything that can break a client written against today's response: removing or renaming an endpoint, a parameter or a field, changing a field's type or meaning, or changing a default. We make a breaking change only with at least 6 months' notice:

  1. an email to the owner of every account that called the affected endpoint in the last 90 days;
  2. a line in the list below, with the date the old behaviour stops;
  3. Deprecation and Sunset headers on the affected responses for the whole notice period.

If a whole new version is ever needed, it will be served under /v2 next to /v1, and /v1 keeps working for at least 12 months after /v2 is released.

Corrections are not breaking changes. When a calculation was wrong (a festival date, a sunrise time, a translation), we fix it in place, because a client should never keep a wrong answer.

Current deprecations

None.

Timeouts

Responses are fast. Server times measured in production over the last 30 days (successful calls):

Kind of callMedian9 in 10 calls within
Western astrology9 ms18 ms
Narrative readings19 ms141 ms
Panchang, charts, dashas, transits, matching, numerology25 ms182 ms
Festivals and calendars34 ms185 ms
Composed reports, including the Brihad Kundli127 ms422 ms

The server works on a request for at most 28 seconds, then answers 504.

Set your client timeout to 30 seconds for report endpoints and about 10 seconds for the rest. The official SDKs default to 30 seconds and let you change it per client or per call.

Retries

ResponseWhat to do
429Wait the number of seconds in Retry-After, then retry.
500, 502, 503, 504, network errorRetry with exponential backoff (for example 0.5 s, 1 s, 2 s; 3 tries).
Any other 4xxDo not retry. The request is invalid as sent; fix it (see Errors).

The official SDKs (Node.js, React Native, Python, PHP, Flutter, Java, .NET) do this for you: up to 2 retries by default, honouring Retry-After.

All compute endpoints are GET requests that change nothing on our side, so a retry is always safe and there is no need for idempotency keys.

What is billed

  • Only successful responses (2xx) cost credits. A 4xx, a 5xx, a timeout or a request that breaks off midway costs nothing: the credits are held while we work and released if the answer is not a success.
  • Every successful call is billed, including an identical call repeated a minute later that we answer from our cache. Cache the answers your users share on your side (today's panchang for a city is the same for every user), and you pay once.
  • A retry after a lost response is billed again if the first attempt had succeeded on our side. This only happens when the network fails after we answered.
  • Each endpoint's price is in the API reference and on pricing. X-Credits-Remaining shows your balance of bought credits (plan and wallet) after a call paid from them (see Errors for all headers). The official SDKs hand these headers to an onResponse callback, so you can log usage or warn when credits run low.

Usage analytics

Your usage is available with the same API key, at no cost (these calls count towards your rate limit but not your credits):

EndpointReturns
GET /v1/billing/usage/by-endpointCalls and credits per endpoint. period=current (default), previous or a month as YYYY-MM; sort=credits_desc (default) or calls_desc.
GET /v1/analytics/usage?from=YYYY-MM-DD&to=YYYY-MM-DDRequests and credits per day.
GET /v1/analytics/top-routes?from=YYYY-MM-DDYour most used endpoints.
GET /v1/analytics/by-featureRequests and credits per X-Feature tag (below).
curl "https://api.lifeastroapi.com/v1/billing/usage/by-endpoint?period=current" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "period": "current",
  "period_start": "2026-11-01T00:00:00Z",
  "period_end": "2026-11-15T05:00:00Z",
  "sort": "credits_desc",
  "endpoints": [
    { "endpoint_id": "reports.kundli.lite", "calls": 4, "credits": 6000 },
    { "endpoint_id": "panchang.tithi", "calls": 120, "credits": 1200 }
  ]
}

Tag calls by product area. Send X-Feature: <tag> (1–32 characters of a-z, 0-9, _, -) with a request, for example X-Feature: daily-panchang, and the analytics above can be filtered by it (feature=daily-panchang on by-endpoint, usage and top-routes). The tag never changes the answer or the price. The same numbers are in the dashboard under Usage.

Health checks

EndpointAnswers 200 when
GET /healthzThe API process is running.
GET /readyzThe server can serve a paid request: the ephemeris computes a known planet position and the database answers. Returns 503 with the failing check otherwise.

Both are free and need no key. Use /readyz in your own monitoring.

When something goes wrong

Include the X-Request-ID of a failing response, and the build_commit from GET /v1/meta/version, when you write to [email protected]. With those two we can find your request and the exact build that served it.