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

# Authentication

> How to authenticate requests to the Gateway API

Authentication is required to access protected endpoints in the AmploPay API.

## Getting credentials

To use the API, you need a public key and a private key. These credentials can be generated in your account dashboard.

1. Access the AmploPay dashboard.
2. Go to the API section in the integrations area.
3. Click `Generate credentials`.
4. Store the keys in a secure location. The private key will not be displayed again.

## Required headers

Include the headers below in every authenticated request:

| Header         | Description     |
| -------------- | --------------- |
| `x-public-key` | Your public key |
| `x-secret-key` | Your secret key |

## Axios example

<Warning>
  The example below is illustrative only. It shows how to send the headers, but it does not represent a specific endpoint.
</Warning>

```js theme={null}
await axios.get("https://app.amplopay.com/api/v1", {
  headers: {
    "x-public-key": "SUA_CHAVE_PUBLICA_AQUI",
    "x-secret-key": "SUA_CHAVE_PRIVADA_AQUI"
  }
})
```

## Security

* Never share your private key.
* Store keys in environment variables, vaults, or secret managers.
* Never include keys in frontend code.
* Never commit credentials to repositories.
* Always use HTTPS.
* Monitor credential usage and regenerate keys if compromise is suspected.

## Support

If you have questions about credentials or authentication, contact the AmploPay support team through your dashboard.
