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.

Every v1 error code, whether it is retryable, and what it means
CodeRetryWhat it means
api_key_requiredNoNo key was sent. Send it in the X-API-Key header or as Authorization: Bearer.
invalid_api_keyNoThe key does not match any key. Check it, or create a new one in the dashboard.
api_key_inactiveNoThe key was deactivated. Create a new key in the dashboard.
api_key_expiredNoThe key is past its expiry date. Create a new key.
subscription_inactiveNoThe team subscription is not active. Renew it, then the key works again.
plan_without_api_accessNoThe current plan does not include API access. Upgrade the plan.
plan_not_eligibleNoThis endpoint needs a plan that includes it (Starter, Pro, or Lifetime Founder for async, batch, and upscale).
team_not_foundNoThe key belongs to a team that no longer exists.
quota_exceededNoThe monthly quota is used up. Read resetsAt from /api/v1/usage-stats. Retrying does not help before then.
rate_limitedYesToo many requests in the last minute. Wait Retry-After seconds, then retry.
validation_unavailableYesKey validation is temporarily unavailable. Retry after Retry-After seconds.
service_unavailableYesThe service is degraded. Retry after Retry-After seconds.
invalid_jsonNoThe request body is not valid JSON.
request_too_largeNoThe body is over 4 MB. Use a smaller or compressed image.
invalid_requestNoA required field is missing or has the wrong value. See the message.
invalid_texture_typesNotextureTypes contains a value that is not normal, metallic, roughness, ao, or height. validTypes lists the allowed values.
invalid_imageNoThe image could not be decoded or fetched. Send a valid PNG, JPG, or WebP.
image_too_largeNoThe decoded image is over 50 MB.
insufficient_quotaNoThe request needs more quota units than remain. Reduce the batch or wait for resetsAt.
job_not_foundNoNo job with this id for your team. Jobs expire 24 hours after creation.
idempotency_conflictNoThis Idempotency-Key was used with a different request body. Use a new key for a new request.
idempotency_in_progressYesThe first request with this Idempotency-Key is still running. Retry after Retry-After seconds.
idempotency_replay_unavailableNoThe original request succeeded, but its response was too large to replay. Check usage before using a new key.
generation_failedYesTexture generation failed on the server. Retry, and report it if it persists.
internal_errorYesUnexpected server error. Retry with backoff.