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

# Authentication

> How requests are authenticated and how to create API keys.

## Headers

Every request to the Mako API requires two headers:

| Header             | Value                                          | Required              |
| ------------------ | ---------------------------------------------- | --------------------- |
| `x-wallet-address` | Your EVM wallet address (e.g. `0x1234...abcd`) | Always                |
| `Authorization`    | `Bearer YOUR_API_KEY`                          | When free mode is off |

```bash theme={null}
curl https://gateway.deepmako.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "x-wallet-address: 0xYourWalletAddress" \
  -H "Authorization: Bearer mako_sk_abc123..." \
  -d '{"model": "conductor", "messages": [{"role": "user", "content": "gas on base?"}]}'
```

The `x-wallet-address` header identifies the caller for credit tracking. It is **not** an API key. The `Authorization` header carries the API key when the gateway requires authentication.

## Create an API key

```
POST /auth/api-keys
```

Generates a new API key tied to your wallet address.

### Headers

<ParamField header="x-wallet-address" type="string" required>Your EVM wallet address.</ParamField>

### Request body

<ParamField body="name" type="string" default="default">
  A label for the key (for your own reference).
</ParamField>

### Response

```json theme={null}
{
  "key": "mako_sk_abc123def456...",
  "name": "default",
  "address": "0x1234...abcd",
  "message": "Store this key securely. It won't be shown again."
}
```

<Warning>
  The full API key is only returned once, at creation time. Store it immediately — there is no way to retrieve it later. Keys are SHA-256 hashed before storage.
</Warning>

## Free mode

When the gateway runs with `FREE_MODE=true`, authentication is relaxed. All requests are accepted with just the `x-wallet-address` header — no API key required, no credits deducted.

The hosted gateway at `gateway.deepmako.com` currently runs in free mode.
