Skip to content

Authentication & API Keys

Every request to the Potpie API requires an API key passed via the x-api-key header.

Generate an API key

  1. Sign in to the dashboard at app.potpie.ai.
  2. Click the account menu in the bottom-left corner and select Settings.
  3. In the API Key section, click + Generate API Key.
  4. Copy the key and store it securely.

Warning

Treat your API key like a password. It grants access to your repositories, agents, and conversations. Store it in a secret manager or environment variable — never commit it to source control.

Use the key

Pass the key in the x-api-key header on every request:

curl -X GET http://localhost:8001/api/v2/projects/ \
  -H "x-api-key: YOUR_API_KEY"

A convenient pattern is to export it once per shell session:

export POTPIE_API_KEY="sk-..."

curl -X GET http://localhost:8001/api/v2/projects/ \
  -H "x-api-key: $POTPIE_API_KEY"

CLI vs. API authentication

There are two distinct auth surfaces — don't confuse them:

Use case How to authenticate
Using the potpie CLI / agent harness potpie login (browser session) or potpie login --api-key sk-...
Calling the REST API directly (curl, scripts, services) x-api-key header with a key generated in the dashboard

For CLI login details, see CLI Commands → Authentication.

Next steps