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:
- an email to the owner of every account that called the affected endpoint in the last 90 days;
- a line in the list below, with the date the old behaviour stops;
DeprecationandSunsetheaders 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 call | Median | 9 in 10 calls within |
|---|---|---|
| Western astrology | 9 ms | 18 ms |
| Narrative readings | 19 ms | 141 ms |
| Panchang, charts, dashas, transits, matching, numerology | 25 ms | 182 ms |
| Festivals and calendars | 34 ms | 185 ms |
| Composed reports, including the Brihad Kundli | 127 ms | 422 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
| Response | What to do |
|---|---|
429 | Wait the number of seconds in Retry-After, then retry. |
500, 502, 503, 504, network error | Retry with exponential backoff (for example 0.5 s, 1 s, 2 s; 3 tries). |
Any other 4xx | Do 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. A4xx, a5xx, 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-Remainingshows 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 anonResponsecallback, 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):
| Endpoint | Returns |
|---|---|
GET /v1/billing/usage/by-endpoint | Calls 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-DD | Requests and credits per day. |
GET /v1/analytics/top-routes?from=YYYY-MM-DD | Your most used endpoints. |
GET /v1/analytics/by-feature | Requests 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
| Endpoint | Answers 200 when |
|---|---|
GET /healthz | The API process is running. |
GET /readyz | The 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.