Errors
All API errors follow a consistent JSON format.
Error Format
json
{
"error": "error_code",
"message": "Human readable description",
"details": {}
}
| Field | Type | Description |
|---|---|---|
error |
string | Machine-readable error code |
message |
string | Human-readable description |
details |
object | Optional additional context |
Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
invalid_api_key |
401 | Bad or missing API key |
credits_exhausted |
402 | No credits remaining |
not_configured |
400 | Brand/product not set up yet |
rate_limit_exceeded |
429 | Too many requests |
job_not_found |
404 | Invalid job_id |
generation_failed |
500 | Pipeline error (credits refunded) |
ga4_not_connected |
400 | Analytics requested but no GA4 configured |
invalid_request |
400 | Malformed request body |
plan_required |
403 | Feature requires a paid plan |
Common Scenarios
401 — Invalid API Key
json
{
"error": "invalid_api_key",
"message": "Bad or missing API key"
}
Fix: Check that your Authorization: Bearer sk_live_... header is correct.
402 — Credits Exhausted
json
{
"error": "credits_exhausted",
"message": "No credits remaining",
"credits_remaining": 0,
"upgrade_url": "https://blogaizer.com/dashboard"
}
Fix: Subscribe to a plan or wait for your billing period to reset.
400 — Not Configured
json
{
"error": "not_configured",
"message": "Brand not configured. Call POST /v1/config/brand first."
}
Fix: Configure your brand before generating content.
500 — Generation Failed
json
{
"error": "generation_failed",
"message": "Article generation pipeline failed at step: research",
"details": { "step": "research", "credits_refunded": 1 }
}
Credits are automatically refunded when pipeline errors occur. Retry the request.
