BEFOREAI / DEVELOPER DOCUMENTATIONGood experiences start with good foundations.
Resources / Errors & troubleshooting

A thoughtful recovery.

Handle rejected requests, failed generations, and interrupted connections without losing the customer’s place.

Read the HTTP status and body

These integration examples use errors in a detail object with message and error fields. Check the HTTP status, preserve the error code for recovery, and fall back to a general message when the body is missing or not JSON.

Illustrative structured error
{
  "detail": {
    "error": "access_denied",
    "message": "This operation is not enabled for your account."
  }
}

Preserve a machine-readable code when provided, but show a concise message in your interface. Do not render raw upstream errors or credentials to customers.

Common error cases

FieldTypeUsage
402Insufficient creditsCheck the account balance and arrange additional credits before submitting again.
403 / access_deniedTier or permission restrictionConfirm that your account is enabled for the operation.
422Validation failureCheck the request schema, garment vocabulary, and garment hint shape.
Non-JSON / network failureConnection or upstream failureKeep local state and inspect backend diagnostics before deciding whether to retry.

A failed job is a separate outcome

A successful HTTP status request can still report a job whose status is failed. Check the job state, display a recovery action, and stop polling terminal jobs. A queued or processing job is pending, not an error.

Retry with care

Generation and styling submissions can consume credits. If a connection drops after submission, the request may have been accepted even if your app did not receive a response. Do not blindly replay POST requests. No idempotency-key guarantee is documented here.

For a known generation ID, retry the read-only status request with a bounded backoff. Preserve the ID so your app can resume tracking. Confirm rate limits and timeout expectations for your account during onboarding.

Give support the useful details

Include the endpoint, HTTP status, error code, approximate request time, and generation ID if available. Remove API keys, customer photos, and signed URLs before sharing logs.

Contact the team for account permissions, credits, or an unresolved generation.