Skip to main content

API Key Authentication

Byul REST API uses API key authentication. All requests must include a valid API key in the request headers.

Getting Your API Key

  1. Sign up at byul.ai
  2. Login to your API Dashboard
  3. Copy your API key (starts with byul_v2)
Your API key starts with the byul_ prefix and is immediately available after account creation.

Authentication Methods

Include your API key using the X-API-Key header:

Example Requests

Security Best Practices

Environment Variables

Secure (Recommended)
Insecure (Don’t do this)

Client-Side Security

Never expose API keys in client-side code. API keys should only be used on your backend servers.
Don’t expose in browser
Use a backend proxy instead

Key Management

  1. Rotate Keys Regularly: Generate new API keys periodically
  2. Monitor Usage: Check your dashboard for unusual activity
  3. Restrict Access: Use separate keys for different environments
  4. Secure Storage: Store keys in secure environment variables or key management systems

Development Environments

Use different API keys for different environments:

Authentication Errors

401 Unauthorized

Common causes:
  • Missing X-API-Key header
  • Invalid API key format
  • Expired or revoked API key

403 Forbidden

Common causes:
  • Plan doesn’t support the requested feature
  • Account suspended or payment overdue

402 Payment Required

Common causes:
  • Plan expired
  • Payment method failed
  • Usage exceeded plan limits

Testing Authentication

Use the health check endpoint to test your authentication:
Success response:

Plan-Based Access

Different plans have different capabilities:
Check your current plan and usage in the API Dashboard.

Next Steps

Make Requests

Learn about request structure and parameters

Handle Errors

Implement proper error handling and retries

Rate Limits

Understand rate limiting and optimization

Upgrade Plan

Increase your rate limits and access WebSocket