Skip to main content
Lithtrix uses API keys for authentication. You get a key by calling POST /v1/register — there is no dashboard, email confirmation, or OAuth flow. Once you have a key, pass it as a Bearer token in the Authorization header of every authenticated request. This page explains how to get the key, use it, rotate it, and understand your usage limits.

Get your API key

Call POST /v1/register with an agent_name and an owner_identifier. The response includes a one-time api_key field.
curl -X POST https://lithtrix.ai/v1/register \
  -H "Content-Type: application/json" \
  -d '{"agent_name":"my-agent","owner_identifier":"you@example.com"}'
Example response:
{
  "api_key": "ltx_a3f9b2c1d5e7...",
  "agent_id": "550e8400-e29b-41d4-a716-446655440000",
  "message": "Store this key securely. It cannot be retrieved again."
}
The api_key value is returned only once and cannot be retrieved again. Store it in a secure location — an environment variable, a secrets manager, or encrypted configuration — before you make any other request. If you lose the key, you must rotate it to get a new one.

Use your API key

Pass your key in the Authorization header using the Bearer scheme on every authenticated request:
Authorization: Bearer ltx_your_api_key
For example, to search the web:
curl "https://lithtrix.ai/v1/search?q=renewable+energy+policy" \
  -H "Authorization: Bearer ltx_your_api_key"
Or in Python:
import requests

resp = requests.get(
    "https://lithtrix.ai/v1/search",
    params={"q": "renewable energy policy"},
    headers={"Authorization": "Bearer ltx_your_api_key"},
    timeout=15,
)
resp.raise_for_status()
All ltx_ keys follow the same format. Keys that begin with anything else are invalid.

Rotate your key

If your key is compromised or you want to issue a new one, call POST /v1/keys/rotate with your current key:
curl -X POST https://lithtrix.ai/v1/keys/rotate \
  -H "Authorization: Bearer ltx_your_current_key"
The response contains your new key. The old key is invalidated immediately upon rotation.
Any in-flight requests using the old key will fail after rotation. Update all services and agents that hold the key before rotating, or accept a brief period of authentication errors during the cutover.

Free tier limits

New agents start on the free tier, which includes 300 lifetime calls. This quota never resets — once you use 300 calls, searches will return an error until you upgrade. Check your current usage and tier at any time:
curl https://lithtrix.ai/v1/billing \
  -H "Authorization: Bearer ltx_your_api_key"
Example response:
{
  "tier": "free",
  "calls_total": 47,
  "call_limit": 300,
  "calls_remaining": 253,
  "over_limit": false
}
To upgrade to the Pro tier (unlimited calls, 600 requests/min), follow the billing upgrade flow:
  1. Call GET /v1/billing/config to retrieve the Stripe configuration.
  2. Create a Stripe PaymentMethod using the config.
  3. Call POST /v1/billing/setup with the PaymentMethod ID to activate Pro.
See the Billing API reference for the full upgrade flow.