API

Errors

Stable codes you can switch on.

Every error uses the same shape. Branch on code, never on message.

json
{ "code": "INSUFFICIENT_CREDITS", "message": "Top up the account balance and retry.", "status": 402 }

Auth and routing

CodeHTTPMeaning
MISSING_API_KEY401No x-api-key header
INVALID_API_KEY401Unknown or rotated-out key
FORBIDDEN403Key lacks access to the resource
ROUTE_NOT_FOUND404

Input

CodeHTTPMeaning
VALIDATION_FAILED400Carries details
FILE_TOO_LARGE413Over 10 MB
UNSUPPORTED_IMAGE_TYPE400Not JPEG, PNG, WebP or HEIC
CUSTOMER_IMAGE_REQUIRED400No person.image.source
PRODUCT_IMAGE_FETCH_FAILED400Product image URL unreachable
PRODUCT_NOT_FOUND404Reference call for an expired product — fall back to inline upsert

Moderation

These run before any inference spend and consume no credit.

CodeHTTPMeaning
NO_PERSON_DETECTED422No person found in the photo
MULTIPLE_PERSONS422More than one person
UNSUITABLE_POSE422Framing or angle unusable
IMAGE_QUALITY_TOO_LOW422Blur or resolution below threshold
CONTENT_POLICY422Input failed moderation. Message is deliberately generic

Capacity and billing

CodeHTTPMeaning
INSUFFICIENT_CREDITS402Top up and retry
QUOTA_EXCEEDED402Allowance exhausted
RATE_LIMITED429Retryable — back off
PROVIDER_UNAVAILABLE503No model cleared the quality gate. Retryable
QUALITY_CHECK_FAILED502Output failed validation on every candidate
GENERATION_TIMEOUT504Did not terminate in time

Failed generations are never billed. A credit is settled only when a generation reaches

COMPLETED.