Menu

Billing AI video by the rendered second (without double-charging when webhooks race)
📰

Billing AI video by the rendered second (without double-charging when webhooks race)

DEV Community: postgres·AI Video·19 days ago
#OzFc2azP
#devtopostgresql#devto#dev#completed#provider
Reading 0:00
15s threshold

At TalkPix you upload a portrait, type a script or upload your own audio, and get back a lip-synced talking video. Users pay with credits, and the price depends on how long the video is.

That sounds simple until you notice that you don't know how long the video is until it exists. A typed script has an estimated length. An uploaded recording can run for minutes. The provider renders asynchronously and tells you it's done through a webhook, which may arrive late, twice, or never.

This is the billing flow we ended up with, and the bugs that shaped it.

Rule 1: nothing renders before it's paid for

The first version had a free short preview. It cost real inference money and, when we measured it, didn't convert.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.