Developer API
Server-to-server structured calculation and retrieval, sharing one Registry with MCP.
- Open tools
- 37
- LingXi Skill
- 5
- Default quota
- 200 / day
- Burst limit
- 30 / min
Reading /api/v1/public/mcp; currently showing defaults 37 / 5
curl -sS -X POST \
"https://www.ancientechoes.ai/api/v1/tools/bazi.calculate_chart" \
-H "Authorization: Bearer ae_live_xxx" \
-H "Content-Type: application/json" \
-d '{ "input_mode": "birth", "cast_time_source": "birth", "is_male": true, "calendar_type": "solar", "year": 1990, "month": 1, "day": 1, "hour": 8, "minute": 0, "is_leap_month": false, "split_zi_hour": true, "use_true_time": false, "apply_dst": false, "timezone_id": "Asia/Shanghai" }'Successful responses return both api_version (transport contract) and calculation.version (per-tool calculation version).
Three credentials. Do not mix them.
Devices, the developer API, and legacy keys each have their own page.
| Credential | Prefix | Where | Use |
|---|---|---|---|
| LingXi device | lxd_ | My LingXi devices | Pair your own bot or computer and call authorized MCP / Skill tools. This is not a REST API key. |
| Developer API | ae_live_ / ae_test_ | Developer console | Call POST /api/v1/tools from code. Cannot pair a device. |
| Legacy key | sk- | Developer console | Legacy Web API and MCP. New integrations should use ae_*. |
Quickstart
Send your first request in three steps
No SDK to install. Sign in, create a key in the Console, copy the plaintext once, then call it with any HTTP client.
Open the Console and choose scopes (tools:read, tools:invoke, rag:search, rag:query), then set an expiry and limits.
The plaintext key is shown only once, at creation or rotation, in the form ae_live_xxx; use ae_test_xxx for the test environment.
curl -sS -X POST \
"https://www.ancientechoes.ai/api/v1/tools/bazi.calculate_chart" \
-H "Authorization: Bearer ae_live_xxx" \
-H "Content-Type: application/json" \
-d '{ "input_mode": "birth", "cast_time_source": "birth", "is_male": true, "calendar_type": "solar", "year": 1990, "month": 1, "day": 1, "hour": 8, "minute": 0, "is_leap_month": false, "split_zi_hour": true, "use_true_time": false, "apply_dst": false, "timezone_id": "Asia/Shanghai" }'{
"success": true,
"api_version": "<当前契约版本>",
"data": { "...": "领域结果" },
"calculation": {
"capability": "bazi.chart",
"version": "<单工具计算版本>"
}
}Capabilities
Capability matrix and billing rules
37 tools and 5 LingXi Skills are currently open; the same Registry serves the Developer API, MCP and in-site agents.
Natal chart, luck cycles, chain palaces, lu-ming, synastry, wealth analysis and naming context. Input must be an explicit civil timestamp or explicit four pillars.
Produces reproducible charts from a valid placement code and an explicit target time; it never reads the server's current time.
Hourly rotating-plate charts, the three-yuan layout from the 24 solar terms, and explicit time/place semantics.
House system, coordinates, timezone and transit times are all passed explicitly; output includes calculation provenance.
Preview casts such as Liu Yao, Mei Hua, tarot, Xiao Liu Ren, Da Liu Ren and He Luo; results are read-only.
Lunar conversion, solar terms, daily almanac entries, and election evidence such as jian-chu, day officer, Tai Sui and Rahu killer-teacher days.
Returns traceable snippets and hit metadata without calling a generation model.
Retrieves then calls a model to produce non-streaming JSON; a missing dataset_key / source_persona_id fails immediately.
lingxi.rag_search) only consume tool-call quota; lingxi.rag_query consumes both tool quota and the account/organization AI plan allowance. Generated content is billed against the AI plan, so do not treat it as a pure retrieval endpoint.Limits & Quotas
Limits, quotas and key types
Quotas are stored per account/key; every value can be overridden by an administrator or per-key configuration.
Calls per day
200
Burst per minute
30
- All quotas are configurable; 0 = unlimited. Organizations, service accounts and individual keys can each have their own quota pool.
- Keys can set daily/monthly hard caps so one key cannot exhaust the whole site's allowance.
- Responses carry X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Burst-Limit headers; exceeding the limit returns 429 with Retry-After.
ae_live_… Live Key
Calls the real Registry and data plane and counts against the account/key's real quota; suited to production server code.
ae_test_… Test Key
Isolated from production data and returns limited or fixed sample results for request-shape and error-handling integration. Test keys cannot run generative RAG (calling lingxi.rag_query returns test_key_rag_disabled). Never draw real conclusions from test key results.
Non-expiring keys are only issued when explicitly selected at creation and do not expire on their own after a leak. In production, prefer a 90-day expiry and rotate regularly.
Error model
Error codes and troubleshooting
Failure responses share the structure { success:false, code, message, request_id, docs_url }; include the request_id when reporting issues.
| Error code | HTTP | Meaning | What to do |
|---|---|---|---|
| tool_not_found | 404 | The tool name is not in the Registry or is misspelled | Read the exact tool name and input_schema from GET /api/v1/tools first |
| tool_authentication_required | 401 | No valid key was supplied, or the browser session expired | Check Authorization: Bearer; sign in again in the browser and retry |
| tool_scope_required | 403 | The key's scopes do not permit this operation | Issue a new key in the Console that includes tools:invoke / rag:query |
| tool_entitlement_required | 403 | The account plan does not include this tool's entitlement | Upgrade the plan or switch to the freely available read-only tools |
| tool_quota_exceeded | 429 | Daily/monthly quota or per-minute burst exceeded | Read Retry-After and X-RateLimit-*; reduce concurrency or request a higher quota |
| rag_dataset_required | 400 | Generative RAG is missing dataset_key / source_persona_id | Pass the dataset or persona ID explicitly; use lingxi.rag_search for pure retrieval |
| rag_service_unavailable | 502 | The retrieval service is unreachable and this retrieval did not run | Retry later; do not interpret the result as "the library has nothing relevant" |
| test_key_rag_disabled | 403 | Sandbox keys cannot run generative RAG | Use a live key for lingxi.rag_query, or use the test key only for retrieval integration |
| tool_invocation_failed | 400 | Other parameter or execution error (including schema validation failures) | Fix the request body against the input_schema from GET /api/v1/tools and report with the request_id |
Examples
Thin wrapper examples
These samples only illustrate auth, request shape and error handling; they are not a published official SDK.
curl -sS -X POST \
"https://www.ancientechoes.ai/api/v1/tools/bazi.calculate_chart" \
-H "Authorization: Bearer ae_live_xxx" \
-H "Content-Type: application/json" \
-d '{ "input_mode": "birth", "cast_time_source": "birth", "is_male": true, "calendar_type": "solar", "year": 1990, "month": 1, "day": 1, "hour": 8, "minute": 0, "is_leap_month": false, "split_zi_hour": true, "use_true_time": false, "apply_dst": false, "timezone_id": "Asia/Shanghai" }'In the samples, ae_live_xxx, AE_API_KEY and similar values are placeholders. Never commit real keys, and never embed a key in browser code — only server-to-server calls are safe.
Versioning
Versioning and deprecation policy
Transport contract, calculation semantics, Skill packages and the MCP protocol are versioned independently and cannot substitute for one another.
X-Tool-API-Version marks the transport and error-model contract version; URIs use semantic /v1. Breaking changes go through a new version and a deprecation window, while new optional fields only bump the minor version.
Every tool also carries calculation_capability and calculation_version; when reproducing results you must check both the contract version and the calculation version.
The Developer API is a REST tool interface for programs; MCP is a tool protocol for agents that additionally carries resources and MCP Apps; a Skill is only a distribution and prompt layer and defines no capability or permission boundary of its own.
All three share the same Registry, entitlements, quotas and calculation versions; only transport and presentation differ.
View MCP / LingXi access