Source: https://www.tokenify.dev/docs/video/veo/

# Video, the Gemini Veo way

Their predictLongRunning endpoint and the operation it returns, served here. Change the base URL and keep your request.

## The one line

```bash
# before
https://generativelanguage.googleapis.com

# after
https://api.tokenify.dev
```

Your key goes in the header their client already sends — `x-goog-api-key: tk-live-…` — and `Authorization: Bearer tk-live-…` works too.

```bash
curl -s "https://api.tokenify.dev/v1beta/models/bytedance/seedance-2.0-mini:predictLongRunning" \
  -H "x-goog-api-key: $TOKENIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instances": [{"prompt": "A paper boat on still water"}],
    "parameters": {"aspectRatio": "16:9", "resolution": "720p", "durationSeconds": "8"}
  }'

# {"name":"models/bytedance/seedance-2.0-mini/operations/7630138d-…", "metadata":{…}}

# poll until done, exactly as their sample does
curl -s "https://api.tokenify.dev/v1beta/models/bytedance/seedance-2.0-mini/operations/7630138d-…" \
  -H "x-goog-api-key: $TOKENIFY_API_KEY"
```

The model in the path is one of ours, not one of theirs. This endpoint serves their **protocol**, not their catalogue: a request naming `veo-3.1-generate-preview` is refused by name with a pointer to `GET /v1/models`, which is more useful than a generic unknown-model error. Google shut their Veo 3.1 Preview models down on 22 October 2026, so that refusal is the only honest answer either way.

## What maps across

All of it. Their parameter set is one documented list and every value in it is something this service already prices.

A request with no `parameters` at all works, which is the shape their own quickstart leads with. It is treated as `durationSeconds: "8"` and `resolution: "720p"`. The 8 is theirs — their models produce eight-second videos — and the 720p is ours, because their default is model-dependent and undocumented. The submit reply quotes the estimate those two produce, so the commitment is visible before the wait.

| Theirs                            | Here                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                 |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aspectRatio: "16:9" \| "9:16"     | the same, passed through                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                 |
| resolution: "720p" \| "1080p"     | "4k"                                                                                                                                                                                                                                                          | the same. Which of them a given model makes is on its own page; a band the model does not carry is refused rather than substituted. Omitted, it is 720p — the lowest band they offer and the only one every model here carries. |
| durationSeconds: "4" \| "6"       | "8"                                                                                                                                                                                                                                                           | the same, as a string or a number — their table spells it as a string and plenty of code sends an integer, so both are read. Omitted, it is 8, which is what their own models produce.                                          |
| instances\[0\].prompt             | the prompt                                                                                                                                                                                                                                                    |                                                                                                                                                                                                                                 |
| instances\[0\].image (inlineData) | the first frame. Send the bytes inline as they document. A still image does not change the rate: it is charged at the same per-token rate as a prompt-only request.                                                                                           |                                                                                                                                                                                                                                 |
| instances\[0\].video (inlineData) | a video to work from. This is what selects the lower video-input rate, and the reference role their shape has no word for is supplied here. The mimeType has to be a video type — it decides how the request is priced, so it is checked rather than trusted. |                                                                                                                                                                                                                                 |
| numberOfVideos: 1                 | the same. Anything above 1 is refused rather than silently served once.                                                                                                                                                                                       |                                                                                                                                                                                                                                 |

## What is refused, and why

By name, with a sentence saying what the field does. The alternative — dropping it — was measured on another dialect: a caller who asked for something and got neither it nor an error has been told nothing, and the bill is the same.

| Field                          | Why                                                                                                       |
| ------------------------------ | --------------------------------------------------------------------------------------------------------- |
| instances\[0\].lastFrame       | interpolates towards an end frame. The models here take a first frame only.                               |
| instances\[0\].referenceImages | carries style or asset references, which these models do not take.                                        |
| parameters.personGeneration    | restricts the generation of people. Accepting it would claim a restriction this service does not enforce. |
| parameters.seed                | is not passed to the model, so it would not make a result repeatable.                                     |
| parameters.negativePrompt      | is not passed to the model. Put what you do not want in the prompt.                                       |
| fileData / fileUri             | points at their Files API, which cannot be read from here. Send the bytes as inlineData.                  |

## The operation

`done` is the whole protocol, and it behaves as theirs does.

|                     | Body                                                                                                                                                                                    |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Waiting or running  | 200 with done: false and a metadata.state of PENDING or RUNNING.                                                                                                                        |
| Finished            | 200 with done: true and response.generateVideoResponse.generatedSamples\[0\].video.uri — the path their own sample reads.                                                               |
| Failed or cancelled | 200 with done: true and an error carrying code, message and status. Their page does not document a failure body; this is the convention every long-running operation of theirs follows. |

Always `200`, including while it is still running: an unfinished operation is a successful read of an unfinished operation. The other dialects here answer `202` while waiting, and this one must not, because their sample loops on `done` and would read a `202` as a transport failure to retry.

The `uri` is on this service's own domain and is fetched the same way theirs is — `GET` with the key attached, following redirects.

## google-genai, their own SDK

Use REST. Their SDK can be re-based — `HttpOptions(base_url=…)` is a supported option — but `client.models.generate_videos(...)` refuses before it sends anything:

```python
ValueError: This method is only supported in Gemini Enterprise Agent Platform
mode, not in Gemini Developer API mode.
```

That is raised client-side, in their code, on both `v1` and `v1beta`, and it has nothing to do with this service: their SDK dropped Developer-API video generation when the Veo models went. Measured against `google-genai` 3.6.1\. Their Enterprise Agent Platform mode posts to a different host and a project-scoped path, which is not served here.

Two things worth knowing if you drive their transport yourself: `api_version` defaults to `v1`, and this endpoint is on `v1beta` where their Veo REST reference puts it — so set `HttpOptions(api_version="v1beta")`. The three REST calls above need none of this.

## What it costs

Billing is per **output token**, not per second of compute, and the count scales with the pixels and the seconds. There is no prompt charge. The [video endpoint page](https://www.tokenify.dev/docs/video/) has the formula and the rest of the rules, and they apply here unchanged — the dialect changes the shape of the request, never the price.

A failed job is not charged. The estimate a job was accepted on is in the submit reply's `metadata.estimatedOutputTokens`, so the commitment is visible before the wait, and the finished operation carries what it actually cost.

Last updated 2026-11-19.
