Errors
Error codes and retries
Every v1 error uses one envelope. Branch on error_detail.code and error_detail.retryable, not on the English message, which can change.
Error envelope
The legacy error and message fields stay for existing integrations. The structured part is error_detail.
Response body
{
"error": "Unauthorized",
"message": "Monthly quota exceeded",
"error_detail": {
"code": "quota_exceeded",
"message": "Monthly quota exceeded",
"retryable": false,
"docs_url": "https://genpbr.com/developers/errors#quota_exceeded"
}
}Some errors add fields such as validTypes or remainingQuota. Read them when they are present.
Retries and waiting
Throttled responses (429 and 503) send Retry-After in seconds. Every v1 response also sends RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset and RateLimit-Policy.
Retry only when retryable is true. For generation calls, send an Idempotency-Key header, so a retry of the same request is not billed twice.
All codes
Each row is an anchor, so error_detail.docs_url links straight to it.
| Code | Retry | What it means |
|---|---|---|
api_key_required | No | No key was sent. Send it in the X-API-Key header or as Authorization: Bearer. |
invalid_api_key | No | The key does not match any key. Check it, or create a new one in the dashboard. |
api_key_inactive | No | The key was deactivated. Create a new key in the dashboard. |
api_key_expired | No | The key is past its expiry date. Create a new key. |
subscription_inactive | No | The team subscription is not active. Renew it, then the key works again. |
plan_without_api_access | No | The current plan does not include API access. Upgrade the plan. |
plan_not_eligible | No | This endpoint needs a plan that includes it (Starter, Pro, or Lifetime Founder for async, batch, and upscale). |
team_not_found | No | The key belongs to a team that no longer exists. |
quota_exceeded | No | The monthly quota is used up. Read resetsAt from /api/v1/usage-stats. Retrying does not help before then. |
rate_limited | Yes | Too many requests in the last minute. Wait Retry-After seconds, then retry. |
validation_unavailable | Yes | Key validation is temporarily unavailable. Retry after Retry-After seconds. |
service_unavailable | Yes | The service is degraded. Retry after Retry-After seconds. |
invalid_json | No | The request body is not valid JSON. |
request_too_large | No | The body is over 4 MB. Use a smaller or compressed image. |
invalid_request | No | A required field is missing or has the wrong value. See the message. |
invalid_texture_types | No | textureTypes contains a value that is not normal, metallic, roughness, ao, or height. validTypes lists the allowed values. |
invalid_image | No | The image could not be decoded or fetched. Send a valid PNG, JPG, or WebP. |
image_too_large | No | The decoded image is over 50 MB. |
insufficient_quota | No | The request needs more quota units than remain. Reduce the batch or wait for resetsAt. |
job_not_found | No | No job with this id for your team. Jobs expire 24 hours after creation. |
idempotency_conflict | No | This Idempotency-Key was used with a different request body. Use a new key for a new request. |
idempotency_in_progress | Yes | The first request with this Idempotency-Key is still running. Retry after Retry-After seconds. |
idempotency_replay_unavailable | No | The original request succeeded, but its response was too large to replay. Check usage before using a new key. |
generation_failed | Yes | Texture generation failed on the server. Retry, and report it if it persists. |
internal_error | Yes | Unexpected server error. Retry with backoff. |