PDFCraft
Error reference

payment_required

HTTP 402 · not billed

{ "error": {
    "code": "payment_required",
    "message": "…",
    "docs_url": "https://pdfcraft.dev/errors#payment_required"
} }

When you get it

The last subscription payment failed, so the account is past_due.

The last subscription payment failed, so the account sits in past_due. Work stops; nothing is lost. It is a distinct code from invalid_api_key on purpose — the key is perfectly valid, and telling you it is not would send you looking in exactly the wrong place.

How to fix it

Is it billed?

No. A request is billed only when Chromium actually ran. Usually a card expiry rather than a decline, and usually a fortnight after the card expired — the provider retries for several days before the subscription flips, so the first 402 tends to arrive well after the email did.

Reproducing it

curl -i -X POST https://api.pdfcraft.dev/v1/render \
  -H "Authorization: Bearer $PDFCRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html":"<h1>hi</h1>"}'

The -i matters: Retry-After and X-Renders-Remaining are headers, and a client that only reads the body throws away the two numbers that tell it what to do next.

Every code

HTTPCodeBilled?
400invalid_requestfree
401invalid_api_keyfree
402payment_requiredfree
404not_foundfree
408render_timeoutfree
422render_failedbilled
429rate_limitedfree
429quota_exceededfree
429demo_busyfree
415unsupported_filefree
422extraction_failedfree
500internal_errorfree