Skip to content

Authentication

All API requests must be authenticated using an API key. Keys are scoped to your account and grant access to all resources you own.

  1. Log in to your BeInfi dashboard.
  2. Navigate to Settings > Developer > API Keys.
  3. Click Generate New Key.
  4. Give the key a descriptive name (e.g., “Production server” or “Testing”).
  5. Copy the key immediately — it will not be shown again.

Include the key in the Authorization header of every request:

Terminal window
curl https://api.beinfi.com/v1/me \
-H "Authorization: Bearer YOUR_API_KEY"

A successful response returns your account details:

{
"id": "usr_abc123",
"email": "you@example.com",
"name": "Your Name",
"plan": "pro",
"created_at": "2025-01-15T10:30:00Z"
}

If authentication fails, the API returns a 401 Unauthorized response:

{
"error": "unauthorized",
"message": "Invalid or expired API key."
}

Common causes:

  • The API key is missing from the request headers.
  • The key was revoked or deleted.
  • The key was copied incorrectly (check for trailing whitespace).

API requests are rate-limited per key:

PlanRate limit
Free60 requests/minute
Pro300 requests/minute
Business1000 requests/minute

When you exceed the limit, the API returns a 429 Too Many Requests response with a Retry-After header indicating how many seconds to wait.

  • Use separate keys for development and production environments.
  • Rotate keys periodically (every 90 days is recommended).
  • Revoke unused keys to minimize your attack surface.
  • Use environment variables to store keys in your application code.