Skip to main content
Developer API requests use the same credit wallet as the Porn Factory AI web generator. Check the current balance before submitting large batches:
The response returns only the balance fields needed to budget requests:
Generation responses include credits.charged. If the wallet cannot cover a request, the API returns 402 insufficient_credits with the required and available amounts when available. Use an idempotency key for every generation. A safe retry with the same key and body returns the existing request instead of creating another charge.

Budget a batch

Read the current balance once before a batch, compare it with the catalog’s credit_estimate, and still handle 402 on submission because another request can use credits in the meantime.
Credits are charged once for an accepted generation. If that generation ends in FAILED, its generation charge is restored. Poll the request or consume its webhook before reconciling a final batch cost.
credit_estimate helps with planning, while credits.charged on the request is the authoritative amount for that generation.