Do I lose credits if a generation fails?

Credits are reserved when a task starts. If the image or video fails, times out or is rejected by the model, the reserved credits go back to your balance automatically, and the refund appears in your credit history. If you cancel a video before it finishes, those credits are returned as well.