Guides
Pay as you go with a wallet
You do not need a subscription to call the API. Top up a wallet, create an access token, and pay per call. This guide covers when pay-as-you-go fits, how to set it up, and where to watch spend.
What pay-as-you-go is
A wallet holds a credit balance in one currency. An access token authenticates requests against that balance. Each API call deducts credits from the wallet as the call runs.
There is no plan, no monthly commitment, and no seat count. You add credits when you need them.
Pay-as-you-go fits variable traffic: a side project, a seasonal spike, or an app you are still validating.
Pay-as-you-go also fits building against products across multiple suites (Vedic, Western, PDF reports) without a separate plan for each. You keep one wallet and one access token across every suite.
A subscription is the better fit once your volume is steady month to month. Committing to a plan gets you a predictable monthly cost instead of a wallet you top up on a schedule. Compare plans on the pricing page.
Set it up
- Sign up. Every new account starts with 150 free credits, so you can make your first calls before you add any money.
- Open the wallet screen in your dashboard. The wallet screen shows your current balance and currency.
- Top up the wallet. The minimum top-up is
₹50for an INR wallet or$5for a USD wallet. An INR wallet tops up through Razorpay. A USD wallet tops up by card, through Stripe, or through PayPal. Which methods you see depends on the wallet's currency, not on where you are signing in from. - Create an access token on the credentials screen. The access token authenticates a wallet-backed call. The access token replaces the user ID and API key pair used for subscription-backed calls.
- Call an endpoint with the token in an
x-astrologyapi-keyheader, instead of HTTP Basic auth. The request body is unchanged, JSON, sent over POST.
Here is a full call to western_horoscope using an access token. Set YOUR_ACCESS_TOKEN to the token from the credentials screen.
curl -X POST https://json.astrologyapi.com/v1/western_horoscope \
-H "x-astrologyapi-key: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"day": 12,
"month": 3,
"year": 1993,
"hour": 14,
"min": 15,
"lat": 19.076,
"lon": 72.8777,
"tzone": 5.5,
"house_type": "placidus",
"is_asteroids": "false"
}'What each call costs
Credit cost varies by endpoint. A geocoding lookup, a planetary position call, and a PDF report do not draw the same number of credits from your wallet.
The definitive, current cost per endpoint lives in the API Pricing Catalog. Check the catalog before you estimate what an integration costs to run at volume.
Monitor your spend
Two dashboard screens track wallet usage. Cost analysis breaks down what your credits are going toward. Analytics shows call volume over time.
Both currency figures should match what you see on the wallet screen.
The wallet screen also flags a low balance once the balance drops below a threshold. You are not caught mid-integration with an empty wallet. Check the wallet screen on a schedule if your traffic is unpredictable.
Where to go next
- Access tokens vs. API keys — when to use a wallet-backed token instead of the user ID/API key pair.
- Access token usage guide — the full auth walkthrough, including Postman setup.
- Going to production: credits, errors, caching — caching computed results cuts how many credits a given user base draws.