VEO Studio by NCPVEO Studio by NCP
← All guidesGuides

Veo 3 API error 429 (RESOURCE_EXHAUSTED): what it means and how to fix it

Updated · By Sajid Ali, founder of Veo Studio

Veo 3 API error 429 (RESOURCE_EXHAUSTED): what it means and how to fix it
Short answer

A 429 from a Veo 3 API means you asked for more than your quota allows right now. Either you sent too many requests in a minute, you have too many videos in progress at once, or a daily or monthly limit is used up. Retry with exponential backoff, never send more jobs at once than your limit, and read the error to see which limit you hit. If the quota itself is too small, ask the provider to raise it or use a plan whose only limit is a known number of parallel generations.

What a 429 actually means

HTTP 429 means "too many requests". Google's APIs send it with the status RESOURCE_EXHAUSTED. Your prompt isn't broken and the service isn't down. The request was fine, but some counter on your account or project was already full.

Fix 1: retry with exponential backoff

Don't retry straight away, and don't retry in a tight loop. That just keeps the counter full. Wait, and make each wait longer than the last one. Google's own 429 page recommends exactly this (it calls it truncated exponential backoff). And if the reply has a Retry-After header, wait exactly that long.

Python: retry a 429, waiting longer each time
import random, time, requests

def post_with_backoff(url, headers, body, tries=6):
    """Send a request; on 429 wait and try again, each wait longer than the last."""
    for attempt in range(tries):
        r = requests.post(url, headers=headers, json=body, timeout=60)
        if r.status_code != 429:
            return r
        # the server may say how long to wait
        wait = float(r.headers.get("Retry-After", 0)) or min(60, 2 ** attempt)
        time.sleep(wait + random.uniform(0, 1))  # a little randomness spreads retries out
    return r

Fix 2: put the jobs in a queue with a fixed number in parallel

Most of the 429s we see in bulk video work come from starting everything at once. Video is slow (one to three minutes a clip), so the jobs pile up. Put your prompts in a queue and let only as many run as your limit allows.

Python: never more than 4 videos in progress
from concurrent.futures import ThreadPoolExecutor

PARALLEL = 4  # never more in progress than your plan allows

def make(prompt):
    return create_and_wait(prompt)  # your "send, poll, download" function

with ThreadPoolExecutor(max_workers=PARALLEL) as pool:
    results = list(pool.map(make, prompts))

Fix 3: read the error to see which limit you hit

A good API tells you which counter was full. The VEO Studio API sends a fixed word in errorCode with every 429, so your code knows what to do next:

When the quota itself is the problem

Say you have backoff and a queue in place, and you still spend the day waiting. Then the quota is smaller than your workload, and no code will fix that. On Google Cloud the Veo models have a fixed quota per project (Google's model page lists 50 requests per minute per model), and to get more you ask for a quota increase. The other way out is a plan that tells you the limit up front. On the VEO Studio API every plan runs 4 generations at the same time, API Unlimited has no monthly count, and you can add more parallel generations in steps of 4.

A job that was accepted and then couldn't be made is not a 429. It ends with the status failed, most often because a safety filter refused the prompt or an image. Change the wording and send it again.

Questions

Why do I get 429 on a paid account?

Paying switches billing on. It doesn't remove quotas. Video models have their own limits per project, and they're often lower than the limits for text models. Check the quota for the video model itself.

How long should I wait after a 429?

As long as the Retry-After header says. If there's no header, start at one or two seconds and double the wait after every failed try, up to about a minute.

Does retrying a 429 cost money?

A refused request makes no video, so you aren't charged for it. A retry that works is a new video. On per-second pricing you pay for it again, and on a flat plan it just counts toward the plan.

How do I avoid 429 errors in n8n?

Send the prompts in batches no bigger than your parallel limit, and wait for each batch to finish before you start the next. The n8n guide shows the loop.

Veo 3 API

A Veo 3.1 API key at one fixed monthly price. 2,000 videos and 2,000 images for USD 35 a month, or unlimited videos and images for USD 100. No per-second billing.

More guides