Authentication

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

API Keys

Each account receives two keys on registration:

Key Type Prefix Purpose
Live sk_live_ Production use, charges credits
Test sk_test_ Development, free, limited, responses marked as test

Making Authenticated Requests

Include your API key in the Authorization header:

bash
curl https://blogaizer.com/api/v1/account/usage \
  -H "Authorization: Bearer sk_live_your_key_here"
python
import requests

headers = {"Authorization": "Bearer sk_live_your_key_here"}
response = requests.get("https://blogaizer.com/api/v1/account/usage", headers=headers)
javascript
const response = await fetch("https://blogaizer.com/api/v1/account/usage", {
  headers: { "Authorization": "Bearer sk_live_your_key_here" }
});

Test vs Live Keys

Test keys (sk_test_):

  • Free to use, no credit charges
  • Rate limited to 5 requests/minute
  • Responses include "test": true flag
  • Article generation returns sample content
  • Use during development and testing

Live keys (sk_live_):

  • Charges credits per operation
  • Full rate limits based on plan
  • Real AI-generated content
  • Use in production

Security Best Practices

  • Never expose API keys in client-side code or public repositories
  • Use environment variables to store keys
  • Rotate keys periodically via the dashboard
  • Use test keys during development
  • Each key is scoped to a single account