> ## 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.

<Steps>
  <Step title="Open the settings page">
    Log in to your merchant dashboard and navigate to **Settings** from the sidebar menu.
  </Step>

  <Step title="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](/guides/authentication#environments).
    </Note>
  </Step>

  <Step title="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](/guides/security/generating-ssh-keys).
  </Step>

  <Step title="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](/guides/security#credential-handling-rules).
    </Warning>
  </Step>
</Steps>

## 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](/guides/encryption).
