PDFCraft
Error reference

invalid_request

HTTP 400 · not billed

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

When you get it

Both html and url were supplied, or neither, or an option is out of range.

The body did not survive validation at the boundary. Most often that is both html and url in one request, or neither — the contract requires exactly one, because a request carrying both has no single correct answer.

How to fix it

Is it billed?

No. A request is billed only when Chromium actually ran. Almost always on the first integration attempt, and almost never afterwards.

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