Every model has a credit price: images cost a flat amount per image, video and audio cost per second. The exact amount is shown before you generate, and the Pricing page lists every model.
Credits are set aside when you start something. If it fails, or you cancel it before it starts, the credits come back automatically. For work with many steps (films, ads, workflows) only the steps that did not finish are returned.
Your ledger on the Credits page shows every charge and refund.