API Tokens

API tokens let your coding agent, scripts and CI use the Potions API. Create and revoke them under API tokens in your account.

Access

You choose a token's access when you create it:

Access What it can do Apps
Agent Find and create apps, deploy and roll back, read deployments and their logs, set environment variables that aren't secret (such as POOL_SIZE), have Potions generate a random secret, such as a signing salt, see each server's resources, create servers on your connected cloud accounts, and ask you to confirm deleting an app All your apps, or one app
Read only Find apps, see your servers, and read deployments and their logs All your apps, or one app
CI deploy Deploy one app, roll it back, and read its deployments and logs One app, required
CI secrets Set secret environment variables for one app, for CI that keeps your secrets somewhere else One app, required

A token limited to one app can't see your other apps or your servers, and can't create apps or servers. It can still ask you to delete its own app.

What tokens can do with environment variables:

  • No token can read a value. Logs that tokens read have every value removed.
  • An Agent token can set variables that aren't secret. It can't replace a secret, and values that look like one are refused. A secret it has Potions generate is never shown to anyone and never replaces an existing variable.
  • Only a CI secrets token, or a CLI login you allowed to set secrets, can set or replace a secret.

No token can delete anything by itself, and no token can delete a server. An Agent token can ask to delete an app: you get a link to the app's danger zone, where you type the name and confirm each consequence yourself. Creating a server bills your cloud account, so your agent shows you the price and asks first, and each token can create at most 5 servers an hour. No token can run commands on your servers, connect cloud accounts or edit build hooks. Those stay in the dashboard.

A token keeps the access it was created with. If you need more later, create a new token: Agent tokens made before server creation existed can't create servers or ask to delete apps.

Expiry

Tokens expire after 30 days, 90 days (the default), 1 year, or never. Expired tokens stop working and stay in the list so you can see what they were.

Keeping a token safe

Potions shows a token once, when you create it, and stores only a fingerprint of it. If you lose a token, revoke it and create a new one.

Tokens start with pot_. Keep them out of your repository:

  • On your computer, add export POTIONS_TOKEN=pot_... to your shell profile (for example ~/.zshrc), or load it from your password manager's command-line tool.
  • In CI, use a CI deploy token stored as a secret, for example a GitHub Actions secret.
  • Never paste a token into a chat with your agent. The Potions plugin only uses it as $POTIONS_TOKEN.

Revoking

Click Revoke next to a token and confirm. Anything using the token stops working on its next request. Revoking can't be undone, and the token stays in the list marked Revoked.

Deleting an app also deletes any token limited to it.

Limits

You can have up to 50 active tokens at a time. Each token can make 120 API requests a minute.

The list shows when each token was last used, to within five minutes.