API Reference
Error Codes
Complete list of MakePhotos API error codes and their meanings.
Error Codes
All API errors return a consistent JSON format:
{
"error": {
"code": "error_code",
"message": "Human-readable description",
"details": {}
}
}Error code reference
| Code | HTTP Status | Description |
|---|---|---|
missing_api_key | 401 | No API key provided |
invalid_api_key | 401 | API key is invalid or revoked |
no_active_subscription | 403 | No active subscription |
insufficient_credits | 402 | Not enough credits |
invalid_params | 400 | Missing or invalid parameters |
generation_failed | 502 | AI generation failed (credits refunded) |
internal_error | 500 | Unexpected server error |
Error details
Some errors include a details object with additional context:
insufficient_credits
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits. Need 4, have 2.",
"details": {
"monthly_remaining": 0,
"topup_remaining": 2
}
}
}generation_failed
{
"error": {
"code": "generation_failed",
"message": "Generation timed out",
"details": {
"refunded": true
}
}
}When refunded is true, credits that were deducted before the generation attempt have been returned to your account.
HTTP status codes
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad request (invalid parameters) |
| 401 | Unauthorized (invalid or missing API key) |
| 402 | Payment required (insufficient credits) |
| 403 | Forbidden (no active subscription) |
| 500 | Internal server error |
| 502 | Bad gateway (generation failed) |