# Lemon Squeezy API keys: find, store, rotate, and use them safely with AI agents

Source: https://botpassword.com/keys/lemon-squeezy
Last checked: 2026-10-25

Lemon Squeezy API keys are created in the dashboard under **Settings → API** and are shown only once. Send the key as a bearer token with JSON:API headers; keys made in test mode only touch test mode store data.

## Key types

| Type | Prefix | Secret | Scope | Expiry |
|---|---|---|---|---|
| API key | — | Yes | Access to the store data in the mode (test or live) it was created in | Not stated in the developer guide |

## How to create a Lemon Squeezy key

1. Sign in to the Lemon Squeezy dashboard and go to **Settings → API**.
2. Create a key and give it a clear name.
3. Copy the key immediately; it is shown only once.

## How to rotate a Lemon Squeezy key

1. Create a new key on the Settings → API page.
2. Update your application to use it.
3. Delete the old key.

## How to revoke a Lemon Squeezy key

1. Delete the key from **Settings → API**.

## If the key leaked

1. Delete the exposed key from Settings → API.
2. Create a replacement and update your environment files and deployments.

## Gotchas

- Requests need `Accept` and `Content-Type` set to `application/vnd.api+json` plus `Authorization: Bearer {api_key}`.
- Keys created in Test mode only interact with test mode store data.
- Key names cannot be edited, so name keys by purpose.

## Using this key with AI agents (BotPassword)

- `run_with`: Runs a command with the key injected as an environment variable or a 0600 temporary file, never on the command line, and redacts the key from the output.
- `http_request`: Makes an authenticated API call after checking the destination against the hosts this key may be sent to. The response comes back with credential-shaped values redacted, and one that holds the key itself is refused.
- `store_secret`: Saves a value the agent already holds as a new vault item.

## FAQ

### Where do I create a Lemon Squeezy API key?

In the dashboard at Settings → API. Copy it at once because it is shown only once.

### How do I authenticate to the Lemon Squeezy API?

Send `Authorization: Bearer {api_key}` with `Accept` and `Content-Type` set to `application/vnd.api+json`.

### Do test mode keys work on live data?

No. Test mode keys only interact with test mode store data.

### Can an AI agent use my Lemon Squeezy key without seeing it?

Yes, if the key never enters the agent's context. Instead of pasting the key into a chat or leaving it in a `.env` file the agent can read, keep it in a credential broker that injects it into the command or request on the agent's behalf. BotPassword does this with `run_with`, `http_request`, `store_secret`, so the agent gets the result and never the value.

## Sources

- https://docs.lemonsqueezy.com/guides/developer-guide/getting-started
- https://docs.lemonsqueezy.com/api
