{
  "name": "Ask for a free OpenAlex API key for your user",
  "method": "POST",
  "url": "https://api.openalex.org/api-keys",
  "headers": {
    "Content-Type": "application/json",
    "Idempotency-Key": "<optional: a UUID, so a retry returns the same key>"
  },
  "body": {
    "email": "<your user's email address: ask them, don't invent one>",
    "name": "<optional>",
    "agent": "<optional: what is asking, e.g. Claude Code>"
  },
  "returns": "201 with api_key. We email the address a link; the key starts working when they click it, with $1 of free usage a day. Until then, requests with it are refused (403 key_not_activated): call without a key meanwhile.",
  "use_the_key": "Send it as api_key=KEY on any request, or an \"Authorization: Bearer KEY\" header. Keep it in an environment variable (OPENALEX_API_KEY), not in code you share. It is for API calls only: it can't sign in to openalex.org, and your user can revoke it there.",
  "errors": {
    "400": "the address is missing, malformed, or a placeholder like you@example.com: ask your user for their real address",
    "429": "too many keys from this network or email domain today: your user can sign up at https://openalex.org/signup instead",
    "409 account_exists": "the address already has an account and a key: your user copies it from https://openalex.org/settings/api-key",
    "409 activation_pending": "a key for the address is waiting for activation: your user clicks the link we emailed"
  },
  "docs": "https://help.openalex.org/api/authentication/#getting-a-key-for-your-user"
}
