Docs  /  Authentication

Authentication

The API has three tiers. Anonymous (no key) requests are treated as free tier.

TierDaily limitLookbackWho gets it
free20 / day7 daysDefault for all users, including anonymous requests
pro100 / day7 daysActive paid Pro subscription, OR founding members within their first year
dev500 / day90 daysActive paid Developer subscription, OR the global archive key

All tiers get every endpoint. The only differences between tiers are the daily request cap and the lookback window. Free and Pro both top out at 7 days of history; only Dev reaches 90 days.

A request without a key is fine. You only need a key when:

  • You want a stable per-user daily quota instead of the shared per-IP rate limit, OR
  • You need history beyond 7 days (Dev tier required), OR
  • You want to see your usage on the account page

Getting a key

  1. Sign up at https://divergence.news/auth/signup.
  2. Open https://divergence.news/account.
  3. Click "Generate API key", optionally label it ("My laptop", "CI bot").
  4. Copy the key once. The full key is shown only at creation time; only the prefix (e.g. dv_api_AbCd...) is retained.

The key format is dv_api_ followed by 43 url-safe base64 chars. Treat it as a secret. Keys can be revoked at any time from the account page.

Sending the key

Use any of these (in order of preference):

curl -H "X-API-Key: dv_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  "https://divergence.news/api/v2/events?limit=10"

curl -H "Authorization: Bearer dv_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  "https://divergence.news/api/v2/events?limit=10"

curl "https://divergence.news/api/v2/events?limit=10&token=dv_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Prefer the header forms; the query-string form leaks the key into server logs and browser history.

Error responses

StatusCodeWhen
401invalid_api_keyThe key was supplied but does not match any active key. No silent downgrade to anonymous.
401archive_token_requiredThe request reaches data older than your tier's lookback window (7 days for free/pro, 90 for dev).
429daily_limit_exceededYou hit your tier's daily cap. Resets at UTC midnight.
429rate_limitedPer-minute burst limit. See rate-limits.

MCP tokens

Dev-tier subscribers can also generate dv_mcp_<token> keys for the MCP server (Claude Desktop and other MCP clients). They are managed from the same account page and obey the same per-tier daily limits.