# Create an API key

To use the authenticated endpoints, you need an API key to include with your requests.
To create it, follow the steps below.

:::tip
To use the public endpoints, you don't need an API key.
See [Make your first request](/docs/guides/crypto-exchange/get-started/make-your-first-request) for more details.
:::

## How it works

The Revolut X Crypto Exchange REST API endpoints authenticate requests using an API key created in the [Revolut X web app](https://exchange.revolut.com/account/api-keys).

Every authenticated request includes your API key in the `X-Revx-API-Key` header.
Additionally, the requests include the `X-Revx-Timestamp` and `X-Revx-Signature` headers as an extra security layer on top of the API key.
These signing keys must be generated before the API key.
The public key is uploaded to the Revolut X app, and the private key is used to sign requests.

## Before you begin

Before you start, make sure you have:

- A [personal Revolut account](https://help.revolut.com/help/profile-and-plan/getting-started-with-revolut/) or a [Revolut Business account](https://help.revolut.com/business/help/setting-up-an-account/is-my-business-eligible/why-is-my-account-not-eligible/).

## Generate an Ed25519 key pair

Before creating your API key in the [Revolut X web app](https://exchange.revolut.com/account/api-keys), you must first generate an **Ed25519 key pair**.

An Ed25519 key pair consists of a private key and a public key.
The **private key** is kept secret and used for signing data or authenticating, while the **public key** can be shared to verify signatures and authenticate access.

You can generate this pair using `openssl`.

### 1. Generate the private key

Run the following command in your terminal:

```sh
openssl genpkey -algorithm ed25519 -out private.pem
```

This command generates a file named `private.pem`, which contains your private key.
It has the following structure:

```
-----BEGIN PRIVATE KEY-----
{YOUR BASE64-ENCODED PRIVATE KEY}
-----END PRIVATE KEY-----
```

:::danger[IMPORTANT: Secure your private key]
This is your **private** key, and it will be used for signing requests.
**Your private key is a secret.**
Never share it with anyone and never send it as a part of any request.
:::

### 2. Generate the public key

Next, generate the public key from your private key:

```sh
openssl pkey -in private.pem -pubout -out public.pem
```

This command generates a file named `public.pem` with your public key.
It has the following structure:

```
-----BEGIN PUBLIC KEY-----
{YOUR BASE64-ENCODED PUBLIC KEY}
-----END PUBLIC KEY-----
```

:::info[About your public key]
This is your **public** key.
It is not secret, and it is safe to share.
You will provide this key to Revolut X so we can verify the requests signed with your matching private key.

When you provide it, make sure that you copy all of it, including the `-----BEGIN KEY-----` and `-----END KEY-----` lines.
:::

## Create your API key

Once you have your **public key** (the content of `public.pem`), you are ready to create your API key.

Go to the [**API keys** page](https://exchange.revolut.com/account/api-keys) in the Revolut X web app to complete the setup.