LogoPatentFig AI Docs
LogoPatentFig AI Docs
Homepage

Getting Started

Quick StartAuthentication

Endpoints

Generate FiguresVectorizeEnhanceConvertCredits

Reference

Use with AI AgentsErrorsChangelog
X (Twitter)

Errors

Error format, codes, and retry guidance

All errors share one envelope:

{
  "success": false,
  "error": { "code": "INSUFFICIENT_CREDITS", "message": "…" }
}

Error codes

HTTPCodeMeaningRetry?
400INVALID_INPUTMissing or invalid parameter; the message names the fieldNo — fix the request
400INVALID_IDEMPOTENCY_KEYIdempotency-Key is not 1–255 permitted charactersNo — send a valid key or omit the optional header
401UNAUTHORIZEDMissing, invalid, or revoked API keyNo — check the key
402INSUFFICIENT_CREDITSBalance too low for this callAfter topping up
409REQUEST_IN_PROGRESSThe same idempotency key is still being processedYes — wait briefly, then retry the identical request with the same key
409IDEMPOTENCY_CONFLICTThe key was already used for a different requestNo — use a new key for the new request
422FETCH_FAILEDimageUrl could not be fetched or returned an errorCheck the URL is public
429RATE_LIMITEDOver 60 requests/minute on this keyYes — back off and retry
500GENERATION_FAILEDModel or processing failureYes — safe to retry once
500INTERNAL_ERRORUnexpected server errorYes — safe to retry once

Retry guidance

  • Credits are only charged on success, so retrying a failed call never double-bills.
  • For a timeout on a paid POST, reuse the same Idempotency-Key (not a new key) for the identical request. The key is retained for 24 hours.
  • For 429, wait for the window to reset (up to 60 s) — an exponential backoff starting at 5 s works well.
  • For 500, one retry is reasonable; persistent failures usually indicate an input the model cannot process (e.g. a photo sent to a line-art pipeline). If a request keeps failing, contact contact@patentfig.ai with the request payload.

Table of Contents

Error codes
Retry guidance