API Reference/

Getting Started

API Keys

API keys are the simplest way to authenticate with the Anagrama API. Generate a key in the Developer Portal and include it in every request.

How to get a key

  1. Sign in at playanagrama.com
  2. Open Developer Portal → API Keys
  3. Click Generate New Key and give it a name
  4. Copy the key immediately — it is only shown once

Using your key

There are two ways to authenticate with your API key:

Option 1: Environment variable (recommended)

Set the ANAGRAMA_API_KEY environment variable. All SDKs read it automatically — no code changes needed.

Shell
export ANAGRAMA_API_KEY="ak_your_key_here"

Option 2: Pass it in your code

Pass the key directly to the SDK constructor. This takes priority over the environment variable.

bash
curl "https://api.playanagrama.com/api/v1/words/random" \
  -H "Authorization: Bearer ak_your_key_here"

Raw HTTP header

If you're not using an SDK, include your key as a Bearer token in the Authorization header:

Header
Authorization: Bearer ak_your_key_here
API keys are read-only — they can fetch puzzle data but cannot submit guesses or request hints. For full gameplay access, use the CLI with the Device Code Flow. You can revoke a key anytime from Developer Portal.

Monitor request volume on the Usage dashboard, or set up Webhooks to get notified about key events. Need full gameplay access? Use the Device Code Flow for CLI/terminal applications.

Was this page helpful?
Anagrama API Docs | Developer Reference