Ask Divine

API Reference

One question in, one grounded astrology answer out. You send a question and the person's birth details; we fetch and compress their chart, and stream back an answer written for a reader, not a developer.

POST/chatAsk a question inside a conversation we keep for you
POST/askAsk a one-shot question, no session stored
GET/sessionsList conversations under your key
GET/session/{session_id}Full history of one conversation
DELETE/session/{session_id}Erase one conversation
GET/balanceWallet balance and lifetime usage
GET/usageUsage broken down by day
GET/healthLiveness check, no key needed
01

Authentication

Every request carries your api_key in the JSON body, or as a query parameter on the GET endpoints. There is no separate token to fetch and no expiry to handle.

Each answered question is charged to your wallet at the moment it succeeds. A request that fails, or that a guardrail blocks, costs nothing.

Keep the key server-side. It spends money, so it does not belong in a mobile app or in browser JavaScript.
# every call, one field
"api_key": "dk_live_..."
02

Quickstart

Send a question and the person's birth details. The birth fields go at the top level of the request, the same shape as every other DivineAPI endpoint. Send them once per conversation; we remember them for that session_id.

Birth details
FieldExample
BIRTH DETAILS · needed once per session
full_namePriya SharmaOPTIONAL
day month year24 · 05 · 1996REQUIRED
hour min14 · 40, 24-hour clockREQUIRED
genderfemaleREQUIRED
placeNew DelhiREQUIRED
lat lon28.7041 · 77.1025REQUIRED
tzone5.5, hours from UTCREQUIRED
Birth time changes the ascendant, the houses and every dasha date. If your user does not know theirs, an invented time produces confident and wrong answers rather than an error.
curl https://ask.divineapi.com/chat \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "dk_live_...",
    "user_id": "u_8812",
    "session_id": "s_5f21",
    "message": "When will I get married?",
    "depth": "standard",
    "full_name": "Priya Sharma",
    "day": "24", "month": "05", "year": "1996",
    "hour": "14", "min": "40",
    "gender": "female",
    "place": "New Delhi",
    "lat": "28.7041", "lon": "77.1025",
    "tzone": "5.5"
  }'
POST/chat

Ask a question inside a conversation we store for you. Follow-ups like "and my career?" or "what about him?" resolve on their own, because the thread is kept server-side.

Send the birth fields once and we hold them for that session_id. Every later message in the same session can omit them.

Charged only when an answer succeeds. Failures and guardrail replies cost nothing.
// response
{
  "answer": "Your chart points to...",
  "charged_inr": 0.9,
  "wallet_inr": 286.7,
  "grounding": "ok"
}
// stream: true
data: {"delta": "Your chart points"}
data: {"done": true, ...}
Body
ParameterValuesDefaultDescription
api_keystringREQUIREDYour key
user_idstringREQUIREDYour ID for the end user. Recorded on every request and used for usage reporting
session_idstringREQUIREDYour ID for this conversation. A new ID starts a fresh thread
messagestringREQUIREDWhat the user typed, in any language
BIRTH DETAILS · needed once per session
full_namestringnoneUsed to address the person by name
day01 to 31REQUIREDDay of birth
month01 to 12REQUIREDMonth of birth
yeare.g. 1996REQUIREDYear of birth
hour00 to 23REQUIREDHour of birth on a 24-hour clock
min00 to 59REQUIREDMinute of birth
sec00 to 590Rarely needed
gendermale · femaleREQUIREDUsed by some traditional calculations
placee.g. New DelhiREQUIREDBirth city, shown back to the user
late.g. 28.7041REQUIREDLatitude of the birth city
lone.g. 77.1025REQUIREDLongitude of the birth city
tzonee.g. 5.5REQUIREDHours ahead of UTC at the time of birth
streamtrue · falsefalseStream the answer as it is written, rather than waiting for all of it
PRICED
depthquick · standard · deepstandardHow much of the chart we read before answering. Rs 0.30, Rs 0.90, Rs 3.00 per answer
length_capshort · medium · fullmediumCeiling on how long the answer may be
STYLE, FREE
languageauto, or any language name
e.g. Hindi · Tamil · Spanish
EnglishDefaults to English. Set auto to reply in whatever language and script the person wrote in, which suits a mixed audience but is a judgement the model makes per message rather than a guarantee
schoolwestern · vedic · kp · lalkitabwesternWhich tradition the reading follows
lensgeneral · career · love · health · money · spiritualgeneralWhich area of life to read the chart through
confidencebalanced · definitive · carefulbalancedHow strongly claims are stated
sensitivitystandard · strictstandardUse strict for matrimony and relationship products
tonefree text
e.g. “calm and practical”
“playful, like a close friend”
warm, friendlyHow the astrologer sounds
framingfree text
e.g. “honest but hopeful”
“never sugar-coat it”
empoweringIts attitude to difficult placements
WHITE LABEL, FREE
assistant_namefree text
e.g. “Guru ji”
“Tara”
noneWhat your astrologer calls itself
brand_voicefree text
e.g. “We speak plainly and never
frighten people about their chart”
noneA line of personality in your brand's words
sign_offfree text
e.g. “With light, Team Tara”
noneA closing line added to the end of every single answer, including each reply in a chat. Natural on a report; on a chat it can read as repetitive, so most chat products leave it empty
style_notesfree text, max 500 chars
e.g. “Never name Sade Sati directly.”
“Explain any Sanskrit term the
first time you use it.”
“Do not suggest gemstones or
paid remedies, we do not sell them.”
noneAnything the parameters above do not cover
Response
FieldDescription
answerThe reply, ready to show your user
request_idIdentifier for this request, useful in support queries
charged_inrWhat this answer cost. 0.0 if a guardrail replied
wallet_inrBalance remaining after the charge
bandPrice band that applied: simple, standard or deep
groundingok, or flagged when a claim did not match the chart data
chart_cacheHits and misses on the chart fetch. All hits means no upstream call was needed
latency_msChart fetch, time to first token, and total
usageInput, output and cached token counts
blockedPresent only when a guardrail replied instead. Nothing is charged
POST/ask

One question, one answer, nothing stored. Use it for report pages, daily cards, push notifications, or anywhere the answer is not part of a back-and-forth.

length_cap behaves differently here. On /ask it is a target, so a report page gets a full block of prose every time. On /chat it is a ceiling and the answer sizes itself to the question.

The response is identical to /chat.

curl https://ask.divineapi.com/ask \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "dk_live_...",
    "question": "What does my chart say about career?",
    "depth": "deep",
    "length_cap": "full",
    "day": "24", "month": "05", "year": "1996", ...
  }'
Body
ParameterValuesDefaultDescription
api_keystringREQUIREDYour key
questionstringREQUIREDThe question, in any language
BIRTH DETAILS · needed once per session
full_namestringnoneUsed to address the person by name
day01 to 31REQUIREDDay of birth
month01 to 12REQUIREDMonth of birth
yeare.g. 1996REQUIREDYear of birth
hour00 to 23REQUIREDHour of birth on a 24-hour clock
min00 to 59REQUIREDMinute of birth
sec00 to 590Rarely needed
gendermale · femaleREQUIREDUsed by some traditional calculations
placee.g. New DelhiREQUIREDBirth city, shown back to the user
late.g. 28.7041REQUIREDLatitude of the birth city
lone.g. 77.1025REQUIREDLongitude of the birth city
tzonee.g. 5.5REQUIREDHours ahead of UTC at the time of birth
historyarray[][{"role": "user", "text": "..."}] if you keep the thread on your side
streamtrue · falsefalseStream the answer as it is written
PRICED
depthquick · standard · deepstandardHow much of the chart we read before answering. Rs 0.30, Rs 0.90, Rs 3.00 per answer
length_capshort · medium · fullmediumCeiling on how long the answer may be
STYLE, FREE
languageauto, or any language name
e.g. Hindi · Tamil · Spanish
EnglishDefaults to English. Set auto to reply in whatever language and script the person wrote in, which suits a mixed audience but is a judgement the model makes per message rather than a guarantee
schoolwestern · vedic · kp · lalkitabwesternWhich tradition the reading follows
lensgeneral · career · love · health · money · spiritualgeneralWhich area of life to read the chart through
confidencebalanced · definitive · carefulbalancedHow strongly claims are stated
sensitivitystandard · strictstandardUse strict for matrimony and relationship products
tonefree text
e.g. “calm and practical”
“playful, like a close friend”
warm, friendlyHow the astrologer sounds
framingfree text
e.g. “honest but hopeful”
“never sugar-coat it”
empoweringIts attitude to difficult placements
WHITE LABEL, FREE
assistant_namefree text
e.g. “Guru ji”
“Tara”
noneWhat your astrologer calls itself
brand_voicefree text
e.g. “We speak plainly and never
frighten people about their chart”
noneA line of personality in your brand's words
sign_offfree text
e.g. “With light, Team Tara”
noneA closing line added to the end of every single answer, including each reply in a chat. Natural on a report; on a chat it can read as repetitive, so most chat products leave it empty
style_notesfree text, max 500 chars
e.g. “Never name Sade Sati directly.”
“Explain any Sanskrit term the
first time you use it.”
“Do not suggest gemstones or
paid remedies, we do not sell them.”
noneAnything the parameters above do not cover
GET/sessions

Every conversation under your key, most recent first.

QueryDescription
api_keyREQUIREDYour key

Each entry carries the session ID, message count, when it started, when it was last active, and whether birth details are on file.

curl "https://ask.divineapi.com/sessions?api_key=dk_live_..."
GET/session/{session_id}

The full history of one conversation, for restoring a chat screen.

Returns every message in order with its role and timestamp, plus the birth details stored against the session. Returns 404 if the session has neither.

{
  "session_id": "s_5f21",
  "messages": [
    { "role": "user", "text": "When will I marry?" },
    { "role": "assistant", "text": "Your chart..." }
  ],
  "birth_details": { ... }
}
DELETE/session/{session_id}

Erase one conversation: its messages and its stored birth details.

Takes api_key as a query parameter. Permanent, and intended as the path you call when a user asks you to delete their data.

curl -X DELETE \
  "https://ask.divineapi.com/session/s_5f21?api_key=dk_live_..."
GET/balance

Wallet balance and lifetime usage. No question is asked and nothing is charged.

Returns your account name, remaining balance in rupees, total requests, total charged, and how many were blocked by a guardrail and therefore free.

{
  "name": "Pilot",
  "wallet_inr": 286.7,
  "total_requests": 529,
  "total_charged_inr": 778.2,
  "blocked_free": 0
}
GET/usage

Usage broken down by day, for reconciling your own billing.

Takes api_key as a query parameter.

curl "https://ask.divineapi.com/usage?api_key=dk_live_..."
GET/health

Liveness check. No key needed, nothing charged.

Use it for uptime monitoring.

{ "ok": true }
04

Errors

CodeMeaning
401Unknown api_key
402Wallet empty. The message names your balance and what the answer needed
404Unknown session_id
422A parameter is outside its allowed values, or style_notes is too long. The message lists what is allowed
429Rate limit for your key. Retry after a short pause
502Chart data or the model was unreachable. Nothing is charged

Guardrails are not errors. A question we will not answer, such as one asking for a date of death, returns 200 with a kind reply, blocked: true, and charged_inr: 0.0.

// 402
{ "detail": "wallet empty (balance Rs0.12, need Rs0.90). Top up to continue." }
// guardrail, HTTP 200, free
{
  "answer": "That is not something I can read...",
  "blocked": true,
  "charged_inr": 0.0
}