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

# Authentication

> Authenticate your API requests with a Bearer token.

<Info>
  **Preview.** API access and key management are being finalised. This page
  describes the intended flow.
</Info>

## API keys

You'll generate an API key from **Dashboard → Settings → API**. Treat it like a
password.

<Warning>
  Never commit your API key to source control or expose it in client-side code.
  Keep it server-side and rotate it if it's ever exposed.
</Warning>

## Making an authenticated request

Send your key as a Bearer token in the `Authorization` header.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.gamer2z.com/v1/me \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```ts TypeScript theme={null}
  const res = await fetch("https://api.gamer2z.com/v1/me", {
    headers: { Authorization: `Bearer ${process.env.GAMER2Z_API_KEY}` },
  });
  const me = await res.json();
  ```

  ```python Python theme={null}
  import os, requests

  res = requests.get(
      "https://api.gamer2z.com/v1/me",
      headers={"Authorization": f"Bearer {os.environ['GAMER2Z_API_KEY']}"},
  )
  me = res.json()
  ```
</CodeGroup>

A successful request returns your account profile. From there, explore the
[endpoints](/api-reference/introduction).
