← All updates

Per-page billing on /api/v1/enhance

/api/v1/enhance now bills 1 credit per page on success. The /enhance web UI shows the cost before you submit and links straight to the credit purchase page when your balance is short.

apibillingenhance

POST /api/v1/enhance now bills 1 credit per page on success. Previously every call was free for anyone with a session or API key (rate-limited at 50/hour); the per-page rate flips on so the endpoint covers its OpenRouter spend.

The rate is flat across all three modes — in-place, regenerate, and both. mode: "both" is charged once for the in-place page count, with the regenerate render bundled at no marginal charge.

A few invariants worth calling out:

  • Pre-dispatch gate. The page count is read from the uploaded PDF before the enhance pipeline is dispatched. API-key callers without enough credits receive 402 { error: "Insufficient credits", required, available } and no OpenRouter call is made.
  • Partial paths stay free. mode: "regenerate" partials (returned when at least one page fails to reconstruct) deduct zero credits.
  • Failures don't deduct. A pipeline failure leaves your balance untouched; the deduction only happens on the successful response.
  • Web UI is unbilled. The /enhance page in the web app uses your session, which mirrors how /render treats session callers — only API-key traffic consumes credits.

The /enhance page now shows the cost before you submit (e.g. "this will cost 5 credits") and replaces the submit button with a buy-credits link when your balance is short. x402 wallet callers should keep using authed credits on /enhance for now — fixed-price wallet payments are still available on /md and /render.

This is the bottom of the planned $0.20–$0.50/page band. Calibration follows the competitor pricing snapshot.