Billing for AI video renders: quotes, credit ledgers and automatic refunds
I recently shipped Memevibe , an AI body swap tool: you drop in a short clip, add a photo, and it renders the clip again with you as the person in it. Every render costs real GPU time, takes a few minutes, and can fail halfway. That makes billing a more interesting problem than the usual "check subscription, allow request". This post walks through the billing side: how a price is quoted, how…
This report explains the billing system for an AI video rendering tool called Memevibe. The service generates videos with a user swapped into the body of another person using AI technology. Every render costs real GPU time and takes a few minutes to complete, with the possibility of failure or safety checks blocking completion.
The core of the system is a single function called "quote" which calculates the price based on user settings like the rendering tier, video resolution and clip length. The function returns both the tier that will actually render the video, and how many "credits" are required. Clips longer than 15 seconds always use the most expensive Ultra tier. A quote can be requested for any clip length and tier, and the amount is shown on a button before the render starts.
If the rendering process fails or the model blocks the clip due to safety reasons, the credits are automatically refunded. All billing changes are recorded in an append-only ledger instead of simply subtracting credits. When a render job is created, credits are deducted from the user's total at the same time. The job's status moves through a few states - queued, rendering, completed or failed/blocked.
A failed or blocked job automatically generates a refund by adding a positive entry to the ledger for the credits used. This refund process is built into the system, not something that requires support from users. Periodically, the system checks for any jobs stuck in the rendering state that haven't completed by a timeout, and marks them as failed to trigger the refund. This ensures credits are returned without any manual intervention, making the billing process seamless for users without the need for support inquiries.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.