Skip to contentOceanToken

11 min read

Veo 3.1 Reference Images API Guide

How to send reference images to Veo 3.1 through the API: input_references vs first frame, which tiers take them, two-shot Python script and a consistency test.

By OceanToken Team

Veo 3.1 Reference Images API Guide

Editor's note: Most advice about consistent characters in AI video is prompt folklore. The API side is simpler and more useful: Veo 3.1 has a field for up to three reference images, a separate field for first and last frames, and one tier, Lite, that does not list the reference field at all. Get the fields right first. Prompt craft only helps once the request carries the right images.

Want to run the examples in this article? Get API Key  and call every model below with one key.

Short answer: The Veo 3.1 reference images API is the input_references field on POST /v1/videos: up to 3 images, each {"type": "image_url", "image_url": {"url": ...}}. google/veo-3.1 and google/veo-3.1-fast list it; google/veo-3.1-lite does not. Use references for who or what appears, and frame_images for where a shot starts or ends.

We wrote this against OceanToken because one key there runs all three Veo 3.1 tiers through the same job flow, so moving a reference-image request from Fast to the standard tier changes only the model string, and a request a tier cannot serve is refused with a 400 before anything is charged (docs.oceantoken.ai, checked November 30, 2026).

01 · Veo 3.1 reference images API: the request

A reference-image request is a normal Veo 3.1 video job with one extra array. You send it to POST /v1/videos, poll GET /v1/videos/{video_id} until the job completes, then download the MP4. The array is input_references, and on the two tiers that list it, it holds up to three images.

{
  "model": "google/veo-3.1-fast",
  "prompt": "The woman in the yellow raincoat from the reference images walks into a busy night market, handheld camera following her",
  "duration": 6,
  "resolution": "1080p",
  "aspect_ratio": "16:9",
  "generate_audio": true,
  "seed": 20261130,
  "input_references": [
    {"type": "image_url", "image_url": {"url": "https://example.com/ref-face.png"}},
    {"type": "image_url", "image_url": {"url": "https://example.com/ref-profile.png"}},
    {"type": "image_url", "image_url": {"url": "https://example.com/ref-full-body.png"}}
  ]
}

Each item names its type and carries a URL. The URL can be a public https:// link or a data URL. Our video guide puts two limits on media sent this way: each item up to 25 MB, and the whole request under 10 MB where you can. Three large PNGs as data URLs can pass that second limit quickly, which is the main reason to use links or uploaded assets instead (section 06).

The prompt should name what the references show. A line like "the woman in the yellow raincoat from the reference images" ties the text to the pictures; a prompt that never mentions the subject leaves the model to decide how much the references matter. That is a writing habit rather than a documented rule, so treat it as something to test, not a guarantee.

The other fields are the usual Veo 3.1 set: duration of 4, 6 or 8 seconds (default 6), resolution of 720p, 1080p or 4K, aspect_ratio of 16:9 or 9:16, generate_audio, and seed. Nothing about references changes those menus.

02 · Veo input_references vs first frame: which field does what

input_references tells Veo who or what should appear; frame_images tells it what the first or last image of the clip is. That one distinction answers the Veo input_references vs first frame question in most cases. A first frame is a composition you have already decided on. A reference is an identity you want carried into a composition the model will decide.

Diagram: First frame or reference images on Veo 3.1

The two fields also look different in the request. A frame item adds frame_type, either first_frame or last_frame, and frame_images holds up to two of them. A reference item has no frame type; it is one of up to three images the clip is built from.

You want Field Why
The clip to open on an exact picture frame_images, first_frame The first frame is that image, layout included
The clip to land on an exact picture frame_images, last_frame Same idea at the end; up to 2 frame items
The same person in a new scene input_references Identity carries over, the composition does not
A product to look the same from new angles input_references Several views of one object, up to 3
A smooth cut between two shots frame_images End shot A on an image, start shot B on it
Different framings of one character input_references A first frame would lock each shot's composition

There is a case for both at once: a first frame that sets the scene plus references that hold the character. The Veo references do not say whether one request may carry both fields together. Our guide does say that on Seedance a request carries frames or references, not both, and sending both is refused with 400. Veo may differ, and we have not confirmed either way, so send one request with both and read the answer before you design around it. It is the first item in the test list.

03 · Which Veo 3.1 tiers take reference images

Two of the three tiers list input_references, and the third does not. Here are the three side by side, from each tier's API reference read on November 30, 2026.

Field google/veo-3.1 google/veo-3.1-fast google/veo-3.1-lite
input_references Up to 3 images Up to 3 images Not listed
frame_images Up to 2 (first, last) Up to 2 (first, last) Up to 2 (first, last)
resolution 720p, 1080p, 4K 720p, 1080p, 4K 720p, 1080p
duration 4, 6, 8 s 4, 6, 8 s 4, 6, 8 s
aspect_ratio 16:9, 9:16 16:9, 9:16 16:9, 9:16
generate_audio Listed Listed Listed
seed Listed Listed Listed

For reference work, the practical choice is between the standard tier and Fast, and the reference rows are identical: same field, same limit of three. Choosing between them for quality and cost is a separate question that our Veo 3.1 Fast vs Standard for 1080p comparison covers. We would build and debug the reference setup on Fast, because you will run it many times while you tune the images and prompt, and then decide per project whether the final shots move to the standard tier.

04 · Veo 3.1 Lite reference images: what to expect

Veo 3.1 Lite lists no input_references field, so plan for Lite reference images to be refused rather than used. The Lite reference lists the same frame_images field as the other two tiers, which means a first or last frame is the closest thing Lite offers to steering by image.

What happens if you send references anyway? Our video guide states the general rule: a reference the model cannot use is refused with 400, never dropped without telling you. That is the behavior we would expect on Lite, but we have not sent the request ourselves, so it is a test item, not a promise. The useful part of the rule is that a refused request costs nothing and returns a message, so a router can catch it and retry on Fast.

If your pipeline uses Lite for drafts and Fast for finals, keep in mind that a Lite draft built from a first frame and a Fast final built from references are not the same experiment. The draft tells you about pacing and camera, not about whether the character holds. Lite also lists no 4K, which matters only if the final is 4K.

05 · Veo 3.1 consistent character API: a method for several shots

There is no single "consistent character" switch in the Veo 3.1 consistent character API; consistency comes from holding three things fixed across shots and changing only what each shot is about. This is the method we would use, written as a procedure because we have not measured how well it holds on our side.

First, fix the reference set. Pick three images that between them show the subject clearly: for a person, a front view of the face, a profile and a full-body shot in the costume; for a product, three angles with the logo visible in at least one. Use the same three images, in the same order, for every shot in the sequence. Swapping one image mid-sequence is the easiest way to get a slightly different person.

Second, fix the seed. Veo 3.1's reference says the same seed, prompt and settings give a similar clip, and that -1 or no seed is random. Across shots the prompt changes, so a seed will not make clips identical, but holding it constant removes one source of variation. Read x-oceantoken-dropped-params on every create call: where a seed is not available, it is ignored and named there, and you want to know which shots ran without it.

Third, change only action and camera in the prompt. Keep the subject description word for word ("the woman in the yellow raincoat from the reference images") and vary the part after it: where she walks, what the camera does. If wardrobe or lighting words drift between prompts, the model has permission to drift too. Our camera movement prompt glossary helps with that varying part, and if the shots need lines spoken on camera, the native audio dialogue prompts guide covers how to write them.

For a sequence that must flow from one shot into the next, add frames on top: end shot A, save its last image, and send it as shot B's first frame if the test in section 02 shows Veo accepts frames and references together. If it does not, you will have to choose per shot between continuity (frames) and identity (references). For one longer continuous scene rather than separate shots, our guide to extending Veo 3.1 clips into longer scenes is the better starting point.

06 · Python: three references, two shots, one script

The script below uploads three reference images once, then makes two shots with the same references and seed and different camera directions, polls both jobs, and saves the MP4s. It is a starting point for the test in the next section, not a measured recipe.

import os, time, uuid, requests

BASE = "https://api.oceantoken.ai/v1"
H = {"Authorization": f"Bearer {os.environ['OCEANTOKEN_API_KEY']}"}
MODEL = "google/veo-3.1-fast"
SEED = 20261130
SUBJECT = "The woman in the yellow raincoat from the reference images"

# 1. Upload the three references once (JPEG, PNG or WebP, up to 30 MB each)
refs = []
for path in ["ref-face.png", "ref-profile.png", "ref-full-body.png"]:
    with open(path, "rb") as f:
        r = requests.post(f"{BASE}/assets", headers=H,
                          files={"file": f}, data={"name": path})
    r.raise_for_status()
    refs.append({"type": "image_url", "image_url": {"url": r.json()["id"]}})

# 2. Same references and seed; only action and camera change
SHOTS = {
    "shot1-wide": f"{SUBJECT} walks into a busy night market, wide shot, slow dolly forward",
    "shot2-close": f"{SUBJECT} stops at a noodle stall and smiles, close-up, static camera",
}

jobs = {}
for name, prompt in SHOTS.items():
    r = requests.post(f"{BASE}/videos",
                      headers={**H, "Idempotency-Key": str(uuid.uuid4())},
                      json={"model": MODEL, "prompt": prompt, "duration": 6,
                            "resolution": "1080p", "aspect_ratio": "16:9",
                            "seed": SEED, "input_references": refs})
    if not r.ok:
        print(name, r.status_code, r.text[:300]); continue
    print(name, "dropped:", r.headers.get("x-oceantoken-dropped-params"))
    jobs[name] = r.json()["id"]

# 3. Poll every 15 seconds, then download
while jobs:
    for name, vid in list(jobs.items()):
        job = requests.get(f"{BASE}/videos/{vid}", headers=H).json()
        if job["status"] in ("queued", "in_progress"):
            continue
        if job["status"] == "completed":
            mp4 = requests.get(f"{BASE}/videos/{vid}/content", headers=H)
            open(f"{name}.mp4", "wb").write(mp4.content)
            print(name, "saved")
        else:
            print(name, job["status"], job.get("error"))
        del jobs[name]
    time.sleep(15)

A few choices in that script are deliberate. Uploading to /v1/assets keeps the create request small and lets you reuse the same three images across many shots; the docs say an asset id, or its asset:// reference, goes wherever a request takes a link to a file. They name fields such as first_frame as examples, so confirm once that input_references accepts an id on Veo; if it does not, swap in public URLs.

Uploaded assets are kept until you delete them, and storing and using them is not billed, though an upload, like a model request, needs a balance above zero. The Idempotency-Key means a retried create call after a network timeout returns the existing job instead of charging a second one. Our video API reference assets guide covers asset reuse across models in more depth.

How to test this on your workload

We have not generated reference-image clips for this article, so none are shown. These are the tests we would run, in order.

  1. Frames and references together. Send one Veo 3.1 Fast request with a first_frame and three references. Note whether it is accepted or refused with 400.
  2. Lite with references. Send the same references to google/veo-3.1-lite and keep the response, so your router knows what to catch.
  3. A fourth image. Send four references to Fast and confirm the 400 message names the limit.
  4. Asset ids in references. Send an uploaded asset id inside input_references and confirm the job completes.
  5. Three shots, one reference set. Run the script with a third shot. For each clip, write down whether the face, the costume and any logo match the references.
  6. Seed on and off. Rerun one shot with the seed removed and compare it with the seeded version; check x-oceantoken-dropped-params each time.
  7. Fast against standard. Rerun the best shot on google/veo-3.1 and judge whether the identity holds up well enough to justify the standard tier.
  8. Time and charge. Note render time per shot and check each charge in the console's Logs.

Our take: Treat references as the identity layer and frames as the composition layer, and keep the reference set and seed fixed for a whole sequence. Build on Veo 3.1 Fast, route Lite away from reference work, and confirm the frames-plus-references question in your own account before you design a sequence around it.

Running it on OceanToken

The base URL is https://api.oceantoken.ai/v1, video jobs go to POST /v1/videos, and the model ids are google/veo-3.1, google/veo-3.1-fast and google/veo-3.1-lite. What helps for reference work, from our docs as of November 30, 2026:

  • One key for all three tiers. The same request body moves between Fast and the standard tier by changing model, and the OpenAI SDKs work with the base URL changed.
  • Refusals before charges. Too many references, or a reference a tier cannot use, is refused with 400 before anything runs, and a failed job is not charged.
  • A reusable asset library. Upload a reference once to /v1/assets and name it by id in later requests.
  • Prepaid, no subscription. One balance covers video, text, image and speech models.

Veo 3.1 is billed per second of video by resolution, counted in video tokens. Price: see the current rate on /veo-api and on the Veo 3.1, Veo 3.1 Fast and Veo 3.1 Lite model pages. The video models page lists the other video models on the same key.

FAQ

How many reference images does Veo 3.1 take? Up to 3 on google/veo-3.1 and google/veo-3.1-fast, in input_references. More than that is refused with 400.

Does Veo 3.1 Lite take reference images? Its API reference lists no input_references. Use a first or last frame on Lite, or move reference work to Fast.

What is the difference between a reference image and a first frame? A first frame becomes the opening picture of the clip, layout included. A reference image tells the model who or what to show, in a composition it chooses.

Can I send a first frame and reference images in one request? The Veo references do not say. Send one test request and read the answer before you rely on it.

Does a fixed seed make every shot the same? No. The same seed, prompt and settings give a similar clip, but across shots the prompt changes, so the seed only removes one source of variation.

Can I upload reference images once and reuse them? Yes. Upload to /v1/assets (JPEG, PNG or WebP up to 30 MB) and use the returned id; confirm once that input_references accepts it.

Sources

  1. docs.oceantoken.ai: Veo 3.1 API reference  (checked 2026-11-30)
  2. docs.oceantoken.ai: Veo 3.1 Fast API reference  (checked 2026-11-30)
  3. docs.oceantoken.ai: Veo 3.1 Lite API reference  (checked 2026-11-30)
  4. docs.oceantoken.ai: Video guide  (checked 2026-11-30)
  5. docs.oceantoken.ai: API overview and Assets  (checked 2026-11-30)

Get your OceanToken API key

  1. Create an OceanToken account and an API key.
  2. Copy the snippet below, paste your key, and run it.
  3. Check the current rate on /veo-api.
curl https://api.oceantoken.ai/v1/videos \
  -H "Authorization: Bearer $OCEANTOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"model": "google/veo-3.1-fast", "prompt": "The woman from the reference image walks into a night market", "duration": 6, "resolution": "720p", "aspect_ratio": "16:9", "input_references": [{"type": "image_url", "image_url": {"url": "https://example.com/ref-face.png"}}]}'

Get API Key 

  • Veo
  • AI video
  • Tutorial
  1. 12 min read

    LLM Function Calling API Across Models

    Write one LLM function calling API loop that works across GPT, Claude, Gemini, Qwen, GLM and DeepSeek: tool_choice, streaming and the silent no-call trap.

    • LLM API
    • Tutorial
  2. 10 min read

    LLM Image Input API: Screenshots and Scans

    Send screenshots, photos and scans to a chat model with one LLM image input API: URL vs base64 data URL, per-model image limits, the 400 error and token costs.

    • LLM API
    • Tutorial
  3. 16 min read

    AI Voiceover API for Generated Video

    Add narration to AI video with an AI voiceover API: write the script with a chat model, voice it with a speech model, and merge it onto a silent Seedance clip.

    • MiniMax
    • AI video