Skip to main content

Overview

Requests to the REST API authenticate with an API key in the X-API-Key header. The MCP endpoint accepts the same key as a bearer token — or an OAuth 2.0 sign-in, which needs no key at all.
For MCP, prefer OAuth where the client supports it — there’s no key to copy, leak, or rotate. Reach for an API key when the client can’t run an OAuth flow, or for headless and CI runs where no browser is available. See Add to Agents.
Keys are prefixed with alch_ followed by 32 random URL-safe characters. The full raw key is shown once at creation and is never stored — only a hash is kept.

Provisioning a key

  1. Go to app.askalchemist.com/settings/api-keys
  2. Click Create key
  3. Enter a name (e.g. cursor-dev, prod-agent)
  4. Copy the key immediately — it won’t be shown again

Via the API

If you’re already authenticated via the app session (Clerk JWT), you can create keys programmatically:
Response:

Listing your keys

The list response omits raw_key — only the prefix (first 12 characters) is shown to help you identify keys.

Revoking a key

Returns 204 No Content on success. Revoked keys are rejected immediately on the next request.

Tiers

Keys carry a tier field that controls rate limits and access scope. Higher tiers are available for production workloads — contact us at hello@askalchemist.com.

Rate limit headers

Every API response includes rate limit state:
A 429 Too Many Requests response means you’ve hit the limit for the current window. Wait until X-RateLimit-Reset (Unix timestamp) before retrying.

Security practices

  • One key per integration — name keys after where they’re used (cursor-dev, prod-pipeline). This makes it easy to rotate a compromised key without disrupting other integrations.
  • Never commit keys to version control. Use environment variables or a secrets manager.
  • Rotate regularly. Revoke and reissue keys quarterly or after any suspected exposure.