> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alakazam.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# auth

> How an AI agent gets an Alakazam API key for its user.

If you're an AI coding agent setting up Alakazam, here's how to get an API key for your user.

<Note>
  Alakazam keys are minted per app from the developer dashboard and require your
  user to sign in — they can't be minted fully headlessly yet. So walk your user
  through the steps below, then continue with the [Agent quickstart](/agent-quickstart).
</Note>

## Get a key

1. Ask your user to open **[play.alakazam.gg/?view=developer](https://play.alakazam.gg/?view=developer)** and sign in (or create an account — free).
2. Create an **app**, then mint a **secret** key. Start with an **`sk_test_…`** key — it runs a free, mocked [sandbox](/testing) (no GPU spend); swap to `sk_live_…` to ship.
3. Have them export it so the skill, MCP server, and SDKs pick it up:

   ```bash theme={null}
   export ALAKAZAM_SECRET_KEY="sk_test_..."
   ```
4. For browser reads / a like button, also mint a publishable `pk_…` key → `ALAKAZAM_PUBLISHABLE_KEY`.

## Then

* Install the [skill](/install-skill) so you know the API across sessions.
* Install the [MCP server](/install-mcp) (`npx @alakazamworld/mcp`) for live tool calls.
* Follow the [Agent quickstart](/agent-quickstart) to wire Alakazam into the app.

<Warning>
  Never put a **secret** (`sk_…`) key in client/browser/game code. For runtime, your
  backend mints a short-lived session token (`POST /v1/sessions/token`) that the client
  uses — the **two-token rule**. See the [skill](/skill.md).
</Warning>
