Production APIv1 alphaSDK Source Included

The Leo KingDeveloper Docs

Build deterministic astrology infrastructure, premium AI experiences, dating-app intelligence, audience scoring, and Beyond The Veil world-signal workflows from one API surface. Start with server-to-server REST, OpenAPI, SDK source, async jobs, and usage-aware billing.

Primary transport
REST JSON
Realtime media
Not v1
Async work
Jobs + polling
AI spend
Metered separately
Dedicated API Gateway
https://api.theleokingai.com

Current production API host with clean /v1 routing.

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

Backward-compatible website host for existing alpha integrations.

Local Development
http://localhost:3000/api

Local Next.js development server.

Platform Contract

The pro API standard is predictable integration behavior: versioned routes, scoped auth, retry-safe billing, traceable envelopes, and explicit output-quality failure states.

Version
v1 alpha

Public route names stay stable while alpha response fields continue to harden.

Authentication
x-api-key

Keys are scoped by endpoint and validated through env-backed records or Convex.

Retries
Idempotency-Key

Retry-safe usage and billing records are part of the public contract.

Rate Limits
60-second sliding window

429 responses include limit details and rate-limit headers when limiter metadata is present.

Trace Headers
X-Request-Id, X-API-Version

Paid responses expose stable trace and version headers, and use no-store caching.

Envelope
request_id, data, usage, meta

Every success response carries tracing, billing, and runtime metadata.

Failures
request_id, error

Errors are support-ready; unexpected server failures use sanitized public messages.

AI Quality
Hard gate

Fallback-looking or incomplete AI output is a failed response, not a successful billable result.

01

Introduction

These docs are organized like a real developer platform: what the API is, how to connect, how to choose no-AI versus AI workflows, how async jobs work, what realtime is not yet, and which tools support production integration.

What The API Does

The Leo King API is a business astrology intelligence layer: deterministic chart compute, relationship scoring, helio StarTypes background, audience intelligence, world signals, and premium AI experiences.

How It Is Different

The platform separates owned astrology math from model-backed interpretation. Partners can run no-AI infrastructure at scale, then add AI only where users pay for synthesis, forecasts, or finished experiences.

What v1 Is Not

v1 is not a WebRTC/video SDK or a raw websocket agent stream. It is a server-to-server API with OpenAPI, SDK source, async jobs, usage metering, and a roadmap for partner callbacks and realtime products.

02

Ways To Connect

Partners should not have to guess how to integrate. The v1 platform supports REST calls, OpenAPI, SDK source, private console testing, and async jobs. Webhooks, streaming, WebSocket, and WebRTC are documented as explicit roadmap or non-v1 lanes so expectations stay clean.

REST API

Live
Best For

Server-side product integrations, backend jobs, app features, and partner workflows.

How

POST JSON to /api/v1 routes with x-api-key and Idempotency-Key headers.

/v1/charts/natal/v1/charts/current-sky/v1/audience/insights/v1/experiences/love-reveal

OpenAPI Contract

Live
Best For

Generated clients, endpoint discovery, schema review, and AI-agent-readable integration context.

How

Fetch /api/v1/openapi and generate your preferred client or validation layer.

/v1/openapi/v1

Node And Python SDK Source

Alpha source
Best For

Teams that want typed helpers while the public packages are prepared.

How

Use sdk/node or sdk/python from the repo; preserve usage metadata in responses.

sdk/nodesdk/python

API Console And Lab

Private beta
Best For

Trying endpoints, inspecting payloads, testing helio/chart/world/experience routes, seeing credit behavior, and reviewing key audit events.

How

Use the customer console for keys, usage, audit trail, and plan state; use the API Lab for chatbot-style endpoint testing.

/api-console/api-console/lab

Async Jobs And Polling

Live for World Signals
Best For

Deep forecasts and longer AI work where the partner app should not block a user request.

How

Create a job, store the job id, poll the status URL, and bill only after a complete quality-gated result.

/v1/world/signals/jobs/v1/world/signals/jobs/{jobId}

Partner Webhooks

Release gate
Best For

Production callbacks for job completion, billing events, quality failures, and long-running reports.

How

Internal queue and drain worker sign callbacks now; partner-facing activation still needs endpoint approval, Convex deploy, and delivery smoke.

job.completedjob.failedusage.recorded
03

Development Workflows

Good integrations start with the right workflow. Choose no-AI compute for infrastructure, AI Intelligence for paid synthesis, async jobs for deep forecasts, and hybrid patterns for dating apps or other products that need both scale and premium reveals.

Core Compute Workflow

No AI

Return deterministic chart facts, compatibility scores, transits, or helio background data.

01

Collect birth data or event timing.

02

Call the core endpoint from your backend.

03

Cache the deterministic payload for repeated use.

04

Use the output to power matching, filters, badges, dashboards, or timing rules.

/v1/charts/natal/v1/charts/current-sky/v1/charts/transits/v1/lunar/phase/v1/compatibility/score/v1/helio/patterns

AI Experience Workflow

AI

Return display-ready interpretation, guidance, prediction, campaign advice, or a premium spiritual product.

01

Start with a deterministic substrate when the endpoint needs chart context.

02

Call the AI route only for a paid or high-value moment.

03

Require quality gates before showing or billing output.

04

Store usage credits, provider, model, tokens, and request_id.

/v1/audience/insights/v1/experiences/future-partner-vision/v1/experiences/crystal-ball

Async Forecast Workflow

AI job

Run deep world-signal work without blocking the app request.

01

Create a forecast job with topic, window, and depth.

02

Show queued/running status in the partner app.

03

Poll the status URL until complete or failed.

04

Charge only after a complete quality-gated forecast is stored.

/v1/world/signals/jobs/v1/world/signals/jobs/{jobId}

Dating App Workflow

Hybrid

Use no-AI compute for match ranking and AI for premium reveal products.

01

Create a profile substrate from natal and optional helio background routes.

02

Precompute synastry and compatibility across candidate pairs.

03

Rank matches without AI spend.

04

Offer Love Reveal or Future Partner Vision as paid unlocks.

/v1/charts/synastry/v1/compatibility/score/v1/experiences/love-reveal
04

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://api.theleokingai.com/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://api.theleokingai.com/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://api.theleokingai.com/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://api.theleokingai.com/v1/world/signals/jobs/$JOB_ID \
  -H "x-api-key: $LEOKING_API_KEY"
04A

Production Buyer Proof

A production-ready API is not proven by a pretty docs page. Before selling or demoing the buyer path, run the smoke that calls the live API with a real scoped key and confirms Convex recorded the usage row.

What must pass
Live key accepted

A real scoped key can call the production API from a server-side request.

Core lane proven

POST /v1/charts/natal returns core credits and no token usage.

AI lane proven

POST /v1/customer/profile returns AI credits, model, and positive token totals.

Convex row proven

The smoke reads production usageEvents and matches the exact request_id after each call.

Buyer path proven

Console usage, billing economics, and docs are backed by the same ledger the API writes.

production smoke
# Core/no-AI production proof on the dedicated gateway
npm run smoke:buyer-path -- --base-url https://api.theleokingai.com --output inference-smoke/buyer-path-gateway-core-YYYYMMDD.json

# Required paid-route contract on the dedicated gateway
npm run smoke:paid-routes -- --base-url https://api.theleokingai.com --output inference-smoke/paid-route-contract-YYYYMMDD.json

# The smoke fails unless the live API response and Convex usageEvents row match
# by request_id, endpoint, usage.lane, credits, billableUnits, model, and AI token totals.
05

Use Cases: Core Compute Vs AI Intelligence

The profitable way to build on this API is not to call AI for everything. Core Compute should power high-volume infrastructure. AI Intelligence should be reserved for paid, display-ready experiences, business recommendations, and forecasts where the customer sees premium value.

No AI

Core Compute is the infrastructure lane

Use this when your product needs scale, repeatability, chart facts, scores, or background profile data without paying for generated language on every request.

Best for onboarding, matching, ranking, caching, dashboards, and partner-side UX.
Returns deterministic JSON: chart payloads, aspects, scores, timing seeds, StarTypes lookup, and source metadata.
Usage records core credits only; no provider, model, or token fields should appear on these calls.
/v1/charts/natal/v1/charts/current-sky/v1/charts/transits/v1/charts/synastry/v1/lunar/phase/v1/compatibility/score/v1/helio/patterns
AI

AI Intelligence is the product experience lane

Use this when the customer is paying for interpretation, recommendation, prediction, synthesis, story, coaching, or a finished feature your partner can display.

Best for paid reveals, campaign advice, personalized copy, world forecasts, and premium spiritual experiences.
Returns display-ready structured output with reasoning fields, quality metadata, and product-specific sections.
Usage records AI credits plus provider, model, token counts, and quality-gate metadata after success.
/v1/audience/insights/v1/experiences/future-partner-vision/v1/experiences/love-reveal/v1/world/signals
Dating App Implementation Blueprint

Build the match engine without AI, then sell AI as the premium reveal.

A dating app should not call a model every time it sorts a match stack. It should use Core Compute for profile substrate, pair scoring, and compatibility labels, then call AI only when the user asks for a deeper connection story, future-partner vision, or paid relationship explanation.

Better match quality than static sun-sign matching because the app can use synastry, compatibility subscores, and relationship risk flags.
Lower cost at scale because ranking, sorting, and badges can run on no-AI Core Compute.
Clear premium moments because AI is reserved for reveals, future-partner products, and connection explanations.
Cleaner trust model because every AI interpretation can point back to a deterministic calculation basis and usage record.

Profile Creation

/v1/charts/natal/v1/helio/patterns
Without AI

User enters birth date, time, and place. The app stores a normalized profile, natal chart payload, chart quality, and optional StarTypes background.

With AI

Only if the app wants profile copy, generate a short display bio or onboarding insight after the deterministic profile exists.

Match Ranking

/v1/charts/synastry/v1/compatibility/score
Without AI

The backend scores many possible pairs with synastry and compatibility routes, then ranks candidates by chemistry, partnership, intimacy, and risk flags.

With AI

No AI is required for normal ranking. Save AI for the user-selected match or a paid unlock.

Match Detail Screen

/v1/compatibility/score/v1/experiences/love-reveal
Without AI

Show score bands, strongest contacts, caution flags, and relationship categories from structured JSON.

With AI

Generate a readable connection summary only when the user opens a deeper explanation.

Premium Reveal

/v1/experiences/future-partner-vision/v1/experiences/love-reveal
Without AI

Use the stored core scores to decide whether the reveal should be offered and what category it belongs to.

With AI

Generate Future Partner Vision, Love Reveal, or a cinematic compatibility read as the paid moment.

Retention And Notifications

/v1/charts/current-sky/v1/charts/transits/v1/lunar/phase/v1/timing/windows/v1/audience/insights
Without AI

Use timing windows and transits to schedule non-generated prompts, match reminders, and relationship check-ins.

With AI

Generate personalized notification copy only for high-value campaigns or subscription features.

How Partners Should Build
1. Compute

Call Core Compute for chart facts, transit substrate, compatibility score, or helio background signal.

2. Store

Cache the deterministic output in the partner app because the same request can power many screens.

3. Decide

Let the partner choose when a customer action deserves AI interpretation or a premium reveal.

4. Generate

Call the AI route, enforce quality gates, and return display-ready output only after success.

5. Meter

Expose `usage.lane`, credits, model, and tokens so the partner understands margin on every feature.

Commercial Use-Case Map

Every strong partner pitch should show the lower-cost deterministic route, the premium AI upgrade, and why the split makes the product easier to price.

Dating App

Turns astrology into a matching layer: richer onboarding, better pair ranking, explainable chemistry, and premium reveal moments beyond a basic swipe interface.

Implementation Pattern

Collect birth data once, precompute profile and pair scores, cache the results, then call AI only when the user asks for a paid relationship explanation or future-partner product.

Core Compute

Run synastry and compatibility scoring across many candidate pairs without model spend.

  • +Create a profile substrate with natal chart data and optional helio background.
  • +Precompute pair compatibility scores for candidate batches.
  • +Use scores, subscores, and risk flags to sort or annotate the match stack.
/v1/charts/synastry/v1/compatibility/score
AI Upgrade

Unlock Future Partner Vision or Love Reveal only when the user taps a premium reveal.

  • +Generate a paid Love Reveal from the selected connection.
  • +Generate Future Partner Vision for users who want a premium future-love product.
  • +Log AI credits, model, tokens, and quality gates separately from core matching.
/v1/experiences/future-partner-vision/v1/experiences/love-reveal

The app can rank matches with lower-cost compute, then charge for a cinematic relationship product.

Commerce Or Creator Funnel

Helps creators and brands decide who should receive an offer, when to send it, and what angle should make the message feel personal.

Implementation Pattern

Use core compute during signup or list import, store the segment metadata, then call AI during campaign planning instead of on every page view.

Core Compute

Calculate core profiles once, cache the chart basis, and segment the audience without generated copy.

  • +Attach natal profile and optional StarTypes background to the customer record.
  • +Segment audiences by signs, chart quality, broad archetypes, or timing substrate.
  • +Filter lists before any generated messaging is requested.
/v1/charts/natal/v1/helio/patterns
AI Upgrade

Call Audience Intelligence when a real campaign, offer, or send/no-send decision needs interpretation.

  • +Score a real campaign against a selected audience.
  • +Generate send/no-send guidance, timing notes, and message angles.
  • +Return usage metadata so campaign margin is visible.
/v1/audience/insights/v1/timing/windows

The partner avoids wasting AI credits on every subscriber while still selling smarter timing and messaging.

Media Or Newsletter Desk

Gives editorial teams a repeatable world-signal workflow: verified astrology context first, then premium forecasts when a topic deserves a full read.

Implementation Pattern

Run core ephemeris checks on a schedule, tag topics and windows, then use async AI jobs for deep subscriber reports or sponsor-grade briefs.

Core Compute

Use transits and mundane ephemeris context as the verified substrate for scheduled editorial planning.

  • +Build a transit calendar and topic watchlist.
  • +Attach deterministic timing windows to editorial planning.
  • +Use core data as the source of truth for later forecasts.
/v1/charts/current-sky/v1/charts/transits/v1/lunar/phase
AI Upgrade

Use World Signals or async jobs for deep BTV-style forecasts, citations, analogs, and watch windows.

  • +Generate deep World Signals only for selected topics.
  • +Use async jobs for long-form forecasts so the app does not block.
  • +Require citations, analogs, quality metadata, and forward-looking implications.
/v1/world/signals/v1/world/signals/jobs/v1/mundane/analyze-event

The newsroom separates factual astrology context from high-value narrative intelligence.

Wellness Or Spiritual App

Lets an app support daily utility, personal reflection, and premium spiritual experiences without making every session a costly AI call.

Implementation Pattern

Use core routes for daily context, saved profiles, and lightweight personalization, then meter AI for paid readings, reveals, and generated guidance.

Core Compute

Use deterministic daily chart context, compatibility scores, tarot draws, or StarTypes background profile data.

  • +Store a stable profile and daily timing substrate.
  • +Use core context for check-ins, reminders, and non-generated UI.
  • +Keep helio StarTypes clearly labeled as background signal.
/v1/charts/natal/v1/charts/current-sky/v1/lunar/phase/v1/helio/patterns
AI Upgrade

Offer Oracle Ask, Crystal Ball, Past-Life Reading, or Daily Horoscope as metered premium experiences.

  • +Generate Oracle, Crystal Ball, Past-Life, or Daily Horoscope products on demand.
  • +Block fallback-looking output before it is shown or billed.
  • +Expose credits and model usage to protect subscription economics.
/v1/oracle/ask/v1/experiences/crystal-ball/v1/past-life/reading/v1/horoscope/daily

The app can support free or low-cost utility while reserving AI spend for paid moments.

No-AI compatibility scoring
curl https://api.theleokingai.com/v1/compatibility/score \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: $LEOKING_API_KEY" \
  -H "Idempotency-Key: match-person-a-person-b-core-v1" \
  -d '{
    "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
  }'

# Response shape to expect
# usage: { "lane": "core", "credits": 4, "billableUnits": 1 }
# tokens: not present
AI premium reveal
curl https://api.theleokingai.com/v1/experiences/love-reveal \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: $LEOKING_API_KEY" \
  -H "Idempotency-Key: match-person-a-person-b-reveal-v1" \
  -d '{
    "question": "What is the real potential in this connection?",
    "subject": { "id": "person_a", "dob": "1990-07-23" },
    "context": {
      "relationship_status": "new connection",
      "desired_tone": "direct, premium, grounded"
    }
  }'

# Response shape to expect
# usage: { "lane": "ai", "credits": 5, "tokens": { "input": 1430, "output": 720 } }
# quality gates: required before billing is recorded
06

Realtime, Webhooks, WebSocket, And WebRTC

The current API is not a realtime media stack. v1 uses REST, async jobs, and polling. Partner callbacks, server-sent streaming, WebSocket, and WebRTC are separate product lanes with different infrastructure, billing, latency, and SDK requirements.

ModeStatusUse In This API
REST request/responseLiveDefault v1 integration path for charts, intelligence, experiences, and knowledge routes.
Async jobs + pollingLiveUse for World Signals and longer-running AI reports.
Partner webhooks/callbacksRelease gateInternal queue, signed delivery worker, retry, and dead-letter storage exist behind ops auth.
Server-sent streamingRoadmapPotential fit for long text generation, progressive forecasts, and API Lab responses.
WebSocketNot v1Only needed if we ship live bidirectional chat sessions or streaming agent state.
WebRTCNot v1Only needed for real-time voice/video/spatial sessions; this API is not a Telnyx/Tavus-style media transport today.

Realtime Product Rule

If a partner wants a live AI companion, voice session, video avatar, or two-way streaming interface, that should become a separate realtime SDK/API product. The current business API should stay reliable: authenticated REST, async jobs, strict quality gates, and usage records that protect margin.

07

Development Tools

Developer docs should give teams a working loop: create a key, inspect OpenAPI, run a test request, check readiness, review usage, and debug errors. These are the tool surfaces for that loop.

API Console
/api-console

Manage keys, plan state, credit pools, endpoint access, audit trail, and organization billing.

API Lab
/api-console/lab

Run real endpoints from a chatbot-style interface and inspect request/response JSON.

OpenAPI JSON
/api/v1/openapi

Machine-readable endpoint contract for generated clients and agent-readable docs.

Endpoint Index
/api/v1

Lightweight route catalog for discovery and integration checks.

Public Status
/api/v1/status

Public non-secret status component inventory for discovery and partner review.

Public SLA
/api/v1/sla

Published SLA targets, support boundaries, incident policy, and monitoring status.

Incident History
/api/v1/incidents

Public incident ledger and reporting policy for partner-impacting production issues.

Security Packet
/api/v1/security

Public controls, data handling boundaries, subprocessor scope, and enterprise review notes.

Access Control
/api/v1/access-control

API-key custody, scopes, environment boundaries, lifecycle, browser/CORS policy, and allowlist gates.

Security.txt
/.well-known/security.txt

Well-known security contact and policy discovery for vulnerability reporting.

Observability Proof
/api/v1/observability

Gateway smoke, env gate, buyer-path usage proof, readiness, and AI output-quality signals.

Onboarding Contract
/api/v1/onboarding

Server-key setup, first request, retry handling, usage proof, launch-readiness gates, handoff artifacts, and support packet guidance.

Versioning And Limits
/api/v1/versioning

Compatibility guarantees, deprecation windows, sunset rules, and rate-limit behavior.

Migration Guides
/api/v1/migrations

Legacy alias moves, deprecation artifacts, before/after route guidance, and validation checks.

Procurement Packet
/api/v1/procurement

Buyer-review checklist, legal/security/ops boundaries, signed-term gates, and durable trust links.

Conformance Contract
/api/v1/conformance

Acceptance suites, smoke commands, launch gates, pass criteria, and evidence artifacts.

Data Processing
/api/v1/data-processing

Processing purposes, minimization rules, restricted-data list, DSR policy, and DPA boundaries.

Compliance Map
/api/v1/compliance

Framework-style control mapping, public evidence artifacts, certification boundaries, and signed-term gates.

AI Governance
/api/v1/ai-governance

Acceptable-use boundaries, prohibited and restricted use cases, output-quality controls, human review, and escalation triggers.

Examples And Cookbooks
/api/v1/examples

Public request/response payloads, SDK snippets, and partner workflow recipes.

Support Policy
/api/v1/support

Public support tiers, severity routing, required support packet, and enterprise escalation boundaries.

SDK Readiness
/api/v1/sdks

Package names, source paths, install commands, helper surface, generated-client policy, and release gates.

Changelog
/api/v1/changelog

Public release notes for current docs work, alpha foundation, and next enterprise gates.

Webhook Contract
/api/v1/webhooks

Signed callback contract plus release-gated worker, retry, and dead-letter behavior.

Error Catalog
/api/v1/errors

Support-grade error codes, retry behavior, partner actions, and escalation signals.

Postman Collection
/api/v1/postman

Importable Postman collection generated from the public v1 endpoint catalog.

Readiness
/api/v1/ops/readiness?deep=1

Internal production health checks for auth, billing, usage logging, AI provider, and sidecars.

SDK Source
sdk/node + sdk/python

Typed client source for Node and Python before public package release.

07A

Public Developer Metadata

Major APIs make their platform state easy to inspect without a sales call. These public JSON surfaces give developers and AI coding tools the current status map, release history, and release-gated webhook contract.

Public Status
/api/v1/status

Component inventory, readiness boundary, and integration status.

Public SLA
/api/v1/sla

Availability targets, support boundaries, measurement state, and enterprise caveats.

Incident History
/api/v1/incidents

Incident ledger, severity policy, public fields, and postmortem expectations.

Security Packet
/api/v1/security

Controls, data handling boundaries, subprocessor scope, and enterprise review notes.

Access Control
/api/v1/access-control

Key custody, scopes, environment boundaries, lifecycle, browser/CORS policy, and allowlist gates.

Security.txt
/.well-known/security.txt

Well-known vulnerability contact, policy, canonical URL, and expiration metadata.

Observability Proof
/api/v1/observability

Production env gate, gateway smoke, buyer-path proof, readiness, and output-quality signals.

Onboarding Contract
/api/v1/onboarding

Server-key setup, first request, retry handling, usage proof, launch-readiness gates, handoff artifacts, and support packet guidance.

Versioning And Limits
/api/v1/versioning

Compatibility guarantees, deprecation windows, sunset rules, and rate-limit behavior.

Migration Guides
/api/v1/migrations

Legacy alias moves, deprecation artifacts, before/after route guidance, and validation checks.

Procurement Packet
/api/v1/procurement

Buyer-review checklist, legal/security/ops boundaries, signed-term gates, and durable trust links.

Conformance Contract
/api/v1/conformance

Acceptance suites, smoke commands, launch gates, pass criteria, and evidence artifacts.

Data Processing
/api/v1/data-processing

Processing purposes, minimization rules, restricted-data list, DSR policy, and DPA boundaries.

Compliance Map
/api/v1/compliance

Framework-style mappings, public evidence artifacts, certification boundaries, and signed-term gates.

AI Governance
/api/v1/ai-governance

Acceptable-use boundaries, prohibited and restricted use cases, output-quality controls, human review, and escalation triggers.

Examples And Cookbooks
/api/v1/examples

Public request/response payloads, SDK snippets, and partner workflow recipes.

Support Policy
/api/v1/support

Support tiers, severity routing, support packet requirements, and enterprise escalation boundaries.

SDK Readiness
/api/v1/sdks

Package names, install commands, helper surfaces, generated-client policy, and release gates.

Changelog
/api/v1/changelog

Version history, current docs release, and next build gates.

Webhook Contract
/api/v1/webhooks

Signed callback events, payload fields, idempotency, and retry policy.

Error Catalog
/api/v1/errors

Support-grade error codes, retry behavior, and partner actions.

Postman Collection
/api/v1/postman

Importable API collection with baseUrl and apiKey variables.

Security.txt

Vulnerability reporting discovery is available at /.well-known/security.txt. The published contact is mailto:partners@theleokingai.com, and the canonical policy points back to the API security packet.

Canonical
https://theleokingai.com/.well-known/security.txt
Policy
https://theleokingai.com/api/v1/security
Languages
en
07B

Procurement Packet

Enterprise buyers need the review packet before a custom deal moves forward. The public packet exposes what is ready for review, what needs partner evidence, and which commitments require signed terms.

Review Checklist

Public procurement metadata is available at /api/v1/procurement. Reviewers should use these durable links instead of screenshots.

CategoryOwnerRequirementEvidence
Security Controls
live
platformPublish API-key handling, data minimization, rate-limit, and no-fallback-success controls.Security packet exposes public controls and partner expectations.
Data Handling
live
sharedReview retention boundaries and restrict support packets to sanitized operational evidence.Security and support routes publish data-retention categories plus never-include fields.
Compliance Mapping
live
sharedMap public controls to common enterprise review categories without claiming certifications that are not published.Compliance map identifies current evidence, framework-style mappings, and signed-term boundaries.
AI Governance
live
sharedReview generated-output quality gates, acceptable-use boundaries, restricted use cases, and escalation triggers before production launch.AI governance packet defines allowed, restricted, prohibited, human-review, and support-evidence boundaries.
Subprocessor Review
beta
platformExpose current infrastructure, auth, billing, model, sidecar, rate-limit, and monitoring subprocessors.Security packet lists current subprocessors and the data scope for each.
SLA And Incidents
live
platformPublish current availability targets, measurement boundary, incident fields, and postmortem policy.SLA and incidents routes expose public targets and current incident history status.
Versioning And Migration
live
platformDocument compatibility guarantees, breaking-change artifacts, migration guides, and sunset requirements.Versioning and migrations routes publish lifecycle policy and route-specific migration guides.
Operational Proof
beta
sharedRun env gate, gateway smoke, buyer-path usage proof, and AI output-quality sampling before launch.Observability route and onboarding route publish production proof requirements.
Legal Terms
enterprise
sharedMove DPA, custom retention, dedicated support, allowlists, and contractual SLA into signed terms.Procurement packet identifies what public metadata does and does not contractually promise.
Buyer Packet
Company and product summary for The Leo King Business Intelligence API.
Dedicated production gateway and public OpenAPI contract.
Security packet, data-retention notes, and current subprocessor scope.
Compliance-readiness map with current evidence links and certification boundaries.
Public SLA targets, incident policy, and support escalation boundary.
Versioning, deprecation, migration, and rate-limit policy.
Requires Signed Terms
custom DPA or private data-processing terms
contractual SLA response windows
dedicated support contacts
IP allowlists
long-range audit export packages
custom retention schedules
private endpoint scopes or customer-specific model terms
Review Boundary

Public metadata does not create a contractual SLA, DPA, or custom retention obligation.

Private readiness, env values, raw logs, raw prompts, and raw customer payloads require authenticated/internal process.

07C

Conformance And Smoke

Production-ready APIs need an acceptance contract. These suites define what must pass before SDK release, enterprise review, custom limits, production launch, or a claim that AI output quality is healthy.

Acceptance Suites

Public conformance metadata is available at /api/v1/conformance. Passing local tests is only one part of production readiness.

SuiteOwnerCommandProves
Local Contract Suite
live
platformnpm run test -- --run tests/api-v1.test.ts tests/api-reference-docs.test.ts tests/robots.test.ts tests/api-gateway-config.test.ts tests/sdk-contract.test.tsPublic API metadata, docs discovery, gateway rewrites, and SDK helpers agree before deploy.
API Reference Discovery
live
platformnpm run smoke:api-reference -- --base-url https://api.theleokingai.comEvery documented endpoint has parseable examples, stable reference links, SDK snippets where shipped, and matching discovery coverage across examples, Postman, OpenAPI, and docs.
SDK Source And Dist
live
platformnpm run smoke:sdk-release -- --skip-liveSDK public metadata helpers, authenticated route helpers, webhook helpers, package metadata, Python import behavior, and generated Node dist compile.
Production Build
live
platformnpm run buildThe app compiles, route handlers type-check, and static public metadata routes are generated.
Production Env Gate
live
platformnpm run prod:env:productionRequired production env surfaces exist before push/deploy and Clerk JWT template is configured.
Dedicated Gateway Smoke
live
platformnpm run smoke:api-gateway -- --mode finalDedicated gateway DNS, root JSON, OpenAPI, Postman, status, and docs discovery work in production.
Buyer Path Usage Smoke
beta
sharednpm run smoke:paid-routes -- --base-url https://api.theleokingai.com --output inference-smoke/paid-route-contract-YYYYMMDD.jsonA scoped key can call one Core Compute route and one AI Intelligence route, and each exact request_id appears in the usage ledger.
GitHub Production Release Gate
live
platformGitHub Actions > API Production Release GateProduction API readiness claims have a durable CI artifact with Core/no-AI, AI, and Convex usageEvents proof.
AI Output Quality Sampling
beta
sharedInspect 1-3 fresh live outputs created after the deploy timestamp.AI value quality is preserved, not merely that status codes and pipelines succeeded.
Launch Gates
Production env guard prints READY FOR PUSH/DEPLOY for the target environment.
Public metadata routes, OpenAPI, Postman, docs, llms files, sitemap, and robots discovery all agree.
API reference smoke proves catalog examples, SDK snippets, OpenAPI paths, Postman items, and docs links agree.
SDK source, generated dist, README snippets, and public endpoint catalog stay in sync.
Dedicated gateway smoke passes against https://api.theleokingai.com.
Paid-route smoke proves one Core/no-AI route and one AI route write usage ledger evidence for the exact request_id.
Required Before
publishing SDK packages
approving enterprise procurement packets
raising rate limits
launching a signed partner integration
declaring AI generation logic healthy after deploy
Evidence Retention

Keep smoke outputs, request_id, endpoint, UTC timestamp, key prefix only, commit SHA, deployment URL, and sanitized payload shape for support and procurement review.

07D

Data Processing

Enterprise review needs a clear answer to what data is processed, why it is processed, what should never be sent, and when a signed DPA is required. The public packet keeps that boundary explicit.

Processing Purposes

Public data-processing metadata is available at /api/v1/data-processing. The packet does not replace signed customer-specific DPA terms.

CategoryStatusDataPartner Responsibility
Core Astrology Compute

Calculate deterministic chart, transit, compatibility, lunar, and helio background data for partner products.

betapartner subject id, birth date, birth time when supplied, birth place or coordinates, event datetime/locationStore only the deterministic output needed for the product and avoid sending unrelated identity fields.
AI Intelligence And Experiences

Generate audience intelligence, premium spiritual experiences, oracle/tarot interpretation, and world-signal analysis.

betapartner customer id, campaign context, route-specific prompt/context, generated output, model/provider metadataDo not send private prompts, sensitive personal data, or regulated data unless the signed use case permits it.
Billing And Entitlement

Meter credits, plan state, scoped key access, request rate, subscription state, and usage reconciliation.

betaorganization id, API key hash/prefix, endpoint, credits, billing lane, subscription state, request_idNever send payment card or bank account data to API routes or support channels.
Support, Incident, And Conformance Evidence

Triage integration issues, incidents, output-quality regressions, conformance evidence, and procurement review.

liverequest_id, endpoint, UTC timestamp, key prefix only, idempotency key hash, sanitized payload shape, deployment metadataRedact raw payloads, secrets, payment details, and complete birth data unless a signed support process requires them.
Data Minimization
Send stable partner-side subject or customer ids instead of names whenever possible.
Send only birth date, time, place, latitude, longitude, campaign context, or prompt fields required by the selected endpoint.
Do not send payment instruments, government ids, health records, unrelated profile data, or raw secrets.
Use sanitized payload shape, request_id, endpoint, UTC timestamp, and key prefix only for support.
Restricted Data
raw API keys, bearer tokens, webhook secrets, provider credentials
payment card or bank account data
government identifiers
health records or protected medical data
children's data without a signed, reviewed use case
regulated or high-risk data categories not approved in signed terms
Data Subject Requests

Deletion/export requests should start from the partner system of record. Platform-side deletion/export assistance requires request_id, partner subject id, organization id, and signed support process when private payloads are involved.

organization id
partner subject id
request_id list when available
endpoint list
UTC date range
requested action
07E

Compliance Map

Enterprise reviewers need a control map, but the API should not overclaim certifications. This section maps public evidence to common review categories while keeping SOC 2 reports, DPAs, regulated-data commitments, and private audit artifacts behind signed terms.

Framework Mapping

Public compliance metadata is available at /api/v1/compliance. This is a readiness map, not a certification report.

Review AreaStatusControlsBoundary
SOC 2-Style Security Review

Security, confidentiality, access control, change evidence, and incident review areas.

liveserver-side API-key custody, scoped endpoint access, secret redaction boundaries, support packet minimizationPublic docs are readiness evidence; formal SOC 2 report access requires separate availability and signed review terms.
SOC 2-Style Availability Review

Gateway availability, status publication, operational smoke, and support escalation readiness.

betapublic SLA targets, incident history policy, gateway smoke, production env gateContractual availability targets require signed customer terms and dedicated monitoring.
GDPR/Data Processing Review Readiness

Processing purposes, data minimization, restricted data, retention, subprocessors, and DSR support.

livepublished processing purposes, restricted-data list, data-minimization rules, subprocessor scopePublic packet does not create a DPA, residency promise, or regulated-data authorization.
OWASP API Security Review Readiness

Authentication, authorization, rate limiting, input validation, error handling, and secret exposure boundaries.

betax-api-key auth, endpoint scope checks, rate-limit policy, standard error envelopeCustom network controls, mTLS-style controls, and allowlists require signed enterprise terms.
Enterprise Procurement And Vendor Risk

Buyer packet, legal/security/ops review, signed-term gates, support boundaries, and durable evidence links.

livebuyer packet, review checklist, legal boundary, operational proofPublic metadata accelerates vendor review but is not a master services agreement, DPA, or security exhibit.
AI Output Quality Governance

Generation quality, fallback prevention, output sampling, model/provider metadata, and incident escalation.

betano fallback success rule, fresh live output sampling, quality-gate failure handling, model/token visibilityPassing builds and HTTP status checks do not prove AI product quality.
No Certification Overclaim

This public packet is a readiness and evidence map only. It does not claim SOC 2 or ISO 27001 certification, HIPAA or PCI eligibility, GDPR compliance determination, or regulated-data approval unless those artifacts are separately published in signed customer review materials.

Signed-Term Gates
SOC 2 report or bridge letter sharing when available
customer-specific DPA or data-processing addendum
HIPAA, PCI, children data, regulated-data, or regional residency commitments
long-range audit export packages or private logs
IP allowlists, private endpoints, custom network controls, or dedicated security exhibits
contractual SLA/support response windows
Evidence Artifacts

Use these public artifacts as durable starting points. Private reports, raw logs, raw payloads, and customer-specific controls stay out of public docs.

ArtifactOwnerReview UsePublic Link
Security Packet

Security controls, retention policy, subprocessor scope, security.txt, and enterprise review notes.

platformSecurity and confidentiality review starter evidence./api/v1/security
Access-Control Packet

API-key custody, scope model, environment separation, rotation, revocation, and allowlist boundary.

sharedAuthentication, authorization, and key-management review./api/v1/access-control
Data-Processing Packet

Processing purposes, minimization, restricted data, DSR policy, retention, subprocessors, and DPA boundary.

sharedPrivacy, data-processing, and DPA scoping review./api/v1/data-processing
Conformance Contract

Local contract tests, SDK build, app build, env gate, gateway smoke, buyer-path proof, and AI quality sampling.

platformProduction readiness and acceptance evidence./api/v1/conformance
Observability Proof

Gateway smoke, production env gates, buyer-path proof, readiness boundary, and output-quality signals.

platformOperational readiness and smoke-evidence review./api/v1/observability
SLA And Incident Policy

Availability targets, measurement boundary, incident fields, severity policy, and postmortem expectations.

platformAvailability and resilience review./api/v1/sla
Procurement Packet

Buyer checklist, legal/security/ops boundaries, signed-term gates, and durable trust links.

sharedVendor-risk and legal handoff review./api/v1/procurement
07F

AI Governance

Model-backed API products need acceptable-use boundaries that buyers can review before launch. This packet documents what partners may build, what needs signed review, what is prohibited, and when output quality must fail instead of publishing degraded content.

Use-Case Boundaries

Public AI governance metadata is available at /api/v1/ai-governance. Route output is interpretive guidance unless signed terms say otherwise.

Use CaseAllowedRestrictedProhibited
Entertainment, Wellness, And Personal Insight
beta
Horoscope, tarot, oracle, love, timing, compatibility, and spiritual-experience products with clear interpretive framing.Sensitive relationship, crisis, addiction, grief, fertility, medical, legal, or financial claims require product review and may need signed terms.Do not present output as diagnosis, guaranteed prophecy, emergency guidance, or factual certainty about a person's future.
Audience Intelligence And Campaign Strategy
beta
Segment-level campaign-fit, tone, timing, and creative-angle guidance for marketing teams.Individual pricing, eligibility, employment, credit, insurance, housing, political persuasion, or sensitive profiling requires signed review and may be disallowed.Do not use outputs as the sole basis for consequential decisions about a person or protected class.
World Signals, Markets, And Public Research
beta
Editorial, research, scenario planning, media analysis, trend monitoring, and strategic briefing workflows.Trading, investment, insurance, legal, public safety, emergency, or policy decisions require independent review and signed customer terms.Do not present forecasts as investment advice, legal advice, guaranteed outcomes, or emergency instructions.
Core Astrology Compute
live
Deterministic chart, transit, lunar, compatibility, synastry, and helio background calculation for partner products.High-volume, regulated, minors, or sensitive personalization should be reviewed for data minimization and consent.Do not infer protected traits, medical states, legal status, or eligibility from chart data.
Acceptable-Use Boundary

The API may support entertainment, media, wellness, relationship, audience-intelligence, timing, and world-signal workflows when partners present output as guidance or analysis, not deterministic fact, diagnosis, legal advice, financial instruction, or emergency direction.

Quality And Human Review

Model-backed routes must satisfy route-specific schemas, required sections, metadata, and no-fallback-looking language before a response is treated as successful or billable.

High-impact, public, paid, regulated, crisis, or strategic decisions should include partner-side human review before output is published or acted upon.

Escalation Triggers
fallback-looking, generic, thin, malformed, or placeholder output reaches a user or partner workflow
required sections, model metadata, citations/evidence, or forward-looking analysis are missing where promised
a partner wants to use output for regulated, high-impact, minors, crisis, medical, legal, financial, employment, housing, insurance, or eligibility contexts
a customer asks for custom retention, model/data terms, public claims, or private evidence beyond public metadata
raw secrets, regulated data, or complete private payloads appear in logs, screenshots, support tickets, or prompt examples
Prohibited Uses
medical diagnosis, treatment, emergency response, or mental-health crisis handling
legal, tax, investment, credit, insurance, employment, housing, or eligibility decisions as deterministic instruction
government benefit, law-enforcement, surveillance, biometric, or identity-verification decisions
automated decisions that materially affect a person's rights or access to essential services without signed review and human oversight
deception, impersonation, harassment, manipulation, or content presented as guaranteed prophecy or factual certainty
sending raw secrets, payment instruments, government identifiers, health records, children's data, or regulated data without signed approval
Governance Controls
ControlOwnerRequirementEvidence
No Fallback Success
live
platformFallback-looking, malformed, thin, missing-section, or placeholder output must fail instead of publishing as success./api/v1/conformance
Route-Specific Quality Gates
beta
platformGenerated output must satisfy the route's schema, required sections, product depth, model metadata, and route-specific constraints./api/v1/openapi
Human Review Boundary
live
partnerPartner reviewers should inspect output before publication, customer delivery, or operational use where reliance risk is meaningful./api/v1/ai-governance
Restricted Use Escalation
enterprise
sharedMove restricted workflows into signed review or decline the use case before production traffic./api/v1/procurement
Transparent Support Evidence
live
sharedUse request_id, endpoint, UTC timestamp, key prefix only, model/provider metadata, and sanitized payload/output shape./api/v1/support
Data Minimization
live
sharedSend only route-required data and keep secrets, payment data, regulated data, and unnecessary identifiers out of prompts and support evidence./api/v1/data-processing
Versioning Policy

The current API version is v1. Route names, auth headers, envelopes, billing lanes, and idempotency behavior are compatibility-sensitive.

Public metadata routes remain unauthenticated unless a route is explicitly marked internal.
Successful paid responses keep the standard request_id, data, usage, and meta envelope.
Error responses keep request_id plus error.code, error.message, and optional error.details.
Core Compute routes stay no-AI unless a new versioned endpoint or explicit route policy says otherwise.
Deprecation Notice

90 days for beta/public metadata routes; 180 days target for paid production routes once enterprise terms are signed.

Rate Limit Contract

Sliding window backed by Upstash Redis or Vercel marketplace Redis aliases. Limits are measured over 60 seconds per organization, key, endpoint, and plan limit..

RateLimit-LimitRateLimit-RemainingRateLimit-ResetRetry-AfterX-RateLimit-Reset-At

Enterprise limits can be raised by signed contract after traffic shape, endpoint mix, output quality risk, and provider budget are reviewed.

Migration Guides

Public migration metadata is available at /api/v1/migrations. Breaking changes require documented artifacts before removal.

GuideStatusFromTo
Move From Website API Host To Dedicated Gatewaylivehttps://theleokingai.com/api/v1/*https://api.theleokingai.com/v1/*
Move Customer Profile Alias To Audience InsightsbetaPOST /v1/customer/profilePOST /v1/audience/insights
Move Mundane Forecast Alias To World SignalsbetaPOST /v1/mundane/forecastPOST /v1/world/signals or POST /v1/world/signals/jobs
Breaking Change Rule

Breaking changes require a changelog entry, OpenAPI update, migration guide, support path, and the notice window defined in /api/v1/versioning before removal.

Changelog entry with exact affected routes and dates.
OpenAPI diff or replacement schema reference.
Before/after request and response examples.
SDK helper alias or explicit no-alias decision.
Support packet guidance and escalation route.
Security Controls

This is the public procurement packet: what is live, what partners must do, and what evidence backs each claim.

ControlStatusPartner ExpectationEvidence
Server-Side API KeysliveStore keys in a backend secret manager or server env. Never ship keys in browser, mobile, or client-side code.Auth middleware rejects missing or invalid keys and public docs show backend-only usage examples.
Dedicated HTTPS GatewaylivePin production clients to the dedicated gateway and keep the legacy website host only for alpha compatibility.Gateway DNS, OpenAPI servers, Postman baseUrl, SDK defaults, and gateway smoke all target the dedicated host.
Scoped Endpoint AccessbetaRequest only the lanes and endpoints needed for the customer workflow.API-key validation checks endpoint scope, organization status, key status, and credit limit before paid route execution.
Retry-Safe Usage RecordsbetaSend stable idempotency keys for retries and include request_id in support tickets.Buyer-path smoke verifies live response usage and Convex `usageEvents` rows by exact request_id.
No Fallback Success For AI OutputliveTreat `INVALID_RESPONSE` or `UPSTREAM_FAILED` as retry/escalation conditions instead of rendering degraded content.Quality checks fail fallback phrases, missing sections, malformed schemas, and local path leaks before success.
Data MinimizationliveAvoid sending names, payment data, unrelated profile fields, or freeform PII unless a route explicitly requires it.Docs and trust page publish the collection boundary; request schemas keep required fields narrow.
Rate Limits And Abuse GuardbetaUse backoff on 429 responses and coordinate enterprise limits before load tests.Production env gate requires `API_RATE_LIMIT_MODE=enforce` and Redis credentials for remote production traffic.
Enterprise Security ReviewenterpriseRequest contract review before regulated, high-volume, or custom-data deployments.Public security packet identifies current controls, console audit visibility, and remaining signed-contract work without exposing secret config.
Observability Proof

Production Env Gate

live

`npm run prod:env:production` verifies required Vercel production env names before push/deploy.

Before every production deploy or config change.

Dedicated Gateway Smoke

live

`npm run smoke:api-gateway -- --mode final` verifies DNS, root JSON, status, OpenAPI, and Postman on api.theleokingai.com.

After gateway, OpenAPI, SDK, or docs deploys.

Buyer Path Usage Proof

beta

`npm run smoke:paid-routes` calls the live Core/no-AI and AI routes and confirms matching Convex usageEvents by request_id.

Before enterprise demos, after auth/billing/usage changes, and after production deploys that affect paid routes.

Internal Deep Readiness

beta

GET `/api/v1/ops/readiness?deep=1` checks provider env, usage logging, rate limits, sidecars, and AI provider state.

Before deploy and during incident triage.

AI Output Quality Sampling

beta

Fresh live AI outputs must be inspected for required sections, metadata, depth, and no fallback-looking copy.

After any generation logic, prompt, RAG, model, or provider deploy.

Incident Ledger

live

GET `/api/v1/incidents` publishes partner-impacting incidents and reporting policy.

Within the public incident publication window after confirmed impact.

Error Catalog

live

GET `/api/v1/errors` maps response codes to retry behavior, partner action, and support signals.

Reviewed with API contract changes.

Buyer Onboarding Path
01 / Choose The Production Base URL
partner

Use `https://api.theleokingai.com` and `/v1/*` paths for new integrations.

OpenAPI, Postman, SDK examples, and gateway smoke all point to the dedicated gateway.

02 / Create A Server-Side Key
shared

Generate a scoped API key from the customer console or approved internal smoke flow.

Keys are hashed/scoped by organization, endpoint access, and credit state before paid route execution.

03 / Make The First Core Request
partner

Call `POST /v1/charts/natal` with `x-api-key`, `Idempotency-Key`, and a minimal subject payload.

Core endpoint should return `usage.lane = core`, credits, no token usage, and deterministic chart data.

04 / Wire Retry And Error Handling
partner

Preserve idempotency keys across retries and branch on the public error catalog.

409, 429, 502, and 503 responses include partner action and support-ready request_id.

05 / Verify Usage And Credits
shared

Run buyer-path smoke and confirm the Convex `usageEvents` row for the exact request_id.

Passing smoke proves response usage and billing ledger agree before a buyer demo.

06 / Sample AI Output Quality
shared

For AI routes, inspect 1-3 fresh production outputs created after deploy.

Outputs must include required sections, model metadata, depth, no placeholder copy, and no fallback language.

07 / Prepare The Support Packet
partner

Record request_id, endpoint, UTC timestamp, key prefix only, idempotency key hash, and sanitized payload shape.

Support can triage without raw secrets, complete private payloads, or payment data.

08 / Request Enterprise Terms
shared

Move to signed terms for custom limits, private endpoints, allowlists, DPAs, audit exports, and dedicated incident contacts.

Enterprise terms are contract-specific and should not be assumed from public metadata.

Data Handling
API Request MetadataDo not include full secrets or raw payloads in support tickets; provide request_id and sanitized payload shape.
Birth Data PayloadsUse customer ids and only the birth fields needed for the route. Avoid names and unrelated personal profile data.
Generated AI OutputsAI output must meet the same product contract after retries; fallback-shaped output should be escalated as a quality incident.
Billing And Entitlement RecordsPayment instruments are handled by Clerk/Stripe rather than stored directly in this API surface.
Support EvidenceNever send raw API keys, bearer tokens, payment details, or complete private payloads in email or chat.
Raw SecretsRotate any exposed secret immediately and replace it with a managed environment variable.
Subprocessor Scope
VercelNext.js hosting, edge routing, logs, and deployment rollback.
ConvexAPI key validation, usage ledger, entitlement state, and billing/event records.
ClerkCustomer console authentication, organizations, billing state, and checkout integration.
StripePayment processing through Clerk Billing and Stripe-connected checkout.
OpenAI Or RunPodModel-backed generation for AI Intelligence routes when enabled by production config.
RenderKerykeion sidecar hosting for deterministic astrology calculation.
UpstashDistributed rate limit state and abuse protection.
SentryError monitoring, release visibility, and source-map assisted debugging.
Production Checklist
  • Production env gate prints READY FOR PUSH/DEPLOY for the target environment.
  • API CI passes lint, full tests, source-only API reference smoke, and production build.
  • GitHub API Production Release Gate passes in the protected production environment after deploy.
  • Dedicated gateway smoke passes in final mode on api.theleokingai.com.
  • Buyer-path smoke passes against the dedicated gateway with Convex proof enabled.
  • Core endpoints return no token usage and AI endpoints return model/token visibility.
  • Fresh AI outputs satisfy product quality requirements after the deploy timestamp.
  • Support packet includes request_id, endpoint, key prefix only, UTC timestamp, and sanitized payload shape.
  • Access-control review confirms server-side key custody, endpoint scope, environment separation, rotation triggers, and no public-client key exposure.
  • Compliance mapping review confirms public evidence links, framework-style mapping, no certification overclaim, and signed-term boundaries.
  • AI governance review confirms acceptable-use boundaries, prohibited/restricted use cases, human-review requirements, and no fallback-success behavior.
  • Conformance evidence includes local contract tests, SDK build, app build, env gate, gateway smoke, buyer-path proof, and AI output sampling when relevant.
  • Data-processing review confirms minimization, restricted-data boundaries, retention policy, subprocessor scope, and signed-DPA requirements.
  • Launch-readiness handoff includes smoke evidence, partner integration matrix, billing proof, AI quality evidence, and rollback plan.
Launch Readiness Gates

Public onboarding metadata is available at /api/v1/onboarding. These gates define when an integration is ready for paid traffic, enterprise demo, or custom terms.

GateOwnerRequired EvidenceBlocker
Dedicated Gateway Reachability
live
platform`npm run smoke:api-gateway -- --base-url https://api.theleokingai.com --final` passes and returns the current contractVersion.Block launch if the dedicated gateway, OpenAPI, status, docs, or metadata aliases do not resolve through the public host.
Partner Server Key Handling
beta
sharedPartner confirms keys are stored server-side only, scoped to the expected organization/routes, and never shipped to browser/mobile clients.Block production traffic if keys are exposed in client code, screenshots, support tickets, or analytics events.
Usage Ledger Reconciliation
beta
platformBuyer-path smoke proves response `request_id`, usage lane, credits, and Convex usage event agree for the same call.Block paid launch when usage response fields and ledger rows disagree or cannot be traced by request_id.
AI Output Quality Sampling
beta
sharedInspect 1-3 fresh production AI outputs after deploy for required sections, model metadata, depth, and no fallback-looking copy.Block publication or partner demo if output quality is unverified, generic, missing required sections, or fallback-looking.
Support And Incident Drill
live
sharedPartner can provide request_id, endpoint, UTC timestamp, key prefix only, idempotency hash, sanitized payload shape, and severity.Block enterprise launch if support evidence requires raw secrets, complete private payloads, payment details, or a private DPA process that is not signed.
Signed Enterprise Boundary
enterprise
sharedOrder form, DPA/addendum when applicable, custom SLA/support exhibit, limits, allowlists, and launch checklist are signed before custom commitments.Do not promise custom retention, residency, allowlists, private endpoints, dedicated response windows, or audit export packages from public metadata alone.
Launch Handoff Artifacts

Production Smoke Evidence

platform

Gateway readiness, public metadata compatibility, OpenAPI freshness, and post-deploy release proof.

Include URL, status, contractVersion, deployment URL, commit SHA, and timestamps; do not include secrets or private payloads.

Partner Integration Matrix

partner

Mapping environments, server owners, endpoint scopes, expected volume, retry policy, and escalation contacts before traffic ramps.

Use role/team contacts and endpoint scopes; do not publish personal phone numbers, raw keys, or customer payload samples.

Usage And Billing Proof

platform

Confirming credits, lane, billable units, idempotency behavior, and ledger traceability before paid production use.

Use request_id, organization id, key prefix only, endpoint, credits, and timestamps; never expose key hashes or payment identifiers.

AI Quality Evidence

shared

Proving generated-output routes meet product contract after deploy or generation-logic changes.

Use sanitized prompts/outputs or customer-approved examples; do not export complete private payloads without signed support terms.

Rollback And Disable Plan

shared

Knowing how to pause keys, downgrade traffic, disable AI publication, roll back a deploy, and communicate incidents.

Include runbook names and owners; keep admin tokens, provider dashboards, and private incident contacts out of public packets.

Support Policy

Public support metadata is available at /api/v1/support. Signed response windows, dedicated contacts, audit exports, and allowlists require enterprise terms.

TierStatusAudienceResponse
Developer Metadata SupportliveDevelopers evaluating the public docs, OpenAPI, Postman, SDK source, examples, status, and errors catalog.Best-effort while the API is in alpha.
Partner Beta SupportbetaApproved beta partners using scoped server-side keys and paid routes.One business day for integration blockers; faster for production-impacting incidents.
Enterprise Contract SupportenterpriseSigned enterprise customers with custom limits, private terms, audit exports, or dedicated support windows.Contract-specific after enterprise support terms are signed.
Support Packet

Send only support-safe identifiers. Never include raw keys, webhook secrets, payment details, or full private payloads.

request_id
endpoint
UTC timestamp
key prefix only
idempotency key hash
response status and error code
SLA Targets

These targets are public review contracts, not a substitute for signed enterprise terms. External synthetic monitoring is the next ops gate.

TargetStatusAvailabilityMeasurement
Public Metadata RoutesliveStatic/discovery routes should stay available with the marketing site and Vercel edge cache.Validated by production smoke checks today; external synthetic monitoring is the next gate.
Core Compute RoutesbetaProduction target is 99.5% for paid beta once sidecar probes and buyer-path smoke stay green.Current route tests and production env gates exist; provider-side synthetic checks are still being added.
AI Intelligence RoutesbetaProduction target is quality-preserved successful generation, not fallback-shaped continuity.Fresh live outputs must satisfy required sections, metadata, depth, and quality gates after each generation-logic deploy.
Enterprise Contract SLAenterpriseNegotiated per customer after dedicated monitoring, support window, limits, and escalation terms are signed.Requires customer-specific probes, usage thresholds, incident comms, audit exports, and billing reconciliation.
Incident History
0

Public incidents recorded. Current history status is exposed at /api/v1/incidents.

Publication Policy

Publish a public incident entry for confirmed partner-impacting production issues that last more than 15 minutes or affect billed output quality.

Platform Component Status

Public status is non-secret and safe for integration review. Deep provider readiness remains behind `x-ops-token` on the internal readiness route.

ComponentStatusScopePublic Note
REST API GatewayliveServer-to-server /api/v1 routes with API-key auth and standard envelopes.Use https://api.theleokingai.com for clean /v1 production routing. The legacy https://theleokingai.com/api base remains backward compatible during alpha.
OpenAPI ContractliveMachine-readable OpenAPI 3.1 contract for generated clients and review.Public metadata routes are unauthenticated; paid routes require x-api-key.
Human Developer DocsliveDiscoverable docs page, quickstart, examples, endpoint reference, plans, and enterprise path.Docs are the canonical human integration surface.
API Console And LabbetaPrivate console for keys, usage, billing, endpoint testing, workspace audit history, and paginated audit CSV export.Console access is customer/workspace gated; signed audit export packages remain enterprise-contract work.
Core ComputebetaNo-AI chart, sky, transit, lunar, synastry, compatibility, and helio background routes.Best for high-volume partner infrastructure where AI spend is not needed.
AI IntelligencebetaAudience intelligence, premium experiences, oracle/tarot, horoscope, and world signals.Fallback-looking AI output is treated as a failed product response.
Usage LedgerbetaRequest id, endpoint, credits, billing lane, model, token metadata, and idempotency tracking.Run buyer-path smoke before live enterprise demos.
SDK Packagesrelease gateNode and Python source exists; public npm/PyPI publication is still gated.Use raw HTTP or source clients until package publication is approved and release smoke passes.
Partner Webhooksrelease gateSigned callbacks for async completion, usage, quality, billing, and entitlement events.Partner-facing activation still requires approved endpoint configuration, Convex deployment, production env validation, and delivery smoke.
SLA And Incident HistorylivePublic SLA target and incident-history contract for discovery, procurement, and partner review.Public targets are published now; external uptime monitoring and contractual enterprise SLA terms are the next ops gate.
Security And Trust PacketlivePublic security controls, well-known security contact, data handling boundaries, subprocessor notes, and enterprise review packet.Public trust metadata plus console audit visibility/export are live beta; signed customer DPAs, audit export packages, and allowlists remain enterprise-contract work.
Access Control PacketlivePublic key custody, scope model, environment separation, rotation/revocation, browser boundary, and allowlist policy.Server-side key custody is required today; IP allowlists, private endpoint terms, and custom network review remain signed enterprise work.
Observability ProofbetaGateway smoke, production env gates, buyer-path usage proof, readiness checks, and AI output quality sampling.Public observability contract is live; automated external synthetic monitoring remains the next ops gate.
Buyer OnboardingbetaServer-key setup, first request, idempotency, error handling, usage proof, launch-readiness gates, handoff artifacts, and escalation packet.Self-serve docs are live; fully automated procurement and enterprise private onboarding remain sales-led, but launch evidence is now explicit.
Versioning And LimitslivePublic lifecycle, compatibility, deprecation, sunset, and rate-limit contract for v1 partners.Standard rate-limit headers are now emitted on 429 responses when limiter metadata is available.
Migration GuideslivePublic route migration, deprecation artifact, legacy alias, validation, and partner checklist guidance.No paid production route should be removed without a published migration guide, notice window, and support path.
Examples And CookbookslivePublic endpoint examples, SDK snippets, and partner workflow cookbooks generated from the API catalog.Examples are safe to share publicly and should stay aligned with OpenAPI, Postman, SDKs, and endpoint reference pages.
Support And EscalationlivePublic support tiers, support packet requirements, severity routing, and enterprise escalation boundaries.Public support metadata improves integration triage; contract-specific response windows require signed enterprise terms.
Procurement And Compliance PacketlivePublic buyer-review checklist, security/legal/ops review boundaries, signed-term gates, and durable trust links.Public packet speeds enterprise review; DPA, custom retention, audit exports, allowlists, and contracted SLA remain signed-term work.
Conformance And Smoke ContractlivePublic acceptance suites, commands, pass criteria, evidence artifacts, and launch gates for partner and production readiness.Passing tests alone is not enough for paid AI products; live gateway, usage ledger, and fresh output-quality evidence are part of readiness.
Data Processing PacketlivePublic data-use purposes, minimization rules, restricted-data boundary, DSR support policy, and signed-DPA gates.Public data-processing metadata supports enterprise review; custom retention, residency, DPA, and private export commitments require signed terms.
Compliance MaplivePublic compliance-readiness mapping across SOC 2-style, GDPR/data-processing, OWASP API, procurement, resilience, and AI quality review areas.The map is review evidence, not a certification claim; SOC 2 reports, DPAs, regulated-data approvals, and private audit evidence require signed terms.
AI Governance And Acceptable UselivePublic generated-output governance, acceptable-use boundaries, restricted use cases, human-review policy, and escalation triggers.Generated output is interpretive guidance; regulated, high-impact, crisis, medical, legal, financial, employment, housing, insurance, or eligibility use requires signed review or is prohibited.
Webhook Event Contract
world_signal.job.completedrelease gate

A long-running world-signal forecast job finished and passed quality gates.

Delivery

Signed HTTPS POST

Retry

Exponential retry with dead-letter visibility after final failure.

world_signal.job.failedrelease gate

A long-running world-signal forecast job failed before producing a billable result.

Delivery

Signed HTTPS POST

Retry

Exponential retry with dead-letter visibility after final failure.

usage.recordedrelease gate

A successful billable API call wrote usage metadata for partner reconciliation.

Delivery

Signed HTTPS POST

Retry

Retry only after ledger write succeeds; failed partner delivery does not create duplicate usage.

quality.failedrelease gate

A generative endpoint failed a quality or schema gate and should not be shown or billed.

Delivery

Signed HTTPS POST

Retry

Low retry count because this is diagnostic, not a user deliverable.

entitlement.updatedenterprise

A workspace plan, scoped key, endpoint allowance, or custom limit changed.

Delivery

Signed HTTPS POST

Retry

Retry until partner acknowledges or event moves to dead letter.

billing.subscription.updatedenterprise

A customer subscription, renewal, cancellation, or invoice state changed.

Delivery

Signed HTTPS POST

Retry

Retry after internal billing state is consistent.

Signature Verification
Header
TheLeoKing-Signature
Format
t=<unix_seconds>,v1=<hex_hmac_sha256>
Algorithm
HMAC-SHA256
Replay Window
300 seconds

Sign and verify the raw request body before JSON parsing. The signed payload is timestamp.raw_body. Store endpoint secrets server-side and deduplicate accepted event ids before side effects.

Node verification
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyLeoKingWebhook({ rawBody, signatureHeader, secret }) {
  const parts = signatureHeader.split(",").map((part) => part.trim());
  const timestampPart = parts.find((part) => part.startsWith("t="));
  const signatures = parts
    .filter((part) => part.startsWith("v1="))
    .map((part) => part.slice(3));

  if (!timestampPart || signatures.length === 0) {
    return false;
  }

  const timestamp = Number(timestampPart.slice(2));
  const ageSeconds = Math.abs(Math.floor(Date.now() / 1000) - timestamp);

  if (!Number.isSafeInteger(timestamp) || ageSeconds > 300) {
    return false;
  }

  const expected = createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody}`, "utf8")
    .digest("hex");

  return signatures.some((signature) => {
    if (!/^[a-f0-9]{64}$/i.test(signature)) {
      return false;
    }

    return timingSafeEqual(Buffer.from(signature, "hex"), Buffer.from(expected, "hex"));
  });
}
Changelog
Enterprise trust and observability upgrade
v1 alpha / 2026-07-07
Current

Public security, observability, onboarding, SLA, and incident contracts are linked through the docs, OpenAPI, gateway, and trust page.

  • +Security packet, observability proof, and onboarding JSON routes added to the public metadata contract.
  • +Authenticated API console now exposes org-bound, redacted audit trail groundwork for key and workspace events.
  • +Partner webhook signature verification now has a concrete HMAC-SHA256 contract and test-backed helper.
  • +Versioning, deprecation, sunset, and rate-limit policy are now published as public developer metadata.
  • +Examples and partner cookbooks are now published as public developer metadata generated from the endpoint catalog.
  • +Support tiers, escalation rules, and support packet requirements are now published as public developer metadata.
  • +SDK package readiness, install commands, helper surface, and release gates are now published as public developer metadata.
  • +Migration guides and deprecation artifact requirements are now published as public developer metadata.
  • +Procurement review packet, signed-term gates, and buyer evidence checklist are now published as public developer metadata.
  • +Conformance suites, smoke commands, launch gates, and evidence artifacts are now published as public developer metadata.
  • +Data-processing purposes, minimization rules, restricted-data boundaries, and DSR support policy are now published as public developer metadata.
  • +Launch-readiness gates and partner handoff artifacts are now published through the onboarding contract.
  • +Access-control policy, API-key custody, environment boundaries, lifecycle steps, and allowlist gates are now published as public developer metadata.
  • +Compliance-readiness mappings, evidence artifacts, certification boundaries, and signed-term gates are now published as public developer metadata.
  • +AI governance, acceptable-use boundaries, restricted-use escalation, human-review policy, and no-fallback-success controls are now published as public developer metadata.
  • +API docs now expose trust controls, data handling, subprocessor scope, production proof, and buyer onboarding steps.
  • +Dedicated gateway smoke and buyer-path smoke are documented as production evidence.
  • +Trust page now links enterprise buyers to the API security and observability packet.
Developer docs and discovery upgrade
v1 alpha docs / 2026-07-06
Shipped

Docs were made easier to find from navigation, API product CTAs, redirects, sitemap, OpenAPI, and AI-readable docs files.

  • +Public docs entry added to the main navigation.
  • +Legacy docs, docs/api, developer, developers, and reference URLs redirect to /api-docs or the endpoint reference section.
  • +robots.txt and sitemap.xml expose public docs, API metadata, security.txt, and AI-readable docs while paid route prefixes remain crawler-blocked.
  • +llms.txt and llms-full.txt publish API context for AI coding assistants.
  • +OpenAPI, endpoint index, status, changelog, and webhook contract are linked together.
Commercial API foundation
v1 alpha foundation / 2026-06
Live beta

Business API routes, OpenAPI, console, API Lab, billing surface, usage ledger, async world-signal jobs, and SDK source are in place.

  • +Standard request envelope and error envelope established.
  • +Core compute and AI billing lanes separated.
  • +Convex usage ledger records request id, endpoint, credits, lane, and model metadata.
  • +Node and Python source clients are available before package publication.
Generated clients and package publication
self-serve beta / Next
Next

Publish SDK packages, generated endpoint pages, stronger examples, and buyer-path onboarding once release approval is complete.

  • +Publish npm and PyPI packages after approval.
  • +Generate typed clients from the OpenAPI contract.
  • +Add CI contract tests for SDK examples.
  • +Expand docs by partner vertical and endpoint use case.
Enterprise callback, SLA, audit, and security layer
enterprise beta / Planned
Planned

Ship signed partner webhooks, public status/incident history, audit exports, private contracts, allowlists, and custom endpoint templates.

  • +Signed webhook delivery worker and replay-safe verification docs.
  • +Public status and incident history backed by internal readiness checks.
  • +Downloadable audit exports, audit retention terms, and security documentation.
  • +Private contract controls for custom limits and dedicated evals.
08

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. The full access-control packet is available at /api/v1/access-control.

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

API keys are server-side credentials. Public clients should call a partner backend, not paid API routes directly.

RequirementScopePartner ActionPlatform Evidence
Server-Side Custody
live
All paid API routes.Call API routes from a trusted backend and keep raw keys out of public clients, logs, screenshots, and support tickets.Docs, SDKs, support packet rules, and auth errors all require `x-api-key` from server-controlled contexts.
Endpoint Scope
beta
Route access and monthly credit enforcement.Request only the endpoints and traffic volume the key is scoped to use.Key validation checks status, organization, endpoint access, credit state, and plan limits before execution.
Environment Separation
beta
Production, legacy compatibility, and local development.Keep production keys and evidence separate from local fixtures and legacy-host compatibility testing.Public metadata publishes canonical base URLs, key prefixes, and gateway smoke commands.
Rotation And Revocation
live
Key lifecycle, compromised credentials, and staff/offboarding changes.Report exposed key prefixes only and rotate keys when custody changes or exposure is suspected.Console audit trail and access-control packet define rotation triggers and non-billable failure behavior.
Rate-Limit Cooperation
live
Per organization, key, endpoint, and plan limit.Respect 429 responses, back off with Retry-After, and coordinate load tests before traffic spikes.Versioning and limits route publishes rate-limit algorithm, headers, and plan limits.
Enterprise Network Controls
enterprise
IP allowlists, private endpoints, custom network review, and dedicated security evidence.Do not assume customer-specific network controls from public docs; include them in signed enterprise terms.Procurement, security, access-control, and launch-readiness packets all mark allowlists as signed-term work.
Key Custody Policy

API keys are server-to-server credentials. Store them in a backend secret manager or server-only environment variable; never ship them to browser, mobile, analytics, screenshots, or client logs.

Browser and mobile clients must call a partner backend. Direct public-client calls to paid API routes are unsupported because keys, scopes, usage, and support evidence must stay server-controlled.

IP allowlists, private endpoint terms, mTLS-style controls, and dedicated network review require signed enterprise terms and launch-readiness evidence.

Support Evidence
request_id
endpoint
organization id
key prefix only
UTC timestamp
idempotency key hash
expected endpoint scope
sanitized payload shape
Never Include
raw API keys
bearer tokens
key hashes
provider secrets
payment details
complete private payloads
Environment Boundary
Production Gateway
https://api.theleokingai.com
Paid production, buyer-path smoke, and customer-facing server integrations.Use production-scoped keys only from trusted server environments and verify usage ledger evidence before enterprise demos.
Legacy Website API Host
https://theleokingai.com/api
Backward-compatible alpha integrations while clients migrate to the dedicated gateway host.Do not create new public integrations on the legacy host unless compatibility testing requires it.
Local Development
http://localhost:3000/api
Local contract testing, SDK development, and smoke rehearsal with non-production data.Local keys and fixture payloads must not be reused as production credentials or customer evidence.
Key Lifecycle
01 / Create Server-Side Key
shared

Create the key from the customer console, approved internal smoke flow, or signed enterprise onboarding path.

Key has organization id, key prefix, status, endpoint scope, plan/credit state, and creation audit event.

02 / Store In Backend Secret Manager
partner

Put the raw key in a backend secret manager or server-only environment variable before making requests.

Partner confirms the key is absent from browser bundles, mobile clients, analytics events, source control, and support screenshots.

03 / Validate Scope Before Launch
shared

Run a scoped smoke request and verify the endpoint, usage lane, credit charge, and Convex ledger row match expectations.

Buyer-path smoke proves the same request_id in response and usageEvents before paid traffic ramps.

04 / Rotate On Exposure Or Staff Change
shared

Rotate any key that appears outside server-only storage or after relevant operator/offboarding changes.

Audit trail shows old key revoked and replacement key created with equivalent intended scope.

05 / Revoke Or Pause On Incident
platform

Disable compromised, over-limit, expired, or out-of-contract keys before route execution.

Auth validation returns a non-billable auth/scope error and support packet uses key prefix only.

06 / Negotiate Enterprise Controls
shared

Move IP allowlists, private endpoint terms, dedicated network review, or audit export packages into signed terms.

Signed order form or security exhibit names the customer-specific controls and evidence cadence.

09

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://api.theleokingai.com/v1/openapi

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

# SDK source in this repo
sdk/node
sdk/python
Webhook verification helper
import { verifyLeoKingWebhookSignature } from "@theleoking/ai-api";

const rawBody = await request.text();
const isValid = await verifyLeoKingWebhookSignature({
  payload: rawBody,
  signatureHeader: request.headers.get("TheLeoKing-Signature"),
  secret: process.env.LEOKING_WEBHOOK_SECRET!,
});

if (!isValid) {
  throw new Error("Invalid The Leo King webhook signature");
}

const event = JSON.parse(rawBody);
SDK Package Readiness

Public package metadata is available at /api/v1/sdks. Publication stays gated until package names, docs, production domain, support policy, and release approval are current.

PackageStatusSourceInstall
@theleoking/ai-apirelease gatesdk/nodenpm install @theleoking/ai-api
theleoking-ai-apirelease gatesdk/pythonpip install theleoking-ai-api
Release Policy

npm and PyPI publication is gated until package names, production domain, support policy, docs, env readiness, SDK release smoke evidence, publication dry-run evidence, and Dave's explicit release approval are all current.

npm run smoke:sdk-release -- --base-url https://api.theleokingai.comnpm run smoke:sdk-publication -- --base-url https://api.theleokingai.comnpm --prefix sdk/node run buildpython -m compileall sdk\python\theleoking_ai_apinpm run smoke:sdk-release -- --skip-livenpm run smoke:sdk-publication -- --skip-livenpm run smoke:sdk-release -- --base-url https://api.theleokingai.com after deploy

npm publication must use provenance from CI or an approved release machine; PyPI publication must use trusted publishing or a scoped token with no credentials committed to repo logs.

Create a signed sdk-vX.Y.Z tag only after SDK release smoke, publication dry-run, changelog link, and rollback note are committed.

For a bad SDK release, deprecate the npm version, yank the bad Python release, publish a patch version, keep source clients available, and add the rollback note to /api/v1/changelog.

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://api.theleokingai.com/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://api.theleokingai.com/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://api.theleokingai.com/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)
10

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 for high-volume chart facts, compatibility checks, timing context, and product workflows that do not need generated interpretation.

Metering

1-4 core credits per request. Usage tracks endpoint, request id, and credit spend without generative AI token charges.

/v1/charts/natal/v1/charts/current-sky/v1/charts/transits/v1/charts/synastry/v1/lunar/phase/v1/compatibility/score/v1/helio/patterns
ai

AI Intelligence

Premium interpretation routes that combine owned astrology math, curated spiritual context, product-specific prompts, and polished synthesis.

Cost Basis

Premium path for polished, display-ready spiritual products and partner experiences.

Metering

4-10 AI credits per completed response. Incomplete or rejected responses are not treated as successful billable output.

/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 forecast path with world-event context, timing intelligence, citations, freshness checks, and reviewed output contracts.

Metering

5+ AI credits per forecast, higher for deep async jobs. Only completed, structured forecast outputs are billed as successful results.

/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/*
Core Compute
$99/mo

Teams that want the lowest-cost production astrology compute lane without AI spend.

Monthly Credits
5,000
80 requests/min

No generative AI is included. Core routes record core credits only and avoid token-based usage charges.

Basic
$199/mo

Small apps, creators, and pilot integrations.

Monthly Credits
10,000
120 requests/min

Core routes avoid generative AI. Light AI routes are opt-in and consume 4-8 AI credits per completed 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 product lane.

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 content 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 terms for high-cost media generation products.

Ready to issue keys and start billing?

The buyer path is organization-based: sign in, select or create a workspace, choose a plan in Clerk checkout, then manage keys and usage in the API console.

Plan-Gated Endpoint Access

These access rules are shared by the public docs, customer console, and Convex API-key validation. Core Compute is the no-AI entry plan. Basic adds 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 coreCore Compute+No model call required; safe for high-volume deterministic workflows.
Current Sky
/v1/charts/current-sky
No AI coreCore Compute+No model call required; safe for high-volume deterministic workflows.
Transit Chart
/v1/charts/transits
No AI coreCore Compute+No model call required; safe for high-volume deterministic workflows.
Synastry Chart
/v1/charts/synastry
No AI coreCore Compute+No model call required; safe for high-volume deterministic workflows.
Lunar Phase
/v1/lunar/phase
No AI coreCore Compute+No model call required; safe for high-volume deterministic workflows.
Compatibility Score
/v1/compatibility/score
No AI coreCore Compute+No model call required; safe for high-volume deterministic workflows.
Helio StarTypes
/v1/helio/patterns
No AI coreCore Compute+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.
11

Commercial Roadmap

Buyers need to know what works now, what the beta gate requires, and where the enterprise product is going. This roadmap keeps the public API, docs, billing, and internal build path aligned.

1

Choose the lane

Start with Core Compute when the product needs high-volume astrology infrastructure. Add AI Intelligence only for paid, display-ready moments.

Compare plans and endpoint access
2

Create the workspace

Sign in, create or select the company workspace, and attach the subscription to the account that will own keys and usage.

Open workspace checkout
3

Issue scoped keys

Generate API keys for the selected product surface, keep endpoints scoped by plan, and use idempotency keys for retry-safe billing.

Create a production key
4

Scale from evidence

Review live usage, response quality, support needs, and upgrade timing before moving a partner into production volume.

Review usage and readiness
Live

Live foundation

The public API, checkout route, customer console, usage dashboard, API Lab, and no-AI core routes are in place.

  • Core Compute route family
  • Workspace checkout surface
  • API key and usage records
  • Integration docs and schema
Live

Full Erlewine StarTypes layer

The helio tropical StarTypes endpoint now uses the full packaged Michael Erlewine short ephemeris lookup instead of the old pilot slice.

  • 1750-01-01 to 2099-12-30 coverage
  • 127,834 structured records
  • Michael Erlewine source attribution
  • Background-use limits
Beta gate

Self-serve beta hardening

The next commercial gate is making a buyer able to discover plans, check out, create keys, run examples, and see usage without hand-holding.

  • Checkout smoke after explicit charge approval
  • Plan-to-feature sync review
  • Node and Python SDK package prep
  • Docs examples by vertical use case
Next build

Endpoint expansion

The strongest roadmap is deeper business functions around dating apps, creator funnels, media intelligence, world signals, and premium spiritual products.

  • More no-AI chart and timing functions
  • More premium AI products
  • Output review per endpoint
  • Partner-specific examples and payloads
Enterprise

Enterprise platform

Large partners need private contracts, committed usage, custom endpoints, stronger observability, and optional realtime or callback products.

  • Partner webhooks
  • Dedicated reporting dashboards
  • Custom credit contracts
  • Private model and data options
12

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/current-sky/v1/charts/transits/v1/charts/synastry/v1/lunar/phase

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 alphaOwned western tropical sidecar calculation
Current skyPOST /v1/charts/current-skyLive alphaOwned current positions, house cusps, aspects, and lunar phase
Transit chartPOST /v1/charts/transitsLive alphaOwned western transit positions and transit-to-natal aspects
Lunar phasePOST /v1/lunar/phaseLive alphaOwned Sun-Moon phase context for a supplied moment and location
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.
13

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.current_sky.calculatechart.transits.calculatechart.synastry.calculatelunar.phase.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
14

Endpoint Reference

Each endpoint now has a standalone reference page with credit model, plan gate, supported inputs, outputs, function names, curl, Node, Python, errors, Postman, 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 violet-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 coreCore Compute+
Relationships

Synastry Chart

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

Minimum Plan
Core Compute+
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 coreCore Compute+
Relationships

Compatibility Score

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

Minimum Plan
Core Compute+
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 coreCore Compute+
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
Core Compute+
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 coreCore Compute+
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
Core Compute+
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/charts/current-skyalphaNo AI coreCore Compute+
Chart Calculation

Current Sky

Return the owned geocentric tropical current-sky chart for a supplied moment and location without calling external astrology APIs.

Minimum Plan
Core Compute+
Billing Lane
No AI core
Console Scope
/v1/charts/current-sky
Inputs
  • +datetime
  • +location or coordinates
  • +house system
  • +active points
Outputs
  • +planet positions
  • +house cusps
  • +aspects
  • +lunar phase
  • +supported and unsupported western lanes
Tool Functions
1 credit per lookup
chart.current_sky.calculate

Computes the live or requested sky through the owned sidecar path.

planet.positions.list

Returns selected point positions with sign, degree, house, and retrograde data.

houses.resolve

Returns owned house cusps for the selected house system.

lunar.phase.extract

Returns the Sun-Moon phase context from the same owned chart.

Current Sky request
{
  "datetime": "2026-06-17T12:00:00.000Z",
  "location": "Greenwich, GB",
  "options": {
    "house_system": "placidus",
    "zodiac": "tropical"
  }
}
Current Sky response
{
  "request_id": "req_...",
  "data": {
    "datetime": "2026-06-17T12:00:00.000Z",
    "calculation_basis": {
      "provider": "owned_western",
      "frame": "geocentric",
      "zodiac": "tropical"
    },
    "chart": { "planets": [], "house_cusps": [], "aspects": [] },
    "lunar_phase": {}
  },
  "usage": { "lane": "core", "credits": 1, "billableUnits": 1 }
}
POST/v1/lunar/phasealphaNo AI coreCore Compute+
Chart Calculation

Lunar Phase

Return first-party Sun-Moon lunar phase context for a supplied moment and location without horoscope prose or third-party fallback.

Minimum Plan
Core Compute+
Billing Lane
No AI core
Console Scope
/v1/lunar/phase
Inputs
  • +datetime
  • +location or coordinates
  • +house system
Outputs
  • +lunar phase
  • +Sun position
  • +Moon position
  • +calculation basis
Tool Functions
1 credit per lookup
lunar.phase.calculate

Calculates lunar phase from owned Sun and Moon positions.

planet.positions.list

Returns the Sun and Moon positions that produced the phase.

calculation.basis.report

Reports the owned western calculation basis and unsupported lanes.

Lunar Phase request
{
  "datetime": "2026-06-17T12:00:00.000Z",
  "location": "Greenwich, GB"
}
Lunar Phase response
{
  "request_id": "req_...",
  "data": {
    "datetime": "2026-06-17T12:00:00.000Z",
    "calculation_basis": {
      "provider": "owned_western",
      "frame": "geocentric",
      "zodiac": "tropical"
    },
    "lunar_phase": {},
    "chart": { "sun": {}, "moon": {} }
  },
  "usage": { "lane": "core", "credits": 1, "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 coreCore Compute+
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
Core Compute+
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 }
}
15

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.

High-volume apps that need first-party astrology facts without AI spend.

Core Chart Compute

Calculate deterministic chart, transit, lunar, synastry, compatibility, or helio background data and store it for repeated product use.

/v1/charts/natal/v1/charts/current-sky/v1/charts/transits/v1/lunar/phase
Shopify, CRM, email, SMS, and funnel teams scoring audiences before campaign sends.

Commerce Audience Intelligence

Score customer fit, message angle, and timing against a product or campaign context.

/v1/audience/insights/v1/customer/profile
Media, market, geopolitical, insurance, crypto, and research teams that need deeper BTV-style forecasts.

Async World Signals

Create a deep forecast job, poll until complete, and bill only after a quality-gated result is stored.

/v1/world/signals/jobs/v1/world/signals/jobs/{jobId}/v1/world/signals
Dating, wellness, coaching, and relationship apps.

Dating Compatibility Stack

Run no-AI synastry and compatibility first, then offer premium love products only when the user pays for interpretation.

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

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_REQUESTThe request body failed schema validation, JSON parsing, or endpoint-specific preconditions.
401AUTH_REQUIREDThe request did not include an API key.
401AUTH_INVALIDThe supplied API key could not be validated.
402CREDITS_EXHAUSTEDThe key or workspace does not have enough credits for the requested endpoint.
403AUTH_FORBIDDENThe key is valid but is not allowed to call this endpoint or billing lane.
404NOT_FOUNDThe requested resource, usually an async job id, was not found for this key.
409IDEMPOTENCY_CONFLICTThe same Idempotency-Key was reused with a different request body.
429RATE_LIMITEDThe request exceeded the current key, plan, endpoint, or environment rate limit.
502INVALID_RESPONSEA model, sidecar, RAG, or generation path failed the response contract or quality gate.
502UPSTREAM_FAILEDA required upstream provider, sidecar, or internal service failed before a valid API response was produced.
503SERVER_MISCONFIGUREDA required production environment variable, provider mode, or internal integration is missing or malformed.
Error envelope
{
  "request_id": "req_...",
  "error": {
    "code": "CREDITS_EXHAUSTED",
    "message": "Not enough credits for this request",
    "details": {
      "requiredCredits": 10,
      "creditsRemaining": 4
    }
  }
}
17

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

18

Enterprise Readiness

Enterprise buyers need more than endpoints. They need package stability, signed callbacks, status reporting, auditability, custom contracts, and proof that AI routes preserve output quality under real traffic.

CapabilityStatusEnterprise Requirement
API referenceLiveOpenAPI JSON, human docs, endpoint catalog, examples, and console links exist.
Self-serve consoleLive betaCustomer console covers keys, plans, usage, API Lab, billing surfaces, audit trail visibility, and paginated audit CSV export.
Usage ledgerLive betaSuccessful calls write Convex usage events with request id, endpoint, credits, lane, and model metadata.
Audit trailLive betaAuthenticated console shows org-bound, redacted key/workspace audit events and exports retained rows as a paginated CSV workflow.
SDK packagesRelease gateNode and Python source exists; public SDK metadata, install commands, helper surface, and release gates are documented.
Partner webhooksRelease gateSigned callback contract, internal delivery worker, retry queue, and dead-letter storage are implemented behind ops auth.
Status and SLALivePublic status, SLA targets, incident history, publication policy, and support boundary are documented.
Security and trustLivePublic security controls, data retention, subprocessor scope, and trust page links exist.
Access controlLivePublic API-key custody, scope model, lifecycle, environment boundaries, browser/CORS policy, and enterprise allowlist gates are documented.
Observability proofLive betaGateway smoke, production env gate, buyer-path usage proof, readiness, and output-quality sampling are documented.
Buyer onboardingLive betaCustomer setup path covers base URL, server key, first request, retries, usage proof, output sampling, and support packet.
Versioning and limitsLivePublic compatibility policy, deprecation windows, sunset rules, and rate-limit response headers are documented.
Migration guidesLivePublic migration policy, legacy alias guidance, before/after route moves, and validation checklists are documented.
Examples and cookbooksLivePublic examples expose request/response payloads, SDK snippets, and partner workflow recipes from the endpoint catalog.
Support escalationLivePublic support tiers, support packet requirements, severity routing, and enterprise escalation boundaries are documented.
Procurement packetLivePublic procurement checklist, buyer evidence requirements, legal/security boundaries, and signed-term gates are documented.
Conformance contractLivePublic contract tests, SDK/build/env/gateway smoke checks, buyer-path proof, AI quality sampling, and evidence artifacts are documented.
Data processing packetLivePublic processing purposes, data minimization rules, DSR boundaries, restricted-data list, and DPA gates are documented.
Compliance mapLivePublic compliance-readiness mappings connect evidence links to SOC 2-style, GDPR/data-processing, OWASP API, procurement, resilience, and AI quality review areas without certification overclaim.
AI governanceLivePublic acceptable-use boundaries, output-quality controls, restricted-use escalation, human-review requirements, and prohibited-use categories are documented.
Audit export packages and custom allowlistsEnterprisePublic access-control policy is documented; signed DPA terms, long-range audit export packages, IP allowlists, and dedicated security review packets remain customer-specific.
Private contractsEnterpriseAdd custom limits, private model/data terms, dedicated evals, and negotiated committed usage.
Webhook Contract

Signed partner callbacks for async job completion, quality failures, usage records, and entitlement changes.

Status And SLA

Public status page, public SLA targets, incident-history contract, private readiness probes, and support tiers.

Audit Trail

Authenticated console view and paginated CSV export for retained org-bound key/workspace events, with secret-looking metadata redacted.

Versioning And Limits

Public compatibility guarantees, deprecation policy, sunset requirements, and rate-limit headers for partner clients.

Security Packet

DPA, retention policy, subprocessors, long-range audit export packages, IP allowlist, and enterprise data-handling terms.

19

Versioning And Changelog

Major API docs make change management visible. Keep alpha changes explicit now, then formalize deprecations, migration guides, package versions, and breaking-change windows before paid enterprise scale.

v1 alpha

Current
Enterprise trust and observability upgrade

Public security, observability, onboarding, SLA, and incident contracts are linked through the docs, OpenAPI, gateway, and trust page.

v1 alpha docs

Shipped
Developer docs and discovery upgrade

Docs were made easier to find from navigation, API product CTAs, redirects, sitemap, OpenAPI, and AI-readable docs files.

v1 alpha foundation

Live beta
Commercial API foundation

Business API routes, OpenAPI, console, API Lab, billing surface, usage ledger, async world-signal jobs, and SDK source are in place.