Skip to main content

Authentication & Security

Learn how to securely authenticate with the Perf API and protect your integration.

API Key Authentication

Perf uses API key authentication with Bearer tokens. All requests must include your API key in the Authorization header.

Header Format

Example Request

API Key Types

Test Keys (pk_test_...)

  • For development and testing
  • Separate usage quotas from production
  • No charges to your billing account
  • Can be regenerated freely

Production Keys (pk_live_...)

  • For production environments
  • Charges applied to your billing account
  • Higher rate limits
  • Should be rotated regularly for security

Managing API Keys

Creating Keys

  1. Log in to withperf.pro
  2. Navigate to SettingsAPI Keys
  3. Click Generate New Key
  4. Provide a descriptive name (e.g., “Production Server”, “Dev Environment”)
  5. Select key type (test or live)
  6. Copy the key immediately - it won’t be shown again

Rotating Keys

We recommend rotating API keys every 90 days:
  1. Generate a new key
  2. Update your application configuration
  3. Deploy the changes
  4. Verify the new key works
  5. Revoke the old key

Revoking Keys

Immediately revoke a key if:
  • It’s been compromised
  • An employee with access leaves
  • You’re retiring an application
To revoke:
  1. Go to SettingsAPI Keys
  2. Find the key in the list
  3. Click Revoke
  4. Confirm the action
Revoked keys are immediately invalidated.

Security Best Practices

1. Never Expose Keys in Client-Side Code

❌ Don’t do this:
✅ Do this instead:

2. Use Environment Variables

Store API keys in environment variables, never in code:

3. Restrict Key Permissions

When available, use scoped keys with minimal permissions:
  • Read-only keys: For analytics dashboards
  • Write-only keys: For logging systems
  • Admin keys: For full account access (use sparingly)

4. Use Different Keys per Environment

Maintain separate keys for:
  • Development
  • Staging
  • Production
  • CI/CD pipelines
This allows you to:
  • Track usage by environment
  • Revoke specific keys without affecting others
  • Apply different rate limits

5. Monitor Key Usage

Regularly review:
  • Request volume per key
  • Unusual access patterns
  • Failed authentication attempts
  • Geographic distribution
Access this data in SettingsAPI KeysUsage Analytics.

6. Implement Server-Side Proxies

For frontend applications, create a backend proxy:

Rate Limiting

Perf enforces rate limits to ensure fair usage and system stability.

Current Limits

Rate Limit Headers

Every response includes rate limit information:

Handling Rate Limits

When you exceed limits, you’ll receive a 429 Too Many Requests response:
Implement exponential backoff:

Data Handling

  • Encryption in Transit: TLS 1.3 for all API requests
  • Prompts: Processed in real-time, not stored permanently
  • Logs: Metadata (model used, tokens, latency) is logged for analytics

Incident Response

If you suspect a security breach:
  1. Immediately revoke compromised API keys
  2. Review audit logs for unauthorized access
  3. Contact security@withperf.pro
  4. Rotate all potentially affected keys
  5. Monitor for unusual activity

Security Contact

Report security vulnerabilities to: We have a responsible disclosure policy and provide:
  • Acknowledgment within 24 hours
  • Resolution timeframe within 30 days
  • Recognition in our security hall of fame

Next Steps