PixMatteAPI

API reference

Errors & rate limits

Errors return a JSON body with a stable code and a sentence a human can act on. Failed requests are not charged.

Error format

Every non-2xx response has Content-Type: application/json and an errors array. Branch on code; show title and detail to people.

Example error
HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "errors": [
    {
      "code": "insufficient_credits",
      "title": "Not enough credits",
      "detail": "This request needs 1 credit. Your balance is 0."
    }
  ]
}

Error codes

StatusCodeWhat happenedWhat to do
400invalid_parametersA parameter is missing, unknown, or has an invalid value.Check detail for the field name and fix the request.
400multiple_sourcesMore than one of image_file, image_url, image_file_b64 was sent.Send exactly one image source.
401missing_api_keyNo X-Api-Key header.Add the header.
401invalid_api_keyKey is malformed, revoked, or unknown.Check the key or create a new one.
402insufficient_creditsYour balance can’t cover the request.Buy credits or change plan, then retry.
403key_not_permittedKey isn’t allowed for this operation.Use a live key or adjust key permissions.
413file_too_largeUpload exceeds 12 MB.Resize or recompress, then retry.
415unsupported_formatNot a JPG, PNG, or WebP.Convert the image first.
422no_subject_foundWe couldn’t find a clear foreground subject.Try a photo with a distinct subject; not charged.
422image_url_unreachableimage_url failed or timed out.Check the URL is public HTTPS, or upload the file.
429rate_limitedToo many requests for this key.Wait for Retry-After seconds, then retry.
500internal_errorSomething failed on our side.Retry with backoff; include X-Request-Id if it persists.
503temporarily_unavailableCapacity or maintenance.Retry with backoff; check Status.

Rate limits

Limits apply per API key, measured in images per minute. When you exceed one you receive 429 with a Retry-After header in seconds.

PlanImages / minute
Pay-as-you-goTBD
GrowthTBD
ScaleTBD
EnterpriseCustom

Retrying safely

  • Retry 429, 500, 503, and 504 with exponential backoff and jitter.
  • Don't retry 4xx errors other than 429 — the same request will fail again.
  • Failed requests aren't charged, so retries never double-bill a single successful result.