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

# API keys and authentication

> Generate a Vanryx Merchant API key in the Dashboard and authenticate requests with the Merchant-API-Key header.

Every Vanryx Merchant API request must include an active API key in the `Merchant-API-Key` header.

## Create an API key

API keys are created in the authenticated Vanryx Dashboard. There is no public API endpoint for creating keys.

**1. Open Merchant Service**

Sign in to the Vanryx Dashboard and open **Merchant Service**.

**2. Generate the key**

In **Generate API Key**:

1. Enter a **Key Name**.
2. Select at least one item under **Accepted Crypto Currencies**.
3. Select **Generate API Key**.

**3. Copy and save the key**

The Dashboard shows **Created API Key** and asks you to **Copy and save your API key**. Copy it into your server-side secret storage.

The key must be active to authenticate API calls. A deactivated or deleted key no longer authenticates.

## Authenticate requests

Send the key in this header, exactly as shown:

```text theme={null}
Merchant-API-Key: <YOUR_API_KEY>
```

Minimal authenticated request:

```bash theme={null}
curl --request POST \
  --url https://api.vanryx.com/api/v1/swap/rate \
  --header 'Merchant-API-Key: <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{"from_currency":"BTC","to_currency":"USD"}'
```

## Authentication errors

| HTTP status | Response body | Cause |
| - | - | - |
| `401` | `{"message":"Missing merchant API Key"}` | The `Merchant-API-Key` header is absent. |
| `401` | `{"message":"Invalid or inactive API Key"}` | The key is not valid or not active. |

## Keep your key secret

> [!WARNING]
>
> Anyone who holds your API key can make Merchant API requests on your behalf.

* Keep keys in server-side secret storage.
* Never put keys in browser or client-side code, URLs, source control, or logs.
* If a key is compromised, deactivate or delete it in the Dashboard where that option is available, then generate a replacement key.

## Rate limits

[Create Invoice](https://docs.vanryx.com/api-reference/create-invoice.md) is limited to 10 requests per minute. Other API routes may also return HTTP `429`. Their effective limits and any rate-limit response headers are not documented. Handle `429` responses by backing off before you retry.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.