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

# Generating API Keys

> Retrieve your API and encryption keys from the merchant dashboard

Your API key and encryption key are auto-generated by the platform. This guide shows where to find them and how to complete the key setup.

**1. Open the settings page**

Log in to your merchant dashboard and navigate to **Settings** from the sidebar menu.

**2. Open the API Key tab**

Select the **API Key** tab from the tab menu at the top of the settings page. Both your **API Key** and **Encryption Key** are already generated and displayed there:

* Click the **eye icon** to reveal a key
* Click the **clipboard icon** to copy it

> [!NOTE]
>
> Each environment has its own key set. Test keys start with `cngn_test` and live keys with `cngn_live`; make sure you are viewing the environment you intend to integrate. See [Authentication](https://docs.cngn.co/guides/authentication.md#environments).

**3. Add your SSH public key**

On the same API Key tab, paste your **SSH public key** into the designated field. The platform uses it to encrypt response data to you; without it, requests fail with `No Test SSH Key found` or `No Live SSH Key found`.

Don't have a key pair yet? Create one first: [Generating SSH Keys](https://docs.cngn.co/guides/security/generating-ssh-keys.md).

**4. Store the keys securely**

Move both keys into a secrets manager immediately.

> [!WARNING]
>
> Never expose the API key or encryption key in client-side code, mobile apps, or public repositories. See the [credential handling rules](https://docs.cngn.co/guides/security.md#credential-handling-rules).

## What each key does

| Key | Purpose | Where it's used |
| - | - | - |
| API Key | Authenticates every request | `Authorization: Bearer <key>` header |
| Encryption Key | Encrypts request bodies (AES-256-CBC) | Your server, before sending `POST`/`PUT` bodies |
| SSH Public Key | Lets the platform encrypt responses to you | Uploaded to the dashboard |

Next: wire up the payload crypto in [Encrypting & Decrypting Requests](https://docs.cngn.co/guides/encryption.md).


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