Production APIv1 alphaSDK Source Included

The Leo King API Docs

Production documentation for business astrology APIs: chart calculation, audience intelligence, mundane world signals, heliocentric tropical StarTypes, Michael Erlewine source context, auth, credits, examples, and error contracts.

Production Gateway
https://api.theleokingai.com

Preferred production hostname once the API domain is mapped.

Website API
https://www.theleokingai.com/api

Current public production host for the same Next.js API routes.

Local Development
http://localhost:3000/api

Local Next.js development server.

01

Quickstart

Every request is server-to-server, authenticated with `x-api-key`, and tracked only after successful work. Use `Idempotency-Key` for retry-safe usage and billing records.

curl
curl https://www.theleokingai.com/api/v1/charts/natal \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: $LEOKING_API_KEY" \
  -H "Idempotency-Key: natal-subject-123-2026-06-17" \
  -d '{
    "subject": {
      "id": "subject_123",
      "dob": "1990-07-23",
      "tob": "14:30",
      "pob": "New York, US"
    }
  }'
Node fetch
const response = await fetch("https://www.theleokingai.com/api/v1/world/signals", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": process.env.LEOKING_API_KEY!,
    "Idempotency-Key": "world-signals-markets-2026-06-17"
  },
  body: JSON.stringify({
    topic: "markets",
    window_days: 14,
    depth: "deep"
  })
});

if (!response.ok) {
  throw new Error(await response.text());
}

const payload = await response.json();
Async world signals
# Create an async deep forecast job
curl https://www.theleokingai.com/api/v1/world/signals/jobs \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: $LEOKING_API_KEY" \
  -H "Idempotency-Key: world-signals-markets-2026-06-17" \
  -d '{"topic":"markets","window_days":14,"depth":"deep"}'

# Poll until data.status is complete or failed
curl https://www.theleokingai.com/api/v1/world/signals/jobs/$JOB_ID \
  -H "x-api-key: $LEOKING_API_KEY"
02

Authentication

Clerk protects the customer console. Public API calls use scoped backend API keys so partner systems can call routes from trusted servers without exposing user sessions in browsers.

Header
x-api-key: lk_live_...
Retry Safety
Idempotency-Key: stable-operation-id
Envelope
request_id, data, usage, meta
03

SDKs And Source Code

Customers can call raw HTTP immediately, use the OpenAPI contract for generated clients, or build from the repo SDK source. The Node and Python clients expose the live paid routes and preserve `usage` metadata so core compute and AI spend stay visible.

npm
# Published package target after release approval
npm install @theleoking/ai-api

# Alpha source in this repo today
cd sdk/node
npm install
npm run build
Node SDK
import { TheLeoKingApi } from "@theleoking/ai-api";

const api = new TheLeoKingApi({
  apiKey: process.env.LEOKING_API_KEY!,
  baseUrl: "https://api.theleokingai.com"
});

const result = await api.futurePartnerVision({
  subject: {
    id: "user_123",
    dob: "1990-07-23",
    tob: "14:30",
    pob: "New York, US"
  },
  intent: "future long-term partner",
  context: {
    relationship_status: "single",
    desired_tone: "direct, cinematic, grounded"
  }
}, "future-partner-user-123-2026-06-17");

console.log(result.data.partner_archetype);
console.log(result.usage.credits, result.usage.tokens);
Python
# Published package target after release approval
pip install theleoking-ai-api

# Alpha source in this repo today
cd sdk/python
pip install -e .
Python SDK
import os
from theleoking_ai_api import TheLeoKingApi

api = TheLeoKingApi(
    api_key=os.environ["LEOKING_API_KEY"],
    base_url="https://api.theleokingai.com",
)

result = api.compatibility_score({
    "subject": {
        "id": "person_a",
        "dob": "1990-07-23",
        "tob": "14:30",
        "pob": "New York, US",
    },
    "partner": {
        "id": "person_b",
        "dob": "1992-11-08",
        "tob": "09:15",
        "pob": "Los Angeles, US",
    },
    "scoring_profile": "balanced",
}, idempotency_key="compat-person-a-person-b-2026-06-17")

print(result["data"]["score"])
print(result["usage"]["credits"])
OpenAPI and source
curl https://www.theleokingai.com/api/v1/openapi

# Machine-readable docs context
GET /api/v1
GET /api/v1/openapi

# SDK source in this repo
sdk/node
sdk/python
No-AI Core Compute

Calculate a natal chart without model spend

Use this for high-volume chart workflows where customers need raw geocentric tropical data and no generated interpretation.

copy-paste
curl https://theleokingai.com/api/v1/charts/natal \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: $LEOKING_API_KEY" \
  -H "Idempotency-Key: natal-subject-123-v1" \
  -d '{
    "subject": {
      "id": "subject_123",
      "dob": "1990-07-23",
      "tob": "14:30",
      "pob": "New York, US"
    }
  }'
Premium Experience

Call Future Partner Vision from Node

Use this for app features that sell a completed experience instead of exposing raw astrology parts.

copy-paste
const response = await fetch("https://theleokingai.com/api/v1/experiences/future-partner-vision", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": process.env.LEOKING_API_KEY,
    "Idempotency-Key": "future-partner-user-123-v1"
  },
  body: JSON.stringify({
    subject: {
      id: "user_123",
      dob: "1990-07-23",
      tob: "14:30",
      pob: "New York, US"
    },
    intent: "future long-term partner",
    context: {
      relationship_status: "single",
      desired_tone: "direct, cinematic, grounded"
    }
  })
});

if (!response.ok) throw new Error(await response.text());
const result = await response.json();
Python Backend

Poll an async World Signals job

Use async jobs for deep BTV-style reports where a partner app can poll instead of blocking the customer request.

copy-paste
import os
import time
import requests

base_url = "https://theleokingai.com/api/v1"
headers = {
    "Content-Type": "application/json",
    "x-api-key": os.environ["LEOKING_API_KEY"],
    "Idempotency-Key": "world-signals-markets-2026-06-18",
}

job = requests.post(
    f"{base_url}/world/signals/jobs",
    headers=headers,
    json={"topic": "markets", "window_days": 14, "depth": "deep"},
    timeout=30,
)
job.raise_for_status()
status_url = job.json()["data"]["status_url"]

while True:
    status = requests.get(status_url, headers={"x-api-key": os.environ["LEOKING_API_KEY"]}, timeout=30)
    status.raise_for_status()
    payload = status.json()
    if payload["data"]["status"] in {"complete", "failed"}:
        break
    time.sleep(payload["data"].get("poll_after_ms", 2000) / 1000)
04

Compute Lanes And Plans

Not every route uses AI. The platform separates deterministic astrology compute from model-backed interpretation so customers can run high-volume chart, transit, compatibility, and helio endpoints without paying for generative AI on every request.

No AI

Core Compute

No-AI astrology infrastructure: geocentric tropical chart math, transit tables, synastry scoring, compatibility scoring, and helio tropical StarTypes lookup.

Cost Basis

Lowest cost path. CPU sidecar, cached ephemeris/RAG lookup, and Convex usage writes only; no OpenAI, vLLM, image, or video model call.

Metering

1-4 core credits per request. Usage tracks endpoint, ephemeris mode, cache state, and request id, not model tokens.

/v1/charts/natal/v1/charts/transits/v1/charts/synastry/v1/compatibility/score/v1/helio/patterns
ai

AI Intelligence

Premium interpretation routes that combine owned astrology math, Erlewine/BTV context, product-specific prompts, and model-backed synthesis.

Cost Basis

Model-backed path. Every successful generation records provider, model, token usage, credits, and quality-gate metadata.

Metering

4-10 AI credits per request to protect margin. Failed upstream/model quality gates do not publish or bill as success.

/v1/audience/insights/v1/experiences/future-partner-vision/v1/experiences/love-reveal/v1/experiences/crystal-ball/v1/oracle/ask/v1/tarot/draw/v1/past-life/reading/v1/horoscope/daily/v1/timing/windows
ai

World Signals

High-value mundane astrology and BTV intelligence for markets, culture, geopolitics, and timing windows.

Cost Basis

Premium model-backed route with ephemeris, BTV retrieval, citations, freshness checks, and reviewed output contracts.

Metering

5+ AI credits per forecast, higher for deep async jobs. Requires model, RAG, ephemeris, and fallback-quality gates to pass.

/v1/world/signals/v1/world/signals/jobs/v1/mundane/hot-zones/v1/mundane/analyze-event
enterprise

Enterprise Licensing

Custom API bundles, private model/data contracts, dedicated evals, partner-specific endpoint design, and negotiated usage minimums.

Cost Basis

Sales-led margin model with committed usage, separate high-cost media AI terms, and partner-specific observability.

Metering

Custom credit blocks, SLA, overage terms, and private deployment options.

/v1/custom/*/v1/enterprise/*
Basic
$199/mo

Small apps, creators, and pilot integrations.

Monthly Credits
10,000
120 requests/min

Core routes do not call AI. AI routes are opt-in and consume 4-8 AI credits with token usage in the response.

Pro
$799/mo

Paid apps, agencies, dating/wellness products, and media workflows.

Monthly Credits
50,000
240 requests/min

Designed for regular AI endpoint use with usage reviewed by endpoint and model.

Business
$2,500/mo

B2B platforms, commerce datasets, large newsletters, and enterprise pilots.

Monthly Credits
200,000
600 requests/min

Built for heavy AI usage with cost review before custom model or image generation expansion.

Enterprise
Custom, $10k+/mo target

Strategic partners, AI platforms, dating networks, media networks, and licensing deals.

Monthly Credits
1,000,000
1200 requests/min

Custom credit pricing, committed usage, and separate pass-through terms for high-cost image/video AI.

Plan-Gated Endpoint Access

These access rules are shared by the public docs, customer console, and Convex API-key validation. Basic starts with core plus light AI. Pro unlocks premium experiences and World Signals.

EndpointLaneMinimum PlanAccess Rule
Audience Insights
/v1/audience/insights
Light AIBasic+Model-backed usage records provider, model, tokens, credits, and quality gates.
Customer Profile
/v1/customer/profile
Light AIBasic+Model-backed usage records provider, model, tokens, credits, and quality gates.
Oracle Ask
/v1/oracle/ask
Light AIBasic+Model-backed usage records provider, model, tokens, credits, and quality gates.
Tarot Draw
/v1/tarot/draw
Light AIBasic+Model-backed usage records provider, model, tokens, credits, and quality gates.
Daily Horoscope
/v1/horoscope/daily
Light AIBasic+Model-backed usage records provider, model, tokens, credits, and quality gates.
Timing Windows
/v1/timing/windows
Light AIBasic+Model-backed usage records provider, model, tokens, credits, and quality gates.
Natal Chart
/v1/charts/natal
No AI coreFree+No model call required; safe for high-volume deterministic workflows.
Transit Chart
/v1/charts/transits
No AI coreFree+No model call required; safe for high-volume deterministic workflows.
Synastry Chart
/v1/charts/synastry
No AI coreFree+No model call required; safe for high-volume deterministic workflows.
Compatibility Score
/v1/compatibility/score
No AI coreFree+No model call required; safe for high-volume deterministic workflows.
Helio StarTypes
/v1/helio/patterns
No AI coreFree+No model call required; safe for high-volume deterministic workflows.
Future Partner Vision
/v1/experiences/future-partner-vision
Premium AIPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
Love Reveal
/v1/experiences/love-reveal
Premium AIPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
Crystal Ball
/v1/experiences/crystal-ball
Premium AIPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
Past-Life Reading
/v1/past-life/reading
Premium AIPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
World Signals
/v1/world/signals
World SignalsPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
World Signals Async Jobs
/v1/world/signals/jobs
World SignalsPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
Mundane Hot Zones
/v1/mundane/hot-zones
World SignalsPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
Mundane Event Analysis
/v1/mundane/analyze-event
World SignalsPro+Model-backed usage records provider, model, tokens, credits, and quality gates.
05

API Products

The commercial surface is organized into product families. This keeps geocentric chart math, heliocentric StarTypes, business intelligence, and source-backed forecasting from getting mixed together.

Experience APIs

Productized spiritual experiences that partners can drop into apps, creator platforms, membership funnels, and media workflows.

/v1/experiences/future-partner-vision/v1/experiences/love-reveal/v1/experiences/crystal-ball/v1/tarot/draw/v1/oracle/ask/v1/past-life/reading

Relationship APIs

Dating, compatibility, synastry, and 5-7-8 love intelligence built on owned chart math plus David Palmer's relationship frameworks.

/v1/charts/synastry/v1/compatibility/score/v1/experiences/love-reveal/v1/experiences/future-partner-vision

Chart Core APIs

Owned geocentric tropical calculations for natal, transits, synastry, composite, solar return, progressions, geo, and timezone workflows.

/v1/charts/natal/v1/charts/transits/v1/charts/synastry

World Intelligence APIs

Beyond The Veil style mundane forecasting, hot zones, timing windows, and event analysis with deterministic ephemeris context.

/v1/world/signals/jobs/v1/world/signals/v1/mundane/hot-zones/v1/mundane/analyze-event/v1/timing/windows

Proprietary Knowledge APIs

Michael Erlewine StarTypes, source attribution, spiritual knowledge, love frameworks, and retrieval-backed interpretation layers.

/v1/helio/patterns
CapabilityRouteStatusNotes
Natal chartPOST /v1/charts/natalLive alphaGeocentric tropical sidecar calculation
Transit chartPOST /v1/charts/transitsLive alphaGeocentric tropical transit positions and aspects
Audience intelligencePOST /v1/audience/insightsLiveBusiness scoring and campaign fit
Mundane forecastingPOST /v1/world/signalsLiveBTV-style forecasts with RAG and quality gates
Helio StarTypesPOST /v1/helio/patternsBackgroundHeliocentric tropical Michael Erlewine lookup
Erlewine source contextEmbedded in intelligence routesLiveRAG metadata and attribution
No third-party AstrologyAPI dependency in the product roadmap.
Geocentric tropical chart work stays separate from heliocentric tropical StarTypes.
StarTypes is helio-only background signal until evals prove lead use cases.
Experience endpoints are sellable products, not demo chatbot wrappers.
Every generative endpoint needs output quality gates before production scale.
06

Tool Functions

These are the function-level capabilities customers can build around. They map to the live endpoints instead of calling a third-party astrology API.

Experience Generation

Future Partner Vision, Love Reveal, Crystal Ball, tarot, and oracle experiences as product APIs.

oracle.ask.generatepartner.vision.generatelove.reveal.generatevision.crystal.generatepastlife.reading.generatetarot.spread.drawtarot.symbols.attachquality.experience.enforce

Owned Chart Core

Geocentric tropical natal, transits, synastry, composite, solar return, progressions, geo, and timezone functions.

chart.natal.calculatechart.transits.calculatechart.synastry.calculatechart.composite.calculatechart.solar_return.calculatechart.progressions.calculategeo.timezone.resolve

Relationship Intelligence

Compatibility scoring built from synastry, 5-7-8 house overlays, love planets, and risk flags.

compatibility.score.calculatelove.578.evaluatesynastry.signals.weightrelationship.signals.extracthelio.background.compare

Business Intelligence

Audience, campaign, and partner intelligence functions built on chart context plus controlled generation.

customer.profile.scorecampaign.fit.evaluatemessage.angle.generatechart.quality.reporttiming.windows.generatequality.gates.enforce

Mundane Forecasting

Beyond The Veil style world-signal functions with deterministic ephemeris and RAG controls.

mundane.forecast.generatemundane.event.analyzeephemeris.transits.ranksignature.stack.applyhistorical.analog.selecthotzones.scorewatch.items.generate

Helio StarTypes

Heliocentric tropical Michael Erlewine StarTypes lookup as a background experimental signal.

startypes.lookuphelio.pattern.componentserlewine.source.creditbackground.signal.guard

Knowledge Retrieval

Curated spiritual, love, mundane, past-life, and Erlewine source context for endpoint-specific synthesis.

erlewine.context.searchspiritual.kb.searchlove.framework.retrievebtv.article.retrievesource.credit.format
07

Endpoint Reference

Each endpoint includes its credit model, supported inputs, returned output, function names, and realistic request/response examples.

POST/v1/audience/insightsliveLight AIBasic+
Intelligence

Audience Intelligence

Generate customer-level buyer archetypes, campaign fit, timing notes, and message angles from birth data and campaign context.

Minimum Plan
Basic+
Billing Lane
Light AI
Console Scope
/v1/audience/insights
Inputs
  • +customer birth data
  • +campaign context
  • +channel
  • +tone
  • +product category
Outputs
  • +buyer archetype
  • +campaign fit score
  • +send/no-send recommendation
  • +message angle
  • +chart quality
Tool Functions
2 credits per customer
customer.profile.score

Scores each customer against a campaign context.

campaign.fit.evaluate

Returns send/no-send guidance with reasoning.

message.angle.generate

Produces positioning language for the audience segment.

chart.quality.report

Reports whether the request used a full chart or limited birth data.

erlewine.context.attach

Adds authorized Michael Erlewine context when local RAG is enabled.

Campaign Fit request
{
  "customers": [
    {
      "id": "cust_123",
      "dob": "1990-07-23",
      "tob": "14:30",
      "pob": "New York, US"
    }
  ],
  "campaign_context": {
    "product_category": "relationship coaching membership",
    "tone": "warm direct",
    "channel": "email"
  }
}
Campaign Fit response
{
  "request_id": "req_...",
  "data": {
    "results": [
      {
        "customer_id": "cust_123",
        "personality": {
          "sun_sign": "Leo",
          "buyer_archetype": "premium loyalist"
        },
        "campaign_fit": {
          "score": 0.86,
          "send": true,
          "reasoning": "High receptivity window"
        }
      }
    ]
  },
  "usage": { "lane": "ai", "credits": 2, "billableUnits": 1 },
  "meta": { "chartQuality": [{ "customer_id": "cust_123", "quality": "full_chart" }] }
}
POST/v1/experiences/future-partner-visionalphaPremium AIPro+
Experience APIs

Future Partner Vision

Generate a structured future partner profile, relationship scene, attraction pattern, timing window, and optional image prompt from birth data and love context.

Minimum Plan
Pro+
Billing Lane
Premium AI
Console Scope
/v1/experiences/future-partner-vision
Inputs
  • +birth data
  • +relationship intent
  • +orientation/context
  • +optional photo signal
  • +optional transit window
Outputs
  • +future partner archetype
  • +meeting scene
  • +chemistry signals
  • +timing windows
  • +image prompt
  • +quality metadata
Tool Functions
8 credits per vision
partner.vision.generate

Creates a structured future partner profile and scene.

love.signature.extract

Reads Moon, Venus, Mars, 5th, 7th, and 8th house signals when available.

timing.romance.window

Uses owned transits and relationship timing rules for timing windows.

image.prompt.partner

Returns a safe visual prompt for partner-vision image generation.

quality.experience.enforce

Blocks generic, thin, or fallback-looking outputs.

Partner Vision request
{
  "subject": {
    "id": "user_123",
    "dob": "1990-07-23",
    "tob": "14:30",
    "pob": "New York, US"
  },
  "intent": "future long-term partner",
  "context": {
    "relationship_status": "single",
    "desired_tone": "direct, cinematic, grounded"
  }
}
Partner Vision response
{
  "request_id": "req_...",
  "data": {
    "partner_archetype": "magnetic builder with public confidence and private loyalty",
    "meeting_scene": {
      "setting": "a work-adjacent creative event",
      "signal": "conversation starts through a practical offer, then turns intimate"
    },
    "timing_windows": [
      { "start": "2026-08-04", "end": "2026-09-12", "confidence": 0.72 }
    ],
    "image_prompt": "premium cinematic future partner portrait..."
  },
  "usage": { "lane": "ai", "credits": 8, "billableUnits": 1 },
  "meta": { "status": "alpha", "requiredSystems": ["geocentric_tropical", "love_5_7_8"] }
}
POST/v1/experiences/love-revealalphaPremium AIPro+
Experience APIs

Love Reveal

Generate a high-specificity love reading that can blend psychic interpretation, tarot symbolism, owned astrology context, and 5-7-8 relationship logic.

Minimum Plan
Pro+
Billing Lane
Premium AI
Console Scope
/v1/experiences/love-reveal
Inputs
  • +question
  • +relationship context
  • +optional birth data
  • +optional partner birth data
  • +tone
Outputs
  • +direct answer
  • +emotional dynamic
  • +tarot/love archetypes
  • +astrology support
  • +next action
Tool Functions
5 credits per reveal
love.reveal.generate

Creates the final structured love reveal experience.

question.intent.classify

Classifies breakup, crush, commitment, return, or future-love intent.

tarot.symbols.attach

Adds tarot structure only when it sharpens the answer.

relationship.context.ground

Prevents generic love output by anchoring to the provided situation.

Love Reveal request
{
  "question": "Is this connection coming back or should I move on?",
  "subject": { "id": "user_123", "dob": "1990-07-23" },
  "context": {
    "relationship_status": "separated",
    "desired_tone": "clear and compassionate"
  }
}
Love Reveal response
{
  "request_id": "req_...",
  "data": {
    "answer": "This connection is not fully closed, but the return depends on whether accountability replaces silence.",
    "dynamic": "strong chemistry with weak consistency",
    "next_action": "Do not chase. Ask one direct question and watch behavior, not emotion."
  },
  "usage": { "lane": "ai", "credits": 5, "billableUnits": 1 },
  "meta": { "status": "alpha", "persona": "lady-avalon" }
}
POST/v1/experiences/crystal-ballalphaPremium AIPro+
Experience APIs

Crystal Ball Vision

Generate a cinematic symbolic vision with concrete interpretation, action guidance, and optional image-generation direction.

Minimum Plan
Pro+
Billing Lane
Premium AI
Console Scope
/v1/experiences/crystal-ball
Inputs
  • +question
  • +topic
  • +optional birth data
  • +desired tone
  • +visual intensity
Outputs
  • +vision scene
  • +symbol meanings
  • +prediction or guidance
  • +action line
  • +image prompt
Tool Functions
4 credits per vision
vision.crystal.generate

Creates a vivid but grounded symbolic vision.

symbols.interpret

Maps visual symbols to practical meaning using owned spiritual knowledge.

image.prompt.crystal

Returns a premium image-generation prompt for campaign or app use.

Crystal Vision request
{
  "question": "What is the hidden opportunity around this career change?",
  "topic": "career",
  "style": "cinematic, concise, grounded"
}
Crystal Vision response
{
  "request_id": "req_...",
  "data": {
    "vision": "A black door opens into a gold-lit room where a desk is already waiting.",
    "meaning": "The opportunity is not more searching. It is accepting a role that asks you to be seen.",
    "action": "Say yes to the serious invitation, not the familiar backup plan."
  },
  "usage": { "lane": "ai", "credits": 4, "billableUnits": 1 },
  "meta": { "status": "alpha", "knowledge": ["psychic", "symbols"] }
}
POST/v1/oracle/askalphaLight AIBasic+
Experience APIs

Oracle Ask

Answer a direct spiritual question through the paid Lady Avalon API path with strict JSON output, usage metering, and no legacy MCP dependency.

Minimum Plan
Basic+
Billing Lane
Light AI
Console Scope
/v1/oracle/ask
Inputs
  • +question
  • +topic
  • +optional birth date
  • +situation context
  • +desired tone
Outputs
  • +direct answer
  • +insight
  • +support signals
  • +next action
  • +caution
Tool Functions
2 credits per answer
oracle.ask.generate

Generates a direct display-ready answer.

sun.sign.derive

Derives sun sign when birth_date is supplied.

quality.experience.enforce

Blocks malformed or fallback-looking JSON.

Oracle Question request
{
  "question": "What is the real opportunity in front of me right now?",
  "birth_date": "1990-07-23",
  "topic": "career",
  "context": { "desired_tone": "direct and grounded" }
}
Oracle Question response
{
  "request_id": "req_...",
  "data": {
    "answer": "The opportunity is to take the visible role instead of staying behind the buildout.",
    "insight": "The pattern is asking for leadership with cleaner boundaries.",
    "next_action": "Make the direct offer this week and remove the backup option."
  },
  "usage": { "lane": "ai", "credits": 2, "billableUnits": 1 }
}
POST/v1/tarot/drawalphaLight AIBasic+
Experience APIs

Tarot Draw

Draw and interpret tarot spreads from the local 78-card Rider-Waite-Smith corpus with deterministic seed support and paid API metering.

Minimum Plan
Basic+
Billing Lane
Light AI
Console Scope
/v1/tarot/draw
Inputs
  • +question
  • +spread type
  • +topic
  • +optional seed
  • +image prompt flag
Outputs
  • +drawn cards
  • +card readings
  • +direct answer
  • +synthesis
  • +next action
Tool Functions
2 credits per spread
tarot.spread.draw

Draws cards deterministically from the local 78-card corpus.

tarot.meanings.apply

Uses local card meanings as interpretation context.

tarot.output.lock

Locks the final response to the actual drawn cards.

Three Card Spread request
{
  "question": "What do I need to know about this relationship?",
  "spread_type": "three_card",
  "topic": "love",
  "seed": "partner-reading-001"
}
Three Card Spread response
{
  "request_id": "req_...",
  "data": {
    "spread": {
      "type": "three_card",
      "cards": [
        { "name": "The Lovers", "position": "situation", "orientation": "upright" }
      ]
    },
    "answer": "The connection is real, but the choice must become conscious."
  },
  "usage": { "lane": "ai", "credits": 2, "billableUnits": 1 }
}
POST/v1/past-life/readingalphaPremium AIPro+
Experience APIs

Past-Life Reading

Generate an AstraGate-style past-life reading with structured scene, karmic pattern, present-life echo, healing action, and empowerment.

Minimum Plan
Pro+
Billing Lane
Premium AI
Console Scope
/v1/past-life/reading
Inputs
  • +optional birth data
  • +question
  • +focus
  • +depth
Outputs
  • +lifetime theme
  • +scene
  • +karmic pattern
  • +present-life echo
  • +healing action
Tool Functions
10 credits per reading
pastlife.reading.generate

Creates a structured past-life reading.

astragate.persona.apply

Uses the AstraGate persona contract and past-life knowledge.

quality.experience.enforce

Requires complete structured output before billing is recorded.

Soul Mission request
{
  "subject": { "id": "user_123", "dob": "1990-07-23" },
  "focus": "soul_mission",
  "question": "What old pattern am I here to complete?"
}
Soul Mission response
{
  "request_id": "req_...",
  "data": {
    "lifetime_theme": "A life of carrying sacred knowledge while hiding your public voice.",
    "healing_action": "Choose one truth and speak it plainly this week."
  },
  "usage": { "lane": "ai", "credits": 10, "billableUnits": 1 }
}
POST/v1/charts/synastryalphaNo AI coreFree+
Relationships

Synastry Chart

Return owned geocentric tropical synastry data and relationship aspect overlays without calling an external astrology API.

Minimum Plan
Free+
Billing Lane
No AI core
Console Scope
/v1/charts/synastry
Inputs
  • +subject birth data
  • +partner birth data
  • +orb policy
  • +max aspects
Outputs
  • +interchart aspects
  • +relationship signals
  • +calculation basis
  • +sidecar metadata
Tool Functions
3 credits per pair
chart.synastry.calculate

Computes interchart aspects through the owned sidecar path.

interchart.aspects.rank

Ranks conjunctions, oppositions, trines, squares, sextiles, and tight orbs.

relationship.signals.extract

Extracts Moon, Venus, Mars, Saturn, and Pluto relationship signals.

calculation.basis.report

Reports geocentric tropical calculation basis.

Synastry Pair request
{
  "subject": {
    "id": "person_a",
    "dob": "1990-07-23",
    "tob": "14:30",
    "pob": "New York, US"
  },
  "partner": {
    "id": "person_b",
    "dob": "1992-11-08",
    "tob": "09:15",
    "pob": "Los Angeles, US"
  },
  "max_aspects": 40
}
Synastry Pair response
{
  "request_id": "req_...",
  "data": {
    "pair_id": "person_a:person_b",
    "calculation_basis": {
      "frame": "geocentric",
      "zodiac": "tropical",
      "system": "owned sidecar"
    },
    "aspects": [],
    "relationship_signals": []
  },
  "usage": { "lane": "core", "credits": 3, "billableUnits": 1 }
}
POST/v1/compatibility/scorealphaNo AI coreFree+
Relationships

Compatibility Score

Score relationship compatibility using synastry, 5-7-8 house activation, love-planet frameworks, and optional StarTypes background comparison.

Minimum Plan
Free+
Billing Lane
No AI core
Console Scope
/v1/compatibility/score
Inputs
  • +two birth profiles
  • +relationship context
  • +scoring profile
  • +optional helio background flag
Outputs
  • +overall score
  • +5/7/8 sub-scores
  • +chemistry
  • +commitment
  • +risk flags
  • +interpretation
Tool Functions
4 credits per pair
compatibility.score.calculate

Creates the numeric compatibility score and tier.

love.578.evaluate

Evaluates 5th, 7th, and 8th house activation patterns.

synastry.signals.weight

Weights personal planet, Saturn, Pluto, Node, Vertex, and Chiron contacts.

helio.background.compare

Optionally compares StarTypes as background context only.

Compatibility Score request
{
  "subject": { "id": "person_a", "dob": "1990-07-23", "tob": "14:30", "pob": "New York, US" },
  "partner": { "id": "person_b", "dob": "1992-11-08", "tob": "09:15", "pob": "Los Angeles, US" },
  "context": { "relationship_type": "dating" },
  "include_helio_background": false
}
Compatibility Score response
{
  "request_id": "req_...",
  "data": {
    "score": 87,
    "tier": "high",
    "subscores": {
      "romance_5th": 0.82,
      "partnership_7th": 0.9,
      "intimacy_8th": 0.78
    },
    "risk_flags": ["strong attraction requires direct communication"]
  },
  "usage": { "lane": "core", "credits": 4, "billableUnits": 1 }
}
POST/v1/charts/natalalphaNo AI coreFree+
Chart Calculation

Natal Chart Calculation

Return a geocentric tropical natal chart from the Kerykeion/Swiss sidecar for partners that need raw chart data, not generated interpretation.

Minimum Plan
Free+
Billing Lane
No AI core
Console Scope
/v1/charts/natal
Inputs
  • +subject id
  • +date of birth
  • +time of birth
  • +place or coordinates
Outputs
  • +sun sign
  • +raw chart payload
  • +calculation basis
  • +sidecar metadata
Tool Functions
2 credits per chart
chart.natal.calculate

Computes a full geocentric tropical natal chart.

planet.positions.list

Returns the sidecar planet/sign/degree payload when provided by the sidecar.

houses.resolve

Returns house data when provided by the configured sidecar response.

aspects.list

Returns natal aspect data when provided by the configured sidecar response.

birth.input.validate

Rejects requests missing time plus place or coordinates.

Full Natal Chart request
{
  "subject": {
    "id": "subject_123",
    "dob": "1990-07-23",
    "tob": "14:30",
    "pob": "New York, US"
  }
}
Full Natal Chart response
{
  "request_id": "req_...",
  "data": {
    "subject_id": "subject_123",
    "calculation_basis": {
      "frame": "geocentric",
      "zodiac": "tropical",
      "system": "Kerykeion sidecar"
    },
    "sun_sign": "Leo",
    "chart": { "planets": [], "houses": [], "aspects": [] }
  },
  "usage": { "lane": "core", "credits": 2, "billableUnits": 1 }
}
POST/v1/charts/transitsalphaNo AI coreFree+
Chart Calculation

Transit Chart Calculation

Return geocentric tropical transit positions and aspects from the owned sidecar for timing, daily horoscope, and ephemeris workflows.

Minimum Plan
Free+
Billing Lane
No AI core
Console Scope
/v1/charts/transits
Inputs
  • +transit datetime
  • +transit location
  • +max aspects
Outputs
  • +transit chart
  • +ranked aspects
  • +calculation basis
  • +sidecar metadata
Tool Functions
2 credits per chart
chart.transits.calculate

Computes the current or requested transit chart.

transit.positions.list

Returns planet positions when provided by the sidecar.

transit.aspects.rank

Returns sidecar aspect data up to the requested cap.

mundane.signal.seed

Supplies verified ephemeris context for world signal forecasts.

daily.horoscope.seed

Supplies owned transit substrate for daily horoscope products.

Current Transits request
{
  "transit_datetime": "2026-06-17T12:00:00.000Z",
  "transit_location": "Greenwich, GB",
  "max_aspects": 30
}
Current Transits response
{
  "request_id": "req_...",
  "data": {
    "transit_datetime": "2026-06-17T12:00:00.000Z",
    "transit_location": "Greenwich, GB",
    "calculation_basis": {
      "frame": "geocentric",
      "zodiac": "tropical",
      "system": "Kerykeion sidecar"
    },
    "chart": { "planets": [], "aspects": [] },
    "aspects": []
  },
  "usage": { "lane": "core", "credits": 2, "billableUnits": 1 }
}
POST/v1/horoscope/dailyalphaLight AIBasic+
Intelligence

Daily Horoscope

Generate personalized daily horoscope output from owned transit substrate, zodiac knowledge, and optional birth profile context.

Minimum Plan
Basic+
Billing Lane
Light AI
Console Scope
/v1/horoscope/daily
Inputs
  • +zodiac sign or birth data
  • +date
  • +tone
  • +delivery channel
Outputs
  • +daily theme
  • +transit drivers
  • +love/career/money notes
  • +action guidance
  • +metadata
Tool Functions
1 credit per sign or subject
horoscope.daily.generate

Generates a daily horoscope without calling external horoscope APIs.

transit.daily.seed

Uses owned transits as the calculation substrate.

zodiac.knowledge.apply

Applies local zodiac knowledge without generic filler.

Daily Horoscope request
{
  "sign": "leo",
  "date": "2026-06-17",
  "tone": "premium concise",
  "sections": ["theme", "love", "work", "action"]
}
Daily Horoscope response
{
  "request_id": "req_...",
  "data": {
    "sign": "leo",
    "theme": "Choose the room that lets your confidence become useful.",
    "drivers": ["Moon phase", "active Venus-Mars relationship tone"],
    "action": "Make the direct offer instead of waiting for permission."
  },
  "usage": { "lane": "ai", "credits": 1, "billableUnits": 1 }
}
POST/v1/timing/windowsalphaLight AIBasic+
Intelligence

Timing Windows

Generate practical timing windows for launches, love, career, money, content, and spiritual work using owned transit substrate.

Minimum Plan
Basic+
Billing Lane
Light AI
Console Scope
/v1/timing/windows
Inputs
  • +topic
  • +date range
  • +objective
  • +optional birth data
  • +max windows
Outputs
  • +ranked windows
  • +astrology signal
  • +best use
  • +caution
  • +strategy
Tool Functions
3 credits per run
timing.windows.generate

Generates date-bounded timing windows.

transit.window.seed

Uses owned transit context at the start of the range.

strategy.timing.apply

Converts astrology into operational strategy.

Launch Windows request
{
  "topic": "launch",
  "start_date": "2026-06-17",
  "end_date": "2026-07-17",
  "objective": "Find the best window to announce a paid API beta",
  "max_windows": 3
}
Launch Windows response
{
  "request_id": "req_...",
  "data": {
    "topic": "launch",
    "windows": [
      { "start": "2026-06-21", "end": "2026-06-24", "title": "Visibility push", "confidence": 0.74 }
    ],
    "strategy": "Lead with the strongest proof and keep the offer narrow."
  },
  "usage": { "lane": "ai", "credits": 3, "billableUnits": 1 }
}
POST/v1/world/signalsliveWorld SignalsPro+
Intelligence

World Signals

Generate Beyond The Veil style mundane intelligence with deterministic ephemeris context, BTV RAG metadata, and quality controls.

Minimum Plan
Pro+
Billing Lane
World Signals
Console Scope
/v1/world/signals
Inputs
  • +topic
  • +window days
  • +depth
  • +BTV corpus
  • +Erlewine mundane context
  • +transit ephemeris
Outputs
  • +forecast headline
  • +signature stack
  • +historical analog
  • +manifestations
  • +quality metadata
Tool Functions
5 credits per forecast
mundane.forecast.generate

Generates a source-constrained world signal forecast.

ephemeris.transits.rank

Ranks live transits when sidecar mode is enabled.

signature.stack.apply

Overwrites model-supplied signatures with verified classes.

historical.analog.select

Selects deterministic analog metadata by topic.

quality.gates.enforce

Blocks fallback-looking or under-specified forecast output.

Markets Forecast request
{
  "topic": "markets",
  "window_days": 14,
  "depth": "deep"
}
Markets Forecast response
{
  "request_id": "req_...",
  "data": {
    "forecasts": [
      {
        "headline": "Markets hold a volatile repricing window",
        "forecast_window": {
          "start": "2026-06-17",
          "end": "2026-07-01",
          "specificity": "two-week operational window"
        },
        "confidence": 8
      }
    ]
  },
  "usage": { "lane": "ai", "credits": 5, "billableUnits": 1 },
  "meta": { "ephemeris": { "enabled": true } }
}
POST/v1/world/signals/jobsliveWorld SignalsPro+
Intelligence

World Signals Async Job

Create an asynchronous Beyond The Veil world signal forecast job for deep production use, then poll the job URL until the quality-gated forecast is complete.

Minimum Plan
Pro+
Billing Lane
World Signals
Console Scope
/v1/world/signals/jobs
Inputs
  • +topic
  • +window days
  • +depth
  • +idempotency key
  • +scoped API key
Outputs
  • +job id
  • +status URL
  • +reserved credits
  • +job status
  • +completed forecast envelope
Tool Functions
reserves 5 credits; charges only on complete forecast
mundane.forecast.job.create

Creates an async forecast job without blocking the customer request.

credits.reserve

Counts queued and running jobs against available monthly credits.

job.status.poll

Returns queued, running, failed, or complete job state without extra billing.

mundane.forecast.generate

Runs the existing quality-gated world signal engine in the worker.

usage.bill.on_success

Writes usage only after the worker produces a valid forecast.

Create Job request
{
  "topic": "markets",
  "window_days": 14,
  "depth": "deep"
}
Create Job response
{
  "request_id": "req_...",
  "data": {
    "job_id": "j57...",
    "status": "queued",
    "status_url": "https://api.theleokingai.com/v1/world/signals/jobs/j57...",
    "reserved_credits": 5,
    "poll_after_ms": 2000
  },
  "usage": { "lane": "ai", "credits": 0, "billableUnits": 0 },
  "meta": {
    "billing": "reserved_not_charged_until_complete",
    "worker": "scheduled"
  }
}
POST/v1/mundane/hot-zonesalphaWorld SignalsPro+
Intelligence

Mundane Hot Zones

Rank supplied regions as Beyond The Veil style hot zones for a topic and time window using owned transit context and structured generation.

Minimum Plan
Pro+
Billing Lane
World Signals
Console Scope
/v1/mundane/hot-zones
Inputs
  • +topic
  • +regions
  • +window days
  • +depth
Outputs
  • +regional scores
  • +signals
  • +likely manifestations
  • +watch items
  • +synthesis
Tool Functions
5 credits per run
hotzones.score

Scores supplied regions on a 0-100 hot-zone scale.

mundane.region.rank

Ranks likely pressure regions for a topic.

watch.items.generate

Creates concrete monitoring items.

Market Hot Zones request
{
  "topic": "markets",
  "regions": ["United States", "Europe", "China", "Middle East"],
  "window_days": 30
}
Market Hot Zones response
{
  "request_id": "req_...",
  "data": {
    "topic": "markets",
    "hot_zones": [
      { "region": "United States", "score": 82, "signal": "Policy and liquidity stress cluster." }
    ]
  },
  "usage": { "lane": "ai", "credits": 5, "billableUnits": 1 }
}
POST/v1/mundane/analyze-eventalphaWorld SignalsPro+
Intelligence

Mundane Event Analysis

Analyze a supplied world event through mundane astrology and return forward-looking implications, analogs, watch windows, and action guidance.

Minimum Plan
Pro+
Billing Lane
World Signals
Console Scope
/v1/mundane/analyze-event
Inputs
  • +event
  • +event date
  • +location
  • +topic
  • +window days
Outputs
  • +event summary
  • +signature stack
  • +analogs
  • +forecast implications
  • +watch window
Tool Functions
4 credits per analysis
mundane.event.analyze

Analyzes a specific supplied event.

event.signature.extract

Maps the event to astrology and mundane signal language.

forecast.implications.generate

Returns forward-looking implications.

Policy Shock request
{
  "event": "A central bank unexpectedly signals a policy reversal while markets are fragile.",
  "event_date": "2026-06-17",
  "topic": "markets",
  "window_days": 30
}
Policy Shock response
{
  "request_id": "req_...",
  "data": {
    "event_summary": "A policy signal changed market expectations before liquidity stabilized.",
    "confidence": 7,
    "action": "Watch the second reaction, not the first headline."
  },
  "usage": { "lane": "ai", "credits": 4, "billableUnits": 1 }
}
POST/v1/helio/patternsbackgroundNo AI coreFree+
Helio Tropical

Helio Tropical StarTypes

Lookup heliocentric tropical StarTypes patterns with attribution to Michael Erlewine's contributions, source work, and interpretations as a background/evaluation signal.

Minimum Plan
Free+
Billing Lane
No AI core
Console Scope
/v1/helio/patterns
Inputs
  • +subject id
  • +birth date
  • +experiment context
Outputs
  • +pattern code
  • +pattern signature
  • +components
  • +Michael Erlewine attribution
  • +guardrails
Tool Functions
1 credit per subject
startypes.lookup

Looks up the date-level helio tropical StarTypes row.

helio.pattern.components

Returns pattern components, color code, and geometry labels.

erlewine.source.credit

Returns public source credit and rights bucket metadata.

background.signal.guard

Labels StarTypes as experimental background context only.

StarTypes Lookup request
{
  "subjects": [
    { "id": "subject_123", "dob": "1990-07-23" }
  ],
  "context": {
    "use_case": "audience segmentation experiment"
  }
}
StarTypes Lookup response
{
  "request_id": "req_...",
  "data": {
    "profiles": [
      {
        "subject_id": "subject_123",
        "calculation_basis": {
          "frame": "heliocentric",
          "zodiac": "tropical",
          "prediction_role": "background_evaluation"
        },
        "startype": {
          "pattern_code": "82",
          "pattern_signature": "8-B-TRINESQUARE/18-G-TRINE"
        }
      }
    ]
  },
  "usage": { "lane": "core", "credits": 1, "billableUnits": 1 }
}
POST/v1/knowledge/erlewine/contextplannedsales review
Knowledge

Erlewine Context

Retrieve rights-cleared Michael Erlewine context for controlled interpretation workflows without exposing raw archive internals.

Inputs
  • +query
  • +endpoint target
  • +rights bucket
  • +top k
  • +source filters
Outputs
  • +context chunks
  • +source credits
  • +rights metadata
  • +safe summary seeds
Tool Functions
1 credit per retrieval
erlewine.context.search

Searches curated Erlewine chunks by endpoint target and source family.

source.credit.format

Returns public-safe credit lines and source labels.

rights.bucket.filter

Filters retrieval to approved rights buckets.

Context Retrieval request
{
  "query": "relationship vocation StarTypes pattern",
  "endpoint_target": "compatibility",
  "top_k": 5,
  "rights_bucket": "approved"
}
Context Retrieval response
{
  "request_id": "req_...",
  "data": {
    "chunks": [],
    "credit_line": "Includes interpretive context from Michael Erlewine source materials.",
    "use_policy": "supporting context only"
  },
  "usage": { "lane": "core", "credits": 1, "billableUnits": 1 }
}
08

Examples

The same contract works for raw chart calculation, business scoring, world signal generation, and background helio lookup. Use OpenAPI for generated clients and these examples for implementation review.

09

Errors

Errors return JSON envelopes with `request_id` so partner support and usage logs can trace failures without exposing secrets or internal source paths.

HTTPCodeMeaning
400INVALID_REQUESTRequest body failed schema validation or could not be parsed.
401AUTH_REQUIRED / AUTH_INVALIDMissing or invalid `x-api-key` header.
402CREDITS_EXHAUSTEDThe API key does not have enough credits for the request.
403AUTH_FORBIDDENThe API key is valid but not allowed to call the endpoint.
404NOT_FOUNDThe requested async job does not exist for this API key.
409IDEMPOTENCY_CONFLICTThe same Idempotency-Key was reused with a different request body.
429RATE_LIMITEDToo many requests for the current key, endpoint, plan, or environment policy.
502INVALID_RESPONSE / UPSTREAM_FAILEDGeneration, ephemeris, RAG, usage logging, or sidecar calculation failed quality gates.
Error envelope
{
  "request_id": "req_...",
  "error": {
    "code": "CREDITS_EXHAUSTED",
    "message": "Not enough credits for this request",
    "details": {
      "requiredCredits": 10,
      "creditsRemaining": 4
    }
  }
}
10

Billing And Credits

Credits are checked before work starts and recorded after successful calculation or generation. Core compute credits and AI credits stay visible in usage records. Failed requests do not create billable usage events. Async world-signal jobs reserve credits while queued or running, then charge only after the worker stores a complete quality-gated forecast.

Core chart endpoints

1-4 core credits

No-AI mode

No model call or token spend

Audience intelligence

4-8 AI credits

World signals

5+ AI credits per forecast

Helio StarTypes

1 core credit per subject

AI metering

Provider, model, and tokens logged