LogoMkSaaS Docs
LogoMkSaaS Docs
Homepage

Getting started

Welcome to rlay.aiQuickstartMigrate from fal.ai

Endpoints

Generate imagesGenerate videosError codes
X (Twitter)

Error codes

401 / 402 / 400 / 429 / 5xx — what they mean and how to fix

All errors come back as JSON with a stable shape:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Account has 12 credits, requested job needs 50",
    "type": "billing"
  }
}

HTTP status table

StatusMeaningWhat to do
400Bad request — invalid model id or missing parameterCheck error.message, fix payload
401Missing or invalid Authorization headerVerify the rlay_sk_... token, regenerate if leaked
402Insufficient creditsTop up at /dashboard/billing
403Key revoked or account suspendedContact support
404Job not found, or wrong account ownershipConfirm jobId belongs to this key
429Rate limit exceededBack off — see header Retry-After
5xxUpstream provider error or routing failureRetry with exponential backoff; we auto-failover internally

Error codes you'll actually see

Best practices

  • Always inspect error.code programmatically — error.message may change.
  • Treat 5xx as retryable, 4xx as not (except 429).
  • For async jobs, a failed status comes back via GET /v1/jobs/{id} — you won't get an HTTP 5xx for that path.
Quickstart→

Back to basics

Generate videos→

Async pattern reference

Table of Contents

HTTP status table
Error codes you'll actually see
Best practices