> For the complete documentation index, see [llms.txt](https://docs.pandaboost.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pandaboost.app/api-for-developers/getting-your-api-key.md).

# Getting Your API Key

Create and use live or test API keys securely with PandaBoost API v2.

Manage API keys in the [Web Panel](https://web.pandaboost.app/api-keys).

1. Sign in to the Web Panel and open **API Keys**.
2. Create a key for your integration. Choose a test key for a no-charge integration check.
3. Store it in a server-side secret manager or protected environment variable.
4. Send it in the `x-api-key` header on every request.

Existing API keys also work with v2; migrating does not require a replacement key.

## Authentication

Set `PANDABOOST_API_KEY` securely in your server environment, then request the balance:

```bash
curl -sS \
  -H "x-api-key: ${PANDABOOST_API_KEY}" \
  'https://web.pandaboost.app/api/v2/balance'
```

For JSON requests, also send `Content-Type: application/json`. See the [methods reference](https://docs.pandaboost.app/api-for-developers/api-methods-reference).

## Test keys

Test keys start with `pb_test_`. They use the same authentication and order validation as live keys. A valid test order completes immediately, without charging your balance or delivering the service. `POST /eligibility` works the same way with live and test keys.

A test key does not bypass an eligibility rule or make an invalid payload valid. Immediate test completion also does not reproduce live delivery timing, held orders, or refund review; handle those states in your integration separately.

## Key security

{% hint style="danger" %}
Never expose an API key in frontend JavaScript, public repositories, screenshots, support chats, or documentation. Rotate a key immediately if it may have been disclosed.
{% endhint %}

* Use a separate key for each integration where practical.
* Redact the `x-api-key` header from logs and error reports.
* Keep a test key separate from the key used by your live checkout.
* Do not ask a customer to send their API key to your support chat.

## Authentication errors

A missing or invalid key returns HTTP `401`:

```json
{
  "success": false,
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key",
    "retryable": false
  }
}
```

HTTP `403` with `error.code: "forbidden"` means API access is not enabled. Contact [PandaBoost Support](https://t.me/pandaboosthelp) if you need help with access.
