Skip to content

Authentication

API Keys

Payre uses API keys for authentication. Keys follow the format pyr_sk_ + 32 hex characters (39 characters total).

Using API Keys

Include the key in the X-Payre-Key header:

bash
curl -H "X-Payre-Key: pyr_sk_abc123..." http://localhost:3000/agents

Managing Keys

Create a Key

POST /api-keys
json
{
  "label": "Production Key"
}

Response (key is shown only once):

json
{
  "ok": true,
  "key": {
    "id": "apikey_...",
    "label": "Production Key",
    "key": "pyr_sk_abc123...",
    "active": true,
    "createdAt": "2026-01-01T00:00:00.000Z"
  }
}

List Keys

GET /api-keys

Returns keys without the secret value (only prefix shown).

Deactivate a Key

DELETE /api-keys/:id

Development Mode

Set PAYRE_AUTH_DISABLED=true to bypass authentication in development and testing.

Public Endpoints

GET /health does not require authentication.