Failed AI Generation Charged? How Holds and Charges Work
Is a failed AI generation charged? Not here: the price is held, charged only on success and released on failure. Partial batches, refusals and retries too.
Updated 6 min read
Is a failed AI generation charged? On Frameport, no: the price is held on your balance when a job starts, charged only when it succeeds, and given back in full when it fails or times out. A request refused before it starts holds nothing at all, and in a batch of images you pay only for the images delivered.
This page follows the money through each step of a job, for every model in the catalog, from Seedance 2.5 clips to Nano Banana Pro images and Frameport Replace 1 face swaps. It ends with the habits that keep a script from paying for work it never got, here or anywhere else.
Is a failed AI generation charged? The money step by step
Every request that starts work goes through the same steps. Your balance has two parts: available_usd, what new requests can use, and held_usd, what running jobs have set aside.
| Step | What your balance does | What the API shows |
|---|---|---|
| You submit | The price moves from available to held | 202 Accepted with reserved_usd |
| The job succeeds | The hold becomes the charge | status: "succeeded" and cost_usd |
| The job fails or times out | The hold goes back to available | status: "failed" and cost_usd: 0 |
| The request is refused before it starts | Nothing moves | An error whose message ends "Nothing was charged." |
The price held is the price quoted. POST /v1/generations/quote answers with the same number before you send anything, so a 5-second Seedance 2.5 clip at 720p holds $1.35, and that is what a success costs. A generation settles exactly once, so two reads racing each other can never charge it twice. Pricing explains the balance, and GET /v1/balance shows its parts at any time (account and balance).
If your balance looks lower than you expect, look at held_usd first: a job that is still running keeps its price there until it settles, then the money either becomes a charge or comes back.
To see that price before you submit, the AI video cost calculator guide walks through the quote endpoint.
Failures after a job starts
Once a request is accepted, a failure shows on the generation, not as an HTTP error. The generation moves to status: "failed", error says why, the hold is released, and cost_usd is 0. The codes you can meet there:
generation_failed: the model could not render the request.timeout: the job took too long and was cancelled.content_policy: the model refused the request after it started.invalid_input: an input picture could not be used.
Each of their messages ends with "Nothing was charged." This is a failed Seedance 2.5 clip as GET /v1/videos/generations/{id} returns it:
{
"id": "gen_9sLq2VbX7mN4kR1tYc8WpE",
"object": "generation",
"type": "video",
"model": "seedance-2-5",
"status": "failed",
"input": {
"prompt": "A red vintage car winds along a coastal road at sunrise, drone follow shot",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"audio": true,
"reference_images": 0,
"end_image": false
},
"reserved_usd": 1.35,
"cost_usd": 0,
"outputs": [{
"id": "file_2Tn7XcQ9vLm4Ra8Ws1KbZd",
"status": "failed",
"error": { "code": "generation_failed", "message": "The generation failed. Nothing was charged." }
}],
"error": { "code": "generation_failed", "message": "The generation failed. Nothing was charged." },
"created_at": "2026-11-28T10:00:00.000Z",
"completed_at": "2026-11-28T10:01:12.000Z"
}reserved_usd still shows what was held, for your records; cost_usd is what you paid. Two cases end the same way without any action from you. A job still open hours after it started is given up: its open outputs fail with timeout and cost nothing. A request cut off before its job could start has its hold released within minutes. A webhook on generation.failed tells your code as soon as a job ends this way.
Partial batches: only the images delivered
An image request can ask for up to 4 images with n, and each image settles on its own. If three succeed and one fails, three are charged and the fourth is released. The generation reads succeeded as soon as one image is delivered, so read each output's status to find the one that failed:
{
"id": "gen_4kQ8vT2nLm9Xr7Wd1sYcPa",
"object": "generation",
"type": "image",
"model": "nano-banana-pro",
"status": "succeeded",
"reserved_usd": 0.64,
"cost_usd": 0.48,
"outputs": [
{ "id": "file_8Hc2RkQw5ZpT1mVb7nXe3L", "status": "succeeded", "cost_usd": 0.16 },
{ "id": "file_2Tn7XcQ9vLm4Ra8Ws1KbZd", "status": "succeeded", "cost_usd": 0.16 },
{ "id": "file_3Vb8KqW2nTx7Lc5Rm1YdPs", "status": "succeeded", "cost_usd": 0.16 },
{ "id": "file_6Pq3WnT8vXc1Lm5Rk9YbZs", "status": "failed", "error": { "code": "generation_failed", "message": "The generation failed. Nothing was charged." } }
],
"error": null
}| Nano Banana Pro, four images asked | You pay |
|---|---|
| All four delivered | $0.64 |
| Three delivered, one failed | $0.48 |
| None delivered | Nothing |
A video has one output, so a clip is paid in full or not at all. A clip edit is billed on the clip you send: Frameport Replace 1 first holds the price of the longest clip it takes, then brings the hold down to your clip's length once it is measured. A 6-second clip at 768p ends up holding $0.72, and a failed edit costs nothing (clip edit prices).
Refusals before anything is held
Most problems are caught before a job exists. These answers come back at once, and nothing stays held:
| Status | Code | Why |
|---|---|---|
| 400 | invalid_request | A field is off the model's options; the message lists what it takes |
| 400 | content_filtered | Your workspace's content filter blocked the prompt |
| 400 | content_policy | The model or the acceptable use policy refused the request |
| 400 | invalid_input | An input picture could not be used |
| 400 | max_cost_exceeded | The price is above the request's max_cost_usd |
| 402 | insufficient_balance | The balance does not cover the hold |
| 429 | rate_limited or concurrency_limit | Past the workspace's limits: wait for Retry-After |
| 503 | model_unavailable | The model is down for now |
If a model refuses a request as its job starts, the hold is released before the answer reaches you. The errors reference lists every code, and why a prompt gets refused explains the refusals about content in detail.
Retries that never pay twice
The one way a careless script can pay twice is by sending the same request twice: after a timeout, it cannot tell whether the first one landed. An Idempotency-Key header settles it. The first request with a key runs; the same key with the same body returns that generation for 24 hours instead of starting another, answering 200 with Idempotent-Replayed: true.
import os
import time
import uuid
import requests
API = "https://frameport.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}
body = {
"model": "seedance-2-5",
"prompt": "A paper lantern drifts over a dark lake at night, slow push-in",
"duration": 5,
"resolution": "720p",
}
key = str(uuid.uuid4()) # keep it with your own job record
res = None
for attempt in range(5):
try:
res = requests.post(
f"{API}/videos/generations",
headers={**HEADERS, "Idempotency-Key": key},
json=body,
timeout=30,
)
except requests.exceptions.Timeout:
continue # same key, same body: never a second clip
if res.status_code == 409 and res.json()["error"]["code"] == "request_in_progress":
time.sleep(int(res.headers.get("Retry-After", "2")))
continue
break
if res is None:
raise SystemExit("no answer after five tries")
gen = res.json()
print(res.status_code, gen.get("id"), "replayed:", res.headers.get("Idempotent-Replayed"))A request refused with 400, 402 or 429 frees its key, since nothing was held: fix it and send it again with the same key. A generation that failed is closed for good; submit it again as a new request, with a new key. The first try cost nothing. Idempotency covers the edge cases, and generations shows how to list what a key has run.
Habits that keep failed jobs from costing you
These hold on any service, and on Frameport each one has a field or an endpoint:
- Know the price first. Quote the request (
POST /v1/generations/quote), and addmax_cost_usdto requests built from user input (quotes and spending caps). - Make every submit idempotent, so a timeout never turns into a second job.
- Take webhooks rather than polling jobs you may forget:
generation.failedarrives with the reason. - Read every output of a batch, not only the generation's status.
- Keep the
request_idof any error, and the generation's id, for support.
If another platform charged you for a job that never delivered, gather the job's id, its time and its final status, ask that platform's support, and check their current terms on failed jobs: each service sets its own. The Python guide to the video API shows the whole loop here, from quote to download. What each failure code means, and which ones are worth a retry, is in AI video API error codes.
FAQ
Do AI image generators charge for failed generations?
It depends on the service. On Frameport, no: a failed image or clip costs nothing, and a batch is charged only for the images delivered.
Why was I charged for a failed generation?
On Frameport you are not: a failed job's hold goes back to your balance and its cost_usd is 0. If your balance looks lower, a job may still be running, and its price stays in held_usd until it settles.
How do I get a refund for a failed AI generation?
Here there is nothing to refund, because a failed job is never charged: its hold is released the moment it fails. On another service, contact its support with the job's id and check their current terms.
Does a refused prompt cost anything?
No. A prompt your workspace's content filter blocks answers 400 content_filtered before anything is held, and a request a model refuses answers 400 content_policy, also without a charge. A job refused after it started fails and costs nothing too.
What happens when a video generation times out?
It fails with the code timeout and its hold is released, so you pay nothing. Submit it again when you are ready.
Can a retry charge me twice?
Not if you send an Idempotency-Key. The same key with the same body returns the first generation for 24 hours instead of starting, and charging, a second one.