Skip to main content

Base URL

https://api.a21e.com
All API endpoints are versioned under /v1/.

Authentication

Include your API key in the Authorization header:
Authorization: Bearer a21e_sk_your_api_key_here
Get an API key from Settings > API Keys.

Request format

All request bodies use JSON:
curl -X POST https://api.a21e.com/v1/rpc \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method": "intent.submit", "params": {"input": "Hello"}}'

Response format

Responses are JSON with standard HTTP status codes:
StatusMeaning
200Success
201Created
400Bad request (invalid parameters)
401Unauthorized (missing or invalid API key)
402Insufficient credits
404Resource not found
429Rate limited
500Internal server error
Error responses include a message:
{
  "error": "INSUFFICIENT_CREDITS",
  "message": "Your credit balance is 0."
}

Rate limits

EndpointLimit
Intent submission60 requests/minute
Chat completions60 requests/minute
Read endpoints120 requests/minute
Rate-limited responses return 429 with a Retry-After header.

Endpoints

The API has two main entry points:
  1. JSON-RPC (POST /v1/rpc) — the canonical endpoint for intent submission
  2. REST endpoints — resource-specific endpoints for CRUD operations (sessions, messages, memory, etc.)
  3. OpenAI-compatible (POST /v1/chat/completions) — drop-in replacement for OpenAI SDK
Explore the full API in the sidebar, or try endpoints in the interactive playground.