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.
Lemon Squeezy key types
| Type | Prefix | Secret? | Scope | Expiry |
|---|---|---|---|---|
| API key Key names cannot be changed after creation. | — | 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
- Sign in to the Lemon Squeezy dashboard and go to Settings → API.
- Create a key and give it a clear name.
- Copy the key immediately; it is shown only once.
Open Lemon Squeezy's key settings
How to rotate a Lemon Squeezy key
- Create a new key on the Settings → API page.
- Update your application to use it.
- Delete the old key.
Lemon Squeezy recommends rotating keys regularly.
How to revoke a Lemon Squeezy key
- Delete the key from Settings → API.
If your Lemon Squeezy key leaked
- Delete the exposed key from Settings → API.
- Create a replacement and update your environment files and deployments.
Things that catch people out
- Requests need
AcceptandContent-Typeset toapplication/vnd.api+jsonplusAuthorization: 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 your Lemon Squeezy key with AI agents
A coding agent that can read your .env file or your shell history can read the key, and anything in its context can end up in logs, transcripts or a prompt-injected request. The safer pattern is to keep the key in a credential broker that performs the authenticated step for the agent and hands back only the result.
BotPassword works this way. For a Lemon Squeezy key, these intents fit:
| Intent | What BotPassword does |
|---|---|
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. |
Set it up in your agent: Aider · Amp · Claude Code · Claude Desktop · Cline · OpenAI Codex CLI · all agents
Frequently asked questions
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.