Complete documentation across all 6 sections: - Getting Started (4): introduction, quick-start, registration, dns-management - Chain (5): overview, daemon-rpc, wallet-rpc, mining, aliases, hardforks - Names (4): overview, registration, dns-records, sunrise, sidechain - Services (4): dns-hosting, ssl-certificates, proxy-network, gateway-operators - API (6): overview, names, explorer, proxy, gateway, authentication - Governance (3): cic, wallet-holders, economics 28 markdown pages total, covering the full Lethean ecosystem. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.8 KiB
1.8 KiB
Authentication
API authentication uses Bearer tokens for write endpoints. Read endpoints are public.
Token Format
Authorization: Bearer YOUR_API_TOKEN
Which Endpoints Need Auth?
| Auth Required | Endpoints |
|---|---|
| No (public) | All GET endpoints — availability checks, lookups, directory, explorer, live gateways |
| No (public) | POST /v1/names/claim — pre-registration claims |
| Yes (Bearer) | POST /v1/names/register — name registration |
| Yes (Bearer) | POST /v1/names/records/{name} — DNS updates |
| Yes (Bearer) | POST /v1/proxy/connect — proxy connections |
| Yes (Bearer) | POST /v1/gateway/pair — gateway pairing |
| Yes (Bearer) | POST /v1/gateway/heartbeat — gateway heartbeat |
| Yes (Bearer) | GET /v1/names/claims — admin claim list |
Getting a Token
API tokens are provided when you purchase a service at order.lthn.ai. The token is set in the server's API_TOKEN environment variable.
During the beta period, a single shared token is used. Per-user API keys will be available when the core-api package is installed.
Example
# Public endpoint (no auth)
curl -s -H 'Accept: application/json' \
'https://api.lthn.io/v1/names/available/test'
# Authenticated endpoint
curl -s -X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{"name": "test", "address": ""}' \
'https://api.lthn.io/v1/names/register'
Rate Limiting
Authenticated endpoints are rate-limited to prevent abuse:
| Endpoint | Limit |
|---|---|
| Name registration | 10/minute |
| DNS updates | 20/minute |
| Proxy connections | 60/minute |
| Name claims | 10/minute |
Rate limit responses return HTTP 429 with a Retry-After header.