API Keys & Usage

Manage your API keys, monitor usage, and handle billing.

API Key Management

GET /v1/keys

List all API keys for the authenticated user. Requires authentication.

[
  {
    "id": "key_abc123",
    "name": "Production",
    "key_prefix": "sk-prod...x7f2",
    "created_at": "2026-03-15T10:00:00Z",
    "last_used_at": "2026-04-04T08:30:00Z",
    "revoked": false
  }
]
POST /v1/keys

Create a new API key. Requires authentication. Maximum 10 active keys per account.

ParameterTypeDefaultDescription
name string "Default" A descriptive name for the key

Save your key immediately. The full key value is returned only once at creation time. After this, only the key_prefix is available.

{
  "id": "key_def456",
  "name": "My Key",
  "key": "sk-live-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "key_prefix": "sk-live...o5p6",
  "created_at": "2026-04-04T12:00:00Z"
}
DELETE /v1/keys/{key_id}

Revoke an API key. The key will immediately stop working. Requires authentication.

ParameterInDescription
key_idpathThe key ID to revoke
{
  "status": "ok",
  "id": "key_def456"
}

Usage Tracking

GET /v1/usage/me

Get your current usage and limits. Requires authentication. Only counts requests to /search, /documents, and /resolve.

{
  "plan": "free",
  "requests_today": 12,
  "requests_this_month": 156,
  "daily_limit": 20,
  "monthly_limit": 600,
  "minute_limit": 10,
  "daily_history": [
    {"date": "2026-04-04", "count": 12},
    {"date": "2026-04-03", "count": 18}
  ]
}

Billing

Manage your subscription through the web interface at /pricing or programmatically via the billing endpoints below.

GET /v1/billing/plans

List available plans with limits and features.

POST /v1/billing/checkout

Create a Stripe checkout session to subscribe or upgrade.

ParameterTypeDescription
plan string "dev" or "pro"
interval string "monthly" or "yearly"
{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_live_..."
}
GET /v1/billing/portal

Get a Stripe customer portal URL for managing your subscription, updating payment methods, and viewing invoices.

GET /v1/billing/status

Get your current plan and subscription details.

Next: Rate Limits →