For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Get API Key
GuidesAPI Reference
GuidesAPI Reference
  • Getting Started
    • Introduction
    • Getting Started
    • Authentication
    • Rate Limits
    • Error Handling
  • Concepts
    • Projects & Documents
    • Document Processing
    • Knowledge & Search
    • Compliance Checking
    • Environments & Keys
    • Streaming & Async
  • How-To Guides
    • Manage Projects
    • Upload & Manage Documents
    • Query Your Knowledge Base
    • Run Compliance Checks
    • View Your Organization
Get API Key
LogoLogo
On this page
  • API key format
  • Key lifecycle
  • Key rotation
  • Display fingerprint
  • Security best practices
Getting Started

Authentication

API key management, environments, and security
Was this page helpful?
Edit this page
Previous

Rate Limits

Request quotas, headers, and retry strategies
Next
Built with

All authenticated API requests require a Bearer token in the Authorization header.

$curl https://api.pyramid-ai.com/api/v2/organization \
> -H "Authorization: Bearer pai_live_7fK3aB...xQ2z"

API key format

Keys follow the pattern {prefix}{32_random_chars}:

PrefixEnvironmentBase URL
pai_live_Productionapi.pyramid-ai.com
pai_test_Staging (sandbox)api-staging.pyramid-ai.com

Keys are environment-scoped. A pai_test_* key will return 401 Unauthorized on the production API, and vice versa.

Key lifecycle

active ──(rotate)──> rotated (24h grace period)
│
├──(revoke)──> revoked (immediate)
│
└──(expiry)──> expired (automatic)
  • Active — the key accepts requests.
  • Rotated — a new key has been issued. The old key remains active for 24 hours, then stops working.
  • Revoked — immediately invalidated by an admin.
  • Expired — past its expires_at date (if one was set).

Key rotation

When you rotate a key, a new key is generated and the old key enters a 24-hour grace period during which both keys are accepted. This allows you to update your integration without downtime.

The new key plaintext is shown only once at creation. Store it securely — it cannot be retrieved later.

Display fingerprint

After creation, keys are displayed as a fingerprint: pai_live_...a3f9. This is safe to use in logs and support tickets. Never log the full key.

Security best practices

  • Store keys in environment variables or a secrets manager, never in source code
  • Use pai_test_* keys for development and CI pipelines
  • Rotate keys periodically and after any suspected compromise
  • Monitor the last_used_at timestamp — unused keys should be reviewed
  • Each integration should use its own key for independent revocation