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

# API Keys

> Authenticate requests and manage your personal API keys.

Every backend request must include an API key in the `x-api-key` header. For
programmatic or bot access, create a **personal API key** tied to your account.

| Base URL                      |
| ----------------------------- |
| `https://api.unitedmarket.ai` |

<Note>
  United Market is now live on BNB Smart Chain mainnet. We just launched — start trading on-chain prediction markets today.
</Note>

## How authentication works

* **`x-api-key`** — required on every request. The web app ships a shared key; for your own integrations, create a personal key (below).
* **`Authorization: Bearer <token>`** — additionally required for user-specific endpoints (your orders, your keys, etc.). Obtain it via [Sign In & Trade](/guides/sign-in-and-trade).

## Create a key

Sign in with SIWE first, then:

```bash theme={null}
curl -X POST "https://api.unitedmarket.ai/me/api-keys" \
  -H "x-api-key: WEB_KEY" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "trading-bot" }'
```

The `key` is shown **once** — store it immediately:

```json theme={null}
{
  "id": "…",
  "name": "trading-bot",
  "prefix": "umk_live_AbC123",
  "tier": "DEFAULT",
  "key": "umk_live_xxxxxxxxxxxxxxxxxxxx"
}
```

You can also create and rotate keys from the app at **`/api-keys`**.

## Use a key

```bash theme={null}
curl "https://api.unitedmarket.ai/markets" \
  -H "x-api-key: umk_live_xxxxxxxxxxxxxxxxxxxx"
```

## Rotate or revoke

```bash theme={null}
# rotate — the old secret stops working; a new one is returned once
curl -X POST "https://api.unitedmarket.ai/me/api-keys/{id}/rotate" \
  -H "x-api-key: WEB_KEY" -H "Authorization: Bearer ACCESS_TOKEN"

# revoke
curl -X DELETE "https://api.unitedmarket.ai/me/api-keys/{id}" \
  -H "x-api-key: WEB_KEY" -H "Authorization: Bearer ACCESS_TOKEN"
```

<Note>
  Secrets are stored hashed and can never be shown again after creation. If you lose a key, rotate it.
</Note>

## Rate limits

Requests are rate-limited per key. Responses include `X-RateLimit-Limit-*`,
`X-RateLimit-Remaining-*`, and `X-RateLimit-Reset-*` headers; exceeding a limit
returns `429 Too Many Requests`.

| Tier     | Per second | Per minute |
| -------- | ---------- | ---------- |
| DEFAULT  | 10         | 300        |
| PRO      | 50         | 3000       |
| INTERNAL | 1000       | 60000      |

Contact the team to raise your tier.
